Beispiel #1
0
 public bool Execute( ScriptExecutionService service )
 {
     System.Windows.Forms.Control c = service.GetControl( this.m_Path );
     if( c == null )
         return false;
     MessageSender.SendClick( c );
     return true;
 }
 public bool Execute( ScriptExecutionService service )
 {
     System.Windows.Forms.Menu m = service.GetMenuItem( this.m_Path );
     if( m == null )
         return false;
     if( m is MenuItem )
         ((MenuItem)m).PerformClick();
     else
         return false;
     return true;
 }
        /// <summary>
        /// Execute the ink drawing event
        /// </summary>
        /// <param name="service">The service to execute over</param>
        /// <returns>True if successful, false otherwise</returns>
        public bool Execute( ScriptExecutionService service )
        {
            Control c = service.GetControl( this.m_Path );
            if( c == null )
                return false;
            if( c.InvokeRequired ) {
                GenericVoidCallback func = new GenericVoidCallback( delegate { c.Focus(); } );
                c.Invoke( func );
            } else
                c.Focus();

            this.PlaybackRecordedData( c, true, PacketPlaybackRate.Default, service.GetInkTransform() );
            return true;
        }
Beispiel #4
0
 public bool Execute( ScriptExecutionService service )
 {
     System.Threading.Thread.Sleep( this.m_TimeOut );
     return true;
 }
 public bool Execute( ScriptExecutionService service )
 {
     Random r = new Random();
     System.Threading.Thread.Sleep( r.Next( this.m_LowTimeOut, this.m_HighTimeOut+1 ) );
     return true;
 }
Beispiel #6
0
 protected override void OnClick( EventArgs e )
 {
     if( this.Parent is ScriptingMenuItem &&
         ((ScriptingMenuItem)this.Parent).CurrentScript != null ) {
         service = new ScriptExecutionService( localModel, this.GetMainMenu().GetForm() );
         System.Threading.Thread scriptThread = new System.Threading.Thread( new System.Threading.ParameterizedThreadStart( service.ExecuteScriptThreadEntry ) );
         scriptThread.Start( ((ScriptingMenuItem)this.Parent).CurrentScript );
     }
 }