Exemplo n.º 1
0
        /// <summary>
        /// Returns this class instance, which can be used by other VS packages
        /// </summary>
        /// <param name="Name">Should be "Document"</param>
        /// <param name="pParent">Parent object</param>
        /// <param name="ppDisp">Automation object</param>
        public void GetAutomationObject(string Name, IExtensibleObjectSite pParent, out object ppDisp)
        {
            if (!string.IsNullOrEmpty(Name) && !Name.Equals("Document", StringComparison.CurrentCultureIgnoreCase))
            {
                ppDisp = null;
                return;
            }

            ppDisp = this;
        }
Exemplo n.º 2
0
        public void GetAutomationObject(string Name, IExtensibleObjectSite pParent, out object ppDisp)
        {
            // null or empty string just means the default object, but if a specific string
            // is specified, then make sure it's the correct one, but don't enforce case
            if (!string.IsNullOrEmpty(Name) && !Name.Equals("Document", StringComparison.CurrentCultureIgnoreCase))
            {
                ppDisp = null;
                return;
            }

            // Set the out value to this
            //ppDisp = (IEditor)this;

            // TODO check if this really needs to be defined!
            ppDisp = null;

            // Store the IExtensibleObjectSite object, it will be used in the Dispose method
            extensibleObjectSite = pParent;
        }
        public void GetAutomationObject(string Name, IExtensibleObjectSite pParent, out object ppDisp)
        {
            // null or empty string just means the default object, but if a specific string
            // is specified, then make sure it's the correct one, but don't enforce case
            if (!string.IsNullOrEmpty(Name) && !Name.Equals("Document", StringComparison.CurrentCultureIgnoreCase))
            {
                ppDisp = null;
                return;
            }

            // Set the out value to this
            //ppDisp = (IEditor)this;

            // TODO check if this really needs to be defined!
            ppDisp = null;

            // Store the IExtensibleObjectSite object, it will be used in the Dispose method
            extensibleObjectSite = pParent;
        }
Exemplo n.º 4
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.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.º 5
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.º 6
0
        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);
            }
        }
Exemplo n.º 7
0
        protected override void Dispose(bool disposing)
        {
            try
            {
                if (disposing)
                {
                    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;
                    }
                    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.º 8
0
        protected override void Dispose(bool disposing)
        {
            try
            {
                if (!disposing)
                {
                    return;
                }

                if (this.EditorControl != null && this.EditorControl.RichTextBoxControl != null)
                {
                    this.EditorControl.RichTextBoxControl.TextChanged -= this.OnTextChange;
                    this.EditorControl.RichTextBoxControl.MouseDown -= this.OnMouseClick;
                    this.EditorControl.RichTextBoxControl.SelectionChanged -= this.OnSelectionChanged;
                    this.EditorControl.RichTextBoxControl.KeyDown -= this.OnKeyDown;
                    this.EditorControl.RichTextBoxControl.GotFocus -= this.OnGotFocus;
                }

                // Dispose the timers
                if (null != this.FileChangeTrigger)
                {
                    this.FileChangeTrigger.Dispose();
                    this.FileChangeTrigger = null;
                }

                if (null != this.FNFStatusbarTrigger)
                {
                    this.FNFStatusbarTrigger.Dispose();
                    this.FNFStatusbarTrigger = null;
                }

                this.SetFileChangeNotification(null, false);

                if (this.EditorControl != null)
                {
                    this.EditorControl.RichTextBoxControl.Dispose();
                    this.EditorControl.Dispose();
                    this.EditorControl = null;
                }

                if (this.FileChangeTrigger != null)
                {
                    this.FileChangeTrigger.Dispose();
                    this.FileChangeTrigger = null;
                }

                if (this.extensibleObjectSite != null)
                {
                    this.extensibleObjectSite.NotifyDelete(this);
                    this.extensibleObjectSite = null;
                }

                GC.SuppressFinalize(this);
            }
            finally
            {
                base.Dispose(disposing);
            }
        }
 public void GetAutomationObject(string Name, IExtensibleObjectSite pParent, out object ppDisp)
 {
     var extensibleObject = (IExtensibleObject) _vsCodeWindow;
     extensibleObject.GetAutomationObject(Name, pParent, out ppDisp);
 }
Exemplo n.º 10
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.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);
            }
        }
        public void GetAutomationObject(string Name, IExtensibleObjectSite pParent, out object ppDisp)
        {
            var extensibleObject = (IExtensibleObject)_vsCodeWindow;

            extensibleObject.GetAutomationObject(Name, pParent, out ppDisp);
        }
Exemplo n.º 12
0
		void IExtensibleObject.GetAutomationObject(string Name, IExtensibleObjectSite pParent, out object ppDisp)
		{
			GetAutomationObject(Name, pParent, out ppDisp);
		}
Exemplo n.º 13
0
		/// <summary>
		/// Implements IExtensibleObject.GetAutomationObject. Returns the ORM XML stream for
		/// the "ORMXmlStream" object name and the this object for everything else.
		/// </summary>
		protected void GetAutomationObject(string name, IExtensibleObjectSite parent, out object result)
		{
			if ("ORMXmlStream" == name)
			{
				MemoryStream stream = new MemoryStream();
				(new ORMSerializationEngine(Store)).Save(stream);
				stream.Position = 0;
				result = stream;
				return;
			}
			else if ("ORMExtensionManager" == name)
			{
				// This returns an object with two methods:
				// GetLoadedExtensions returns an array of current loaded extension objects
				// EnsureExtensions accepts an array of extensions that need to be loaded
				result = new ORMExtensionManagerAutomationObject(this);
				return;
			}
			result = this;
		}