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); } }
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())); } }
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())); } }