public ToolWindowViewModel(DTE dte, OptionsViewModel options, GenerateMenuItemsHelper generateMenuHelper, Func <InternalBlameWindow> internalBlameWindowAccessor) { this.generateMenuItemsHelper = generateMenuHelper; this.dte = new DteWrapper(dte); this.internalBlameWindowAccessor = internalBlameWindowAccessor; Options = options; ServiceContainer = new ServiceContainer(this); MergeCommand = new DelegateCommand <bool?>(Merge, CanMerge); MergeAllCommand = new DelegateCommand(MergeAll, CanMergeAll); UpdateCommand = new DelegateCommand(Update, CanUpdate); BlameCommand = new DelegateCommand(Blame, CanBlame); CheckInCommand = new DelegateCommand <CheckInTarget>(CheckIn, CanCheckIn); CompareCurrentVersionCommand = new DelegateCommand(CompareWithCurrentVersion, CanCompareWithCurrentVersion); ComparePortVersionCommand = new DelegateCommand(CompareWithPortVersion, CanCompareWithPortVersion); CompareCurrentWithPortCommand = new DelegateCommand(CompareCurrentWithPortVersion, CanCompareCurrentWithPortVersion); ManualMergeCommand = new DelegateCommand(ManualMerge, CanManualMerge); NavigateToSolutionCommand = new DelegateCommand(NavigateToSolution, CanNavigateToSolution); UndoCheckoutCommand = new DelegateCommand(UndoCheckout, CanUndoCheckout); ShowLogCommand = new DelegateCommand(ShowLog, CanShowLog); NavigateToFileCommand = new DelegateCommand <ProjectItemBase>(NavigateToItem, CanNavigateToItem); ShowAllCommand = new DelegateCommand(ShowAlllItems, CanShowAllItems); ShowCheckoutOnlyCommand = new DelegateCommand(ShowCheckoutOnly, CanSHowCheckoutOnly); ShowNewOnlyCommand = new DelegateCommand(ShowNewOnly, CanShowNewOnly); FilterCriteria = CreateFilterCriteria(Options.StartupFilterType); }
void GenerateNavigationMenu() { var dte = (DTE)GetService(typeof(DTE)); GenerateMenuItemsHelper generateMenuHelper = new GenerateMenuItemsHelper(this, dte); generateMenuHelper.GenerateDefault(); generateMenuHelper.GenerateMenus(); }
public void InitializePackage() { AssemblyLoadingGuard.Protect(); AssemblyLoadingGuard.LoadXpfLibraries(); Options = SerializeHelper.DeSerializeSettings(); GenerateMenuHelper = new GenerateMenuItemsHelper(this, dte); ToolWindowViewModel = new ToolWindowViewModel(dte, Options, GenerateMenuHelper, GetBlameWindow); GenerateNavigationMenu(); }
public DXVcsTools_VSIXPackage() { var dte = GetGlobalService(typeof(DTE)) as DTE; Options = SerializeHelper.DeSerializeSettings(); Menu = new MenuViewModel(); Menu.DoConnect(dte); GenerateMenuHelper = new GenerateMenuItemsHelper(this, dte); ToolWindowViewModel = new ToolWindowViewModel(dte, Options, GenerateMenuHelper); }
/// <summary> /// Initialization of the package; this method is called right after the package is sited, so this is the place /// where you can put all the initialization code that rely on services provided by VisualStudio. /// </summary> protected override void Initialize() { base.Initialize(); var dte = (DTE)GetService(typeof(DTE)); GenerateMenuItemsHelper generateMenuHelper = new GenerateMenuItemsHelper(this, dte); generateMenuHelper.GenerateDefault(); generateMenuHelper.GenerateMenus(); var solution = ServiceProvider.GlobalProvider.GetService(typeof(SVsSolution)) as IVsSolution2; if (solution != null) { solution.AdviseSolutionEvents(this, out solutionEventsCookie); } var shellService = GetService(typeof(SVsShell)) as IVsShell; ErrorHandler.ThrowOnFailure(shellService.AdviseShellPropertyChanges(this, out shellCookie)); }
public ToolWindowViewModel(DTE dte, OptionsViewModel options, GenerateMenuItemsHelper generateMenuHelper) { this.generateMenuItemsHelper = generateMenuHelper; this.dte = new DteWrapper(dte); Options = options; ServiceContainer = new ServiceContainer(this); MergeCommand = new DelegateCommand <bool?>(Merge, CanMerge); MergeAllCommand = new DelegateCommand(MergeAll, CanMergeAll); UpdateCommand = new DelegateCommand(Update, CanUpdate); BlameCommand = new DelegateCommand(Blame, CanBlame); CheckInCommand = new DelegateCommand <CheckInTarget>(CheckIn, CanCheckIn); CompareCurrentVersionCommand = new DelegateCommand(CompareWithCurrentVersion, CanCompareWithCurrentVersion); ComparePortVersionCommand = new DelegateCommand(CompareWithPortVersion, CanCompareWithPortVersion); ManualMergeCommand = new DelegateCommand(ManualMerge, CanManualMerge); NavigateToSolutionCommand = new DelegateCommand(NavigateToSolution, CanNavigateToSolution); UndoCheckoutCommand = new DelegateCommand(UndoCheckout, CanUndoCheckout); ShowLogCommand = new DelegateCommand(ShowLog, CanShowLog); NavigateToFileCommand = new DelegateCommand <ProjectItemBase>(NavigateToItem, CanNavigateToItem); }