Beispiel #1
0
 public static void UnregisterScannerActivity()
 {
     try
     {
         ElContext?.UnregisterReceiver(Receiver);
     }
     catch { }
     AfterReceive?.GetInvocationList().ToList().ForEach(x => AfterReceive   -= (EventHandler <ReceiveEventArgs>)x);
     BeforeReceive?.GetInvocationList().ToList().ForEach(x => BeforeReceive -= (EventHandler)x);
     ElContext = null;
     ARP       = null;
 }
Beispiel #2
0
 public static void RegisterScannerActivity(this Activity context, View rootView = null, bool RegularEvents = false, AfterReceiveProcedure Procedure = null, bool Silent = false)
 {
     UnregisterScannerActivity();
     //register the new activity
     ElContext = context;
     ElContext.RegisterReceiver(Receiver, Filter);
     RootView = rootView;
     if (RegularEvents)
     {
         AfterReceive  += Scanner_AfterReceive;
         BeforeReceive += Scanner_BeforeReceive;
     }
     ARP    = Procedure;
     silent = Silent;
 }