/// <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.ModelingDSL.PDEModelingDSLDocumentData modelData = new global::Tum.PDE.ModelingDSL.PDEModelingDSLDocumentData(); // Create shell model data PDEModelingDSLDocData shellModelData = new PDEModelingDSLDocData(modelData, this.ServiceProvider, typeof(PDEModelingDSLEditorFactory).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.ModelingDSL.PDEModelingDSLDocumentData modelData = new global::Tum.PDE.ModelingDSL.PDEModelingDSLDocumentData(); // Create shell model data PDEModelingDSLDocData shellModelData = new PDEModelingDSLDocData(modelData, this.ServiceProvider, typeof(PDEModelingDSLEditorFactory).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); }