protected override TypeInfo?GetTypeInfo(TypeTreeViewItemViewModel item) { if (item.DiffState == DiffState.Inserted && item.IsResolved == false) { return(null); } return(item.Source1.TypeInfo); }
public TypeDocumentViewModel(TypeTreeViewItemViewModel viewModel) : base(viewModel) { this.viewModel = viewModel; this.undoService.Changed += UndoService_Changed; this.resolveCommand = new DelegateCommand((p) => this.Resolve(), (p) => this.CanResolve); this.DisplayName = viewModel.DisplayName; }
public void View(TypeTreeViewItemViewModel viewModel) { var document = this.Items.OfType <TypeDocumentViewModel>().FirstOrDefault(item => item.Source == viewModel.Source); if (document == null) { document = new TypeDocumentViewModel(viewModel); this.Items.Add(document); } this.ActivateItem(document); }
public void View(TypeTreeViewItemViewModel viewModel) { var document = this.Items.OfType <TypeDocumentViewModel>().FirstOrDefault(item => item.Source == viewModel.Source); if (document == null) { document = new TypeDocumentViewModel(viewModel); this.Items.Add(document); } var cancellation = new CancellationTokenSource(); this.ActivateItemAsync(document, cancellation.Token); }
public override void SelectObject(object obj) { if (this.viewModel != null) { this.viewModel.PropertyChanged -= ViewModel_PropertyChanged; } this.viewModel = obj as TypeTreeViewItemViewModel; if (this.viewModel != null) { this.DisplayName = $"{Resources.Title_TypeInfo}({this.GetHeader(this.viewModel)})"; this.typeInfo = this.GetTypeInfo(this.viewModel); this.viewModel.PropertyChanged += ViewModel_PropertyChanged; } else { this.typeInfo = null; } this.NotifyOfPropertyChange(nameof(this.TypeInfo)); this.NotifyOfPropertyChange(nameof(this.IsVisible)); this.NotifyOfPropertyChange(nameof(this.SelectedObject)); }
protected abstract string GetHeader(TypeTreeViewItemViewModel item);
protected abstract TypeInfo?GetTypeInfo(TypeTreeViewItemViewModel item);
protected override string GetHeader(TypeTreeViewItemViewModel item) { return(item.Header1); }