public override void Loaded(object sender, SectionLoadedEventArgs e) { base.Loaded(sender, e); var page = ((TeamExplorerPageBase)ServiceProvider.GetService(typeof(ITeamExplorerPage))); //var obj = (Microsoft.VisualStudio.TeamFoundation.VersionControl.PendingChanges.PendingChangesModelVS)page.Model; //var obj2 = (Microsoft.TeamFoundation.VersionControl.Client.IPendingCheckinPendingChanges)page.Model; var model = GetService <TeamExplorerModel>(); //var viewModel = GetService<TeamExplorerViewModel>(); //var pages = new List<ITeamExplorerPage>(); //if (viewModel.CurrentPage != null) // pages.Add(viewModel.CurrentPage); //pages.AddRange(viewModel.UndockedPages); //var changesGuid = Guid.Parse(TeamExplorerPageIds.PendingChanges); //var changesPage = pages.FirstOrDefault(p => p.GetId() == changesGuid); //var view = changesPage.PageContent as UserControl; //(Microsoft.VisualStudio.TeamFoundation.VersionControl.PendingChanges.PendingChangesPageVS) model; //Microsoft.VisualStudio.TeamFoundation.VersionControl. // Microsoft.VisualStudio.TeamFoundation. //Microsoft.VisualStudio.TeamFoundation.VersionControl.PendingChanges.PendingChangesPageVS; //var _labeledTextBox = view.FindName("commentTextBox") as LabeledTextBox; }
public override void Loaded(object sender, SectionLoadedEventArgs e) { var teamExplorer = GetService <ITeamExplorer>(); var page = teamExplorer.CurrentPage as TeamExplorerPageBase; page.PropertyChanged += TeamExplorerPageBasePropertyChanged; var service = GetService <TeamExplorerViewModel>(); var pages = new List <ITeamExplorerPage>(); pages.Add(service.CurrentPage); pages.AddRange(service.UndockedPages); var commitPage = pages.FirstOrDefault(p => p.GetId() == Guid.Parse(TeamExplorerPageIds.GitChanges)); var view = commitPage.PageContent as UserControl; var labeledTextBox = view.FindName("commentTextBox") as LabeledTextBox; var commitTextBox = labeledTextBox.FindName("textBox") as TextBox; commitButton = view.FindName("commitButton") as Button; var commitGrid = commitButton.Parent as Grid; var commitCzButton = new Button(); commitCzButton.Content = "CommitCz"; commitCzButton.HorizontalAlignment = System.Windows.HorizontalAlignment.Center; commitCzButton.Margin = new System.Windows.Thickness(12, 0, 0, 0); commitCzButton.Click += (s, re) => teamExplorer.NavigateToPage(Guid.Parse(VsCommitizenPage.PageId), null); commitGrid.Children.Add(commitCzButton); // Place the button on the right of the Commit button Grid.SetColumn(commitCzButton, 1); }
public override void Loaded(object sender, SectionLoadedEventArgs e) { var teamExplorer = GetService <ITeamExplorer>(); var page = teamExplorer.CurrentPage as TeamExplorerPageBase; page.PropertyChanged += TeamExplorerPageBasePropertyChanged; var service = GetService <TeamExplorerViewModel>(); var pages = new List <ITeamExplorerPage>(); pages.Add(service.CurrentPage); pages.AddRange(service.UndockedPages); var commitPage = pages.FirstOrDefault(p => p.GetId() == Guid.Parse(TeamExplorerPageIds.GitChanges)); var view = commitPage.PageContent as UserControl; var labeledTextBox = view.FindName("commentTextBox") as LabeledTextBox; var commitTextBox = labeledTextBox.FindName("textBox") as TextBox; commitButton = view.FindName("commitButton") as Button; var commitGrid = commitButton.Parent as Grid; var commitCzButton = createCommitCzButton(teamExplorer); AppendButtonToPage(commitGrid, commitCzButton); }
public override void Loaded(object sender, SectionLoadedEventArgs e) { base.Loaded(sender, e); var workItemView = FindWorkItemView(SectionContent as DependencyObject); var workItemWrapPanel = FindWorkItemWrapPanel(workItemView); AddCommand(workItemWrapPanel); }
public override void Loaded(object sender, SectionLoadedEventArgs e) { base.Loaded(sender, e); //manually set to false because apparently HideBusy will set isBusy on false much later... IsBusy = false; MergeCommand.RaiseCanExecuteChanged(); FetchChangesetsCommand.RaiseCanExecuteChanged(); }
public override void Loaded(object sender, SectionLoadedEventArgs e) { var teamExplorer = GetService <ITeamExplorer>(); var page = teamExplorer.CurrentPage as TeamExplorerBasePage; this.CommitizenSection.ViewModel.ProceedExecuted += (s, autoCommit) => { AddNavigationValue(NavigationDataType.CommitData, new NavigationCommitModel { AutoCommit = autoCommit, Comment = CommitizenSection.ViewModel.GetComment() }); teamExplorer.NavigateToPage(Guid.Parse(TeamExplorerPageIds.GitChanges), null); }; }
void ITeamExplorerSection.Loaded(object sender, SectionLoadedEventArgs e) { Debug.WriteLine($"CsrTeamExplorerSection.Loaded {sender.GetType().Name} {sender.ToString()}, {e}"); }
/// <summary> /// Called when the section is loaded. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public virtual void Loaded(object sender, SectionLoadedEventArgs e) { }
public virtual void Loaded(object sender, SectionLoadedEventArgs e) { }
public override void Loaded(object sender, SectionLoadedEventArgs e) { var service = GetService <TeamExplorerViewModel>(); if (service == null) { ShowNotification("Commit Formatter: Can't get TeamExplorerViewModel", NotificationType.Error); return; } var changesGuid = Guid.Parse(TeamExplorerPageIds.GitChanges); var pages = new List <ITeamExplorerPage>(); if (service.CurrentPage != null) { pages.Add(service.CurrentPage); } pages.AddRange(service.UndockedPages); var changesPage = pages.FirstOrDefault(p => p.GetId() == changesGuid); if (changesPage == null) { ShowNotification("Commit Formatter: Can't get the Changes page", NotificationType.Error); return; } var view = changesPage.PageContent as UserControl; if (view == null) { ShowNotification("Commit Formatter: Can't get the Changes view", NotificationType.Error); return; } _labeledTextBox = view.FindName("commentTextBox") as LabeledTextBox; if (_labeledTextBox == null) { ShowNotification("Commit Formatter: Can't find commentTextBox", NotificationType.Error); return; } _commitMessageBox = _labeledTextBox.FindName("textBox") as TextBox; if (_commitMessageBox == null) { ShowNotification("Commit Formatter: Can't find textBox", NotificationType.Error); return; } _commitMessageBox.TextChanged += OnCommitMessageChanged; _commitMessageBox.SelectionChanged += OnSelectionChanged; _commitMessageBox.SpellCheck.IsEnabled = _enableSpellCheck; if (_useMonospacedFont) { _commitMessageBox.FontFamily = new FontFamily("Consolas"); } _commitMessageBox.FontSize = _fontSize; _commitMessageBox.TextWrapping = TextWrapping.NoWrap; }
public override void Loaded(object sender, SectionLoadedEventArgs e) { HideSolutionSection(); model.Update(); }