private void worker_OnInitComplete() { foreach (HeroDefinition definition in GOM.Instance.Definitions.Values) { HeroNodeDef node = definition as HeroNodeDef; if (node != null) { string[] strArray = node.Name.Split(new char[] { '.' }); TreeDirectory directory = this.directory; for (int i = 0; i < (strArray.Length - 1); i++) { if (!directory.Folders.ContainsKey(strArray[i])) { directory.Folders[strArray[i]] = new TreeDirectory(strArray[i]); } directory = directory.Folders[strArray[i]]; } directory.Folders[strArray[strArray.Length - 1]] = new TreeDirectory(strArray[strArray.Length - 1], node); } } if (base.InvokeRequired) { base.Invoke(new Worker.InitCompleteHandler(this.worker_OnInitComplete)); } else { this.treeViewNodes.Nodes.AddRange(this.directory.Children); } }
public FormMain() { this.InitializeComponent(); this.directory = new TreeDirectory(null); this.logViewControl1.Log = Log.Instance; this.worker = new Worker(); this.worker.OnInitComplete += new Worker.InitCompleteHandler(this.worker_OnInitComplete); ImageList list = new ImageList(); list.Images.Add(new Bitmap(8, 8)); this.listViewVariables.SmallImageList = list; }