Exemplo n.º 1
0
        protected override void Dispose(bool disposing)
        {
            try
            {
                if (disposing)
                {
                    // Dispose the timers
                    if (null != _fileChangeTrigger)
                    {
                        _fileChangeTrigger.Dispose();
                        _fileChangeTrigger = null;
                    }
                    if (null != _fnfStatusbarTrigger)
                    {
                        _fnfStatusbarTrigger.Dispose();
                        _fnfStatusbarTrigger = 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);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Initialization routine for the Editor. Loads the list of properties for the odml document 
        /// which will show up in the properties window 
        /// </summary>
        /// <param name="package"></param>
        private void PrivateInit(VSPackagePackage package)
        {
            _package = package;
            _trackSel = null;
            var sp = package as System.IServiceProvider;
            _dte = sp.GetService(typeof(DTE)) as DTE;

            Control.CheckForIllegalCrossThreadCalls = false;

            // Create and initialize the editor
            _editorControl = new ModelingEditor(this);
            _editorControl.Changed += (o, e) => _isDirty = true;
            this.Content = this._editorControl;

            var resources = new ComponentResourceManager(typeof(EditorPane));
            resources.ApplyResources(this._editorControl, "editorControl", CultureInfo.CurrentUICulture);

            this.InitSelection();
        }