protected void DeserializePropertyView(XmlNode xmlPropertyView, ClassView classView)
        {
            PropertyView propertyView = new PropertyView(classView);

            if (!(xmlPropertyView.Attributes["name"] == null))
                propertyView.Name = xmlPropertyView.Attributes["name"].Value;
            else
                throw new FormatException("The property element must contain a name attribute!");

            if (!(xmlPropertyView.Attributes["path"] == null))
                propertyView.Name = xmlPropertyView.Attributes["path"].Value;

            if (!(xmlPropertyView.Attributes["category"] == null))
                propertyView.Category = xmlPropertyView.Attributes["category"].Value;

            if (!(xmlPropertyView.Attributes["description"] == null))
                propertyView.Description = xmlPropertyView.Attributes["description"].Value;

            if (!(xmlPropertyView.Attributes["display-name"] == null))
                propertyView.DisplayName = xmlPropertyView.Attributes["display-name"].Value;

            if (!(xmlPropertyView.Attributes["read-only"] == null))
                propertyView.IsReadOnly  = ParseBool(xmlPropertyView.Attributes["display-name"].Value);

            if (!(xmlPropertyView.Attributes["default"] == null))
                propertyView.DefaultValue  = xmlPropertyView.Attributes["default"].Value;
        }
        public object CreateView(object obj, ClassView classView)
        {
            if (obj == null)
                throw new ArgumentNullException("obj");
            if (classView == null)
                throw new ArgumentNullException("classView");

            return wrapper.WrapObject(obj, classView);
        }
        protected ClassView DeserializeClassView(XmlNode xmlClassView)
        {
            ClassView classView = new ClassView();

            if (!(xmlClassView.Attributes["name"] == null))
                classView.Name = xmlClassView.Attributes["name"].Value;
            else
                throw new FormatException("The class element must contain a name attribute!");

            XmlNodeList xmlPropertyViews = xmlClassView.SelectNodes("property");
            foreach (XmlNode xmlPropertyView in xmlPropertyViews)
                DeserializePropertyView(xmlPropertyView, classView);

            return classView;
        }
        public IList CreateViewList(IList list, ClassView classView)
        {
            if (list == null)
                throw new ArgumentNullException("list");
            if (classView == null)
                throw new ArgumentNullException("classView");

            IList wrappedList = (IList) Activator.CreateInstance(list.GetType());

            foreach (object obj in list)
            {
                wrappedList.Add(wrapper.WrapObject(obj, classView));
            }

            return wrappedList;
        }
Exemple #5
0
        protected virtual IList DeserializeView(XmlNode xmlDom)
        {
            IList list = new ArrayList();

            XmlNodeList xmlClassViews = xmlDom.SelectNodes("class");

            foreach (XmlNode xmlClassView in xmlClassViews)
            {
                ClassView classView = DeserializeClassView(xmlClassView);
                if (classView != null)
                {
                    list.Add(classView);
                }
            }

            return(list);
        }
Exemple #6
0
        protected void DeserializePropertyView(XmlNode xmlPropertyView, ClassView classView)
        {
            PropertyView propertyView = new PropertyView(classView);

            if (!(xmlPropertyView.Attributes["name"] == null))
            {
                propertyView.Name = xmlPropertyView.Attributes["name"].Value;
            }
            else
            {
                throw new FormatException("The property element must contain a name attribute!");
            }

            if (!(xmlPropertyView.Attributes["path"] == null))
            {
                propertyView.Name = xmlPropertyView.Attributes["path"].Value;
            }

            if (!(xmlPropertyView.Attributes["category"] == null))
            {
                propertyView.Category = xmlPropertyView.Attributes["category"].Value;
            }

            if (!(xmlPropertyView.Attributes["description"] == null))
            {
                propertyView.Description = xmlPropertyView.Attributes["description"].Value;
            }

            if (!(xmlPropertyView.Attributes["display-name"] == null))
            {
                propertyView.DisplayName = xmlPropertyView.Attributes["display-name"].Value;
            }

            if (!(xmlPropertyView.Attributes["read-only"] == null))
            {
                propertyView.IsReadOnly = ParseBool(xmlPropertyView.Attributes["display-name"].Value);
            }

            if (!(xmlPropertyView.Attributes["default"] == null))
            {
                propertyView.DefaultValue = xmlPropertyView.Attributes["default"].Value;
            }
        }
Exemple #7
0
        protected ClassView DeserializeClassView(XmlNode xmlClassView)
        {
            ClassView classView = new ClassView();

            if (!(xmlClassView.Attributes["name"] == null))
            {
                classView.Name = xmlClassView.Attributes["name"].Value;
            }
            else
            {
                throw new FormatException("The class element must contain a name attribute!");
            }

            XmlNodeList xmlPropertyViews = xmlClassView.SelectNodes("property");

            foreach (XmlNode xmlPropertyView in xmlPropertyViews)
            {
                DeserializePropertyView(xmlPropertyView, classView);
            }

            return(classView);
        }
Exemple #8
0
 public TreeNodeView(ClassView classView)
 {
     this.classView = classView;
 }
 public ViewObject(ClassView classView)
 {
     this.classView = classView;
 }
 public WrappedObject(object obj, ClassView classView)
     : base(classView)
 {
     this.obj = obj;
 }
 public TreeNodeView(ClassView classView)
 {
     this.classView = classView;
 }
        public IWrappedObject WrapObject(object obj, ClassView classView)
        {
            IWrappedObject wrappedObject = new WrappedObject(obj, classView);

            return wrappedObject;
        }
 public ViewTreeNode(IViewObject obj)
 {
     this.obj = obj;
     this.classView = obj.GetClassView();
     SetupFromView();
 }
 public ViewTreeNode(object obj, ClassView classView)
 {
     this.obj = obj;
     this.classView = classView;
     SetupFromView();
 }