Exemplo n.º 1
0
		private void OnComponentRename(object sender,ComponentRenameEventArgs e) {
			if (e.Component == this.Component) {
				Control.Name = e.NewName;
				Control.Text = e.NewName;
				Control.Invalidate();
			}
		}
 private void OnComponentRename(object sender, ComponentRenameEventArgs e)
 {
     if (e.Component == base.Component)
     {
         this.UpdateControlName(e.NewName);
     }
 }
Exemplo n.º 3
0
 void OnComponentRename(object sender, ComponentRenameEventArgs e)
 {
     if (e.Component == Component) {
         if ((!String.IsNullOrEmpty(e.NewName)) && (e.NewName != Control.Name)) {
             var c = Component as AbstractItem;;
             c.Name = e.NewName;
             Control.Invalidate();
         }
     }
 }
Exemplo n.º 4
0
 /// <summary>
 ///  Listens for component removes to delete all the references it holds.
 /// </summary>
 private void OnComponentRename(object sender, ComponentRenameEventArgs cevent)
 {
     foreach (ReferenceHolder reference in _references)
     {
         if (object.ReferenceEquals(reference.SitedComponent, cevent.Component))
         {
             reference.ResetName();
             return;
         }
     }
 }
Exemplo n.º 5
0
 private void OnComponentRename(object sender, ComponentRenameEventArgs e)
 {
     if (this.Component is IPersistComponentSettings)
     {
         IDesignerHost service   = this.GetService(typeof(IDesignerHost)) as IDesignerHost;
         IComponent    component = (service != null) ? service.RootComponent : null;
         if (!this.settingsKeyExplicitlySet && ((e.Component == this.Component) || (e.Component == component)))
         {
             this.ResetSettingsKey();
         }
     }
 }
 private void OnComponentRename(object sender, ComponentRenameEventArgs e)
 {
     if ((this._enabled && (this._executingUnit == null)) && (this._unitStack.Count == 0))
     {
         string name = System.Design.SR.GetString("UndoEngineComponentRename", new object[] { e.OldName, e.NewName });
         this._unitStack.Push(this.CreateUndoUnit(name, true));
     }
     foreach (UndoUnit unit in this._unitStack)
     {
         unit.ComponentRename(e);
     }
 }
Exemplo n.º 7
0
		private void OnComponentRename (object sender, ComponentRenameEventArgs args)
		{
			if (_currentUnit == null)
				_currentUnit = CreateUndoUnit ("Rename " + ((IComponent)args.Component).Site.Name, true);
			_currentUnit.ComponentRename (args);

			IDesignerHost host = GetRequiredService (typeof (IDesignerHost)) as IDesignerHost;
			if (!host.InTransaction) {
				_currentUnit.Close ();
				AddUndoUnit (_currentUnit);
				_currentUnit = null;
			}
		}
Exemplo n.º 8
0
        /// <summary>
        ///  Raised when a component's name changes.  Here we update the SettingsKey property if necessary.
        /// </summary>
        private void OnComponentRename(object sender, ComponentRenameEventArgs e)
        {
            if (Component is IPersistComponentSettings)
            {
                IComponent rootComponent = GetService <IDesignerHost>()?.RootComponent;

                // SettingsKey is formed based on the name of the component and the root component. If either of
                // these change, we reset settings key (if it hasn't been explicitly set) so it can be recomputed.
                if (!_settingsKeyExplicitlySet && (e.Component == Component || e.Component == rootComponent))
                {
                    ResetSettingsKey();
                }
            }
        }
Exemplo n.º 9
0
		private void ComponentRenamed(object sender, ComponentRenameEventArgs e)
		{
			IDesignerHost dh=(IDesignerHost)GetService(typeof(IDesignerHost));
			if(dh==null)
				return;

			if(e.Component==dh.RootComponent || e.Component==this.Component)
			{
				DotNetBarManager m=this.Component as DotNetBarManager;
				if(m!=null && m.DefinitionName!="")
				{
					if(DesignTimeDte.DeleteFromProject(m.DefinitionName, this.Component.Site))
					{
						m.DefinitionName="";
						m.SaveDesignDefinition();
					}
				}
			}
		}
Exemplo n.º 10
0
 internal void RenameComponent(DesignSite site, string newName)
 {
     if (!this.IsValidComponentName(newName))
     {
         throw new ArgumentException("'" + newName + "' is not a valid name for the component.");
     }
     if (this.ComponentTable[newName] != null)
     {
         throw new ArgumentException("A component with the name '" + newName + "' already exists.");
     }
     string name = site.Name;
     ComponentRenameEventArgs e = new ComponentRenameEventArgs(site.Component, name, newName);
     this.ComponentTable.Remove(name);
     this.ComponentTable[newName] = site.Component;
     site.SetName(newName);
     this.OnComponentRename(e);
 }
