Пример #1
0
        void LoadConfig(GeoStar.Utility.Config config)
        {
            m_CursorMgr = new CursorMgr(config["Cursors"]);

            Text = config.Child("Caption").StringValue("");
            string strIcon = config.Child("Icon").StringValue("");

            if (!string.IsNullOrEmpty(strIcon))
            {
                if (!System.IO.Path.IsPathRooted(strIcon))
                {
                    strIcon = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, strIcon);
                }
                if (System.IO.File.Exists(strIcon))
                {
                    this.Icon = new Icon(strIcon);
                }
            }
            m_MainToolBar = new CToolLoader(toolStrip1);
            m_MainMenuBar = new CToolLoader(menuStrip1, 16);

            if (config.Exist("Menu"))
            {
                m_MainMenuBar.Load(config.Child("Menu"));
            }

            if (config.Exist("ToolBar"))
            {
                m_MainToolBar.Load(config.Child("ToolBar"));
            }
        }
Пример #2
0
 void LoadContextMenu(GeoStar.Utility.Config config)
 {
     foreach (var item in config)
     {
         ContextMenuStrip menu = new ContextMenuStrip();
         menu.Name = item.Name;
         CToolLoader load = new CToolLoader(menu);
         load.Load(item);
     }
 }