Exemplo n.º 1
0
        public void Bind(string opsXml)
        {
            if (string.IsNullOrEmpty(opsXml))
            {
                return;
            }

            OpsReader reader = new OpsReader();

            reader.LoadOps(opsXml);

            this.Name = reader.RootName;

            while (reader.Read())
            {
                XItem item = new XItem();
                item.Name = reader.Name;

                if (reader.IsTextOnly())
                {
                    item.Type = XType.Xml;
                    item.Text = reader.Data;
                }
                else
                {
                    item.Type = reader.Type();
                    item.Note = reader.Note();
                    item.Text = reader.Text();
                }

                Add(item);
            }
        }
Exemplo n.º 2
0
        public void Bind(string opsXml)
        {
            OpsReader read = new OpsReader();

            read.LoadOps(opsXml);

            while (read.Read())
            {
                T dom = Activator.CreateInstance <T>();

                dom.Bind("<" + read.Name + ">" + read.Data + "</" + read.Name + ">");

                this.Add(dom);
            }
        }
Exemplo n.º 3
0
        public static void Bind(object obj, string opsXml)
        {
            if (opsXml == null || opsXml.Length == 0)
                return;

            Type type = obj.GetType();

            OpsReader reader = new OpsReader();
            reader.LoadOps(opsXml);

            while (reader.Read())
            {
                SetText(type, obj, reader.Name, Escape.XmlUnEscape(reader.Text()));
            }
        }
Exemplo n.º 4
0
        public static void Bind(object obj, string opsXml)
        {
            if (opsXml == null || opsXml.Length == 0)
            {
                return;
            }

            Type type = obj.GetType();

            OpsReader reader = new OpsReader();

            reader.LoadOps(opsXml);

            while (reader.Read())
            {
                SetText(type, obj, reader.Name, Escape.XmlUnEscape(reader.Text()));
            }
        }