Exemplo n.º 11
0
		private void OnComponentRename (object sender, ComponentRenameEventArgs args)
		{
			if (!_loading && _loaded) {
					OnModifying ();
					this.Modified = true;
			}
		}
 private void OnComponentRename(object sender, ComponentRenameEventArgs e)
 {
     this.OnComponentRename(e.Component, e.OldName, e.NewName);
 }
 private void ComponentRenameEventHandler(object sender, ComponentRenameEventArgs e)
 {
     ((NamedComponent) base.Component).Name = base.Component.Site.Name;
 }
Exemplo n.º 14
0
 // SECREVIEW: This seems safe, but could anything dangerous occur here?
 protected void OnComComponentNameChanged(ComponentRenameEventArgs e) {
     ComponentRenameEventHandler handler = (ComponentRenameEventHandler)Events[EventComComponentNameChanged];
     if (handler != null) handler(this,e);
 }
Exemplo n.º 15
0
        // Occurs when a component is renamed
        //
        void componentChangeService_ComponentRename(object sender, ComponentRenameEventArgs e)
        {
            try
            {
                // search and change the modified name in relations
                //
                for (int i = relations.Count - 1; i >= 0; --i)
                {
                    Relation relation = relations[i] as Relation;

                    if (relation.Source == e.OldName)
                    {
                        relation.Source = e.NewName;
                    }
                    if (relation.Destination == e.OldName)
                    {
                        relation.Destination = e.NewName;
                    }
                }
            }
            catch (Exception err)
            {
                language = CliUtils.fClientLang;
                string sMess = SysMsg.GetSystemMessage(language, ThisModuleName, ThisComponentName, "msg_Exception");
                MessageBox.Show(string.Format(sMess, ThisComponentName, "componentChangeService_ComponentRename", err.Message));
            }
        }
 public virtual void ComponentRename(ComponentRenameEventArgs e)
 {
     this.AddEvent(new RenameUndoEvent(e.OldName, e.NewName));
 }
        /// <summary>
        /// Extends BeginInvoke so that when a state object is not needed, null does not need to be passed.
        /// <example>
        /// componentrenameeventhandler.BeginInvoke(sender, e, callback);
        /// </example>
        /// </summary>
        public static IAsyncResult BeginInvoke(this ComponentRenameEventHandler componentrenameeventhandler, Object sender, ComponentRenameEventArgs e, AsyncCallback callback)
        {
            if(componentrenameeventhandler == null) throw new ArgumentNullException("componentrenameeventhandler");

            return componentrenameeventhandler.BeginInvoke(sender, e, callback, null);
        }
Exemplo n.º 18
0
 private void OnComponentRename(object sender, ComponentRenameEventArgs cevent)
 {
     foreach (ReferenceHolder reference in this.references)
     {
         if (object.ReferenceEquals(reference.SitedComponent, cevent.Component))
         {
             reference.ResetName();
             return;
         }
     }
 }
 private void OnComponentRename(object sender, ComponentRenameEventArgs cevent)
 {
     foreach (ReferenceHolder holder in this._references)
     {
         if (object.ReferenceEquals(holder.SitedComponent, cevent.Component))
         {
             holder.ResetName();
             break;
         }
     }
 }
 private void OnComponentRename(object sender, ComponentRenameEventArgs e)
 {
     if (this.Component is IPersistComponentSettings)
     {
         IDesignerHost service = this.GetService(typeof(IDesignerHost)) as IDesignerHost;
         IComponent component = (service != null) ? service.RootComponent : null;
         if (!this.settingsKeyExplicitlySet && ((e.Component == this.Component) || (e.Component == component)))
         {
             this.ResetSettingsKey();
         }
     }
 }
Exemplo n.º 21
0
 protected virtual void OnComponentRename(ComponentRenameEventArgs e)
 {
     ComponentRenameEventHandler handler = (ComponentRenameEventHandler) this.Events[ComponentRenameEvent];
     if (handler != null)
     {
         handler(this, e);
     }
 }
Exemplo n.º 22
0
 private void OnComponentRename(object sender, ComponentRenameEventArgs e) 
 {
     // When we're notified of a rename, see if this is the componnent that is being
     // renamed.
     //
     if (e.Component == this) 
     {
         // if it is, call DISPID_AMBIENT_DISPLAYNAME directly on the
         // control itself.
         //
         UnsafeNativeMethods.IOleControl oleCtl = this.GetOcx() as UnsafeNativeMethods.IOleControl;
         if (oleCtl != null) 
         {   
             oleCtl.OnAmbientPropertyChange(NativeMethods.ActiveX.DISPID_AMBIENT_DISPLAYNAME);
         }
     }
 }
