本文整理汇总了C#中Link类的典型用法代码示例。如果您正苦于以下问题:C# Link类的具体用法?C# Link怎么用?C# Link使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Link类属于命名空间,在下文中一共展示了Link类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: GenerateGrid
private void GenerateGrid()
{
CompositeLink composLink = new CompositeLink(new PrintingSystem());
PrintableComponentLink pcLink1 = new PrintableComponentLink();
Link linkMainReport = new Link();
Link linkGrid1Report = new Link();
linkGrid1Report.CreateDetailArea += new CreateAreaEventHandler(linkGrid1Report_CreateDetailArea);
// Assign the controls to the printing links.
pcLink1.Component = this.ThirdGridIncomeAnalysis;
// Populate the collection of links in the composite link.
// The order of operations corresponds to the document structure.
composLink.Links.Add(linkGrid1Report);
composLink.Links.Add(pcLink1);
composLink.Links.Add(linkMainReport);
// Create the report and show the preview window.
//composLink.PrintingSystem.PreviewFormEx.AutoScale = true;
composLink.PrintingSystem.PageSettings.Landscape = true;
composLink.CreateDocument(printingSystem1);
printingSystem1.PreviewFormEx.PrintingSystem.PageSettings.LeftMargin = 0;
printingSystem1.PreviewFormEx.PrintingSystem.PageSettings.TopMargin = 30;
//printingSystem1.PreviewFormEx.AutoScale = true;
printingSystem1.PageSettings.Landscape = true;
printingSystem1.PreviewFormEx.ForeColor = System.Drawing.Color.Black;
printingSystem1.PreviewFormEx.Owner = this;
printingSystem1.PreviewFormEx.PrintingSystem.Print();
}
开发者ID:kimykunjun,项目名称:test,代码行数:29,代码来源:RPAllIncomeDetail.cs
示例2: Calculate
/// <summary>
/// Calculation method.
/// </summary>
/// <param name="chain">
/// Source sequence.
/// </param>
/// <param name="link">
/// Link of intervals in chain.
/// </param>
/// <returns>
/// Average remoteness dispersion <see cref="double"/> value.
/// </returns>
public double Calculate(Chain chain, Link link)
{
List<int> intervals = new List<int>();
for (int i = 0; i < chain.Alphabet.Cardinality; i++)
{
intervals.AddRange(chain.CongenericChain(i).GetIntervals(link).ToList());
}
List<int> uniqueIntervals = intervals.Distinct().ToList();
List<int> intervalsCounts = new List<int>();
for (int i = 0; i < uniqueIntervals.Count; i++)
{
var currentInterval = uniqueIntervals[i];
intervalsCounts.Add(intervals.Count(interval => interval == currentInterval));
}
double result = 0;
double gDelta = geometricMean.Calculate(chain, link);
int n = (int)intervalsCount.Calculate(chain, link);
for (int i = 0; i < uniqueIntervals.Count; i++)
{
int nk = intervalsCounts[i];
double kDelta = uniqueIntervals[i];
double centeredRemoteness = Math.Log(kDelta, 2) - Math.Log(gDelta, 2);
result += nk == 0 ? 0 : centeredRemoteness * centeredRemoteness * nk / n;
}
return result;
}
开发者ID:intervals-mining-lab,项目名称:libiada-core,代码行数:44,代码来源:RemotenessDispersion.cs
示例3: DeserializeLink
public ILink DeserializeLink(IConnection connection, SerializationInfo info)
{
Link link = new Link();
string sourceEmployeeId = string.Empty;
string targeteEmployeeId = string.Empty;
if (info["SourceEmployeeId"] != null)
sourceEmployeeId = info["SourceEmployeeId"].ToString();
if (info["TargetEmployeeId"] != null)
targeteEmployeeId = info["TargetEmployeeId"].ToString();
if (info["IsVisible"] != null)
link.IsVisible = bool.Parse(info["IsVisible"].ToString());
if (info["Text"] != null)
link.Text = info["Text"].ToString();
if (info["MainColor"] != null)
link.MainColor = info["MainColor"].ToString();
var sourceModel = this.deserializedEmployees.FirstOrDefault(x => x.GetId().Equals(sourceEmployeeId));
if (sourceModel != null)
{
link.Source = sourceModel;
}
var targetModel = this.deserializedEmployees.FirstOrDefault(x => x.GetId().Equals(targeteEmployeeId));
if (targetModel != null)
{
link.Target = targetModel;
}
return link;
}
开发者ID:netintellect,项目名称:PluralsightSpaJumpStartFinal,代码行数:30,代码来源:ObservableGraphSource.Serialization.cs
示例4: Piece
public Piece (int start, int length, string text, Link link)
{
this.start = start;
this.length = length;
this.text = text;
this.link = link;
}
开发者ID:carrie901,项目名称:mono,代码行数:7,代码来源:LinkLabel.cs
示例5: Calculate
/// <summary>
/// Calculation method.
/// </summary>
/// <param name="firstChain">
/// The first chain.
/// </param>
/// <param name="secondChain">
/// The second chain.
/// </param>
/// <param name="link">
/// The link.
/// </param>
/// <returns>
/// The <see cref="double"/>.
/// </returns>
public double Calculate(CongenericChain firstChain, CongenericChain secondChain, Link link)
{
var partialAccordanceCalculator = new PartialComplianceDegree();
var firstResult = partialAccordanceCalculator.Calculate(firstChain, secondChain, link);
var secondResult = partialAccordanceCalculator.Calculate(secondChain, firstChain, link);
return Math.Sqrt(firstResult * secondResult);
}
开发者ID:intervals-mining-lab,项目名称:libiada-core,代码行数:22,代码来源:MutualComplianceDegree.cs
示例6: CutLink
private static void CutLink(Link n)
{
answer = n.Node1 + " " + n.Node2;
found = true;
links.RemoveAll(x=> x.Node1 == n.Node1 && x.Node2 == n.Node2);
links.RemoveAll(x=> x.Node1 == n.Node2 && x.Node2 == n.Node1);
}
开发者ID:LievenVandeperre,项目名称:codinGame,代码行数:7,代码来源:01.Skynet+-The+Virus.cs
示例7: CanUseRegisterExtensionMethod
public void CanUseRegisterExtensionMethod()
{
var curie = new CuriesLink("aap", "http://www.helpt.com/{?rel}");
var builder = Hypermedia.CreateBuilder();
var selfLink = new Link<ProductRepresentation>("product", "http://www.product.com?id=1");
var link2 = new Link("related", "http://www.related.com");
var link3 = curie.CreateLink<CategoryRepresentation>("category", "http://www.category.com");
builder.Register(selfLink, link2, link3);
var config = builder.Build();
// arrange
var mediaFormatter = new JsonHalOutputFormatter(config) { };
var type = representation.GetType();
var httpContext = new Mock<HttpContext>();
var httpRequest = new DefaultHttpContext().Request;
httpContext.SetupGet(o => o.Request).Returns(httpRequest);
// act
using (var stream = new MemoryStream())
{
mediaFormatter.WriteResponseBodyAsync(new OutputFormatterWriteContext(httpContext.Object,
(s,e)=> new HttpResponseStreamWriter(s, e), type, representation));
//WriteToStreamAsync(type, representation, stream, content, null);
stream.Seek(0, SeekOrigin.Begin);
var serialisedResult = new StreamReader(stream).ReadToEnd();
// assert
Approvals.Verify(serialisedResult);
}
}
开发者ID:iremezoff,项目名称:AspNet.Hal,代码行数:33,代码来源:HypermediaContainerTests.cs
示例8: GetLinks
public List<Link> GetLinks()
{
List<Link> lstLinks = new List<Link>();
DbCommand oDbCommand = DbProviderHelper.CreateCommand("SELECTLinks",CommandType.StoredProcedure);
DbDataReader oDbDataReader = DbProviderHelper.ExecuteReader(oDbCommand);
while (oDbDataReader.Read())
{
Link oLink = new Link();
oLink.LinkId = Convert.ToInt32(oDbDataReader["LinkId"]);
oLink.LinkGuid = (Guid) oDbDataReader["LinkGuid"];
oLink.LinkName = Convert.ToString(oDbDataReader["LinkName"]);
if(oDbDataReader["LinkUrl"] != DBNull.Value)
oLink.LinkUrl = Convert.ToString(oDbDataReader["LinkUrl"]);
if(oDbDataReader["Remark"] != DBNull.Value)
oLink.Remark = Convert.ToString(oDbDataReader["Remark"]);
if(oDbDataReader["Logo"] != DBNull.Value)
oLink.Logo = Convert.ToString(oDbDataReader["Logo"]);
oLink.Rank = Convert.ToInt32(oDbDataReader["Rank"]);
oLink.DateCreated = Convert.ToDateTime(oDbDataReader["DateCreated"]);
lstLinks.Add(oLink);
}
oDbDataReader.Close();
return lstLinks;
}
开发者ID:htawab,项目名称:wiscms,代码行数:27,代码来源:LinkManager.cs
示例9: AddLinkText
private void AddLinkText(SvgDocument document, Link link)
{
if (link.Label.Text.Trim() == "") return;
Style style = new Style();
//Set up text object
PointF location = link.GetLabelLocation();
location = OffsetPoint(location, link.Label.Offset);
location = OffsetPoint(location, link.Rectangle.Location);
Text text = new Text();
text.Label = link.Label;
text.LayoutRectangle = new RectangleF(location, new SizeF());
//Get style
string classId = null;
classId = document.AddClass(text.GetStyle());
//Create fragment and add to document
XmlDocumentFragment frag = null;
XmlNode newElementNode = null;
frag = document.CreateDocumentFragment();
frag.InnerXml = text.ExtractText(0, 0, link.Key + "Text");
frag.FirstChild.Attributes.GetNamedItem("class").InnerText = classId;
newElementNode = document.ContainerNode.AppendChild(frag);
}
开发者ID:savagemat,项目名称:arcgis-diagrammer,代码行数:28,代码来源:LinkFormatter.cs
示例10: Add0
void Add0(Link a)
{
if (head==null)
head = last = a;
else
last = last.next = a;
}
开发者ID:hdinh,项目名称:OmahaBot,代码行数:7,代码来源:olist.cs
示例11: GetLink
public Link GetLink(int LinkId)
{
Link oLink = new Link();
DbCommand oDbCommand = DbProviderHelper.CreateCommand("SELECTLink",CommandType.StoredProcedure);
oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@LinkId",DbType.Int32,LinkId));
DbDataReader oDbDataReader = DbProviderHelper.ExecuteReader(oDbCommand);
while (oDbDataReader.Read())
{
oLink.LinkId = Convert.ToInt32(oDbDataReader["LinkId"]);
oLink.LinkGuid = (Guid) oDbDataReader["LinkGuid"];
oLink.LinkName = Convert.ToString(oDbDataReader["LinkName"]);
if(oDbDataReader["LinkUrl"] != DBNull.Value)
oLink.LinkUrl = Convert.ToString(oDbDataReader["LinkUrl"]);
if(oDbDataReader["Remark"] != DBNull.Value)
oLink.Remark = Convert.ToString(oDbDataReader["Remark"]);
if(oDbDataReader["Logo"] != DBNull.Value)
oLink.Logo = Convert.ToString(oDbDataReader["Logo"]);
oLink.Rank = Convert.ToInt32(oDbDataReader["Rank"]);
oLink.DateCreated = Convert.ToDateTime(oDbDataReader["DateCreated"]);
}
oDbDataReader.Close();
return oLink;
}
开发者ID:htawab,项目名称:wiscms,代码行数:26,代码来源:LinkManager.cs
示例12: Save
public ActionResult Save(Link links)
{
var data = GetData();
data.Add(links);
_pluginContentService.SavePluginData(PluginId, data);
return RedirectToAction("Edit");
}
开发者ID:harpreet,项目名称:TinyBlog,代码行数:7,代码来源:LinksController.cs
示例13: CreateBufferSizeChart
public void CreateBufferSizeChart(ZedGraphControl zgc, Link[] list)
{
GraphPane myPane = zgc.GraphPane;
System.Drawing.Color[] GraphColors = { Color.Red, Color.Blue, Color.Green, Color.Orange, Color.Purple, Color.Brown };
// Set the titles and axis labels
myPane.Title.Text = "";
myPane.XAxis.Title.Text = "Time, ms";
myPane.YAxis.Title.Text = "Buffer size (packets)";
/*myPane.Legend.Position = LegendPos.Float;
myPane.Legend.Location = new Location(0.95, 0.15, CoordType.PaneFraction,
AlignH.Right, AlignV.Top);
myPane.Legend.FontSpec.Size = 10;*/
myPane.Legend.Position = LegendPos.InsideTopLeft;
// Add a curve
for (int k = 0; k < list.Length; k++)
{
LineItem curve = myPane.AddCurve(list[k].name, list[k].buffer_size_list, GraphColors[k % 6], SymbolType.None);
curve.Line.Width = 2.0F;
curve.Line.IsAntiAlias = true;
curve.Symbol.Fill = new Fill(Color.White);
curve.Symbol.Size = 7;
}
// Fill the axis background with a gradient
//myPane.Chart.Fill = new Fill(Color.White, Color.FromArgb(255, Color.ForestGreen), 45.0F);
// Offset Y space between point and label
// NOTE: This offset is in Y scale units, so it depends on your actual data
//const double offset = 1.0;
// Leave some extra space on top for the labels to fit within the chart rect
myPane.YAxis.Scale.MaxGrace = 0.2;
// Calculate the Axis Scale Ranges
zgc.AxisChange();
}
开发者ID:cs143,项目名称:simulator,代码行数:35,代码来源:GraphWindow.cs
示例14: Artist
public Artist(Link link, SessionBase session, bool browse = false)
{
this.Handle = libspotify.sp_link_as_artist(link.Handle);
this._session = session;
Init(browse);
}
开发者ID:razims,项目名称:Spoti,代码行数:7,代码来源:Artist.cs
示例15: Main
static void Main(string[] args)
{
string[] inputs = Console.ReadLine().Split(' ');
int N = int.Parse(inputs[0]); // the total number of nodes in the level, including the gateways
int L = int.Parse(inputs[1]); // the number of links
int E = int.Parse(inputs[2]); // the number of exit gateways
for (int i = 0; i < L; i++)
{
links.Add(new Link(Console.ReadLine().Split(' ')));
}
for (int i = 0; i < E; i++)
{
EditType(int.Parse(Console.ReadLine()), Type.EXIT);
}
// game loop
while (true)
{
// The index of the node on which the Skynet agent is positioned this turn
EditType(int.Parse(Console.ReadLine()), Type.SKY);
// Write an action using Console.WriteLine()
last = GetOne();
Console.WriteLine(last.ToString()); // Example: 0 1 are the indices of the nodes you wish to sever the link between
}
}
开发者ID:quentinlebot,项目名称:CDGChallenges,代码行数:27,代码来源:SkynetTheVirusMEDIUM.cs
示例16: CreateLink
public ILink CreateLink(object source, object target)
{
var mindmapLink = new Link();
var sourceNode = source as Node;
var targetNode = target as Node;
if (sourceNode != null && targetNode != null)
{
mindmapLink.Source = sourceNode;
mindmapLink.Target = targetNode;
targetNode.ShapeType = sourceNode.ShapeType == MindmapItemType.Root ? MindmapItemType.FirstLevelItem : MindmapItemType.SubItem;
if (sourceNode.ShapeType == MindmapItemType.Root)
{
targetNode.MainColor = Colors[colorIndex];
mindmapLink.MainColor = Colors[colorIndex];
colorIndex++;
colorIndex = colorIndex % Colors.Count;
}
else
{
targetNode.MainColor = sourceNode.MainColor;
mindmapLink.MainColor = sourceNode.MainColor;
}
}
return mindmapLink;
}
开发者ID:netintellect,项目名称:PluralsightSpaJumpStartFinal,代码行数:26,代码来源:ObservableGraphSource.cs
示例17: BPCommunicationModbus
/// <summary>
/// Contructor for linklayer
/// </summary>
/// <param name="link">Link layer</param>
public BPCommunicationModbus( Link link)
{
this.link = link;
//Create Rtu modbus master using link port
modbus = ModbusSerialMaster.CreateRtu((SerialPort)this.link.port);
}
开发者ID:offlinehacker,项目名称:DGLB,代码行数:11,代码来源:BPCommunicationModbus.cs
示例18: Add
public void Add(int value)
{
if (treeRoot == null)
{
treeRoot = new Link(value);
}
else
{
Link nodeNow = FindNode(value, treeRoot);
if (value < nodeNow.element.Value)
{
nodeNow.element.Left = new Link(value);
}
else
{
if (value > nodeNow.element.Value)
{
nodeNow.element.Right = new Link(value);
}
else
{
throw new ArgumentException("This element already exists!");
}
}
}
}
开发者ID:MGnuskina,项目名称:Tasks,代码行数:26,代码来源:BinaryTreeLink.cs
示例19: CanUseRegisterExtensionMethod
public void CanUseRegisterExtensionMethod()
{
var curie = new CuriesLink("aap", "http://www.helpt.com/{?rel}");
var builder = Hypermedia.CreateBuilder();
var selfLink = new Link<ProductRepresentation>("product", "http://www.product.com?id=1");
var link2 = new Link("related", "http://www.related.com");
var link3 = curie.CreateLink<CategoryRepresentation>("category", "http://www.category.com");
builder.Register(selfLink, link2, link3);
var config = builder.Build();
// arrange
var mediaFormatter = new JsonHalMediaTypeFormatter(config) { Indent = true };
var content = new StringContent(string.Empty);
var type = representation.GetType();
// act
using (var stream = new MemoryStream())
{
mediaFormatter.WriteToStreamAsync(type, representation, stream, content, null);
stream.Seek(0, SeekOrigin.Begin);
var serialisedResult = new StreamReader(stream).ReadToEnd();
// assert
Approvals.Verify(serialisedResult);
}
}
开发者ID:AndreasKorn,项目名称:WebApi.Hal,代码行数:29,代码来源:HypermediaContainerTests.cs
示例20: Model
public Model(Location location, Orientation orientation, Scale scale, Link link)
{
this.location = location;
this.orientation = orientation;
this.scale = scale;
this.link = link;
}
开发者ID:AlphaTangoIndia,项目名称:excel2earth,代码行数:7,代码来源:Model.cs
注:本文中的Link类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论