예제 #1
0
        public IPreference FromXmlNode(System.Xml.XmlNode node)
        {
            if (node.Attributes != null && node.Attributes["ColumnCount"] != null)
            {
                int v;
                int.TryParse(node.Attributes["ColumnCount"].InnerText, out v);
                Capacity = v;

                for (int idx = 0; idx < v; idx++)
                {
                    Add(null);
                }
            }
            else
            {
                Capacity = node.ChildNodes.Count;
            }

            for (int idx = 0; idx < node.ChildNodes.Count; idx++)
            {
                object o = (object)PreferenceCache.LoadPreference(node.ChildNodes[idx]);
                this[idx] = o as ListHeaderColumnSettings;
            }
            return(this);
        }
예제 #2
0
        public IPreference FromXmlNode(XmlNode node)
        {
            XmlNode curNode = node.SelectSingleNode("StringProperty");

            if (curNode != null)
            {
                StringProperty = (string)PreferenceCache.LoadPreference(curNode);
            }
            else
            {
                StringProperty = null;
            }

            curNode = node.SelectSingleNode("IntProperty");
            if (curNode != null)
            {
                IntProperty = (int)PreferenceCache.LoadPreference(curNode);
            }
            else
            {
                IntProperty = 0;
            }

            curNode = node.SelectSingleNode("BoolProperty");
            if (curNode != null)
            {
                BoolProperty = (bool)PreferenceCache.LoadPreference(curNode);
            }
            else
            {
                BoolProperty = false;
            }

            return(this);
        }
예제 #3
0
        public IPreference FromXmlNode(System.Xml.XmlNode node)
        {
            int Capacity = node.ChildNodes.Count;

            for (int idx = 0; idx < node.ChildNodes.Count; idx++)
            {
                KeyValuePairPreference kvp = PreferenceCache.LoadPreference(node.ChildNodes[idx]) as KeyValuePairPreference;
                this.Add(kvp.Key, kvp.Value);
            }
            return(this);
        }
예제 #4
0
        public IPreference FromXmlNode(System.Xml.XmlNode node)
        {
            if (node.Attributes != null && node.Attributes["maxCapacity"] != null)
            {
                int v;
                int.TryParse(node.Attributes["maxCapacity"].InnerText, out v);
                Capacity = v;
            }
            else
            {
                Capacity = node.ChildNodes.Count;
            }
            items = new object[Capacity];

            for (int idx = 0; idx < node.ChildNodes.Count; idx++)
            {
                items[idx] = (object)PreferenceCache.LoadPreference(node.ChildNodes[idx]);
            }
            return(this);
        }
예제 #5
0
 public IPreference FromXmlNode(System.Xml.XmlNode node)
 {
     this.Key   = (string)PreferenceCache.LoadPreference(node.ChildNodes[0]);
     this.Value = (IPreference)PreferenceCache.LoadPreference(node.ChildNodes[1]);
     return(this);
 }