Exemple #1
0
        public static void ResetHandlers()
        {
            // Clear event handlers
            if (OnNANDPluggedIn != null)
            {
                foreach (Delegate d in OnNANDPluggedIn.GetInvocationList())
                {
                    OnNANDPluggedIn -= (NANDChangedEventHandler)d;
                }
            }
            if (OnNANDRemoved != null)
            {
                foreach (Delegate d in OnNANDRemoved.GetInvocationList())
                {
                    OnNANDRemoved -= (NANDChangedEventHandler)d;
                }
            }

            // Reset validator to default
            Validator = DefaultValidator;
        }
Exemple #2
0
 public static bool InsertNAND(IStorage input, bool raw)
 {
     if (Validator(input))
     {
         if (NAND != null && !raw)
         {
             if (!RequestSwitchSource())
             {
                 return(false);
             }
         }
         NAND       = new Nand(input.AsStream(FileAccess.Read), HACGUIKeyset.Keyset, FileAccess.Read);
         NANDSource = input;
         OnNANDPluggedIn?.Invoke();
         return(true);
     }
     else
     {
         return(false);
     }
 }