protected override void ProcessOnStatusPasteCommand(System.ComponentModel.Design.MenuCommand cmd) { base.ProcessOnStatusPasteCommand(cmd); if (!cmd.Enabled && this.SingleSelection is ElementListCompartment) { var compartment = (ElementListCompartment)this.SingleSelection; ShapeElement pasteTarget = compartment.ParentShape; System.Windows.Forms.IDataObject data = System.Windows.Forms.Clipboard.GetDataObject(); if (pasteTarget != null && this.ElementOperations.CanMerge(pasteTarget, data)) { cmd.Enabled = true; } } }
public static bool _Invoke_System_ComponentModel_Design_MenuCommand( ) { //class object System.ComponentModel.Design.MenuCommand _System_ComponentModel_Design_MenuCommand = new System.ComponentModel.Design.MenuCommand(); //Parameters //Exception System.Exception exception_Real = null; System.Exception exception_Intercepted = null; InterceptionMaintenance.disableInterception( ); try { _System_ComponentModel_Design_MenuCommand.Invoke(); } catch (System.Exception e) { exception_Real = e; } InterceptionMaintenance.enableInterception( ); try { _System_ComponentModel_Design_MenuCommand.Invoke(); } catch (System.Exception e) { exception_Intercepted = e; } return((exception_Real.Message == exception_Intercepted.Message)); }
public static bool _Invoke_System_ComponentModel_Design_MenuCommand( ) { //class object System.ComponentModel.Design.MenuCommand _System_ComponentModel_Design_MenuCommand = new System.ComponentModel.Design.MenuCommand(); //Parameters //Exception System.Exception exception_Real = null; System.Exception exception_Intercepted = null; InterceptionMaintenance.disableInterception( ); try { _System_ComponentModel_Design_MenuCommand.Invoke(); } catch( System.Exception e ) { exception_Real = e; } InterceptionMaintenance.enableInterception( ); try { _System_ComponentModel_Design_MenuCommand.Invoke(); } catch( System.Exception e ) { exception_Intercepted = e; } return( ( exception_Real.Message == exception_Intercepted.Message )); }
/// <summary> /// Updates the UI for the Paste command /// </summary> /// <param name="sender">The sender of the message</param> /// <param name="args">Message parameters</param> private void OnStatusPaste(object sender, global::System.EventArgs args) { System.ComponentModel.Design.MenuCommand cmd = sender as System.ComponentModel.Design.MenuCommand; this.ProcessOnStatusPasteCommand(cmd); }
/// <summary> /// Determines whether Copy menu item should be visible and if so, enabled. /// </summary> /// <param name="sender">The sender of the message</param> /// <param name="args">empty</param> protected virtual void OnStatusCopy(object sender, global::System.EventArgs args) { System.ComponentModel.Design.MenuCommand cmd = sender as System.ComponentModel.Design.MenuCommand; this.ProcessOnStatusCopyCommand(cmd); }
/// <summary> /// Status event handler for validating the model. /// </summary> internal virtual void OnStatusValidateModel(object sender, global::System.EventArgs e) { System.ComponentModel.Design.MenuCommand cmd = sender as System.ComponentModel.Design.MenuCommand; cmd.Enabled = cmd.Visible = true; }