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); } }
protected void AddCommandHash(string command) { var cmdHash = HashAlgoProvider.HashBytes(Encoding.UTF8.GetBytes(command), HashAlgorithmName.SHA256); CommandHashMap.Add(command, cmdHash); }