public void Load(string inFileName) { try { var xmlSerializer = new XmlSerializer(typeof(XmlIO)); using (FileStream fs = new FileStream(inFileName, FileMode.Open)) { var xmlIO = xmlSerializer.Deserialize(fs) as XmlIO; ExecTypeList = xmlIO.ExecTypeList; TreeViewList = xmlIO.TreeViewList; SelectedElement = TreeViewList[0]; SetParent(); } } catch (Exception e) { ExecTypeList = new List <string>(); TreeViewList = new List <OneElement>(); SelectedElement = new OneElement(Database.Instance.ExecTypeList); TreeViewList.Add(SelectedElement); throw e; } }
public void SetParent(OneElement inParent) { Parent = inParent; foreach (var child in Children) { child.SetParent(this); } }
public OneElement(OneElement inParent, IReadOnlyList <string> inExecTypeList) { Parent = inParent; Title = "新規"; foreach (var execType in inExecTypeList) { ExecFlagDict.Add(execType, false); } }
public Database() { SelectedElement = new OneElement(ExecTypeList); TreeViewList.Add(SelectedElement); }