protected override void OnCommandSent( object sender, CommandSentEventArgs e ) { if( e.Command != null && e.Command.StartsWith( CMDSendPredictedWord + ":" ) ) { WordHasBeenChosen( e.Command.Substring( CMDSendPredictedWord.Length + 1 ) ); } }
protected override void OnCommandSent( object sender, CommandSentEventArgs e ) { if( e.Command != null && e.Command.Contains( CMDClearTextualContext ) ) { ClearTextualContext(); } }
protected override void OnCommandSent( object sender, CommandSentEventArgs e ) { if( !e.Canceled && e.Command.StartsWith( PROTOCOL ) ) { string parameter = e.Command.Substring( e.Command.IndexOf( ':' ) + 1 ); CK.InputDriver.Replay.KeyboardReplayer.Play( parameter.Split( ',' )[1] ); } }
protected override void OnCommandSent( object sender, CommandSentEventArgs e ) { if( e.Command.StartsWith( PROTOCOL ) ) { string keyboardName = e.Command.Substring( PROTOCOL.Length ); ChangeKeyboard( keyboardName ); } }
protected override void OnCommandSent( object sender, CommandSentEventArgs e ) { CommandParser p = new CommandParser(e.Command); string str; if( p.IsIdentifier( out str ) && !e.Canceled && str == CMDSendKey ) { if( str == CMDSendKey ) SendKey( p.StringValue ); } }
protected override void OnCommandSent( object sender, CommandSentEventArgs e ) { if( e.Command.StartsWith( PROTOCOL ) ) { string parameter = e.Command.Substring( PROTOCOL.Length ).Trim(); if( parameter == "show" ) ShowHelp(); } }
protected override void OnCommandSent( object sender, CommandSentEventArgs e ) { if( !e.Canceled && e.Command.StartsWith( PROTOCOL ) ) { string parameter = e.Command.Substring( e.Command.IndexOf( ':' ) + 1 ); SendKey( parameter ); } }
protected override void OnCommandSent( object sender, CommandSentEventArgs e ) { if( !e.Canceled && e.Command.StartsWith( PROTOCOL ) ) { string parameter = e.Command.Substring( e.Command.IndexOf( ':' ) + 1 ); string[] splittedParameter = parameter.Split( ',' ); Debug.Assert( splittedParameter.Length == 2 ); string action = splittedParameter[0]; string targetMode = splittedParameter[1]; switch( action ) { case "add": Add( targetMode ); return; case "remove": Remove( targetMode ); return; case "set": ChangeMode( targetMode ); return; case "toggle": Toggle( targetMode ); return; } } //string cmd; //string sub; //string m; //CommandParser p = new CommandParser( e.Command ); //if( !e.Canceled && p.IsIdentifier( out cmd ) && cmd == CMDChangeMode ) //{ // if( p.MatchIsolatedChar( '.' ) ) // { // p.IsIdentifier( out sub ); // sub = sub.ToLower(); // if( p.Match( CommandParser.Token.OpenPar ) ) // if( p.IsString( out m ) ) // if( p.Match( CommandParser.Token.ClosePar ) ) // { // if( cmd == CMDChangeMode ) // { // switch( sub ) // { // case "add": Add( m ); return; // case "remove": Remove( m ); return; // case "set": ChangeMode( m ); return; // case "toggle": Toggle( m ); return; // } // } // } // } //} }
protected override void OnCommandSent( object sender, CommandSentEventArgs e ) { Command cmd = new Command( e.Command ); if( cmd.Name != PROTOCOL_BASE ) return; LaunchFile( cmd.Content ); }
protected override void OnCommandSent( object sender, CommandSentEventArgs e ) { if( !e.Canceled && Notifications != null ) Notifications.ShowNotification( new Guid( PluginId ), "Command viewer : Command sent", "Command : " + e.Command, 1000 ); }
protected override void OnCommandSent( object sender, CommandSentEventArgs e ) { if( e.Command.StartsWith( PROTOCOL ) ) { if( !_timer.IsEnabled ) { if( HighlighterService.Status.IsStartingOrStarted ) HighlighterService.Service.Pause(); string[] parameters = e.Command.Substring( PROTOCOL.Length ).Trim().Split( ',' ); string direction = parameters[0]; int speed = int.Parse( parameters[1] ); bool snakeMode; if( parameters.Length == 3) { if( bool.TryParse( parameters[2], out snakeMode ) ) { BeginMouseMotion( direction, speed, snakeMode ); return; } } BeginMouseMotion( direction, speed ); } else { if( HighlighterService.Status.IsStartingOrStarted ) HighlighterService.Service.Resume(); EndMouseMotion(); } } }
protected override void OnCommandSent( object sender, CommandSentEventArgs e ) { if( e.Command.StartsWith( PROTOCOL ) ) { string parameter = e.Command.Substring( PROTOCOL.Length ).Trim(); switch( parameter ) { case "simple": Clic(); return; case "right": RightClic(); return; case "double": DoubleClic(); return; case "leftpush": LeftPush(); return; case "leftrelease": LeftRelease(); return; } } }
protected override void OnCommandSent( object sender, CommandSentEventArgs e ) { if( !e.Canceled && e.Command.StartsWith( PROTOCOL ) ) { string parameter = e.Command.Substring( e.Command.IndexOf( ":" ) + 1 ); //ex : monitoronce:sendkey,autoclose-shift,mode:remove,shift // protocol:whatcommandtomonitor,thekeyofthecommandtoexecutewhenmonitoredmethodistriggered,thecommandtoexecutewhenmonitoredmethodistriggered string[] splittedParameter = parameter.Split( ',' ); Parse( splittedParameter[0], splittedParameter[1], parameter.Substring( splittedParameter[0].Length + splittedParameter[1].Length + 2 ) ); } }
protected override void OnCommandSent( object sender, CommandSentEventArgs e ) { if( !e.Canceled ) { CommandParser p = new CommandParser( e.Command ); if( p.MatchIdentifier( CMD ) ) { string eventKey; string eventName; if( p.MatchIsolatedChar( '.' ) ) { if( p.IsIdentifier( out eventName ) ) { if( p.Match( CommandParser.Token.OpenPar ) ) { if( p.IsString( out eventKey ) ) { if( p.Match( CommandParser.Token.ClosePar ) ) { if( p.MatchIsolatedChar( ':' ) ) { Parse( eventKey, eventName, e.Command.Split( ':' )[1] ); } } } } } } } } }
protected override void OnCommandSent( object sender, CommandSentEventArgs e ) { if( e.Command != null && e.Command.Contains( CMDSendPredictionAreaContent ) ) SendText(); }
protected override void OnCommandSent( object sender, CommandSentEventArgs e ) { if( e.Command.StartsWith( PROTOCOL ) ) { if( _isInMotion ) { if( HighlighterService.Status.IsStartingOrStarted ) HighlighterService.Service.Resume(); EndMouseMotion(); _isInMotion = false; } else { if( HighlighterService.Status.IsStartingOrStarted ) HighlighterService.Service.Pause(); string[] parameters = e.Command.Substring( PROTOCOL.Length ).Trim().Split( ',' ); string direction = parameters[0]; int speed = int.Parse( parameters[1] ); BeginMouseMotion( direction, speed ); _isInMotion = true; } } }
protected override void OnCommandSent( object sender, CommandSentEventArgs e ) { //string cmd; //string m; //CommandParser p = new CommandParser( e.Command ); //if( !e.Canceled && p.IsIdentifier( out cmd ) && cmd == CMD ) //{ // if( p.Match( CommandParser.Token.OpenPar ) ) // if( p.IsString( out m ) ) // if( p.Match( CommandParser.Token.ClosePar ) ) // if( cmd == CMD ) // Exec( m ); //} if( e.Command.StartsWith( PROTOCOL ) ) { string parameter = e.Command.Substring( PROTOCOL.Length ).Trim(); Exec( parameter ); } }
protected override void OnCommandSent( object sender, CommandSentEventArgs e ) { string cmd; string m; CommandParser p = new CommandParser( e.Command ); if( !e.Canceled && p.IsIdentifier( out cmd ) && cmd == CMD ) { if( p.Match( CommandParser.Token.OpenPar ) ) if( p.IsString( out m ) ) if( p.Match( CommandParser.Token.ClosePar ) ) if( cmd == CMD ) Exec( m ); } }
/// <summary> /// Method reacting from the Command Sent event. Here, you can parse the command you want to listen /// and do some stuff about it. /// </summary> /// <param name="sender"></param> /// <param name="e"><see cref="CommandSentEventArgs"/> containing data about the sent command.</param> protected virtual void OnCommandSent( object sender, CommandSentEventArgs e ) { }
protected override void OnCommandSent( object sender, CommandSentEventArgs e ) { string cmd; string sub; string m; CommandParser p = new CommandParser( e.Command ); if( !e.Canceled && p.IsIdentifier( out cmd ) && cmd == CMDChangeMode ) { if( p.MatchIsolatedChar( '.' ) ) { p.IsIdentifier( out sub ); sub = sub.ToLower(); if( p.Match( CommandParser.Token.OpenPar ) ) if( p.IsString( out m ) ) if( p.Match( CommandParser.Token.ClosePar ) ) { if( cmd == CMDChangeMode ) { switch( sub ) { case "add": Add( m ); return; case "remove": Remove( m ); return; case "set": ChangeMode( m ); return; case "toggle": Toggle( m ); return; } } } } } }