当前位置: 首页>>代码示例>>C#>>正文


C# INode.AddDescriptor方法代码示例

本文整理汇总了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);
     }
 }
开发者ID:chris-tomich,项目名称:Glyma,代码行数:29,代码来源:CompendiumMapRelationship.cs

示例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;
        }
开发者ID:chris-tomich,项目名称:Glyma,代码行数:31,代码来源:CompendiumTransclusionRelationship.cs


注:本文中的INode.AddDescriptor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。