Esempio n. 1
0
 public static void RegisterInputCallback(int callbackID, InputCallback callback)
 {
     if (!InputCallbackDatabase.ContainsKey(callbackID))
     {
         InputCallbackDatabase.Add(callbackID, callback);
     }
     else
     {
         throw new CallbackAlreadyRegisteredException("The Input Callback of Type" + callbackID + "is already registered.");
     }
 }
Esempio n. 2
0
        public static InputCallback FetchInputCallback(int callbackID)
        {
            InputCallback callback;

            if (InputCallbackDatabase.TryGetValue(callbackID, out callback))
            {
                return(callback);
            }
            else
            {
                throw new CallbackNotFoundException("The Input Callback of Type: " + callback + " is not registered with the Callback Registry and can't be fetched.");
            }
        }