Inheritance: System.EventArgs
コード例 #1
0
 protected override void OnCommandSent( object sender, CommandSentEventArgs e )
 {
     if( e.Command != null && e.Command.StartsWith( CMDSendPredictedWord + ":" ) )
     {
         WordHasBeenChosen( e.Command.Substring( CMDSendPredictedWord.Length + 1 ) );
     }
 }
コード例 #2
0
 protected override void OnCommandSent( object sender, CommandSentEventArgs e )
 {
     if( e.Command != null && e.Command.Contains( CMDClearTextualContext ) )
     {
         ClearTextualContext();
     }
 }
コード例 #3
0
 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] );
     }
 }
コード例 #4
0
ファイル: ChangeKeyboard.cs プロジェクト: rit3k/ck-certified
 protected override void OnCommandSent( object sender, CommandSentEventArgs e )
 {
     if( e.Command.StartsWith( PROTOCOL ) )
     {
         string keyboardName = e.Command.Substring( PROTOCOL.Length );
         ChangeKeyboard( keyboardName );
     }
 }
コード例 #5
0
 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 );
     }
 }
コード例 #6
0
        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();
            }
        }
コード例 #7
0
 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 );
     }
 }
コード例 #8
0
        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;
            //                        }
            //                    }
            //                }
            //    }
            //}
        }
コード例 #9
0
        protected override void OnCommandSent( object sender, CommandSentEventArgs e )
        {
            Command cmd = new Command( e.Command );
            if( cmd.Name != PROTOCOL_BASE ) return;

            LaunchFile( cmd.Content );
        }
コード例 #10
0
 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 );
 }
コード例 #11
0
        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();
                }
            }
        }
コード例 #12
0
        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;
                }
            }
        }
コード例 #13
0
        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 ) );
            }
        }
コード例 #14
0
        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] );
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
コード例 #15
0
 protected override void OnCommandSent( object sender, CommandSentEventArgs e )
 {
     if( e.Command != null && e.Command.Contains( CMDSendPredictionAreaContent ) )
         SendText();
 }
コード例 #16
0
ファイル: MoveMouse.cs プロジェクト: rit3k/ck-certified
        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;
                }
            }
        }
コード例 #17
0
        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 );
            }
        }
コード例 #18
0
        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 );
            }
        }
コード例 #19
0
 /// <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 )
 {
 }
コード例 #20
0
        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;
                                    }
                                }
                            }
                }
            }
        }