清理多余引用
This commit is contained in:
@@ -4,13 +4,12 @@ using Nice3point.Revit.Toolkit.External.Handlers;
|
||||
|
||||
|
||||
using ShrlAlgoToolkit.RevitAddins.Properties;
|
||||
using ShrlAlgoToolkit.RevitAddins.RvView;
|
||||
|
||||
namespace ShrlAlgoToolkit.RevitAddins.Entry;
|
||||
|
||||
public class DrawingViewApp
|
||||
{
|
||||
private static readonly string TabName = RevitAddins.Properties.Settings.Default.TabName;
|
||||
private static readonly string TabName = Settings.Default.TabName;
|
||||
|
||||
public DrawingViewApp(UIControlledApplication application)
|
||||
{
|
||||
@@ -116,7 +115,7 @@ public class DrawingViewApp
|
||||
//ribbonPanel.AddPushButton<ViewManagerCmd>("视图管理", Resources.view_manager_32px, "视图管理");
|
||||
}
|
||||
|
||||
private void CreateToggleButton(Autodesk.Windows.RibbonTab rt, string panelName)
|
||||
private void CreateToggleButton(RibbonTab rt, string panelName)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
@@ -4,7 +4,6 @@ using System.Windows;
|
||||
using Autodesk.Revit.DB;
|
||||
using Autodesk.Windows;
|
||||
using ShrlAlgoToolkit.RevitAddins.Properties;
|
||||
using ShrlAlgoToolkit.RevitAddins.RvFamily;
|
||||
using ShrlAlgoToolkit.RevitAddins.RvFamily.FamilyLibrary;
|
||||
using ShrlAlgoToolkit.RevitAddins.Common.Extensions;
|
||||
|
||||
@@ -54,7 +53,7 @@ public class FamilyApp
|
||||
private const string VbRecentPanelName = "最近使用";
|
||||
|
||||
//获取Ribbon类所在的通用类库目录
|
||||
private static readonly string TabName = RevitAddins.Properties.Settings.Default.TabName;
|
||||
private static readonly string TabName = Properties.Settings.Default.TabName;
|
||||
private readonly UIApplication uiapp;
|
||||
|
||||
public ObservableCollection<FamilyModel> Items { get; set; }
|
||||
|
||||
@@ -364,7 +364,7 @@ public class ModifyTabApp
|
||||
alignSource.Items.Add(ribbonRowPanel);
|
||||
alignSource.Items.Add(ribbonRowPanel1);
|
||||
//新建面板
|
||||
Autodesk.Windows.RibbonPanel alignElemsPanel = new() { FloatingOrientation = System.Windows.Controls.Orientation.Vertical };
|
||||
Autodesk.Windows.RibbonPanel alignElemsPanel = new() { FloatingOrientation = Orientation.Vertical };
|
||||
alignElemsPanel.Source = alignSource;
|
||||
tab.Panels.Add(alignElemsPanel);
|
||||
}
|
||||
@@ -375,7 +375,7 @@ public class ModifyTabApp
|
||||
private void SelectionPanel(RibbonTab tab)
|
||||
{
|
||||
//新建面板
|
||||
Autodesk.Windows.RibbonPanel ribbonPanel = new() { FloatingOrientation = System.Windows.Controls.Orientation.Vertical };
|
||||
Autodesk.Windows.RibbonPanel ribbonPanel = new() { FloatingOrientation = Orientation.Vertical };
|
||||
|
||||
//面板资源
|
||||
RibbonPanelSource selSource = new() { Id = "ID_SSI_Panel", Title = "选择元素" };
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace ShrlAlgoToolkit.RevitAddins.Entry;
|
||||
//[Obfuscation(Exclude = true, ApplyToMembers = true)]
|
||||
public class RvApp : ExternalApplication
|
||||
{
|
||||
private static readonly string TabName = Properties.Settings.Default.TabName;
|
||||
private static readonly string TabName = Settings.Default.TabName;
|
||||
private AsyncEventHandler saveHandler;
|
||||
readonly System.Timers.Timer saveTimer = Variables.AutoSaveTimer;
|
||||
private void OnTimedEvent(object source, System.Timers.ElapsedEventArgs e)
|
||||
@@ -46,7 +46,7 @@ public class RvApp : ExternalApplication
|
||||
public override void OnStartup()
|
||||
{
|
||||
saveHandler = new();
|
||||
UiApplication.CreateRibbonTab(Properties.Settings.Default.TabName);
|
||||
UiApplication.CreateRibbonTab(Settings.Default.TabName);
|
||||
|
||||
var versionNumber = UiApplication.Application.VersionNumber;
|
||||
var subVersionNumber = UiApplication.Application.SubVersionNumber;
|
||||
@@ -59,7 +59,7 @@ public class RvApp : ExternalApplication
|
||||
|
||||
var ribbon = Autodesk.Windows.ComponentManager.Ribbon;
|
||||
|
||||
var rt = ribbon.Tabs.FirstOrDefault(tab => tab.Name == Properties.Settings.Default.TabName);
|
||||
var rt = ribbon.Tabs.FirstOrDefault(tab => tab.Name == Settings.Default.TabName);
|
||||
ribbon.Tabs.Remove(rt);
|
||||
//foreach (var tab in ribbon.Tabs)
|
||||
//{
|
||||
@@ -74,11 +74,11 @@ public class RvApp : ExternalApplication
|
||||
|
||||
CivilApp(Application);
|
||||
MEPApp(Application);
|
||||
_ = new Entry.ModifyTabApp(UiApplication);
|
||||
_ = new ModifyTabApp(UiApplication);
|
||||
_ = new DrawingViewApp(Application);
|
||||
CreateCommonTools(Application);
|
||||
_ = new TabManagerApp(Application);
|
||||
_ = new Entry.FamilyApp(Application, UiApplication);
|
||||
_ = new FamilyApp(Application, UiApplication);
|
||||
|
||||
if (Settings.Default.IsActiveAutoSave)
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@ public class TabManagerApp
|
||||
{
|
||||
public TabManagerApp(UIControlledApplication application)
|
||||
{
|
||||
var tab = RibbonControl.Tabs.First(t => t.Name == RevitAddins.Properties.Settings.Default.TabName);
|
||||
var tab = RibbonControl.Tabs.First(t => t.Name == Settings.Default.TabName);
|
||||
|
||||
SetTabControl(tab);
|
||||
application.ViewActivating += Application_ViewActivating;
|
||||
@@ -20,7 +20,7 @@ public class TabManagerApp
|
||||
|
||||
private void InsertQuickAccessAndHidePanel()
|
||||
{
|
||||
var tab = RibbonControl.FindTab(RevitAddins.Properties.Settings.Default.TabName);
|
||||
var tab = RibbonControl.FindTab(Settings.Default.TabName);
|
||||
|
||||
if (tab != null && addInManagerPanel != null)
|
||||
{
|
||||
@@ -63,7 +63,7 @@ public class TabManagerApp
|
||||
var ribbon = ComponentManager.Ribbon;
|
||||
foreach (var tab in ribbon.Tabs)
|
||||
{
|
||||
if (tab.GetType() == typeof(RibbonTab) && tab.Title != RevitAddins.Properties.Settings.Default.TabName)
|
||||
if (tab.GetType() == typeof(RibbonTab) && tab.Title != Settings.Default.TabName)
|
||||
{
|
||||
RibbonToggleButton ribbonToggleButton =
|
||||
new()
|
||||
@@ -132,7 +132,7 @@ public class TabManagerApp
|
||||
//如果是族文档,在激活视图时,隐藏面板
|
||||
private void Application_ViewActivating(object sender, Autodesk.Revit.UI.Events.ViewActivatingEventArgs e)
|
||||
{
|
||||
SetTabEnabled(RevitAddins.Properties.Settings.Default.TabName, !e.NewActiveView.Document.IsFamilyDocument);
|
||||
SetTabEnabled(Settings.Default.TabName, !e.NewActiveView.Document.IsFamilyDocument);
|
||||
}
|
||||
|
||||
private void ControlledApplication_ApplicationInitialized(object sender, Autodesk.Revit.DB.Events.ApplicationInitializedEventArgs e)
|
||||
@@ -145,7 +145,7 @@ public class TabManagerApp
|
||||
if (sender is RibbonToggleButton toggleButton)
|
||||
{
|
||||
var tabName = toggleButton.Name;
|
||||
var tab = Entry.TabManagerApp.RibbonControl.FindTab(tabName);
|
||||
var tab = RibbonControl.FindTab(tabName);
|
||||
tab.IsVisible = toggleButton.IsChecked;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user