Ejemplo n.º 1
0
        public override void SetToolbars(IToolbarDefinitionContext context)
        {
            var group = context.CreateToolbarGroup(MainFormToolbarNames.MainToolsGroup, "MainTools", null);

            group.AddToolbar(new WinformToolbar(
                                 MainFormToolbarNames.SaveTool,
                                 AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "ZtgeoGISDesktop.Icons.Save16.png"),
                                 AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "ZtgeoGISDesktop.Icons.Save16_dis.png"),
                                 false,
                                 "保存",
                                 group
                                 ));
            group.AddToolbar(new WinformToolbar(
                                 MainFormToolbarNames.UndoTool,
                                 AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "ZtgeoGISDesktop.Icons.Undo16.png"),
                                 AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "ZtgeoGISDesktop.Icons.Undo16_dis.png"),
                                 false,
                                 "撤销",
                                 group
                                 ));
            group.AddToolbar(new WinformToolbar(
                                 MainFormToolbarNames.RedoTool,
                                 AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "ZtgeoGISDesktop.Icons.Redo16.png"),
                                 AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "ZtgeoGISDesktop.Icons.Redo16_dis.png"),
                                 false,
                                 "重做",
                                 group
                                 ));
        }
        public override void SetMenus(IMenuDefinitionContext context)
        {
            var settingPageMenu = context.CreateMenu(DataSyncMenuNames.SettingPageMenu, MenuType.Page, "设置", "", null,
                                                     AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "CadastralManagementDataSync.Icons.Setting16.png"));

            var systemSettingGroup = settingPageMenu.CreateChildMenu(DataSyncMenuNames.SystemSettingGroupMenu, MenuType.Group, "系统设置");

            systemSettingGroup.CreateChildMenu(DataSyncMenuNames.SystemSettingGroup_DataSync, MenuType.Button, "数据同步设置", "数据同步设置", null,
                                               AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "CadastralManagementDataSync.Icons.DataSync.png"),
                                               AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "CadastralManagementDataSync.Icons.DataSync_dis.png"),
                                               0, true, MultiTenancySides.Host | MultiTenancySides.Tenant, null
                                               //,m =>
                                               //{
                                               //    MenuActions.DataSyncSettingClick(iocManager, formIOSchemeManager, dataSyncSettingManager, Logger);
                                               //}
                                               );

            var DataSyncPageMenu = context.CreateMenu(DataSyncMenuNames.DataSyncPageMenu, MenuType.Page, "数据同步", "", null,
                                                      AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "CadastralManagementDataSync.Icons.DataSync16.png"));
            var DataSynvSqlCreateMenu = DataSyncPageMenu.CreateChildMenu(DataSyncMenuNames.DataSyncPageSqlCreateGroupMenu, MenuType.Group, "数据同步");

            DataSynvSqlCreateMenu.CreateChildMenu(DataSyncMenuNames.DataSyncPageSqlCreateGroupInnerDataInitMenu, MenuType.Button, "内网数据库初始化", "内网数据库初始化", null,
                                                  AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "CadastralManagementDataSync.Icons.innerDB32.png"),
                                                  null,
                                                  0, true, MultiTenancySides.Host | MultiTenancySides.Tenant, null
                                                  //, m => {
                                                  //    MenuActions.DoDBTriggerOperationCilck(iocManager, DataSyncDirection.InnerDataSync, triggerOperation, Logger);
                                                  //}
                                                  );
            DataSynvSqlCreateMenu.CreateChildMenu(DataSyncMenuNames.DataSyncPageSqlCreateGroupOuterDataInitMenu, MenuType.Button, "外网数据库初始化", "外网数据库初始化", null,
                                                  AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "CadastralManagementDataSync.Icons.outDB32.png"),
                                                  null,
                                                  0, true, MultiTenancySides.Host | MultiTenancySides.Tenant, null
                                                  //, m => {
                                                  //    MenuActions.DoDBTriggerOperationCilck(iocManager, DataSyncDirection.OuterDataSync, triggerOperation, Logger);
                                                  //}
                                                  );

            var DataSynvDoDataSyncMenu = DataSyncPageMenu.CreateChildMenu(DataSyncMenuNames.DataSyncPageDoDataSyncGroupMenu, MenuType.Group, "同步操作");

            DataSynvDoDataSyncMenu.CreateChildMenu(DataSyncMenuNames.DataSyncPageDoDataSyncGroupInnerDoDataSyncMenu, MenuType.Button, "内网数据同步", "内网数据和本地数据同步", null,
                                                   AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "CadastralManagementDataSync.Icons.DataOut32.png"),
                                                   null,
                                                   0, true, MultiTenancySides.Host | MultiTenancySides.Tenant, null
                                                   //,  m =>
                                                   //{
                                                   //    MenuActions.DataSyncOperationClick(iocManager, DataSyncDirection.InnerDataSync, dataCapture, dataSyncOperator, Logger);
                                                   //}
                                                   );
            DataSynvDoDataSyncMenu.CreateChildMenu(DataSyncMenuNames.DataSyncPageDoDataSyncGroupOuterDoDataSyncMenu, MenuType.Button, "外网数据同步", "外网数据和本地数据同步", null,
                                                   AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "CadastralManagementDataSync.Icons.DataIn32.png"),
                                                   null,
                                                   0, true, MultiTenancySides.Host | MultiTenancySides.Tenant, null
                                                   //, m =>
                                                   //  {
                                                   //      MenuActions.DataSyncOperationClick(iocManager, DataSyncDirection.OuterDataSync, dataCapture, dataSyncOperator, Logger);
                                                   //  }
                                                   );
        }
 public override void SetMenus(IMenuDefinitionContext context)
 {
     //filePage
     var filePageMenu = context.CreateMenu(MainFormMenuNames.FilePageMenu, MenuType.Page, "文件", "", null,
                                           AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "ZtgeoGISDesktop.Icons.file16.png"));
     //fileGroup
     var filePageGroup = filePageMenu.CreateChildMenu(MainFormMenuNames.FilePageGroupMenu, MenuType.Group, "文件");
     var fileNew       = filePageGroup.CreateChildMenu(MainFormMenuNames.FilePageGroup_FileNew, MenuType.Button, "新建", "", null
                                                       , AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "ZtgeoGISDesktop.Icons.New.png"));
     var fileOpen = filePageGroup.CreateChildMenu(MainFormMenuNames.FilePageGroup_FileOpen, MenuType.Button, "打开", "", null
                                                  , AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "ZtgeoGISDesktop.Icons.Open.png"),
                                                  menuActionType: AbpType.GetType <IMenuAction>(typeof(Open)));
     var fileSave = filePageGroup.CreateChildMenu(MainFormMenuNames.FilePageGroup_FileSave, MenuType.Button, "保存", "", null
                                                  , AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "ZtgeoGISDesktop.Icons.Save32.png")
                                                  , AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "ZtgeoGISDesktop.Icons.Save_dis32.png")
                                                  , 0, false);
     var fileSaveAs = filePageGroup.CreateChildMenu(MainFormMenuNames.FilePageGroup_FileSaveAs, MenuType.Button, "另存为", "", null
                                                    , AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "ZtgeoGISDesktop.Icons.SaveAs.png"),
                                                    AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "ZtgeoGISDesktop.Icons.Save_dis32.png")
                                                    , 0, false);
     var fileQuickPrint = filePageGroup.CreateChildMenu(MainFormMenuNames.FilePageGroup_FileQuickPrint, MenuType.Button, "快速打印", "", null
                                                        , AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "ZtgeoGISDesktop.Icons.QuickPrint.png"));
     var filePrint = filePageGroup.CreateChildMenu(MainFormMenuNames.FilePageGroup_FilePrint, MenuType.Button, "打印", "", null
                                                   , AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "ZtgeoGISDesktop.Icons.Print.png"));
     var filePrintPreview = filePageGroup.CreateChildMenu(MainFormMenuNames.FilePageGroup_FilePrintPreview, MenuType.Button, "打印预览", "", null
                                                          , AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "ZtgeoGISDesktop.Icons.PrintPreview32.png"),
                                                          AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "ZtgeoGISDesktop.Icons.PrintPreview_dis32.png")
                                                          );
     //document info
     var documentInfoGroup = filePageMenu.CreateChildMenu(MainFormMenuNames.FilePageDocumentInfoGroupMenu, MenuType.Group, "文档");
     var documentInfo      = documentInfoGroup.CreateChildMenu(MainFormMenuNames.FilePageDocumentInfoGroup_Document, MenuType.Button, "文档信息", "", null
                                                               , AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "ZtgeoGISDesktop.Icons.DocumentInfo.png"));
     //lecense info
     var LicenseInfoGroup = filePageMenu.CreateChildMenu(MainFormMenuNames.LicenseGroupMenu, MenuType.Group, "授权");
     var licenseInfo      = LicenseInfoGroup.CreateChildMenu(MainFormMenuNames.LicenseGroup_LicenseInfo, MenuType.Button, "授权信息", "", null
                                                             , AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "ZtgeoGISDesktop.Icons.LicenseInfo.png"));
     var powerBy = LicenseInfoGroup.CreateChildMenu(MainFormMenuNames.LicenseGroup_PowerBy, MenuType.Button, "谴责声明", "", null
                                                    , AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "ZtgeoGISDesktop.Icons.PowerBy.png"));
     //help
     var helpGroup = filePageMenu.CreateChildMenu(MainFormMenuNames.HelpGroupMenu, MenuType.Group, "帮助");
     var about     = helpGroup.CreateChildMenu(MainFormMenuNames.HelpGroup_About, MenuType.Button, "关于", "", null
                                               , AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "ZtgeoGISDesktop.Icons.About.png"));
     var update = helpGroup.CreateChildMenu(MainFormMenuNames.HelpGroup_Update, MenuType.Button, "更新检查", "", null
                                            , AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "ZtgeoGISDesktop.Icons.Update.png"));
     var helpDown = helpGroup.CreateChildMenu(MainFormMenuNames.HelpGroup_HelpDown, MenuType.Button, "下载帮助", "", null
                                              , AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "ZtgeoGISDesktop.Icons.HelpDown.png"));
     var feedBack = helpGroup.CreateChildMenu(MainFormMenuNames.HelpGroup_FeedBack, MenuType.Button, "反馈", "", null
                                              , AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "ZtgeoGISDesktop.Icons.FeedBack.png"));
     //setting page
     var settingPageMenu = context.CreateMenu(MainFormMenuNames.SettingPageMenu, MenuType.Page, "设置", "", null,
                                              AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "ZtgeoGISDesktop.Icons.Setting.png"));
     //systemSettingGroup
     var systemSettingGroup = settingPageMenu.CreateChildMenu(MainFormMenuNames.SystemSettingGroupMenu, MenuType.Group, "系统设置");
     var uiDesign           = systemSettingGroup.CreateChildMenu(MainFormMenuNames.SystemSettingGroup_UiDesign, MenuType.Button, "界面设置", "", null
                                                                 , AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "ZtgeoGISDesktop.Icons.UIDesign.png"));
     var menuOrder = systemSettingGroup.CreateChildMenu(MainFormMenuNames.SystemSettingGroup_MenuOrderSetting, MenuType.Button, "菜单设置", "", null
                                                        , AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "ZtgeoGISDesktop.Icons.MenuOrderSetting.png"),
                                                        menuActionType: AbpType.GetType <IMenuAction>(typeof(Setting)));
 }
