示例#1
0
        public override void Initialize(object sender, SectionInitializeEventArgs e)
        {
            base.Initialize(sender, e);
            var gitExt = ServiceProvider.GetService <IGitExt>();

            gitExt.PropertyChanged += GitExt_PropertyChanged;
        }
        public async override void Initialize(object sender, SectionInitializeEventArgs e)
        {
            ShowBusy();

            try
            {
                base.Initialize(sender, e);
                if (ServiceProvider != null)
                {
                    TfsContextManager = ServiceProvider.GetService<ITeamFoundationContextManager>();
                    if (TfsContextManager != null)
                    {
                        TfsContextManager.ContextChanged -= OnContextChanged;
                        TfsContextManager.ContextChanged += OnContextChanged;
                        var context = TfsContextManager.CurrentContext;
                        Context = context;
                    }
                }
                await InitializeAsync(sender, e);
            }
            catch (Exception ex)
            {
                ShowError(ex.Message);
            }

            HideBusy();
        }
        protected override ITeamExplorerSection CreateViewModel(SectionInitializeEventArgs e)
        {
            var temp = new TeamExplorerSectionViewModelBase();

            temp.Title = Strings.Name;
            return(temp);
        }
        public async override void Initialize(object sender, SectionInitializeEventArgs e)
        {
            base.Initialize(sender, e);

            _buildService = GetService <IVsTeamFoundationBuild>();

            _dte               = GetService <DTE>();
            _dteEvents         = _dte.Events;
            _dteDocumentEvents = _dte.Events.DocumentEvents;

            _dteDocumentEvents.DocumentSaved += _dteDocumentEvents_DocumentSaved;

            _optionsViewModel.OptionsModel.Initialize(this.ServiceProvider);

            var sectionContext = e.Context as BuildsSectionContext;

            if (sectionContext != null)
            {
                Builds = sectionContext.Builds;
            }
            else
            {
                await RefreshAsync();
            }
        }
示例#5
0
 public virtual void Initialize(object sender, SectionInitializeEventArgs e)
 {
     if (e != null)
     {
         this.ServiceProvider = e.ServiceProvider;
     }
 }
        /// <summary>
        /// Initialize override.
        /// </summary>
        public override void Initialize(object sender, SectionInitializeEventArgs e)
        {
            base.Initialize(sender, e);

            // Find the Pending Changes extensibility service and sign up for
            // property change notifications
            var pcExt = this.GetService <IPendingChangesExt>();

            if (pcExt != null)
            {
                pcExt.PropertyChanged += pcExt_PropertyChanged;
            }

            var ds = this.GetService <DocumentService>();

            this.View.Context         = this.CurrentContext;
            this.View.DocumentService = ds;

            var aTimer = new System.Timers.Timer(10000);

            // Hook up the Elapsed event for the timer.
            //aTimer.Elapsed += new ElapsedEventHandler((object source, ElapsedEventArgs ev) => {
            //    this.View.Dispatcher.Invoke(() => this.RefreshAsync());
            //});

            // Set the Interval to 2 seconds (2000 milliseconds).
            aTimer.Interval = 5000;
            aTimer.Enabled  = true;

            this.RefreshAsync();
        }
        public async override void Initialize(object sender, SectionInitializeEventArgs e)
        {
            ShowBusy();

            try
            {
                base.Initialize(sender, e);
                if (ServiceProvider != null)
                {
                    TfsContextManager = ServiceProvider.GetService <ITeamFoundationContextManager>();
                    if (TfsContextManager != null)
                    {
                        TfsContextManager.ContextChanged -= OnContextChanged;
                        TfsContextManager.ContextChanged += OnContextChanged;
                        var context = TfsContextManager.CurrentContext;
                        Context = context;
                    }
                }
                await InitializeAsync(sender, e);
            }
            catch (Exception ex)
            {
                ShowError(ex.Message);
            }

            HideBusy();
        }
示例#8
0
        /// <summary>
        /// Initialize override.
        /// </summary>
        public override void Initialize(object sender, SectionInitializeEventArgs e)
        {
            ThreadHelper.ThrowIfNotOnUIThread();

            base.Initialize(sender, e);

            // Remain hidden when full GitHub extension is installed
            if (FullExtensionUtilities.IsInstalled(ServiceProvider))
            {
                IsVisible = false;
                return;
            }

            RefreshVisibility();

            if (ServiceProvider.GetService(typeof(ITeamExplorerPage)) is ITeamExplorerPage page)
            {
                if (page.GetSection(PushToRemoteSectionId) is ITeamExplorerSection pushToRemoteSection)
                {
                    pushToRemoteSection.PropertyChanged += Section_PropertyChanged;
                }
            }

            PublishToGitHub = new RelayCommand(o => ShowPublishDialogAsync().Forget());
        }
