本文整理汇总了C#中INode.AddDescriptor方法的典型用法代码示例。如果您正苦于以下问题:C# INode.AddDescriptor方法的具体用法?C# INode.AddDescriptor怎么用?C# INode.AddDescriptor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类INode
的用法示例。
在下文中一共展示了INode.AddDescriptor方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateMapRelationship
public static void CreateMapRelationship(INode mapNode, INode childNode)
{
if (childNode != null && mapNode != null)
{
foreach (IDescriptor descriptor in childNode.Descriptors)
{
if (descriptor.Relationship is CompendiumMapRelationship)
{
foreach (IDescriptor altDesc in descriptor.Relationship.Descriptors)
{
if (altDesc.DescriptorType is CompendiumToDescriptor)
{
if (altDesc.Node.Id == mapNode.Id)
{
return;
}
}
}
}
}
CompendiumMapRelationship mapRelationship = new CompendiumMapRelationship();
mapRelationship.Id = mapNode.Id + childNode.Id;
IDescriptor toDescriptor = new CompendiumRelationshipDescriptor(mapNode, mapRelationship, IoCContainer.GetInjectionInstance().GetInstance<CompendiumToDescriptor>());
IDescriptor fromDescriptor = new CompendiumRelationshipDescriptor(childNode, mapRelationship, IoCContainer.GetInjectionInstance().GetInstance<CompendiumFromDescriptor>());
mapRelationship.Descriptors = new IDescriptor[] { fromDescriptor, toDescriptor };
childNode.AddDescriptor(fromDescriptor);
mapNode.AddDescriptor(toDescriptor);
}
}
示例2: CompendiumTransclusionRelationship
public CompendiumTransclusionRelationship(IRelationship relationship, CompendiumViewRelationship viewRelationship, INode toNode, INode fromNode, INode transclusionNode, INode mapNode)
: this()
{
_toNode = toNode;
IDescriptor toDescriptor = new CompendiumRelationshipDescriptor(toNode, this, IoCContainer.GetInjectionInstance().GetInstance<CompendiumToDescriptor>());
_descriptors.Add(toDescriptor);
_toNode.AddDescriptor(toDescriptor);
_fromNode = fromNode;
IDescriptor fromDescriptor = new CompendiumRelationshipDescriptor(fromNode, this, IoCContainer.GetInjectionInstance().GetInstance<CompendiumFromDescriptor>());
_descriptors.Add(fromDescriptor);
_fromNode.AddDescriptor(fromDescriptor);
_transclusionNode = transclusionNode;
IDescriptor transclusionNodeDescriptor = new CompendiumRelationshipDescriptor(transclusionNode, this, IoCContainer.GetInjectionInstance().GetInstance<CompendiumTransclusionNodeDescriptor>());
_descriptors.Add(transclusionNodeDescriptor);
_transclusionNode.AddDescriptor(transclusionNodeDescriptor);
_mapNode = mapNode;
IDescriptor mapDescriptor = new CompendiumRelationshipDescriptor(mapNode, this, IoCContainer.GetInjectionInstance().GetInstance<CompendiumTransclusionMapDescriptor>());
_descriptors.Add(mapDescriptor);
_mapNode.AddDescriptor(mapDescriptor);
this.Id = relationship.Id;
this.Created = relationship.Created;
this.CreatedBy = relationship.CreatedBy;
this.LastModified = relationship.LastModified;
this.Name = relationship.Name;
this.XPosition = viewRelationship.XPosition;
this.YPosition = viewRelationship.YPosition;
}