Пример #1
0
        private void CompletePackageInitialization()
        {
            try
            {
                this.Logger().Debug("Start Second Pass Initialization");

                if (Dte != null)
                {
                    this.Logger().Warn("Package Previously Initialized");
                    return;
                }

                Dte = GetService(typeof(SDTE)) as DTE;

                if (Dte == null)
                {
                    this.Logger().Warn("DTE not found");
                    return;
                }

                Extensibility = (IVsExtensibility)GetGlobalService(typeof(IVsExtensibility));
                this.Logger().Trace("IVsExtensibility: {0}", Extensibility != null);

                if (Extensibility == null)
                {
                    throw new ArgumentException("Extensibility cannot be null");
                }

                VsSolution = (IVsSolution)GetService(typeof(SVsSolution));
                this.Logger().Trace("IVsSolution: {0}", VsSolution != null);

                Dte2 = (DTE2)Extensibility.GetGlobalsObject(null).DTE;
                this.Logger().Trace("Dte2: {0}", Dte2 != null);

                if (Dte2 == null)
                {
                    throw new ArgumentException("Dte2 cannot be null");
                }

                if (VsSolution == null)
                {
                    throw new ArgumentException("VsSolution cannot be null");
                }

                _teamPilgrimVsService   = new TeamPilgrimVsService(_teamPilgrimPackageInstance, UIShell, Dte2, VsSolution);
                TeamPilgrimServiceModel = new TeamPilgrimServiceModel(new TeamPilgrimServiceModelProvider(), _teamPilgrimVsService);

                Messenger.Default.Register <ShowUnshelveDetailsDialogMessage>(this, ShowUnshelveDetailsDialog);

                this.Logger().Debug("End Second Pass Initialization");
            }
            catch (Exception exception)
            {
                this.Logger().FatalException("Second Pass Initialization", exception);
                throw;
            }
        }
Пример #2
0
        private void AttachShowPendingChangesItemEvent(TeamPilgrimServiceModel teamPilgrimServiceModel)
        {
            if (teamPilgrimServiceModel.SelectedWorkspaceModel == null)
            {
                return;
            }

            teamPilgrimServiceModel.SelectedWorkspaceModel.ShowPendingChangesItem += SelectedWorkspaceModelOnShowPendingChangesItem;
            teamPilgrimServiceModel.SelectedWorkspaceModel.ShowShelveDialog       += SelectedWorkspaceModelOnShowShelveDialog;
            teamPilgrimServiceModel.SelectedWorkspaceModel.ShowUnshelveDialog     += SelectedWorkspaceModelOnShowUnshelveDialog;
        }