public override TreeNodeObject LocateObjectNode(Stack <IObjectPointer> ownerStack)
 {
     if (ownerStack.Count > 0)
     {
         IObjectPointer     o   = ownerStack.Pop();
         MethodParamPointer mpp = o as MethodParamPointer;
         if (mpp == null)
         {
             throw new DesignerException("TreeNodeConstructor.LocateObjectNode:{0} is not a MethodParamPointer", o.GetType());
         }
         for (int i = 0; i < this.Nodes.Count; i++)
         {
             TreeNodeMethodParameter tmp = Nodes[i] as TreeNodeMethodParameter;
             if (tmp != null)
             {
                 if (tmp.OwnerPointer.IsSameObjectRef(mpp))
                 {
                     if (ownerStack.Count == 0)
                     {
                         return(tmp);
                     }
                     else
                     {
                         return(tmp.LocateObjectNode(ownerStack));
                     }
                 }
             }
         }
     }
     return(null);
 }
Пример #2
0
        public override bool IsSameObjectRef(IObjectIdentity obj)
        {
            MethodParamPointer mpp = obj as MethodParamPointer;

            if (mpp != null)
            {
                if (base.IsSameObjectRef(obj))
                {
                    return(true);
                }
            }
            return(false);
        }
 public TreeNodeConstructor(ConstructorPointer objectPointer)
     : base(false, objectPointer)
 {
     Text               = objectPointer.MethodSignature;
     ImageIndex         = TreeViewObjectExplorer.IMG_Constructor;
     SelectedImageIndex = ImageIndex;
     //
     if (objectPointer.ConstructInfo != null)
     {
         ParameterInfo[] pifs = objectPointer.ConstructInfo.GetParameters();
         if (pifs != null && pifs.Length > 0)
         {
             for (int i = 0; i < pifs.Length; i++)
             {
                 MethodParamPointer p = new MethodParamPointer();
                 p.Owner      = objectPointer;
                 p.MemberName = pifs[i].Name;
                 TreeNodeMethodParameter tmp = new TreeNodeMethodParameter(false, p);
                 Nodes.Add(tmp);
             }
         }
     }
 }