Ejemplo n.º 4
0
 public ResourceItem(string _fullName, IResource _resource) : base(_fullName)
 {
     resource = _resource;
     if (resource.ResourceMetaData.Icon != null)
     {
         image = resource.ResourceMetaData.Icon;
     }
     else
     {
         image = AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "ZtgeoGISDesktop.Winform.Icons.ResourceFile16.png");
     }
 }
Ejemplo n.º 5
0
        public override void SetToolbars(IToolbarDefinitionContext context)
        {
            var group = context.CreateToolbarGroup(CADToolbarNames.CADToolGroup, "CAD_ToolGroup", null, MultiTenancySides.Tenant | MultiTenancySides.Host, false);

            group.AddToolbar(new WinformToolbar(
                                 CADToolbarNames.ZoomIn,
                                 AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "Ztgeo.Gis.CAD.Icons.ZoomIn16.png"),
                                 AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "Ztgeo.Gis.CAD.Icons.ZoomIn_dis16.png"),
                                 false, "zoom in", group, null, MultiTenancySides.Host | MultiTenancySides.Tenant
                                 , AbpType.GetType <IToolbarAction>(typeof(ZoomIn))
                                 ));
            group.AddToolbar(new WinformToolbar(
                                 CADToolbarNames.ZoomOut,
                                 AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "Ztgeo.Gis.CAD.Icons.ZoomOut16.png"),
                                 AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "Ztgeo.Gis.CAD.Icons.ZoomOut_dis16.png"),
                                 false, "zoom out", group, null, MultiTenancySides.Host | MultiTenancySides.Tenant
                                 , AbpType.GetType <IToolbarAction>(typeof(ZoomOut))
                                 ));
            group.AddToolbar(new WinformToolbar(
                                 CADToolbarNames.Pan,
                                 AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "Ztgeo.Gis.CAD.Icons.pan16.png"),
                                 AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "Ztgeo.Gis.CAD.Icons.pan_dis16.png"),
                                 true, "pan", group, null, MultiTenancySides.Host | MultiTenancySides.Tenant
                                 , AbpType.GetType <IToolbarAction>(typeof(Pan))
                                 ));
            group.AddToolbar(new WinformToolbar(
                                 CADToolbarNames.ShowLayerManager,
                                 AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "Ztgeo.Gis.CAD.Icons.layer16.png"),
                                 AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "Ztgeo.Gis.CAD.Icons.layer_dis16.png"),
                                 false, "layer manager", group, null, MultiTenancySides.Host | MultiTenancySides.Tenant
                                 , AbpType.GetType <IToolbarAction>(typeof(ShowLayer))
                                 ));
            group.AddToolbar(new WinformToolbar(
                                 CADToolbarNames.FitDrawing,
                                 AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "Ztgeo.Gis.CAD.Icons.fitDraw16.png"),
                                 AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "Ztgeo.Gis.CAD.Icons.fitdraw_dis16.png"),
                                 false, "fit drawing", group, null, MultiTenancySides.Host | MultiTenancySides.Tenant
                                 , AbpType.GetType <IToolbarAction>(typeof(FitDraw))
                                 ));
            group.AddToolbar(new WinformToolbar(
                                 CADToolbarNames.SelectionModel,
                                 AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "Ztgeo.Gis.CAD.Icons.select16.png"),
                                 AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "Ztgeo.Gis.CAD.Icons.select_dis16.png"),
                                 false, "select entities", group, null, MultiTenancySides.Host | MultiTenancySides.Tenant
                                 , AbpType.GetType <IToolbarAction>(typeof(Select))
                                 ));
        }
