public DatabaseFile(Dictionary <string, object> node) : base( System.IO.Path.Combine( ProjectManager.ProjectDir, node["FileName"].ToString() ) ) { this.title = node["Title"] as string; this.className = node["ClassName"] as string; if (this.className.StartsWith("[") && this.className.EndsWith("]")) { this.arrayMode = true; this.className = this.className.Substring(1, this.className.Length - 2); } this.views = (node["Views"] as System.Xml.XmlNodeList); if (node.ContainsKey("ClipboardFormat")) { this.clipboardFormat = (node["ClipboardFormat"] as string); } if (this.clipboardFormat == null) { this.clipboardFormat = this.filename; } this.fields = new Dictionary <string, NekoKun.ObjectEditor.StructField>(); var fields = node["Fields"] as System.Xml.XmlNodeList; foreach (System.Xml.XmlNode item in fields) { if (item.Name != "Field") { continue; } var field = new ObjectEditor.StructField(item); this.fields.Add(field.ID, field); if (field.Name == "ID") { idField = field; } } this.Load(); }
public DatabaseFile(Dictionary<string, object> node) : base(System.IO.Path.Combine( ProjectManager.ProjectDir, node["FileName"].ToString() )) { this.title = node["Title"] as string; this.className = node["ClassName"] as string; if (this.className.StartsWith("[") && this.className.EndsWith("]")) { this.arrayMode = true; this.className = this.className.Substring(1, this.className.Length - 2); } this.views = (node["Views"] as System.Xml.XmlNodeList); if (node.ContainsKey("ClipboardFormat")) { this.clipboardFormat = (node["ClipboardFormat"] as string); } if (this.clipboardFormat == null) { this.clipboardFormat = this.filename; } this.fields = new Dictionary<string, NekoKun.ObjectEditor.StructField>(); var fields = node["Fields"] as System.Xml.XmlNodeList; foreach (System.Xml.XmlNode item in fields) { if (item.Name != "Field") continue; var field = new ObjectEditor.StructField(item); this.fields.Add(field.ID, field); if (field.Name == "ID") idField = field; } this.Load(); }