Ejemplo n.º 1
0
 public TypeDocumentViewModel(TypeTreeViewItemViewModel viewModel)
 {
     this.viewModel            = viewModel;
     this.undoService.Changed += UndoService_Changed;
     this.resolveCommand       = new DelegateCommand((p) => this.Resolve(), (p) => this.CanResolve);
     this.DisplayName          = viewModel.DisplayName;
 }
Ejemplo n.º 2
0
 protected override TypeInfo?GetTypeInfo(TypeTreeViewItemViewModel item)
 {
     if (item.DiffState == DiffState.Deleted && item.IsResolved == false)
     {
         return(null);
     }
     return(item.Source2.TypeInfo);
 }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
        private void UpdateItemsSource()
        {
            var dataSet            = this.shell.DataSet;
            var compositionService = this.ServiceProvider.GetService(typeof(ICompositionService)) as ICompositionService;

            foreach (var item in dataSet.Types)
            {
                var viewModel = new TypeTreeViewItemViewModel(item)
                {
                    Header1 = dataSet.Header1,
                    Header2 = dataSet.Header2
                };
                compositionService.SatisfyImportsOnce(viewModel);
                this.Items.Add(viewModel);
            }
        }
Ejemplo n.º 5
0
        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));
        }
Ejemplo n.º 6
0
 protected abstract string GetHeader(TypeTreeViewItemViewModel item);
Ejemplo n.º 7
0
 protected abstract TypeInfo?GetTypeInfo(TypeTreeViewItemViewModel item);
Ejemplo n.º 8
0
 protected override string GetHeader(TypeTreeViewItemViewModel item)
 {
     return(item.Header2);
 }