Пример #1
0
        /// <summary>
        /// 初始化
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void MainGIS_Load(object sender, EventArgs e)
        {
            //从插件文件夹中获得实现插件接口的对象
            PluginCollection pluginCol = PluginHandle.GetPluginsFromDll();
            //解析这些插件对象,获得不同类型的插件集合
            ParsePluginCollection parsePluhinCol = new ParsePluginCollection();
            parsePluhinCol.GetPluginArray(pluginCol);
            _CommandCol = parsePluhinCol.GetCommands;
            _ToolCol = parsePluhinCol.GetTools;
            _ToolBarCol = parsePluhinCol.GetToolBarDefs;
            _MenuItemCol = parsePluhinCol.GetMenuDefs;
            _DockableWindowCol = parsePluhinCol.GetDockableWindows;

            //获得Command和Tool在UI层上的Category属性,只是纯粹的分类符号
            //可以根据不同类别插件进行UI级解析,可以编写 为uicommon uitool
            //foreach (string categoryName in parsePluhinCol.GetCommandCategorys)
            //{
            //    //对ui进行分为不同的类别
            //    //uiCommandManager.Categories.Add(new UICommandCategory(categoryName));
            //}
            //产生UI对象
            CreateUICommandTool(_CommandCol, _ToolCol);
            CreateToolBars(_ToolBarCol);
            CreateMenus(_MenuItemCol);
            CreateDockableWindow(_DockableWindowCol);
            //保证宿主程序启动后不存在任何默认的处于使用状态的ITool对象
            _mapControl.CurrentTool = null;
            _pageLayoutControl.CurrentTool = null;
        }
Пример #2
0
        /// <summary>
        /// 初始化
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void MainGIS_Load(object sender, EventArgs e)
        {
            //从插件文件夹中获得实现插件接口的对象
            PluginCollection pluginCol = PluginHandle.GetPluginsFromDll();
            //解析这些插件对象,获得不同类型的插件集合
            ParsePluginCollection parsePluhinCol = new ParsePluginCollection();
            parsePluhinCol.GetPluginArray(pluginCol);
            _CommandCol = parsePluhinCol.GetCommands;
            _ToolCol = parsePluhinCol.GetTools;
            _ToolBarCol = parsePluhinCol.GetToolBarDefs;
            _MenuItemCol = parsePluhinCol.GetMenuDefs;
            _DockableWindowCol = parsePluhinCol.GetDockableWindows;

            //获得Command和Tool在UI层上的Category属性,只是纯粹的分类符号
            //可以根据不同类别插件进行UI级解析,可以编写 为uicommon uitool
            //foreach (string categoryName in parsePluhinCol.GetCommandCategorys)
            //{
            //    //对ui进行分为不同的类别
            //    //uiCommandManager.Categories.Add(new UICommandCategory(categoryName));
            //}
            //产生UI对象
            CreateUICommandTool(_CommandCol, _ToolCol);
            CreateToolBars(_ToolBarCol);
            CreateMenus(_MenuItemCol);
            CreateDockableWindow(_DockableWindowCol);
            //保证宿主程序启动后不存在任何默认的处于使用状态的ITool对象
            _mapControl.CurrentTool = null;
            _pageLayoutControl.CurrentTool = null;

            //主界面系统名称,获取目录下的SystemName.txt[可灵活设置]
            string sUIName = "县域尺度低丘缓坡山地开发土地优化布局系统";

            string sTxtFileName = System.Windows.Forms.Application.StartupPath+"\\SystemName.txt";

            if (!File.Exists(sTxtFileName))
            {
                this.FindForm().Text = sUIName;
                return;
            }

            StreamReader sr = new StreamReader(sTxtFileName, Encoding.Default);
            String line;
            while ((line = sr.ReadLine()) != null)
            {
                sUIName=line.ToString();
            }
            //this.Name = sUIName;

            this.FindForm().Text = sUIName;
        }