예제 #1
0
        /// <summary>
        /// This method is used to initialize the view model and can be overriden for customization.
        /// </summary>
        protected override void Initialize()
        {
            base.Initialize();
            RegisterImportedLibrariesRessources();

            // register services
            VSPluginDSLServiceRegistrar.Instance.RegisterServices(this.ViewModelStore);

            // ensure context menu provider are initialized
            if (Tum.PDE.VSPluginDSL.ViewModel.ModelTree.VSPluginDSLModelTreeContextMenuProvider.Instance == null)
            {
                throw new System.ArgumentNullException("Context menu provider");
            }


            foreach (DslEditorModeling::ModelContext modelContext in this.ModelData.AvailableModelContexts)
            {
                if (modelContext.Name == "DefaultContext")
                {
                    DefaultContextModelContextViewModel mDefaultContext = new DefaultContextModelContextViewModel(this.ViewModelStore, modelContext, this);
                    mDefaultContext.InitializeMC();
                    this.AvailableModelModelContextViewModels.Add(mDefaultContext);
                    this.SelectedModelContextViewModel = mDefaultContext;
                }
            }

            this.ModelTreeModel = new VSPluginDSLModelTreeViewModel(ViewModelStore as VSPluginDSLViewModelStore);
            AddViewModel(ModelTreeModel);

            this.ErrorListModel = new VSPluginDSLErrorListViewModel(ViewModelStore as VSPluginDSLViewModelStore);
            AddViewModel(ErrorListModel);

            this.PropertyGridModel = new VSPluginDSLPropertyGridViewModel(ViewModelStore as VSPluginDSLViewModelStore);
            AddViewModel(PropertyGridModel);

            this.DependenciesModel = new VSPluginDSLDependenciesViewModel(ViewModelStore as VSPluginDSLViewModelStore);
            AddViewModel(DependenciesModel);

            this.SearchModel = new VSPluginDSLSearchViewModel(ViewModelStore as VSPluginDSLViewModelStore);
            AddViewModel(SearchModel);
            AddViewModel(SearchModel.SearchResultViewModel);

            #region Credits + Further Readings
            this.CreditsViewModel        = new DslEditorViewModelData::CreditsViewModel(this.ViewModelStore);
            this.FurtherReadingViewModel = new DslEditorViewModelData::FurtherReadingViewModel(this.ViewModelStore);


            #endregion
        }
예제 #2
0
        /// <summary>
        /// This method is used to initialize the view model and can be overriden for customization.
        /// </summary>
        protected override void Initialize()
        {
			base.Initialize();
			RegisterImportedLibrariesRessources();
			
			// register services
			VSPluginDSLServiceRegistrar.Instance.RegisterServices(this.ViewModelStore);

			// ensure context menu provider are initialized
			if( Tum.PDE.VSPluginDSL.ViewModel.ModelTree.VSPluginDSLModelTreeContextMenuProvider.Instance == null )
				throw new System.ArgumentNullException("Context menu provider");
		

			foreach(DslEditorModeling::ModelContext modelContext in this.ModelData.AvailableModelContexts)
			{
				if( modelContext.Name == "DefaultContext")
				{
					DefaultContextModelContextViewModel mDefaultContext = new DefaultContextModelContextViewModel(this.ViewModelStore, modelContext, this);
					mDefaultContext.InitializeMC();
					this.AvailableModelModelContextViewModels.Add(mDefaultContext);
					this.SelectedModelContextViewModel = mDefaultContext;
				}
			}
			
			this.ModelTreeModel = new VSPluginDSLModelTreeViewModel(ViewModelStore as VSPluginDSLViewModelStore);
			AddViewModel(ModelTreeModel);

			this.ErrorListModel = new VSPluginDSLErrorListViewModel(ViewModelStore as VSPluginDSLViewModelStore);
			AddViewModel(ErrorListModel);

			this.PropertyGridModel = new VSPluginDSLPropertyGridViewModel(ViewModelStore as VSPluginDSLViewModelStore);
			AddViewModel(PropertyGridModel);

			this.DependenciesModel = new VSPluginDSLDependenciesViewModel(ViewModelStore as VSPluginDSLViewModelStore);
			AddViewModel(DependenciesModel);

			this.SearchModel = new VSPluginDSLSearchViewModel(ViewModelStore as VSPluginDSLViewModelStore);			
			AddViewModel(SearchModel);
			AddViewModel(SearchModel.SearchResultViewModel);	

			#region Credits + Further Readings
			this.CreditsViewModel = new DslEditorViewModelData::CreditsViewModel(this.ViewModelStore);
			this.FurtherReadingViewModel = new DslEditorViewModelData::FurtherReadingViewModel(this.ViewModelStore);

	
			#endregion
		}