示例#9
0
        public async override void Initialize(object sender, SectionInitializeEventArgs e)
        {
            base.Initialize(sender, e);

            // If the user navigated back to this page, there could be saved context information that is passed in
            var sectionContext = e.Context as ChangesSectionContext;

            if (sectionContext != null)
            {
                // Restore the context instead of refreshing
                ChangesSectionContext context = sectionContext;
                this.Changesets = context.Changesets;
                this.WorkItems  = context.WorkItems;
                this.Shelvesets = context.Shelvesets;
            }
            else
            {
                // Kick off the refresh
                await this.RefreshAsyncChangesets();

                await this.RefreshAsyncShelveSets();

                await this.RefreshAsyncWorkitems();
            }
        }
示例#10
0
 void ITeamExplorerSection.Initialize(object sender, SectionInitializeEventArgs e)
 {
     Debug.WriteLine($"CsrTeamExplorerSection.Initialize");
     _serviceProvider     = e.ServiceProvider;
     _teamExploerServices = new TeamExplorerUtils(_serviceProvider);
     _viewModel.Initialize(_teamExploerServices);
 }
示例#11
0
        public override void Initialize(object sender, SectionInitializeEventArgs e)
        {
            base.Initialize(sender, e);

            var openSettingsCommand = new RelayCommand(ExecuteOpenSettings);

            this.teamExplorerSectionCommand = new TeamExplorerSectionCommand(openSettingsCommand, "Open options", WpfUtil.SharedResources["Home_SettingsBrush"] as DrawingBrush);
        }
        public virtual void Initialize(object sender, SectionInitializeEventArgs e)
        {
            m_provider = e.ServiceProvider;
            ITeamFoundationContextManager tfContextManager = GetService <ITeamFoundationContextManager>();

            m_vcServer = tfContextManager.CurrentContext.TeamProjectCollection.GetService <VersionControlServer>();
            m_vcServer.CommitCheckin += vcServer_CommitCheckin;
        }
 protected override object CreateView(SectionInitializeEventArgs e)
 {
     return(new TextBlock
     {
         Text = Strings.Description,
         TextWrapping = System.Windows.TextWrapping.Wrap
     });
 }
示例#14
0
        public override void Initialize(object sender, SectionInitializeEventArgs e)
        {
            base.Initialize(sender, e);
            //IsVisible = _storage.IsLogined;
            var gitExt = ServiceProvider.GetService <Microsoft.VisualStudio.TeamFoundation.Git.Extensibility.IGitExt>();

            gitExt.PropertyChanged += GitExt_PropertyChanged;
        }
 protected override object CreateView(SectionInitializeEventArgs e)
 {
     return(new TextBlock
     {
         Text = (_tes.Project != null && !string.IsNullOrEmpty(_tes.Project.Description)) ? _tes.Project.Description : Strings.Description,
         TextWrapping = System.Windows.TextWrapping.Wrap
     });
 }
示例#16
0
        public override void Initialize(object sender, SectionInitializeEventArgs e)
        {
            IsVisible = false;
            base.Initialize(sender, e);
            var gitExt = Microsoft.VisualStudio.Shell.ServiceProvider.GlobalProvider.GetService <Microsoft.VisualStudio.TeamFoundation.Git.Extensibility.IGitExt>();

            gitExt.PropertyChanged += GitExt_PropertyChanged;
        }
 public override void Initialize(object sender, SectionInitializeEventArgs e)
 {
     base.Initialize(sender, e);
     var viewModelBase = ViewModel as ViewModelBase;
     if (View != null && viewModelBase != null)
     {
         viewModelBase.RegisterService(View);
     }
 }
