private void initDocument(Control parent, DesignerHost host) { System.Diagnostics.Trace.WriteLine("Creating document..."); // get the ExtensibleTextEditor instance of the Source code's view textEditor = IdeApp.Workbench.ActiveDocument.PrimaryView.GetContent <SourceEditorView> ().TextEditor; if (!(parent is WebFormPage)) { throw new NotImplementedException("Only WebFormsPages can have a document for now"); } this.parent = parent; this.host = host; if (!host.Loading) { throw new InvalidOperationException("The document cannot be initialised or loaded unless the host is loading"); } directives = new Hashtable(StringComparer.InvariantCultureIgnoreCase); txtDocDirty = true; suppressSerialization = false; // create and set the event, to let the parser run the first time updateEditorContent = new ManualResetEvent(true); undoTracker = new UndoTracker(); undoHandler = IdeApp.Workbench.ActiveDocument.PrimaryView.GetContent <IUndoHandler> (); if (undoHandler == null) { throw new NullReferenceException("Could not obtain the IUndoHandler from the SourceEditorView"); } }
///<summary>Creates a new document</summary> public Document(Control parent, DesignerHost host, string documentName) { initDocument(parent, host); //newDocument. this.textEditor //Parse (String.Format (newDocument, documentName), documentName); // TODO: get a ExtensibleTextEditor instance, if we have an new empty file }
public DocumentSerializer(DesignerHost hst) { host = hst; document = host.RootDocument; designerContext = String.Empty; //designerContext = ((host.GetDesigner (host.RootComponent) as RootDesigner).GetView (ViewTechnology.Default) as RootDesignerView).DesignerContext; }
///<summary>Creates a document from an existing file</summary> public Document(Control parent, DesignerHost host, string document, string fileName) { initDocument(parent, host); Control[] controls; aspParser.ProcessFragment(document, out controls, out this.document); GetView(); }
protected override void OnCommit() { if (host == null) { return; } host.OnTransactionClosing(true); host.OnTransactionClosed(true, this); host = null; }
protected override void OnCancel() { if (host == null) { return; } host.OnTransactionClosing(false); host.OnTransactionClosed(false, this); host = null; }
//TODO: Some way to reset this when host is reset public WebFormReferenceManager(DesignerHost host) { if (host == null) { throw new ArgumentNullException("host"); } this.host = host; this.typeRes = host.GetService(typeof(ITypeResolutionService)) as ITypeResolutionService; if (typeRes == null) { throw new Exception("Could not obtain ITypesResolutionService from host"); } }
protected override IComponent[] CreateComponentsCore(IDesignerHost host) { DesignerHost desHost = host as DesignerHost; if (desHost == null) { throw new ArgumentException("host", "Must be a AspNetEdit.Editor.ComponentModel.DesignerHost"); } OnComponentsCreating(new ToolboxComponentsCreatingEventArgs(host)); desHost.RootDocument.InsertFragment(text); OnComponentsCreated(new ToolboxComponentsCreatedEventArgs(new IComponent[] {})); return(new IComponent[] {}); }
///<summary>Creates a document from an existing file</summary> public Document(Control parent, DesignerHost host, Stream fileStream, string fileName) { initDocument(parent, host); TextReader reader = new StreamReader(fileStream); try { this.document = DeserializeAndAdd(reader.ReadToEnd()); } catch (ParseException ex) { this.document = ConstructErrorDocument(ex.Title, ex.Message); } catch (Exception ex) { this.document = ConstructErrorDocument("Error loading document", ex.Message + ex.StackTrace); } GetView(); }
private void initDocument(Control parent, DesignerHost host) { System.Diagnostics.Trace.WriteLine("Creating document..."); if (!(parent is WebFormPage)) { throw new NotImplementedException("Only WebFormsPages can have a document for now"); } this.parent = parent; this.host = host; if (!host.Loading) { throw new InvalidOperationException("The document cannot be initialised or loaded unless the host is loading"); } CaseInsensitiveHashCodeProvider provider = new CaseInsensitiveHashCodeProvider(CultureInfo.InvariantCulture); CaseInsensitiveComparer comparer = new CaseInsensitiveComparer(CultureInfo.InvariantCulture); directives = new Hashtable(provider, comparer); this.aspParser = new DesignTimeParser(host, this); }
public ContextMenu (DesignerHost hst) { host = hst; contextMenu = new Menu (); }
public DesignContainer(DesignerHost host) { this.host = host; this.designers = new Hashtable(); this.components = new ArrayList(); }
public Transaction(DesignerHost host, string description) : base(description) { this.host = host; }
///<summary>Creates a document from an existing file</summary> public Document(Control parent, DesignerHost host) { initDocument(parent, host); }
///<summary>Creates a new document</summary> public Document(Control parent, DesignerHost host, string documentName) { initDocument(parent, host); this.document = String.Format(newDocument, documentName); GetView(); }
public DesignerSerializer(DesignerHost hst) { host = hst; document = host.RootDocument; }