示例#1
0
        private void LoadUIHandlers()
        {
            TreeViewItem treeViewItem = new TreeViewItem();

            treeViewItem.Header = "UIHandlers";
            treeViewItem.Items.Add("UIHandlers: " + Engine.Current.UIHandlers.Count());
            foreach (var ui in Engine.Current.UIHandlers.Where(x => x.x00_Name != "-1"))
            {
                treeViewItem.Items.Add(string.Format("UI x00_Name: {0}  (x04_Hash: {1})", ui.x00_Name, ui.x04_Hash));
            }

            foreach (var ui in Engine.Current.UIReferences.Where(x => x.x008_Name != "-1"))
            {
                treeViewItem.Items.Add(string.Format("UI x00_Name: {0}  (x04_Hash: {1})", ui.x008_Name, ui.x000_Hash));

                //try
                //{
                //    var uiControl = UXHelper.GetControl(ui.x008_Name);



                //    MessageBox.Show("OK");
                //}
                //catch
                //{

                //}
            }

            var uiMap = UXHelper.GetUIMap();

            // Get all the ui map objects
            List <UIMap.Pair> uiMapList = uiMap.ToList();

            // For each control in the map get the reference control
            foreach (UIMap.Pair itemmap in uiMapList)
            {
                //uiControls.Add(uiMap[itemmap.x08_Hash].Dereference<UIControl>());
            }

            this.treeView.Items.Add(treeViewItem);
        }