Browse Source

xls:菜单加载信息调整

xulisong 6 năm trước cách đây
mục cha
commit
0ab27609cc

+ 13 - 1
MBI/Menu/MBITool.xml

@@ -173,7 +173,7 @@
       <Modules>MBITool</Modules>
     </Button>
   </Panel>
- <Panel PanelName="标高修正" GroupFlag="True" GroupImage="" RevitVer="R14,R15,R16,R17"  ButtonStyles="Large">   
+ <Panel PanelName="功能扩展" GroupFlag="True" GroupImage="" RevitVer="R14,R15,R16,R17"  ButtonStyles="Large">   
     <Button ButtonStyles="Large">
       <ButtonName>SAGA.MBI.UpdateLevelNameCommand</ButtonName>
       <ButtonText>标高修正</ButtonText>
@@ -186,6 +186,18 @@
       <MenuTab>MBITool_W</MenuTab>
       <Modules>MBITool</Modules>
     </Button>
+<Button ButtonStyles="Large">
+      <ButtonName>SAGA.GplotManage.GraphUploadTest</ButtonName>
+      <ButtonText>拓扑图上传测试</ButtonText>
+      <ImageName>10、空间管理</ImageName>
+      <DllName>..\OutputDll\SAGA.GplotManage.exe</DllName>
+      <ClassName>SAGA.GplotManage.GraphUploadTest</ClassName>
+      <ToolTip>冷冻水-立管</ToolTip>
+      <LongDescription>冷冻水-立管</LongDescription>
+      <ToolTipImage></ToolTipImage>
+      <MenuTab>MBITool_W</MenuTab>
+      <Modules>MBITool</Modules>
+    </Button>
 </Panel>
 </Menus>
 <!--名称里面换行-->

+ 1 - 13
MBI/Menu/SAGABIM.xml

@@ -534,19 +534,7 @@
       <ToolTipImage></ToolTipImage>
       <MenuTab>SJJC_W</MenuTab>
       <Modules>SJJC</Modules>
-    </Button>
-    <Button ButtonStyles="Large">
-      <ButtonName>SAGA.GplotManage.GraphUploadTest</ButtonName>
-      <ButtonText>拓扑图上传测试</ButtonText>
-      <ImageName>10、空间管理</ImageName>
-      <DllName>..\OutputDll\SAGA.GplotManage.exe</DllName>
-      <ClassName>SAGA.GplotManage.GraphUploadTest</ClassName>
-      <ToolTip>冷冻水-立管</ToolTip>
-      <LongDescription>冷冻水-立管</LongDescription>
-      <ToolTipImage></ToolTipImage>
-      <MenuTab>SJJC_W</MenuTab>
-      <Modules>SJJC</Modules>
-    </Button>
+    </Button>   
 <Button ButtonStyles="Large">
       <ButtonName>SAGA.GplotManage.CheckSystemCommand</ButtonName>
       <ButtonText>管网检查</ButtonText>

+ 14 - 2
MBI/SAGA.RevitMenu/Configuration/RevitRibbonOperate.cs

@@ -5,6 +5,7 @@
  * ==============================================================================*/
 using System;
 using System.Collections.Generic;
+using System.IO;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
@@ -163,8 +164,19 @@ namespace SAGA.RevitMenu.Configuration
                                 tszbuttonData.AssemblyName, tszbuttonData.ClassName);
                             if (!string.IsNullOrEmpty(tszbuttonData.ImageName))
                             {
-                                pushbuttonData.Image = new BitmapImage(new Uri(tszbuttonData.ImageName + "16.png"));
-                                pushbuttonData.LargeImage = new BitmapImage(new Uri(tszbuttonData.ImageName + ".png"));
+                                var stringImagePath = tszbuttonData.ImageName + "16.png";
+                                var stringLargeImagePath = tszbuttonData.ImageName + ".png";
+                                if (File.Exists(stringImagePath))
+                                {
+                                    pushbuttonData.Image = new BitmapImage(new Uri(stringImagePath));
+                                }
+
+                                if (File.Exists(stringLargeImagePath))
+                                {
+                                    pushbuttonData.LargeImage = new BitmapImage(new Uri(stringLargeImagePath));
+                                }
+                             
+                             
                             }
                             pushbuttonData.ToolTip = tszbuttonData.ToolTip;
                             pushbuttonData.LongDescription = tszbuttonData.LongDescription;

+ 7 - 5
MBI/SAGA.RevitMenu/MenuApp.cs

@@ -44,10 +44,7 @@ namespace SAGA.RevitMenu
         {
             ErrorHandlers.Start();
             base.OnStartup(application);
-            if (!MenuConfig.LoadMenus(application))
-            {
-                return Result.Failed;
-            }
+         
             StartSetting.RegiterPane(application);
             //使用快捷键自动创建空间,需要先设置快捷键   
             //ScreenMenuKeyBoardShortCut.SetKeyboardShortcuts(application.ControlledApplication.VersionName);
@@ -55,8 +52,13 @@ namespace SAGA.RevitMenu
             TszDocChanged += App_DocumentChanged;
             application.ControlledApplication.DocumentClosing += ControlledApplication_DocumentClosing;
             RevitEventsBingding.AddEvents(application);
+            //将加载菜单逻辑后移 
+            if (!MenuConfig.LoadMenus(application))
+            {
+                return Result.Failed;
+            }
             //删除Addin文件
-            //MenuConfig.ClearAddInFile(application);
+            MenuConfig.ClearAddInFile(application);
             return Result.Succeeded;
         }