/// <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)); }
/// <include file='doc\ReferenceService.uex' path='docs/doc[@for="ReferenceService.ReferenceService"]/*' /> /// <devdoc> /// Constructs the ReferenceService. /// </devdoc> public ReferenceService(IDesignerHost host, bool ignoreCase) { this.host = host; this.ignoreCase = ignoreCase; onComponentAdd = new ComponentEventHandler(OnComponentAdd); onComponentRemove = new ComponentEventHandler(OnComponentRemove); onComponentRename = new ComponentRenameEventHandler(OnComponentRename); referenceList = new ArrayList(); IComponentChangeService changeService = (IComponentChangeService)host.GetService(typeof(IComponentChangeService)); Debug.Assert(changeService != null, "If we can't get a change service, how are we ever going to update references..."); if (changeService != null) { changeService.ComponentAdded += onComponentAdd; changeService.ComponentRemoved += onComponentRemove; changeService.ComponentRename += onComponentRename; } }