public GeometryFeaturesCommandGroupSpec(ISldWorks app, IGeometryMacroFeature[] features, IAboutApplicationService abtService) { Title = Resources.CommandBarGeometryTitle; Tooltip = Resources.CommandBarGeometryTooltip; Icon = new GeometryIcon(Resources.geometry_plus_plus); Id = 0; Commands = GetCommands(features, abtService, app); }
public SuspendRebuildCommandSpec(ISldWorks app, IDocumentsHandler <SuspendRebuildDocumentHandler> docsHandler) { Title = "Suspend Rebuild"; Tooltip = "Suspends the rebuild operation"; SupportedWorkspace = swWorkspaceTypes_e.AllDocuments; Icon = new GeometryIcon(Resources.suspend_rebuild); m_App = app; m_DocsHandler = docsHandler; }
internal AboutCommandSpec(IAboutApplicationService abtService, int id) { m_AbtService = abtService; UserId = id; Title = Resources.CommandAboutTitle; Tooltip = Resources.CommandAboutTooltip; HasMenu = true; HasToolbar = false; HasTabBox = false; SupportedWorkspace = swWorkspaceTypes_e.All; Icon = new GeometryIcon(Resources.about_icon); }
public PerformanceCommandGroupSpec(GeometryFeaturesCommandGroupSpec parent, PerformanceCommandSpec[] cmds) { Title = Resources.CommandGroupPerformanceTitle; Tooltip = Resources.CommandGroupPerformanceTooltip; Icon = new GeometryIcon(Resources.performance); Id = 1; Parent = parent; for (int i = 0; i < cmds.Length; i++) { cmds[i].SetUserId(i); } Commands = cmds; }
internal GeometryFeatureCommandSpec(ISldWorks app, IGeometryMacroFeature feat, int id) { if (feat == null) { throw new ArgumentNullException(nameof(feat)); } if (app == null) { throw new ArgumentNullException(nameof(app)); } m_Feat = feat; m_App = app; var type = feat.GetType(); if (!type.TryGetAttribute <DisplayNameAttribute>(a => Title = a.DisplayName)) { throw new NullReferenceException($"{type.FullName} must be decorated with {typeof(DisplayNameAttribute).FullName}"); } if (!type.TryGetAttribute <DescriptionAttribute>(a => Tooltip = a.Description)) { throw new NullReferenceException($"{type.FullName} must be decorated with {typeof(DescriptionAttribute).FullName}"); } if (!type.TryGetAttribute <IconAttribute>(a => Icon = new GeometryIcon(a.Icon))) { throw new NullReferenceException($"{type.FullName} must be decorated with {typeof(IconAttribute).FullName}"); } UserId = id; HasMenu = true; HasToolbar = true; HasTabBox = true; TabBoxStyle = SolidWorks.Interop.swconst.swCommandTabButtonTextDisplay_e.swCommandTabButton_TextBelow; SupportedWorkspace = swWorkspaceTypes_e.Part; }