public void ProvideEditor(VSEditorControl form, Guid factoryId, out object doc, out object pane) { VSDocumentInstance dc = new VSDocumentInstance(Context, factoryId); pane = new VSDocumentFormPane(Context, dc, form); doc = dc; }
public void InitializeEditor(VSEditorControl form, IVsUIHierarchy hier, IVsWindowFrame frame, uint docid) { VSDocumentFormPane pane = null; object value; if (ErrorHandler.Succeeded(frame.GetProperty((int)__VSFPROPID.VSFPROPID_DocView, out value))) { pane = value as VSDocumentFormPane; } if (pane != null) ((IVSEditorControlInit)form).InitializedForm(hier, docid, frame, pane.Host); }
/// <summary> /// Creates the editor. /// </summary> /// <param name="fullPath">The full path.</param> /// <param name="form">The form.</param> /// <returns></returns> public IVsWindowFrame CreateEditor(string fullPath, VSEditorControl form) { if (string.IsNullOrEmpty(fullPath)) throw new ArgumentNullException("fullPath"); else if (form == null) throw new ArgumentNullException("form"); else if(form.Context == null) throw new ArgumentException("Specified form doesn't have a context"); _forms.Push(form); IVsUIHierarchy hier; uint id; IVsWindowFrame frame; VsShellUtilities.OpenDocumentWithSpecificEditor(Context, fullPath, new Guid(AnkhId.DynamicEditorId), VSConstants.LOGVIEWID_Primary, out hier, out id, out frame); if (_forms.Contains(form)) { _forms.Pop(); throw new InvalidOperationException("Can't create dynamic editor (Already open?)"); } GetService<IAnkhDocumentHostService>().InitializeEditor(form, hier, frame, id); return frame; }