예제 #1
0
        private static List <NOTIFYITEM> getTrayItems(TrayNotify instance)
        {
            NotificationCb callback = new NotificationCb();
            ulong          handle   = 0UL;
            ITrayNotify    notify1  = (ITrayNotify)instance;

            notify1.RegisterCallback(callback, out handle);
            notify1.UnregisterCallback(handle);
            return(callback.items);
        }
예제 #2
0
 public NotifyIconNotifier(Action <NOTIFYITEM, NotifyIconMessage> onNotify)
 {
     try
     {
         this.onNotify = onNotify;
         notifier      = (ITrayNotify) new TrayNotify();
         notifier.RegisterCallback(this, out handle);
     }
     catch (Exception e)
     {
         throw new Exception("Could not register callback.", e);
     }
 }