protected override void Dispose(bool disposing) { try { if (disposing) { /* this will need to be overwritten in my implementation if (this.editorControl != null && this.editorControl.RichTextBoxControl != null) { this.editorControl.RichTextBoxControl.TextChanged -= new System.EventHandler(this.OnTextChange); this.editorControl.RichTextBoxControl.MouseDown -= new MouseEventHandler(this.OnMouseClick); this.editorControl.RichTextBoxControl.SelectionChanged -= new EventHandler(this.OnSelectionChanged); this.editorControl.RichTextBoxControl.KeyDown -= new KeyEventHandler(this.OnKeyDown); this.editorControl.RichTextBoxControl.GotFocus -= new EventHandler(this.OnGotFocus); } */ // Dispose the timers if (null != _fileChangeTrigger) { _fileChangeTrigger.Dispose(); _fileChangeTrigger = null; } SetFileChangeNotification(null, false); if (_editorControl != null) { // editorControl.RichTextBoxControl.Dispose(); _editorControl.Dispose(); _editorControl = null; } if (_fileChangeTrigger != null) { _fileChangeTrigger.Dispose(); _fileChangeTrigger = null; } if (_extensibleObjectSite != null) { _extensibleObjectSite.NotifyDelete(this); _extensibleObjectSite = null; } GC.SuppressFinalize(this); } } finally { base.Dispose(disposing); } }
/// <summary> /// Initialization routine for the Editor. Loads the list of properties for the dal document /// which will show up in the properties window /// </summary> /// <param name="package"></param> private void PrivateInit(SimpleDataAccessLayer_vs2013Package package) { _myPackage = package; _loading = false; _gettingCheckoutStatus = false; _trackSel = null; Control.CheckForIllegalCrossThreadCalls = false; // Create an ArrayList to store the objects that can be selected var listObjects = new ArrayList(); // Create the object that will show the document's properties // on the properties window. var prop = new EditorProperties(this); listObjects.Add(prop); // Create the SelectionContainer object. _selContainer = new SelectionContainer(true, false) { SelectableObjects = listObjects, SelectedObjects = listObjects }; // Create and initialize the editor var resources = new ComponentResourceManager(typeof(EditorPane)); _editorControl = new MyEditor(); //resources.ApplyResources(_editorControl, "editorControl", CultureInfo.CurrentUICulture); // Handle Focus event // I should override this one //this.editorControl.RichTextBoxControl.GotFocus += new EventHandler(this.OnGotFocus); // Call the helper function that will do all of the command setup work // -- no commands here // setupCommands(); }