public IntervalListViewModel(IWindowManager windowManager, IHierarchyManager hierarchyManager, IEventAggregator eventAggregator) { this.hierarchyManager = hierarchyManager; this.eventAggregator = eventAggregator; this.windowManager = Contract.NotNull(windowManager, "windowManager"); this.Values = new BindableCollection<BindableExpertise>(); }
public override void InitializeComponent(ICore core) { this.Sources.AddRange(ComponentRegistry.Instance.GetComponents <IOnDemandMetaDataSource>()); this.MetaDataManager = core.Managers.MetaData; this.HierarchyManager = core.Managers.Hierarchy; base.InitializeComponent(core); }
// -------------------------------------------------------------------------------------------- /// <summary> /// Initializes a new instance of the <see cref="HierarchyNode"/> class. /// </summary> /// <remarks> /// Sets up the default values and parses decorating attributes. /// </remarks> // -------------------------------------------------------------------------------------------- protected HierarchyNode(IHierarchyManager manager) { if (manager == null) { throw new ArgumentNullException(); } ManagerNode = manager; IsExpanded = true; SortPriority = -1; DefaultImageIndex = NoImageIndex; // --- Check for the SortOrder attribute var spAttr = GetType().GetAttribute <SortPriorityAttribute>(true); if (spAttr != null) { SortPriority = spAttr.Value; } // --- Check for the UseInnerHierarchyImages attribute var uihAttr = GetType().GetAttribute <UseInnerHierarchyImagesAttribute>(true); UseInnerHierarchyImages = uihAttr != null; // --- Check for the UseInnerHierarchyCaption attribute var uicAttr = GetType().GetAttribute <UseInnerHierarchyCaptionAttribute>(true); UseInnerHierarchyCaption = uicAttr != null; HierarchyId = ManagerNode.AddSubordinate(this); }
public override void InitializeComponent(ICore core) { this.LibraryManager = core.Managers.Library; this.MetaDataManager = core.Managers.MetaData; this.HierarchyManager = core.Managers.Hierarchy; base.InitializeComponent(core); }
// -------------------------------------------------------------------------------------------- /// <summary> /// Gets the state of the item. /// </summary> /// <param name="manager">The manager.</param> /// <param name="id">The id.</param> /// <param name="stateMask">The state mask.</param> /// <returns></returns> // -------------------------------------------------------------------------------------------- public __VSHIERARCHYITEMSTATE GetNodeState(IHierarchyManager manager, HierarchyId id, __VSHIERARCHYITEMSTATE stateMask) { uint result; HierarchyWindow.GetNodeState(manager, (uint)id, (uint)stateMask, out result); return((__VSHIERARCHYITEMSTATE)(result)); }
// -------------------------------------------------------------------------------------------- /// <summary> /// Removes the specified hierachy from the hierarchy window /// </summary> /// <param name="hierarchy">Hierarchy to remove from the window</param> // -------------------------------------------------------------------------------------------- public void RemoveUIHierarchy(IHierarchyManager hierarchy) { if (HierarchyWindow != null) { ErrorHandler.ThrowOnFailure(HierarchyWindow.RemoveUIHierarchy(hierarchy)); _Hierarchies.Remove(hierarchy); } }
// -------------------------------------------------------------------------------------------- /// <summary> /// Nests the specified hierarchy into this hierarchy node. /// </summary> /// <param name="nestedHierachy">The nested hierachy.</param> // -------------------------------------------------------------------------------------------- public void NestHierarchy(IHierarchyManager nestedHierachy) { if (nestedHierachy == null) { return; } _NestedHierarchy = nestedHierachy; _NestedHierarchy.EnsureHierarchyRoot(); _NestedHierarchy.SetParentHierarchy(ManagerNode, HierarchyId); }
public IntervalViewModel(IWindowManager windowManager, BindableExpertise intervalWithOpinions, IHierarchyManager hierarchyManager) { this.hierarchyManager = Contract.NotNull(hierarchyManager, "hierarchyManager"); this.windowManager = Contract.NotNull(windowManager, "windowManager"); this.expertise = Contract.NotNull(intervalWithOpinions, "intervalWithOpinions"); this.LowerBound = intervalWithOpinions.Interval.LowerBound; this.UpperBound = intervalWithOpinions.Interval.UpperBound; this.DisplayName = "Define Interval"; }
public HierarchyDefinitionViewModel(IHierarchyManager hierarchyManager, IWindowManager windowManager, IEventAggregator eventAggregator) { this.DisplayName = Title; this.eventAggregator = Contract.NotNull(eventAggregator, "eventAggregator"); this.windowManager = Contract.NotNull(windowManager, "windowManager"); this.hierarchyManager = Contract.NotNull(hierarchyManager, "hierarchyManager"); var hierarchy = hierarchyManager.GetCurrentHierarchy(); this.Hierarchy = new BindableHierarchy(hierarchy); this.AddSetButtonText = AddText; this.AddLabelButtonText = AddText; }
public ExpertiseViewModel(IHierarchyManager hierarchyManager, BindableExpertise expertise) { this.expertise = Contract.NotNull(expertise, "expertise"); Contract.NotNull(hierarchyManager, "hierarchyManager"); this.DisplayName = "Define Expertise"; this.Sliders = new BindableCollection<SliderViewModel>(); this.hierarchy = new BindableHierarchy(hierarchyManager.GetCurrentHierarchy()); this.LoadExpertise(); this.Interval = string.Format(IntervalPattern, expertise.Interval.LowerBound, expertise.Interval.UpperBound); }
// -------------------------------------------------------------------------------------------- /// <summary> /// Sites the specified hierarchy /// </summary> /// <param name="hierarchy">Hierarchy to site</param> // -------------------------------------------------------------------------------------------- private void Site(IHierarchyManager hierarchy) { // --- We do not site "null" hierarchies if (hierarchy == null) { return; } var oleSp = Frame.OleServiceProvider; if (oleSp != null) { hierarchy.SetSite(oleSp); } hierarchy.SetUIHierarchyWindow(HierarchyWindow); hierarchy.SetUIHierarchyToolWindow(this); }
// -------------------------------------------------------------------------------------------- /// <summary> /// Adds a new hierachy to the hierarchy window /// </summary> /// <param name="hierarchy">Hierarchy to add to the window</param> /// <param name="dontSelectNew"> /// Flag indicating if the the new hierarchy should not be selected. /// </param> // -------------------------------------------------------------------------------------------- public void AddUIHierarchy(IHierarchyManager hierarchy, bool dontSelectNew) { if (HierarchyWindow != null) { ErrorHandler.ThrowOnFailure( HierarchyWindow.AddUIHierarchy(hierarchy, dontSelectNew ? (uint)__VSADDHIEROPTIONS.ADDHIEROPT_DontSelectNewHierarchy : 0)); _Hierarchies.Add(hierarchy); Site(hierarchy); if (_InitialHierarchy != null) { _InitialHierarchy = hierarchy; } } }
public ShellViewModel( IWindowManager windowManager, IHierarchyManager hierarchyManager, IEventAggregator eventAggregator, CashflowViewModel casflowViewModel, MixedAnalysisViewModel mixedAnalysisViewModel, ResultsViewModel resultsViewModel) { this.DisplayName = "Business valuation using CW"; this.eventAggregator = Contract.NotNull(eventAggregator, "eventAggregator"); this.hierarchyManager = Contract.NotNull(hierarchyManager, "hierarchyManager"); this.windowManager = Contract.NotNull(windowManager, "windowManager"); this.Cashflow = Contract.NotNull(casflowViewModel, "casflowViewModel"); this.MixedAnalysis = Contract.NotNull(mixedAnalysisViewModel, "mixedAnalysisViewModel"); this.Results = Contract.NotNull(resultsViewModel, "resultsViewModel"); this.eventAggregator.PublishOnUIThread(new DataChangedEvent()); }
// -------------------------------------------------------------------------------------------- /// <summary> /// Initializes the tool window with the specified style and initial hierarchy. /// </summary> // -------------------------------------------------------------------------------------------- public override void OnToolWindowCreated() { base.OnToolWindowCreated(); __UIHWINFLAGS flags = 0; // ReSharper disable AccessToModifiedClosure _Attributes.ForEach(attr => flags |= attr.StyleFlag); // ReSharper restore AccessToModifiedClosure SetUIWindowStyle(ref flags); object unkObj; _InitialHierarchy = CreateInitialHierarchy(); if (_InitialHierarchy != null) { _Hierarchies.Add(_InitialHierarchy); } HierarchyWindow.Init(_InitialHierarchy, (uint)flags, out unkObj); Site(_InitialHierarchy); }
protected override void InitializeComponent(ICore core) { this.MetaDataManager = core.Managers.MetaData; this.HierarchyManager = core.Managers.Hierarchy; base.InitializeComponent(core); }
public HiddenRootNode(IHierarchyManager manager) : base(manager) { }
// -------------------------------------------------------------------------------------------- /// <summary> /// Initializes a new instance of the <see cref="HierarchyNode"/> class. /// </summary> /// <param name="manager">The manager object responsible for this node.</param> /// <param name="caption">The caption of the node.</param> // -------------------------------------------------------------------------------------------- protected HierarchyNode(IHierarchyManager manager, string caption) : this(manager) { _DefaultCaption = caption; }
// -------------------------------------------------------------------------------------------- /// <summary> /// Adds a new hierachy to the hierarchy window /// </summary> /// <param name="hierarchy">Hierarchy to add to the window</param> // -------------------------------------------------------------------------------------------- public void AddUIHierarchy(IHierarchyManager hierarchy) { AddUIHierarchy(hierarchy, true); }