public FormWorkbench(DockPanel dockPanel)
        {
            InitializeComponent();
            ReloadDockPanel(dockPanel);

            IXExplorerDictionary explorers = ApplicationRuntime.Explorers;

            foreach (KeyValuePair <ResourceStruct.ResourceType, ResourceStruct.ResInfo> kvp
                     in ResourceStruct.OrderedListNames)
            {
                IXExplorer        explorer = explorers[kvp.Key];
                ToolStripMenuItem tsmi     = explorer.NewToolStripMenuItem();
                tsmi.Click += new System.EventHandler(this.ToolStripMenuItem_Click);

                if (kvp.Value.isCommon)
                {
                    this.explorersMenu.DropDownItems.Add(tsmi);
                }
                else
                {
                    this.infrequentTSMI.DropDownItems.Add(tsmi);
                }

                this.explorersMenu.DropDownItems.Add(this.infrequentTSMI);
            }
        }
        private void Build(string name, ResourceStruct.ResourceType resourceType,
                           ChitinKeyDictionary ckeyDictionary)
        {
            IXExplorer explorer = new IXExplorer(name, resourceType, ckeyDictionary);

            Dictionary.Add(resourceType, explorer);
        }
        private void ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            IXExplorer explorer = (IXExplorer)((ToolStripMenuItem)sender).Tag;

            this.StatusBuffer = "Loading " + explorer.Name + " ...";
            explorer.Form.Show(dockPanel);
            this.StatusBuffer = null;
        }
Example #4
0
        public static void LoadResource(ChitinKey ckey, bool closeResourceOnError)
        {
            ResourceStruct.ResInfo rInfo =
                ResourceStruct.OrderedListNames[ckey.resourceType];
            ResourceClass.IResource irFile =
                ResourceHandler.LoadResourceFile(ckey, rInfo.resourceFileReader);

            if (irFile != null)
            {
                // send the irFile into explorer
                IXExplorer explorer = ApplicationRuntime.Explorers[ckey.resourceType];
                if (!explorer.ShowViewer(rInfo.ViewUserControl, ckey, irFile, closeResourceOnError))
                {
                    MessageBox.Show("Error: Unable to load resource '" + ckey.name + "'!");
                }
            }
        }