示例#18
0
        private void RestoreContext(SectionInitializeEventArgs e)
        {
            var context = (TeamMergeContext)e.Context;

            SelectedProjectName  = context.SelectedProjectName;
            Changesets           = context.Changesets;
            SelectedSourceBranch = context.SourceBranch;
            SelectedTargetBranch = context.TargetBranch;
        }
        protected override void InitializeView(SectionInitializeEventArgs e)
        {
            var view = this.SectionContent as FrameworkElement;

            if (view != null)
            {
                view.DataContext = new ConnectSectionViewModel(_messenger, _shell, _storage, _teamexplorer, _viewFactory, _web);
            }
        }
示例#20
0
        public override void Initialize(object sender, SectionInitializeEventArgs e)
        {
            base.Initialize(sender, e);

            System.Threading.Tasks.Task.Factory.StartNew(async delegate
            {
                IsVisible = await _tes.IsGiteaRepoAsync();
            });
        }
        protected override ITeamExplorerSection CreateViewModel(SectionInitializeEventArgs e)
        {
            var temp = new TeamExplorerSectionViewModelBase
            {
                Title = string.Format(Strings.Publish_Title, Strings.Name)
            };

            return(temp);
        }
        public override void Initialize(object sender, SectionInitializeEventArgs e)
        {
            base.Initialize(sender, e);
            this.wrapper   = GetService <IGitStashWrapper>();
            SectionContent = new RecommendedActionsControl(new RecommendedActionsViewModel(wrapper, this));
            Translator T = GetService <IGitStashTranslator>().Translator;

            Title     = T["Create Stash"];
            IsVisible = true;
        }
        public override void Initialize(object sender, SectionInitializeEventArgs e)
        {
            base.Initialize(sender, e);
            var viewModelBase = ViewModel as ViewModelBase;

            if (View != null && viewModelBase != null)
            {
                viewModelBase.RegisterService(View);
            }
        }
示例#24
0
        protected override void RestoreContext(SectionInitializeEventArgs e)
        {
            var context = (TeamChangesetsViewModelContext)e.Context;

            SelectedProjectName = context.SelectedProjectName;
            Changesets          = context.Changesets;
            Title        = context.Title;
            SourceBranch = context.SourceBranch;
            TargetBranch = context.TargetBranch;
        }
        private void RestoreContext(SectionInitializeEventArgs e)
        {
            var context = (RecentChangesetsViewModelContext)e.Context;

            ChangesetIdsText     = context.ChangesetIdsText;
            Changesets           = context.Changesets;
            SelectedChangeset    = context.SelectedChangeset;
            ShowAddByIdChangeset = context.ShowAddByIdChangeset;
            Title = context.Title;
        }
 public override void Initialize(object sender, SectionInitializeEventArgs e)
 {
     base.Initialize(sender, e);
     ThreadHelper.JoinableTaskFactory.RunAsync(async() =>
     {
         var isvisible = !_tes.IsGitLabRepo();
         await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();
         IsVisible = isvisible;
     }
                                               );
 }
        protected override void InitializeView(SectionInitializeEventArgs e)
        {
            var view = this.SectionContent as FrameworkElement;

            if (view != null)
            {
                var temp = new PublishSectionViewModel(_messenger, _git, _shell, _storage, _tes, _viewFactory, _web);
                temp.Published  += OnPublished;
                view.DataContext = temp;
            }
        }
示例#28
0
        public void Initialize(object sender, SectionInitializeEventArgs e)
        {
            _ = _clientManager.GetLoadedClientsAsync();

            SectionContent = new ConnectPageView()
            {
                DataContext = new ConnectPageViewModel(_teamExplorer, _clientManager)
            };

            ViewModel.PropertyChanged += ViewModel_PropertyChanged;
        }
 /// <summary>
 /// Initializes the section, obtaining service dependencies as available,
 /// and subscribing to changes in the current team project collection.
 /// </summary>
 public virtual void Initialize(object sender, SectionInitializeEventArgs e)
 {
     if (!m_isInitialized)
     {
         m_provider       = e.ServiceProvider;
         m_contextManager = GetService <ITeamFoundationContextManager>();
         m_contextManager.ContextChanged += ContextManager_ContextChanged;
         SetVersionControlServer(m_contextManager.CurrentContext);
         m_isInitialized = true;
     }
 }
