本文整理汇总了C#中ILink.GetDataOperation方法的典型用法代码示例。如果您正苦于以下问题:C# ILink.GetDataOperation方法的具体用法?C# ILink.GetDataOperation怎么用?C# ILink.GetDataOperation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ILink
的用法示例。
在下文中一共展示了ILink.GetDataOperation方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddLink
/// <summary>
/// Adds a link
/// </summary>
/// <param name="NewLink">The link</param>
public virtual void AddLink (ILink NewLink)
{
if (NewLink.SourceComponent==this)
{
for (int iNewDO = 0; iNewDO < NewLink.DataOperationsCount; iNewDO++)
{
IDataOperation newDataOperation = NewLink.GetDataOperation(iNewDO);
foreach (ILink link in _providingLinks)
{
for (int iExistingDO = 0; iExistingDO < link.DataOperationsCount; iExistingDO++)
{
IDataOperation existingDataOperation = link.GetDataOperation(iExistingDO);
if (newDataOperation == existingDataOperation)
{
Event warning = new Event(EventType.Warning);
warning.Description = "DataOperation " + newDataOperation.ID + " has already been used. " +
"It's argument values will overrule the values set previously for this operation.";
warning.Sender = this;
SendEvent(warning);
}
}
}
}
_providingLinks.Add(NewLink);
}
if (NewLink.TargetComponent==this)
{
_acceptingLinks.Add(NewLink);
}
}
示例2: Link
/// <summary>
/// Copy constructor
/// </summary>
/// <param name="source">The link to copy</param>
public Link(ILink source)
{
SourceComponent = source.SourceComponent;
SourceElementSet = source.SourceElementSet;
SourceQuantity = source.SourceQuantity;
TargetComponent = source.TargetComponent;
TargetElementSet = source.TargetElementSet;
TargetQuantity = source.TargetQuantity;
Description = source.Description;
ID = source.ID;
for (int i=0;i<source.DataOperationsCount;i++)
AddDataOperation(source.GetDataOperation(i));
}
示例3: AddLink
public void AddLink(ILink link)
{
DHI.OpenMI.Backbone.Link locallink = new Link();
AlteredLinks.Add(link.ID, locallink);
//Mikeshe is the source. Create new local dataoperations.
if (link.SourceComponent == this)
{
locallink.SourceComponent = MsheOrg;
for (int i = 0; i < link.DataOperationsCount; i++)
{
ElementMapper em = new ElementMapper();
string desc="";
for (int j=0;j<link.GetDataOperation(i).ArgumentCount;j++)
if (link.GetDataOperation(i).GetArgument(j).Key=="Description")
desc = link.GetDataOperation(i).GetArgument(j).Value;
em.Initialise(desc, link.SourceElementSet, link.TargetElementSet);
mappers.Add(link.ID, em);
}
}
else
locallink.SourceComponent = link.SourceComponent;
//Mike she is the target. Copy the dataoperations
if (link.TargetComponent == this)
{
locallink.TargetComponent = MsheOrg;
for (int i = 0; i < link.DataOperationsCount; i++)
locallink.AddDataOperation(link.GetDataOperation(i));
}
else
locallink.TargetComponent = link.TargetComponent;
locallink.ID = link.ID;
locallink.SourceElementSet = link.SourceElementSet;
locallink.SourceQuantity = link.SourceQuantity;
locallink.TargetElementSet = link.TargetElementSet;
locallink.TargetQuantity = link.TargetQuantity;
MsheOrg.AddLink(locallink);
}