Exemplo n.º 23
0
		private void OnComponentRename_EventHandler (object sender, ComponentRenameEventArgs args)
		{
			this.OnComponentRename (args.Component, args.OldName, args.NewName);
		}
 private void OnComponentRename(object sender, ComponentRenameEventArgs e)
 {
     if (e.Component == this.component)
     {
         this.Text = e.NewName;
         this.AdjustSize(true);
     }
 }
 private void OnComponentRename(object source, ComponentRenameEventArgs args)
 {
     if (this.cache != null)
     {
         this.cache.Clear();
     }
 }
Exemplo n.º 26
0
		void changeService_ComponentRename (object sender, ComponentRenameEventArgs e)
		{
			//We just need to rename the right component in the combobox list
			TreeIter t; 
			components.GetIterFirst (out t);

			do {
				if ((IComponent)components.GetValue (t, 1) == e.Component && (string) components.GetValue(t, 0) == e.OldName) {
					components.SetValue (t, 0, e.NewName);
					return;
				}
			} while (components.IterNext (ref t));
		}
 private void OnComponentRename(object sender, ComponentRenameEventArgs e)
 {
     if (e.Component == this.ToolStripItem)
     {
         this.ToolStripItem.AccessibleName = e.NewName;
     }
 }
Exemplo n.º 28
0
 /// <summary>
 /// <para>Raises the <see cref="ComponentRename"/> event.</para>
 /// </summary>
 /// <param name="e">
 /// <para>A <see cref="ComponentRenameEventArgs"/> object containing data for the event.</para>
 /// </param>
 public virtual void OnComponentRename(ComponentRenameEventArgs e)
 {
     if (ComponentRename != null)
     {
         ComponentRename(this, e);
     }
 }
Exemplo n.º 29
0
 private void OnComponentRename(object sender, ComponentRenameEventArgs e)
 {
     if (e.Component is Activity)
     {
         //
         WorkflowOutlineNode node = this.activityToNodeMapping[e.Component] as WorkflowOutlineNode;
         if (node != null)
             node.OnActivityRename(e.NewName);
     }
 }
Exemplo n.º 30
0
		private void OnComponentRename (object sender, ComponentRenameEventArgs args)
		{
			if (_currentUnit == null)
				_currentUnit = CreateUndoUnit ("Rename " + ((IComponent)args.Component).Site.Name, true);
			_currentUnit.ComponentRename (args);

			IDesignerHost host = GetRequiredService (typeof (IDesignerHost)) as IDesignerHost;
			if (!host.InTransaction) {
				_currentUnit.Close ();
				AddUndoUnit (_currentUnit);
				_currentUnit = null;
			}
		}
 private void OnComponentRename(object sender, ComponentRenameEventArgs e)
 {
     if (e.Component == this)
     {
         System.Windows.Forms.UnsafeNativeMethods.IOleControl ocx = this.GetOcx() as System.Windows.Forms.UnsafeNativeMethods.IOleControl;
         if (ocx != null)
         {
             ocx.OnAmbientPropertyChange(-702);
         }
     }
 }
 private void OnComponentRename(object sender, ComponentRenameEventArgs e)
 {
     if ((this._enabled && (this._executingUnit == null)) && (this._unitStack.Count == 0))
     {
         string name = System.Design.SR.GetString("UndoEngineComponentRename", new object[] { e.OldName, e.NewName });
         this._unitStack.Push(this.CreateUndoUnit(name, true));
     }
     foreach (UndoUnit unit in this._unitStack)
     {
         unit.ComponentRename(e);
     }
 }
        private void OnComponentRenamed(object sender, ComponentRenameEventArgs e)
        {
            ActivityDesigner designer = ActivityDesigner.GetDesigner(e.Component as Activity);
            if (designer != null)
                this.Text = Activity.Name;

        }
 public virtual void ComponentRename(ComponentRenameEventArgs e)
 {
     this.AddEvent(new RenameUndoEvent(e.OldName, e.NewName));
 }
Exemplo n.º 35
0
			public virtual void ComponentRename (ComponentRenameEventArgs e)
			{
				if (!_closed) {
					// Console.WriteLine ("New Action: ComponentRenameAction (" + ((IComponent)e.Component).Site.Name + ")");
					_actions.Add (new ComponentRenameAction (e.NewName, e.OldName));
				}
			}
Exemplo n.º 36
0
 ///     This is called when a component has been renamed.
 internal void OnComponentRename(ComponentRenameEventArgs ce) {
     if (ComponentRename != null) {
         ComponentRename(this, ce);
     }
 }