示例#30
0
        public override void Initialize(object sender, SectionInitializeEventArgs e)
        {
            base.Initialize(sender, e);

            // Only show the option button if pacakge is loaded, else it won't do anything
            if (IsPackageLoaded())
            {
                var openSettingsCommand = new RelayCommand(ExecuteOpenSettings);
                this.teamExplorerSectionCommand = new TeamExplorerSectionCommand(openSettingsCommand, "Open options", WpfUtil.SharedResources["Home_SettingsBrush"] as DrawingBrush);
            }
        }
 protected override async Task InitializeAsync(object sender, SectionInitializeEventArgs e)
 {
     if (e.Context == null)
     {
         await RefreshAsync();
     }
     else
     {
         RestoreContext(e);
     }
 }
        public override void Initialize(object sender, SectionInitializeEventArgs e)
        {
            base.Initialize(sender, e);
            _settingsRepository = new SettingsRepository(e.ServiceProvider);
            _workItemRepository = new WorkItemRepository(CurrentContext);
            var view = new MyWorkItemsSectionView();

            SectionContent   = view;
            view.DataContext = this;
            view.Loaded     += ViewOnLoaded;
        }
        public virtual void Initialize(object sender, SectionInitializeEventArgs e)
        {
#if DEBUG
//            VsOutputLogger.WriteLine("{0:HHmmssff}\t{1} Initialize", DateTime.Now, GetType());
#endif
            ServiceProvider = e.ServiceProvider;
            Debug.Assert(holder != null, "Could not get an instance of TeamExplorerServiceHolder");
            if (holder == null)
                return;
            holder.ServiceProvider = e.ServiceProvider;
            SubscribeToRepoChanges();
#if DEBUG
//            VsOutputLogger.WriteLine("{0:HHmmssff}\t{1} Initialize DONE", DateTime.Now, GetType());
#endif
        }
        /// <summary>
        /// Initialize override.
        /// </summary>
        public override void Initialize(object sender, SectionInitializeEventArgs e)
        {
            base.Initialize(sender, e);

            // Find the Pending Changes extensibility service and sign up for
            // property change notifications
            var pcExt = this.GetService<IPendingChangesExt>();
            if (pcExt != null)
            {
                pcExt.PropertyChanged += pcExt_PropertyChanged;
            }

            var ds = this.GetService<DocumentService>();
            this.View.Context = this.CurrentContext;
            this.View.DocumentService = ds;
            this.RefreshAsync();
        }
示例#35
0
        public async override void Initialize(object sender, SectionInitializeEventArgs e)
        {
            base.Initialize(sender, e);

            // If the user navigated back to this page, there could be saved context information that is passed in
            var sectionContext = e.Context as ChangesSectionContext;
            if (sectionContext != null)
            {
                // Restore the context instead of refreshing
                ChangesSectionContext context = sectionContext;
                this.Shelvesets = context.Shelvesets;
            }
            else
            {
                // Kick off the refresh
                await this.RefreshAsync();
            }
        }
 /// <summary>
 /// Overridden method that initializes the team explorer section
 /// </summary>
 /// <param name="sender">The sender object</param>
 /// <param name="e">The event arguments</param>
 public async override void Initialize(object sender, SectionInitializeEventArgs e)
 {
     base.Initialize(sender, e);
     var sectionContext = e.Context as ShelvesetsContext;
     if (sectionContext != null)
     {
         ShelvesetsContext context = sectionContext;
         this.Shelvesets = context.Shelvesets;
     }
     else
     {
         await this.RefreshAsync();
     }
 }
 public virtual void Initialize(object sender, SectionInitializeEventArgs e)
 {
     this.ServiceProvider = e.ServiceProvider;
 }
 public override void Initialize(object sender, SectionInitializeEventArgs e)
 {
     base.Initialize(sender, e);
     RTMSetup();
 }
 protected override ITeamExplorerSection CreateViewModel(SectionInitializeEventArgs e)
 {
     return new WorkItemPageViewModel();
 }
        public override void Initialize(object sender, SectionInitializeEventArgs e)
        {
            // Create the View & ViewModel
            base.Initialize(sender, e);

            this.Host.VisualStateManager.IsBusyChanged += this.OnIsBusyChanged;

            this.InitializeControllerCommands();
            this.InitializeProvidedCommands();
            this.SyncCommands();

            this.Host.SetActiveSection(this);
        }
 protected override ITeamExplorerSection CreateViewModel(SectionInitializeEventArgs e)
 {
     return new ConnectSectionViewModel();
 }
 public void Initialize(object sender, SectionInitializeEventArgs e)
 {
     m_ServiceProvider = e.ServiceProvider;
     Refresh();
 }
 protected virtual Task InitializeAsync(object sender, SectionInitializeEventArgs e)
 {
     return _emptyTask;
 }
 protected override object CreateView(SectionInitializeEventArgs e)
 {
     return new RecentChangesetsView();
 }
 protected override async Task InitializeAsync(object sender, SectionInitializeEventArgs e)
 {
     if (e.Context == null)
     {
         await RefreshAsync();
     }
     else
     {
         RestoreContext(e);
     }
 }
 void ITeamExplorerSection.Initialize(object sender, SectionInitializeEventArgs e)
 {
     Initialize(e.ServiceProvider);
 }
 protected override object CreateView(SectionInitializeEventArgs e)
 {
     return new ConnectSectionView();
 }
        public override void Initialize(object sender, SectionInitializeEventArgs e)
        {
            base.Initialize(sender, e);
            UpdateConnection();

            // watch for new repos added to the local repo list
            var section = ServiceProvider.GetSection(TeamExplorerConnectionsSectionId);
            if (section != null)
                sectionTracker = new SectionStateTracker(section, RefreshRepositories);
        }
