public KeyProgramCommandsEventArgs( IKeyProgram p, KeyProgramCommandsEventType eventType, int index )
     : base(p.Context)
 {
     KeyProgram = p;
     EventType = eventType;
     Index = index;
 }
 public KeyInteractionEventArgs( IKey k, IKeyProgram p, KeyInteractionEventType eventType )
     : base(k)
 {
     EventType = eventType;
     // Clone the commands: the emitted commands is a snapshot of the commands
     // at the time of the event.
     string[] copy = p.Commands.ToArray();
     Commands = new CKReadOnlyListOnIList<string>( copy );
 }
 private static void ParseCommands( HashSet<string> protocols, IKeyProgram keyProgram )
 {
     foreach( var command in keyProgram.Commands )
     {
         int index = command.IndexOf( ':' );
         if( index >= 0 )
             protocols.Add( command.Substring( 0, index ) );
     }
 }
 public KeyPressedEventArgs(IKey k, IKeyProgram p, int repeatCount)
     : base(k, p, KeyInteractionEventType.Pressed)
 {
     RepeatCount = repeatCount;
 }
Beispiel #5
0
        private static void ProcessKeyProgram150To160( IKeyProgram keyProgram )
        {
            for( int i = 0; i < keyProgram.Commands.Count; i++ )
            {
                string command = String.Empty;
                string parameter = String.Empty;

                if( ProcessKeyCommand150To160( keyProgram.Commands[i], out command, out parameter ) )
                {
                    keyProgram.Commands.RemoveAt( i );
                    keyProgram.Commands.Insert( i, String.Format( "{0}:{1}", command, parameter ) );
                }
            }
        }