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

            this.ViewModel = new Tum.PDE.VSPluginDSL.ViewModel.VSPluginDSLMainViewModel(docData.ModelData, this.Package as VSPluginDSLPackage);
            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.PDE.VSPluginDSL.VSPluginDSLDocumentData modelData = new global::Tum.PDE.VSPluginDSL.VSPluginDSLDocumentData();
			
			// Create shell model data
			VSPluginDSLDocData shellModelData = new VSPluginDSLDocData(modelData, this.ServiceProvider, typeof(VSPluginDSLEditorFactory).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;
		}
        /// <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.PDE.VSPluginDSL.VSPluginDSLDocumentData modelData = new global::Tum.PDE.VSPluginDSL.VSPluginDSLDocumentData();

            // Create shell model data
            VSPluginDSLDocData shellModelData = new VSPluginDSLDocData(modelData, this.ServiceProvider, typeof(VSPluginDSLEditorFactory).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);
        }