Пример #1
0
        protected override void CreateChildren()
        {
            base.TreeNode.Nodes.Clear();
            if (this.OkayToCreateChildren())
            {
                foreach (PropertyInfo info in this.Type.GetProperties(BindingFlags.Public | BindingFlags.Instance))
                {
                    object val = info.GetValue(this.val, null);
                    if ((val == null) && this.IsInput())
                    {
                        val = TreeNodeProperty.CreateNewInstance(info.PropertyType);
                    }
                    TreeNodeProperty.CreateTreeNodeProperty(base.GetIncludedTypes(info.PropertyType), info.Name, val).RecreateSubtree(base.TreeNode);
                }
                foreach (FieldInfo info2 in this.Type.GetFields(BindingFlags.Public | BindingFlags.Instance))
                {
                    object obj3 = info2.GetValue(this.val);

                    if ((obj3 == null) && this.IsInput())
                    {
                        obj3 = TreeNodeProperty.CreateNewInstance(info2.FieldType);
                    }
                    TreeNodeProperty.CreateTreeNodeProperty(base.GetIncludedTypes(info2.FieldType), info2.Name, obj3).RecreateSubtree(base.TreeNode);
                }
            }
        }
Пример #2
0
 protected override void CreateChildren()
 {
     base.TreeNode.Nodes.Clear();
     if (this.OkayToCreateChildren())
     {
         System.Type elementType = this.Type.GetElementType();
         int         length      = this.Length;
         for (int i = 0; i < length; i++)
         {
             object val = this.ArrayValue.GetValue(i);
             if ((val == null) && this.IsInput())
             {
                 val = TreeNodeProperty.CreateNewInstance(elementType);
             }
             TreeNodeProperty.CreateTreeNodeProperty(base.GetIncludedTypes(elementType), base.Name + "_" + i.ToString(), val).RecreateSubtree(base.TreeNode);
         }
     }
 }
Пример #3
0
        private void AddBody()
        {
            TreeNode parentNode = base.TreeNode.Nodes.Add("Body");

            if (!this.isIn && (this.method.ReturnType != typeof(void)))
            {
                System.Type type = (this.result != null) ? this.result.GetType() : this.method.ReturnType;
                TreeNodeProperty.CreateTreeNodeProperty(new System.Type[] { type }, "result", this.result).RecreateSubtree(parentNode);
            }
            ParameterInfo[] parameters = this.method.GetParameters();
            for (int i = 0; i < parameters.Length; i++)
            {
                if ((!this.isIn && (parameters[i].IsOut || parameters[i].ParameterType.IsByRef)) || (this.isIn && !parameters[i].IsOut))
                {
                    System.Type parameterType = parameters[i].ParameterType;
                    if (parameterType.IsByRef)
                    {
                        parameterType = parameterType.GetElementType();
                    }
                    object val = (this.paramValues != null) ? this.paramValues[i] : (this.isIn ? TreeNodeProperty.CreateNewInstance(parameterType) : null);
                    TreeNodeProperty.CreateTreeNodeProperty(base.GetIncludedTypes(parameterType), parameters[i].Name, val).RecreateSubtree(parentNode);
                }
            }
            parentNode.ExpandAll();
        }