Exemplo n.º 1
0
        public override object ReadChildren()
        {
            object internalValue = this.InternalValue;

            if (internalValue == null)
            {
                return(null);
            }
            int num = 0;

            foreach (PropertyInfo info in this.Type.GetProperties(BindingFlags.Public | BindingFlags.Instance))
            {
                TreeNode         node = base.TreeNode.Nodes[num++];
                TreeNodeProperty tag  = node.Tag as TreeNodeProperty;
                if (tag != null)
                {
                    info.SetValue(internalValue, tag.ReadChildren(), null);
                }
            }
            foreach (FieldInfo info2 in this.Type.GetFields(BindingFlags.Public | BindingFlags.Instance))
            {
                TreeNode         node2     = base.TreeNode.Nodes[num++];
                TreeNodeProperty property2 = node2.Tag as TreeNodeProperty;
                if (property2 != null)
                {
                    info2.SetValue(internalValue, property2.ReadChildren(), BindingFlags.Public, null, null);
                }
            }
            return(internalValue);
        }
Exemplo n.º 2
0
        public override object ReadChildren()
        {
            object obj1 = InternalValue;

            if (obj1 == null)
            {
                return(null);
            }
            int num1 = 0;

            PropertyInfo[] infoArray1 = Type.GetProperties(BindingFlags.Public | BindingFlags.Instance);
            foreach (PropertyInfo info1 in infoArray1)
            {
                TreeNode         node1     = base.TreeNode.Nodes[num1++];
                TreeNodeProperty property1 = node1.Tag as TreeNodeProperty;
                if (property1 != null)
                {
                    info1.SetValue(obj1, property1.ReadChildren(), null);
                }
            }
            FieldInfo[] infoArray2 = Type.GetFields(BindingFlags.Public | BindingFlags.Instance);
            foreach (FieldInfo info2 in infoArray2)
            {
                TreeNode         node2     = base.TreeNode.Nodes[num1++];
                TreeNodeProperty property2 = node2.Tag as TreeNodeProperty;
                if (property2 != null)
                {
                    info2.SetValue(obj1, property2.ReadChildren(), BindingFlags.Public, null, null);
                }
            }
            return(obj1);
        }
Exemplo n.º 3
0
        public override object ReadChildren()
        {
            Array arrayValue = this.ArrayValue;

            if (arrayValue == null)
            {
                return(null);
            }
            int num = 0;

            for (int i = 0; i < arrayValue.Length; i++)
            {
                TreeNode         node = base.TreeNode.Nodes[num++];
                TreeNodeProperty tag  = node.Tag as TreeNodeProperty;
                if (tag != null)
                {
                    arrayValue.SetValue(tag.ReadChildren(), i);
                }
            }
            return(arrayValue);
        }
Exemplo n.º 4
0
        public override object ReadChildren()
        {
            Array array1 = ArrayValue;

            if (array1 == null)
            {
                return(null);
            }
            int num1 = 0;

            for (int num2 = 0; num2 < array1.Length; num2++)
            {
                TreeNode         node1     = base.TreeNode.Nodes[num1++];
                TreeNodeProperty property1 = node1.Tag as TreeNodeProperty;
                if (property1 != null)
                {
                    array1.SetValue(property1.ReadChildren(), num2);
                }
            }
            return(array1);
        }
Exemplo n.º 5
0
        public override object ReadChildren()
        {
            object proxyProperties = this.proxyProperties;

            if (proxyProperties == null)
            {
                return(null);
            }
            int num = 0;

            foreach (PropertyInfo info in this.Type.GetProperties(BindingFlags.Public | BindingFlags.Instance))
            {
                TreeNode         node = base.TreeNode.Nodes[num++];
                TreeNodeProperty tag  = node.Tag as TreeNodeProperty;
                if (tag != null)
                {
                    info.SetValue(proxyProperties, tag.ReadChildren(), null);
                }
            }
            return(proxyProperties);
        }
Exemplo n.º 6
0
        private void ReadBody()
        {
            TreeNode node = base.TreeNode.Nodes[1];

            ParameterInfo[] parameters = this.method.GetParameters();
            this.paramValues = new object[parameters.Length];
            int index = 0;
            int num2  = 0;

            while (index < this.paramValues.Length)
            {
                ParameterInfo info = parameters[index];
                if (!info.IsOut)
                {
                    TreeNode         node2 = node.Nodes[num2++];
                    TreeNodeProperty tag   = node2.Tag as TreeNodeProperty;
                    if (tag != null)
                    {
                        this.paramValues[index] = tag.ReadChildren();
                    }
                }
                index++;
            }
        }
Exemplo n.º 7
0
        private void ReadBody()
        {
            TreeNode node1 = base.TreeNode.Nodes[1];

            ParameterInfo[] infoArray1 = method.GetParameters();
            paramValues = new object[infoArray1.Length];
            int num1 = 0;
            int num2 = 0;

            while (num1 < paramValues.Length)
            {
                ParameterInfo info1 = infoArray1[num1];
                if (!info1.IsOut)
                {
                    TreeNode         node2     = node1.Nodes[num2++];
                    TreeNodeProperty property1 = node2.Tag as TreeNodeProperty;
                    if (property1 != null)
                    {
                        paramValues[num1] = property1.ReadChildren();
                    }
                }
                num1++;
            }
        }
 private void CopyToClipboard(TreeNodeProperty tnp)
 {
     if (!IsValidCopyNode(tnp))
     {
         throw new Exception("Cannot copy from here");
     }
     object obj1 = tnp.ReadChildren();
     if (obj1 != null)
     {
         StringWriter writer1 = new StringWriter();
         Type[] typeArray1 = new Type[] { obj1.GetType() };
         Type type1 = (obj1 is DataSet) ? typeof(DataSet) : typeof(object);
         new XmlSerializer(type1, typeArray1).Serialize(writer1, obj1);
         Clipboard.SetDataObject(writer1.ToString());
     }
 }
Exemplo n.º 9
0
 private void CopyToClipboard(TreeNodeProperty tnp)
 {
     if (!this.IsValidCopyNode(tnp))
     {
         throw new Exception("Cannot copy from here");
     }
     object o = tnp.ReadChildren();
     if (o != null)
     {
         StringWriter writer = new StringWriter();
         System.Type[] extraTypes = new System.Type[] { o.GetType() };
         System.Type type = (o is DataSet) ? typeof(DataSet) : typeof(object);
         new XmlSerializer(type, extraTypes).Serialize((TextWriter) writer, o);
         Clipboard.SetDataObject(writer.ToString());
     }
 }