protected virtual void OnDesignerCreated(DesignerEventArgs e)
 {
     if (DesignerCreated != null)
     {
         DesignerCreated(this, e);
     }
 }
 protected virtual void OnDesignerDisposed(DesignerEventArgs e)
 {
     if (this.DesignerDisposed != null)
     {
         this.DesignerDisposed(this, e);
     }
 }
        //<Snippet1>
        // This example method creates a DesignerEventArgs using the specified designer host.
        // Typically, this type of event args is created by the IDesignerEventService.
        public DesignerEventArgs CreateComponentEventArgs(IDesignerHost host)
        {
            DesignerEventArgs args = new DesignerEventArgs(host);

            // The designer host of the created or disposed document:  args.Component

            return(args);
        }
        /// <include file='doc\DocumentManager.uex' path='docs/doc[@for="DocumentManager.OnDesignerCreated"]/*' />
        /// <devdoc>
        ///     The designer should call this after it successfully loads.
        /// </devdoc>
        public void OnDesignerCreated(DesignerEventArgs e)
        {
            designers.Add(e.Designer);
            documents = null;
            DesignerEventHandler handler = (DesignerEventHandler)eventTable[DOCUMENT_CREATED_EVENT];

            if (handler != null)
            {
                handler.Invoke(this, e);
            }
        }
Esempio n. 5
0
        /// <summary>
        /// This event is raised when the active tab (designer) changes.
        /// </summary>
        private void DesignersManager_DesignerChanged(object sender, DesignerEventArgs e)
        {
            if (e.Designer == null || e.Designer.File == null || !(e.Designer is ISavable))
            {
                this.Enabled = false;
                this.Text    = "Save as...";
                return;
            }

            this.m_CurrentSavable = (e.Designer as ISavable);
            this.Enabled          = this.m_CurrentSavable.CanSave;
            this.Text             = "Save " + this.m_CurrentSavable.SaveName + " as...";
        }
        /// <include file='doc\DocumentManager.uex' path='docs/doc[@for="DocumentManager.OnDesignerDisposed"]/*' />
        /// <devdoc>
        ///     The designer should call this before it disposes itself.
        /// </devdoc>
        public void OnDesignerDisposed(DesignerEventArgs e)
        {
            DesignerEventHandler handler = (DesignerEventHandler)eventTable[DOCUMENT_DISPOSED_EVENT];

            if (handler != null)
            {
                handler.Invoke(this, e);
            }
            if (designers.Contains(e.Designer))
            {
                designers.Remove(e.Designer);
            }
            if (activeDesigner == e.Designer)
            {
                activeDesigner = null;
            }
            documents = null;
        }
Esempio n. 7
0
 private void DesignerDisposed(object sender, DesignerEventArgs e)
 {
     UpdateStatus("Designer for " + e.Designer.RootComponent.Site.Name + " was disposed.");
 }
 private void OnDesignerEvent(object sender, DesignerEventArgs e)
 {
     // Displays designer event information on the console.
     Console.WriteLine("Name of the root component of the created or disposed designer: " + e.Designer.RootComponentClassName);
 }
        public void Ctor(IDesignerHost designer)
        {
            var eventArgs = new DesignerEventArgs(designer);

            Assert.Same(designer, eventArgs.Designer);
        }
Esempio n. 10
0
        /// <summary>
        /// Extends BeginInvoke so that when a state object is not needed, null does not need to be passed.
        /// <example>
        /// designereventhandler.BeginInvoke(sender, e, callback);
        /// </example>
        /// </summary>
        public static IAsyncResult BeginInvoke(this DesignerEventHandler designereventhandler, Object sender, DesignerEventArgs e, AsyncCallback callback)
        {
            if (designereventhandler == null)
            {
                throw new ArgumentNullException("designereventhandler");
            }

            return(designereventhandler.BeginInvoke(sender, e, callback, null));
        }
Esempio n. 11
0
 private void OnDesignerCreated(object sender, DesignerEventArgs e)
 {
     e.Designer.LoadComplete += new EventHandler(OnDesignerLoadComplete);
 }