Exemplo n.º 1
0
        /// <summary>
        ///     Creates an <see cref="IEnumerable{T}" /> from an <see cref="IEnumRelationship" />
        /// </summary>
        /// <param name="source">An <see cref="IEnumRelationship" /> to create an <see cref="IEnumerable{T}" /> from.</param>
        /// <returns>An <see cref="IEnumerable{T}" /> that contains the relationships from the input source.</returns>
        public static IEnumerable <IRelationship> AsEnumerable(this IEnumRelationship source)
        {
            if (source != null)
            {
                source.Reset();
                IRelationship relationship = source.Next();
                while (relationship != null)
                {
                    yield return(relationship);

                    relationship = source.Next();
                }
            }
        }
Exemplo n.º 2
0
 private void method_2(IRelationshipClass irelationshipClass_0, IObject iobject_0, TreeNode treeNode_0,
                       bool bool_3)
 {
     try
     {
         IObjectClass destinationClass;
         if (bool_3)
         {
             destinationClass = irelationshipClass_0.DestinationClass;
         }
         else
         {
             destinationClass = irelationshipClass_0.OriginClass;
         }
         TreeNode node = new TreeNode(destinationClass.AliasName)
         {
             Tag = destinationClass
         };
         IEnumRelationship relationshipsForObject = irelationshipClass_0.GetRelationshipsForObject(iobject_0);
         relationshipsForObject.Reset();
         for (IRelationship relationship2 = relationshipsForObject.Next();
              relationship2 != null;
              relationship2 = relationshipsForObject.Next())
         {
             if (relationship2.DestinationObject != null)
             {
                 TreeNode node2 = new TreeNode(relationship2.DestinationObject.OID.ToString())
                 {
                     Tag = relationship2.DestinationObject
                 };
                 node.Nodes.Add(node2);
             }
         }
         if (node.Nodes.Count > 0)
         {
             treeNode_0.Nodes.Add(node);
         }
     }
     catch
     {
     }
 }