Ejemplo n.º 6
0
 public override void SetMenus(IMenuDefinitionContext context)
 {
     var settingPageMenu = context.CreateMenu(MainFormMenuNames.SettingPageMenu, MenuType.Page, "设置", "", null,
                                              AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "ZtgeoGISDesktop.Icons.Setting.png"));
     var systemSettingGroup = settingPageMenu.CreateChildMenu(MainFormMenuNames.SystemSettingGroupMenu, MenuType.Group, "系统设置");
     var uiDesign           = systemSettingGroup.CreateChildMenu(MainFormMenuNames.SystemSettingGroup_UiDesign, MenuType.Button, "界面设置", "", null
                                                                 , AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "ZtgeoGISDesktop.Icons.UIDesign.png"), menuEvent: m => {
     });
     //var backend = systemSettingGroup.CreateChildMenu(MainFormMenuNames.SystemSettingGroup_Backend, MenuType.Button, "后台设置", "", null
     //    , AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "ZtgeoGISDesktop.Icons.backend.png"));
     var menuOrder = systemSettingGroup.CreateChildMenu(MainFormMenuNames.SystemSettingGroup_MenuOrderSetting, MenuType.Button, "菜单设置", "", null
                                                        , AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "ZtgeoGISDesktop.Icons.MenuOrderSetting.png"), menuEvent: m =>
     {
         DialogHybirdForm <MenuSettingControl> dialog = new DialogHybirdForm <MenuSettingControl>(iocManager, typeof(ZtgeoGISDesktopMoudle).Assembly, new string[] {
             "WebViews", "MenuSetting", "index.html"
         });
         dialog.Size            = new Size(1260, 560);
         dialog.FormBorderStyle = FormBorderStyle.FixedToolWindow;
         dialog.StartPosition   = FormStartPosition.CenterScreen;
         dialog.ShowDialog();
     });
 }