示例#49
0
 protected override object CreateView(SectionInitializeEventArgs e)
 {
     return new BranchesView();
 }
示例#50
0
        protected override ITeamExplorerSection CreateViewModel(SectionInitializeEventArgs e)
        {
            var viewModel = base.CreateViewModel(e) ?? new BranchesViewModel(Settings, new VsLogger(ServiceProvider));

            return viewModel;
        }
示例#51
0
        protected async override Task InitializeAsync(object sender, SectionInitializeEventArgs e)
        {
            Logger.Debug("Start initilize branches section");

            var tfs = Context.TeamProjectCollection;
            var versionControl = tfs.GetService<VersionControlServer>();
            SubscribeWorkspaceChanges(versionControl);

            _changesetService = new ChangesetService(versionControl);

            _eventAggregator.GetEvent<SelectChangesetEvent>()
                .Subscribe(OnSelectedChangeset);
            _eventAggregator.GetEvent<BranchSelectedChangedEvent>()
                .Subscribe(OnBranchSelectedChanged);

            if (e.Context == null)
            {
                Workspaces =
                    new ObservableCollection<Workspace>(versionControl.QueryWorkspaces(null,
                        tfs.AuthorizedIdentity.UniqueName, Environment.MachineName));
                if (Workspaces.Count > 0)
                {
                    Workspace = WorkspaceHelper.GetWorkspace(versionControl, Workspaces);
                    ShowWorkspaceChooser = Workspaces.Count > 1;
                }
                else
                {
                    Workspace = null;
                }

                MergeModes = new ObservableCollection<MergeMode>
                {
                    MergeMode.Merge,
                    MergeMode.MergeAndCheckIn
                };
                MergeMode = _settings.LastMergeOperation;

                await RefreshAsync();
            }
            else
            {
                RestoreContext(e);
            }

            Logger.Debug("End initialize branches section");
        }
        protected override ITeamExplorerSection CreateViewModel(SectionInitializeEventArgs e)
        {
            var viewModel = base.CreateViewModel(e) ?? new RecentChangesetsViewModel(new VsLogger(ServiceProvider));

            return viewModel;
        }
示例#53
0
 private void RestoreContext(SectionInitializeEventArgs e)
 {
     var context = (BranchesViewModelContext)e.Context;
     _changeset = context.Changeset;
     Branches = context.Branches;
     ErrorMessage = context.ErrorMessage;
     MergeMode = context.MergeMode;
     MergeModes = context.MergeModes;
     MergeOption = context.MergeOption;
     SelectedBranch = context.SelectedBranch;
     ShowWorkspaceChooser = context.ShowWorkspaceChooser;
     Workspace = context.Workspace;
     Workspaces = context.Workspaces;
 }
 public override void Initialize(object sender, SectionInitializeEventArgs e)
 {
     base.Initialize(sender, e);
     UpdateConnection();
 }
 private void RestoreContext(SectionInitializeEventArgs e)
 {
     var context = (RecentChangesetsViewModelContext)e.Context;
     ChangesetIdsText = context.ChangesetIdsText;
     Changesets = context.Changesets;
     SelectedChangeset = context.SelectedChangeset;
     ShowAddByIdChangeset = context.ShowAddByIdChangeset;
     Title = context.Title;
 }