예제 #1
0
        /// <summary>
        /// Creates the main view model.
        /// </summary>
        /// <returns></returns>
        protected virtual void CreateViewModel()
        {
            FamilyTreeDSLDocData docData = this.DocData as FamilyTreeDSLDocData;

            this.ViewModel = new Tum.FamilyTreeDSL.ViewModel.FamilyTreeDSLMainViewModel(docData.ModelData, this.Package as FamilyTreeDSLPackage);
            this.ViewModel.FullFileName = this.DocData.FullFileName;
        }
        /// <summary>
        /// Called by the shell to ask the editor to create a new document object.
        /// </summary>
        /// <param name="fileName"></param>
        /// <param name="hierarchy"></param>
        /// <param name="itemId"></param>
		public override DslShell::ModelingDocData CreateDocData(string fileName, VSShellInterop::IVsHierarchy hierarchy, uint itemId)
		{
			// Create the document type supported by this editor.
			
			// Create model data
			global::Tum.FamilyTreeDSL.FamilyTreeDSLDocumentData modelData = new global::Tum.FamilyTreeDSL.FamilyTreeDSLDocumentData();
			
			// Create shell model data
			FamilyTreeDSLDocData shellModelData = new FamilyTreeDSLDocData(modelData, this.ServiceProvider, typeof(FamilyTreeDSLEditorFactory).GUID);
			this.ModelData = shellModelData;
			
			// Set file name properties
			System.IO.FileInfo info = new System.IO.FileInfo(fileName);
			shellModelData.FullFileName = fileName;
			shellModelData.FileName = info.Name;
			
			return shellModelData;
		}
예제 #3
0
        /// <summary>
        /// Called by the shell to ask the editor to create a new document object.
        /// </summary>
        /// <param name="fileName"></param>
        /// <param name="hierarchy"></param>
        /// <param name="itemId"></param>
        public override DslShell::ModelingDocData CreateDocData(string fileName, VSShellInterop::IVsHierarchy hierarchy, uint itemId)
        {
            // Create the document type supported by this editor.

            // Create model data
            global::Tum.FamilyTreeDSL.FamilyTreeDSLDocumentData modelData = new global::Tum.FamilyTreeDSL.FamilyTreeDSLDocumentData();

            // Create shell model data
            FamilyTreeDSLDocData shellModelData = new FamilyTreeDSLDocData(modelData, this.ServiceProvider, typeof(FamilyTreeDSLEditorFactory).GUID);

            this.ModelData = shellModelData;

            // Set file name properties
            System.IO.FileInfo info = new System.IO.FileInfo(fileName);
            shellModelData.FullFileName = fileName;
            shellModelData.FileName     = info.Name;

            return(shellModelData);
        }