Ejemplo n.º 7
0
        public override void SetMenus(IMenuDefinitionContext context)
        {
            var settingPageMenu = context.CreateMenu(DataSyncMenuNames.SettingPageMenu, MenuType.Page, "设置", "", null,
                                                     AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "CadastralManagementDataSync.Icons.Setting16.png"));

            var systemSettingGroup = settingPageMenu.CreateChildMenu(DataSyncMenuNames.SystemSettingGroupMenu, MenuType.Group, "系统设置");

            systemSettingGroup.CreateChildMenu(DataSyncMenuNames.SystemSettingGroup_DataSync, MenuType.Button, "数据同步设置", "数据同步设置", null,
                                               AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "CadastralManagementDataSync.Icons.DataSync.png"),
                                               AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "CadastralManagementDataSync.Icons.DataSync_dis.png"),
                                               0, true, MultiTenancySides.Host | MultiTenancySides.Tenant, null, AbpType.GetType <IMenuAction>(typeof(DataSyncSettingAction))
                                               );

            var DataSyncPageMenu = context.CreateMenu(DataSyncMenuNames.DataSyncPageMenu, MenuType.Page, "数据同步", "", null,
                                                      AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "CadastralManagementDataSync.Icons.DataSync16.png"));
            var DataSynvSqlCreateMenu = DataSyncPageMenu.CreateChildMenu(DataSyncMenuNames.DataSyncPageSqlCreateGroupMenu, MenuType.Group, "数据同步");

            DataSynvSqlCreateMenu.CreateChildMenu(DataSyncMenuNames.DataSyncPageSqlCreateGroupInnerDataInitMenu, MenuType.Button, "内网数据库初始化", "内网数据库初始化", null,
                                                  AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "CadastralManagementDataSync.Icons.innerDB32.png"),
                                                  null,
                                                  0, true, MultiTenancySides.Host | MultiTenancySides.Tenant, null, AbpType.GetType <IMenuAction>(typeof(DoDBTriggerMenuAction))
                                                  );
            DataSynvSqlCreateMenu.CreateChildMenu(DataSyncMenuNames.DataSyncPageSqlCreateGroupOuterDataInitMenu, MenuType.Button, "外网数据库初始化", "外网数据库初始化", null,
                                                  AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "CadastralManagementDataSync.Icons.outDB32.png"),
                                                  null,
                                                  0, true, MultiTenancySides.Host | MultiTenancySides.Tenant, null, AbpType.GetType <IMenuAction>(typeof(DoDBTriggerMenuAction)));
            var DataSynvDoDataSyncMenu = DataSyncPageMenu.CreateChildMenu(DataSyncMenuNames.DataSyncPageDoDataSyncGroupMenu, MenuType.Group, "同步操作");

            DataSynvDoDataSyncMenu.CreateChildMenu(DataSyncMenuNames.DataSyncPageDoDataSyncGroupInnerDoDataSyncMenu, MenuType.Button, "内网数据同步", "内网数据和本地数据同步", null,
                                                   AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "CadastralManagementDataSync.Icons.DataOut32.png"),
                                                   null,
                                                   0, true, MultiTenancySides.Host | MultiTenancySides.Tenant, null, AbpType.GetType <IMenuAction>(typeof(DataSysncMenuAction)));
            DataSynvDoDataSyncMenu.CreateChildMenu(DataSyncMenuNames.DataSyncPageDoDataSyncGroupOuterDoDataSyncMenu, MenuType.Button, "外网数据同步", "外网数据和本地数据同步", null,
                                                   AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "CadastralManagementDataSync.Icons.DataIn32.png"),
                                                   null,
                                                   0, true, MultiTenancySides.Host | MultiTenancySides.Tenant, null, AbpType.GetType <IMenuAction>(typeof(DataSysncMenuAction)));
        }
