Beispiel #1
0
 public void LocateConstructor(IConstructor cp)
 {
     for (int i = 0; i < treeViewConstructors.Nodes.Count; i++)
     {
         TreeNodeConstructor tn = treeViewConstructors.Nodes[i] as TreeNodeConstructor;
         if (tn != null)
         {
             ConstructorPointer cp0 = tn.OwnerPointer as ConstructorPointer;
             if (cp0.IsSameMethod((IMethod)cp))
             {
                 cp0.CopyFrom(cp);
                 treeViewConstructors.SelectedNode = tn;
                 break;
             }
         }
         else
         {
             TreeNodeCustomConstructorPointer tn2 = treeViewConstructors.Nodes[i] as TreeNodeCustomConstructorPointer;
             if (tn2 != null)
             {
                 CustomConstructorPointer cp2 = tn2.OwnerPointer as CustomConstructorPointer;
                 if (cp2.IsSameMethod((IMethod)cp))
                 {
                     treeViewConstructors.SelectedNode = tn2;
                     break;
                 }
             }
         }
     }
 }
        public void CopyFrom(IConstructor cp)
        {
            CustomConstructorPointer ccp = cp as CustomConstructorPointer;

            if (ccp != null)
            {
            }
        }
        public TreeNodeCustomConstructorPointer(CustomConstructorPointer objectPointer)
            : base(false, objectPointer)
        {
            Text               = objectPointer.DisplayName;
            ImageIndex         = TreeViewObjectExplorer.IMG_Constructor;
            SelectedImageIndex = ImageIndex;
            //
            List <ParameterClass> plst = objectPointer.Parameters;

            if (plst != null && plst.Count > 0)
            {
                foreach (ParameterClass p in plst)
                {
                    TreeNodeCustomMethodParameter tmp = new TreeNodeCustomMethodParameter(false, p);
                    Nodes.Add(tmp);
                }
            }
        }