Beispiel #1
0
 public void AddCommand(string commandName, FunctionHandler.VoidInVoidOutHandlerDelegate responseFunction)
 {
     if (commandName != null && responseFunction != null)
     {
         var cmdHash = HashAlgoProvider.HashBytes(Encoding.UTF8.GetBytes(commandName), HashAlgorithmName.SHA256);
         var fh      = new FunctionHandler(cmdHash, commandName, FunctionHandlerType.VoidInVoidOut, responseFunction);
         CommandList.Add(commandName, fh);
         CommandHashMap.Add(commandName, cmdHash);
     }
 }
Beispiel #2
0
        protected void AddCommandHash(string command)
        {
            var cmdHash = HashAlgoProvider.HashBytes(Encoding.UTF8.GetBytes(command), HashAlgorithmName.SHA256);

            CommandHashMap.Add(command, cmdHash);
        }