Ejemplo n.º 8
0
        /// <summary>
        /// 资源树的右键事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void OnTreeListPopMenuShow(object sender, PopupMenuShowingEventArgs e)
        {
            TreeList        tree            = sender as TreeList;
            TreeListHitInfo treeListHitInfo = tree.CalcHitInfo(e.Point);

            if (treeListHitInfo.HitInfoType == HitInfoType.Cell)
            {
                tree.SetFocusedNode(treeListHitInfo.Node);
            }
            if (tree.FocusedNode != null)
            {
                var item = navigationTreeList.GetRow(tree.FocusedNode.Id);
                if (item is ResourceItem)
                {
                    ResourceItem _item = item as ResourceItem;
                    popupMenu1.ClearLinks();
                    IResource resource = _item.Resource;
                    if (resource.ResourceMetaData != null &&
                        resource.ResourceMetaData.ContextActionTypes != null &&
                        resource.ResourceMetaData.ContextActionTypes.Count > 0)
                    {
                        foreach (Type itemActionType in resource.ResourceMetaData.ContextActionTypes)
                        {
                            IContextMenuItemAction contextMenuItemAction = IocManager.Instance.Resolve(itemActionType) as IContextMenuItemAction;
                            if (contextMenuItemAction.IsSplitor)
                            {
                                var link = popupMenu1.AddItem(new BarLargeButtonItem());
                                link.BeginGroup = true;
                            }
                            else
                            {
                                contextMenuItemAction.Sender = resource;
                                var buttonItem = new DevExpress.XtraBars.BarButtonItem(this.barManager1, contextMenuItemAction.Caption);
                                buttonItem.ImageOptions.Image = contextMenuItemAction.ItemIcon;
                                buttonItem.ItemClick         += (itemSender, ee) =>
                                {
                                    contextMenuItemAction.Excute();
                                };

                                popupMenu1.AddItem(
                                    buttonItem
                                    );
                            }
                        }
                        Point p = new Point(Cursor.Position.X, Cursor.Position.Y);
                        popupMenu1.ShowPopup(p);
                    }
                }
                else if (item is DirectoryItem)
                {
                    popupMenu1.ClearLinks();
                    var barbutton = new DevExpress.XtraBars.BarButtonItem(this.barManager1, "打开资源文件目录");
                    barbutton.ImageOptions.Image = AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "ZtgeoGISDesktop.Icons.ResourceManager16.png");
                    barbutton.ItemClick         += (itemSender, ee) =>
                    {
                        System.Diagnostics.Process.Start("explorer.exe", ((DirectoryItem)item).FullName);
                    };
                    var barbutton2 = new DevExpress.XtraBars.BarButtonItem(this.barManager1, "刷新");
                    barbutton2.ImageOptions.Image = AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "ZtgeoGISDesktop.Icons.Refesh16.png");
                    barbutton2.ItemClick         += (itemSender, ee) =>
                    {
                        //tree.FocusedNode.Collapse();
                        //tree.FocusedNode.HasChildren = true;
                        //tree.RefreshNode(tree.FocusedNode);
                        tree.RefreshDataSource();
                    };
                    popupMenu1.AddItem(barbutton); popupMenu1.AddItem(barbutton2);
                    Point p = new Point(Cursor.Position.X, Cursor.Position.Y);
                    popupMenu1.ShowPopup(p);
                }
                else if (item is FileItem)
                {
                }
            }
        }
Ejemplo n.º 9
0
        public override void SetMenus(IMenuDefinitionContext context)
        {
            var cadPageMenu = context.CreateMenu(CadBaseMenusNames.CadPageMenu, MenuType.Page, "CAD", "", null,
                                                 AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "Ztgeo.Gis.CAD.Icons.cad16.png"));
            var fileGroupMenu = cadPageMenu.CreateChildMenu(CadBaseMenusNames.CadFileGroupMenu, MenuType.Group, "文件");
            var openFile      = fileGroupMenu.CreateChildMenu(CadBaseMenusNames.OpenCadFileMenu, MenuType.Button, "文件打开", "", null
                                                              , AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "Ztgeo.Gis.CAD.Icons.OpenCad32.png")
                                                              , AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "Ztgeo.Gis.CAD.Icons.OpenCad_Dis32.png")
                                                              , menuActionType: AbpType.GetType <IMenuAction>(typeof(OpenCadFileAction))
                                                              );
            var openWebFile = fileGroupMenu.CreateChildMenu(CadBaseMenusNames.OpenCadFromWebMenu, MenuType.Button, "Web打开", "", null
                                                            , AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "Ztgeo.Gis.CAD.Icons.WebFile32.png")
                                                            , AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "Ztgeo.Gis.CAD.Icons.WebFile_dis32.png")
                                                            //,menuEvent: m =>
                                                            //{
                                                            //    IDocumentManager documentManager = iocManager.Resolve<IDocumentManager>();
                                                            //    ICADToolbarControl toolbarControl = iocManager.Resolve<ICADToolbarControl>();
                                                            //    MenuActions.OpenCADFile(documentManager, toolbarControl);
                                                            //}
                                                            );
            var saveFile = fileGroupMenu.CreateChildMenu(CadBaseMenusNames.SaveCadFileMenu, MenuType.Button, "保存", "", null
                                                         , AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "Ztgeo.Gis.CAD.Icons.Savecad32.png")
                                                         , AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "Ztgeo.Gis.CAD.Icons.Savecad_Dis32.png")
                                                         //, menuEvent: m =>
                                                         //{

                                                         //}
                                                         );
            var saveDxfFile = fileGroupMenu.CreateChildMenu(CadBaseMenusNames.SaveCadFileAsDxfMenu, MenuType.Button, "保存为DXF", "", null
                                                            , AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "Ztgeo.Gis.CAD.Icons.SaveDxf32.png")
                                                            , AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "Ztgeo.Gis.CAD.Icons.SaveDxf_dis32.png")
                                                            //, menuEvent: m =>
                                                            //{

                                                            //}
                                                            );

            var quickPrint = fileGroupMenu.CreateChildMenu(CadBaseMenusNames.QuickPrintMenu, MenuType.Button, "快速打印", "", null
                                                           , AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "Ztgeo.Gis.CAD.Icons.QuickPrint32.png")
                                                           , AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "Ztgeo.Gis.CAD.Icons.QuickPrint_dis32.png")
                                                           //, menuEvent: m =>
                                                           //{

                                                           //}
                                                           );
            var print = fileGroupMenu.CreateChildMenu(CadBaseMenusNames.PrintMenu, MenuType.Button, "打印", "", null
                                                      , AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "Ztgeo.Gis.CAD.Icons.Print32.png")
                                                      , AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "Ztgeo.Gis.CAD.Icons.Print_dis32.png")
                                                      //, menuEvent: m =>
                                                      //{

                                                      //}
                                                      );
            var printPreview = fileGroupMenu.CreateChildMenu(CadBaseMenusNames.PrintPreviewMenu, MenuType.Button, "打印预览", "", null
                                                             , AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "Ztgeo.Gis.CAD.Icons.PrintPreview32.png")
                                                             , AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "Ztgeo.Gis.CAD.Icons.PrintPreview_dis32.png")
                                                             //, menuEvent: m =>
                                                             //{

                                                             //}
                                                             );

            var outputGroupMenu = cadPageMenu.CreateChildMenu(CadBaseMenusNames.CadFileOutPutGroupMenu, MenuType.Group, "文件导出");
            var outputIamgeFile = outputGroupMenu.CreateChildMenu(CadBaseMenusNames.CadFileOutPutCad2ImageMenu, MenuType.Button, "导出图片", "", null
                                                                  , AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "Ztgeo.Gis.CAD.Icons.OutputCAD2Img32.png")
                                                                  , AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "Ztgeo.Gis.CAD.Icons.OutputCAD2Img_dis32.png")
                                                                  //, menuEvent: m =>
                                                                  //{

                                                                  //}
                                                                  );
            var outputEmfFile = outputGroupMenu.CreateChildMenu(CadBaseMenusNames.CadFileOutPutCad2EmfMenu, MenuType.Button, "导出Emf", "", null
                                                                , AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "Ztgeo.Gis.CAD.Icons.OutputCAD2Emf32.png")
                                                                , AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "Ztgeo.Gis.CAD.Icons.OutputCAD2Emf_dis32.png")
                                                                //, menuEvent: m =>
                                                                //{

                                                                //}
                                                                );
            var fileOperateGroupMenu = cadPageMenu.CreateChildMenu(CadBaseMenusNames.CadFileOperateGroupMenu, MenuType.Group, "文件操作");
            var mergeFile            = fileOperateGroupMenu.CreateChildMenu(CadBaseMenusNames.CadFileOperate_MergeMenu, MenuType.Button, "文件合并", "", null
                                                                            , AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "Ztgeo.Gis.CAD.Icons.FileMerge32.png")
                                                                            , AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "Ztgeo.Gis.CAD.Icons.FileMerge_dis32.png")
                                                                            //, menuEvent: m =>
                                                                            //{

                                                                            //}
                                                                            );
            var settingGroupMenu = cadPageMenu.CreateChildMenu(CadBaseMenusNames.CadFileViewSettingGroupMenu, MenuType.Group, "设置");
            var shxFontMenu      = settingGroupMenu.CreateChildMenu(CadBaseMenusNames.CadFileShxFontsSettingMenu, MenuType.Button, "Shx Fonts", "", null
                                                                    , AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "Ztgeo.Gis.CAD.Icons.ShxFont32.png")
                                                                    , AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "Ztgeo.Gis.CAD.Icons.ShxFont_dis32.png")
                                                                    //, menuEvent: m =>
                                                                    //{

                                                                    //}
                                                                    );
            var backgroundMenu = settingGroupMenu.CreateChildMenu(CadBaseMenusNames.CadFileBackgroudColorSettingMenu, MenuType.Button, "背景设置", "", null
                                                                  , AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "Ztgeo.Gis.CAD.Icons.background32.png")
                                                                  , AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "Ztgeo.Gis.CAD.Icons.background_dis32.png")
                                                                  //, menuEvent: m =>
                                                                  //{

                                                                  //}
                                                                  );
        }
Ejemplo n.º 10
0
 public override void SetMenus(IMenuDefinitionContext context)
 {
     //filePage
     var filePageMenu = context.CreateMenu(MainFormMenuNames.FilePageMenu, MenuType.Page, "文件", "", null,
                                           AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "ZtgeoGISDesktop.Icons.file16.png"));
     //fileGroup
     var filePageGroup = filePageMenu.CreateChildMenu(MainFormMenuNames.FilePageGroupMenu, MenuType.Group, "文件");
     var fileNew       = filePageGroup.CreateChildMenu(MainFormMenuNames.FilePageGroup_FileNew, MenuType.Button, "新建", "", null
                                                       , AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "ZtgeoGISDesktop.Icons.New.png"));
     var fileOpen = filePageGroup.CreateChildMenu(MainFormMenuNames.FilePageGroup_FileOpen, MenuType.Button, "打开", "", null
                                                  , AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "ZtgeoGISDesktop.Icons.Open.png"), menuActionType: typeof(Open));
     var fileSave = filePageGroup.CreateChildMenu(MainFormMenuNames.FilePageGroup_FileSave, MenuType.Button, "保存", "", null
                                                  , AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "ZtgeoGISDesktop.Icons.Save32.png")
                                                  , AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "ZtgeoGISDesktop.Icons.Save_dis32.png")
                                                  , 0, false);
     var fileSaveAs = filePageGroup.CreateChildMenu(MainFormMenuNames.FilePageGroup_FileSaveAs, MenuType.Button, "另存为", "", null
                                                    , AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "ZtgeoGISDesktop.Icons.SaveAs.png"),
                                                    AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "ZtgeoGISDesktop.Icons.Save_dis32.png")
                                                    , 0, false);
     var fileQuickPrint = filePageGroup.CreateChildMenu(MainFormMenuNames.FilePageGroup_FileQuickPrint, MenuType.Button, "快速打印", "", null
                                                        , AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "ZtgeoGISDesktop.Icons.QuickPrint.png"));
     var filePrint = filePageGroup.CreateChildMenu(MainFormMenuNames.FilePageGroup_FilePrint, MenuType.Button, "打印", "", null
                                                   , AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "ZtgeoGISDesktop.Icons.Print.png"));
     var filePrintPreview = filePageGroup.CreateChildMenu(MainFormMenuNames.FilePageGroup_FilePrintPreview, MenuType.Button, "打印预览", "", null
                                                          , AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "ZtgeoGISDesktop.Icons.PrintPreview32.png"),
                                                          AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "ZtgeoGISDesktop.Icons.PrintPreview_dis32.png")
                                                          );
     //document info
     var documentInfoGroup = filePageMenu.CreateChildMenu(MainFormMenuNames.FilePageDocumentInfoGroupMenu, MenuType.Group, "文档");
     var documentInfo      = documentInfoGroup.CreateChildMenu(MainFormMenuNames.FilePageDocumentInfoGroup_Document, MenuType.Button, "文档信息", "", null
                                                               , AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "ZtgeoGISDesktop.Icons.DocumentInfo.png"));
     //lecense info
     var LicenseInfoGroup = filePageMenu.CreateChildMenu(MainFormMenuNames.LicenseGroupMenu, MenuType.Group, "授权");
     var licenseInfo      = LicenseInfoGroup.CreateChildMenu(MainFormMenuNames.LicenseGroup_LicenseInfo, MenuType.Button, "授权信息", "", null
                                                             , AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "ZtgeoGISDesktop.Icons.LicenseInfo.png"));
     var powerBy = LicenseInfoGroup.CreateChildMenu(MainFormMenuNames.LicenseGroup_PowerBy, MenuType.Button, "谴责声明", "", null
                                                    , AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "ZtgeoGISDesktop.Icons.PowerBy.png"));
     //help
     var helpGroup = filePageMenu.CreateChildMenu(MainFormMenuNames.HelpGroupMenu, MenuType.Group, "帮助");
     var about     = helpGroup.CreateChildMenu(MainFormMenuNames.HelpGroup_About, MenuType.Button, "关于", "", null
                                               , AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "ZtgeoGISDesktop.Icons.About.png"));
     var update = helpGroup.CreateChildMenu(MainFormMenuNames.HelpGroup_Update, MenuType.Button, "更新检查", "", null
                                            , AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "ZtgeoGISDesktop.Icons.Update.png"));
     var helpDown = helpGroup.CreateChildMenu(MainFormMenuNames.HelpGroup_HelpDown, MenuType.Button, "下载帮助", "", null
                                              , AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "ZtgeoGISDesktop.Icons.HelpDown.png"));
     var feedBack = helpGroup.CreateChildMenu(MainFormMenuNames.HelpGroup_FeedBack, MenuType.Button, "反馈", "", null
                                              , AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "ZtgeoGISDesktop.Icons.FeedBack.png"));
     //setting page
     var settingPageMenu = context.CreateMenu(MainFormMenuNames.SettingPageMenu, MenuType.Page, "设置", "", null,
                                              AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "ZtgeoGISDesktop.Icons.Setting.png"));
     //systemSettingGroup
     var systemSettingGroup = settingPageMenu.CreateChildMenu(MainFormMenuNames.SystemSettingGroupMenu, MenuType.Group, "系统设置");
     var uiDesign           = systemSettingGroup.CreateChildMenu(MainFormMenuNames.SystemSettingGroup_UiDesign, MenuType.Button, "界面设置", "", null
                                                                 , AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "ZtgeoGISDesktop.Icons.UIDesign.png"));
     var menuOrder = systemSettingGroup.CreateChildMenu(MainFormMenuNames.SystemSettingGroup_MenuOrderSetting, MenuType.Button, "菜单设置", "", null
                                                        , AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "ZtgeoGISDesktop.Icons.MenuOrderSetting.png")
                                                        //menuEvent: m =>
                                                        //{
                                                        //    DialogHybirdForm<MenuSettingControl> dialog = new DialogHybirdForm<MenuSettingControl>(iocManager, typeof(ZtgeoGISDesktopMoudle).Assembly, new string[] {
                                                        //        "WebViews","MenuSetting","index.html"
                                                        //    });
                                                        //    dialog.Size = new Size(1260, 560);
                                                        //    dialog.FormBorderStyle = FormBorderStyle.FixedToolWindow;
                                                        //    dialog.StartPosition = FormStartPosition.CenterScreen;
                                                        //    dialog.ShowDialog();
                                                        //}
                                                        );
 }