public SystemNotificationAnimHandler(SystemNotificationCode code) { Timer = new DispatcherTimer(); Timer.Interval = TimeSpan.FromMilliseconds(10); Timer.Tick += new EventHandler(OnTimerTick); Handles = new List <UIntPtr>(); EventProc = new GlobalDelegates.Delegate5(SystemNotification); NotificationCode = code; RegisterNotification(); }
public SystemNotificationObjectHandler(SystemNotificationCode code) { EventProc = new GlobalDelegates.Delegate5(SystemNotification); NotificationCode = code; RegisterNotification(); }
/// <summary> /// Unregisters a SystemNotification. /// Be sure not to create new delegates when calling this method, but stored ones used when registering it. /// </summary> protected void UnregisterSystemNotification(GlobalDelegates.Delegate5 proc, SystemNotificationCode code) { int unregResult = MaxInterfaces.Global.UnRegisterNotification(proc, null, code); if (unregResult != 0 && this.systemNotifications != null) { this.systemNotifications.Remove(new Tuple<GlobalDelegates.Delegate5, SystemNotificationCode>(proc, code)); } }
/// <summary> /// Registers a SystemNotification proc, which will be automatically unregistered when UnregisterSystemNotifications is called. /// </summary> protected void RegisterSystemNotification(GlobalDelegates.Delegate5 proc, SystemNotificationCode code) { if (this.systemNotifications == null) this.systemNotifications = new List<Tuple<GlobalDelegates.Delegate5, SystemNotificationCode>>(); int regResult = MaxInterfaces.Global.RegisterNotification(proc, null, code); if (regResult != 0) this.systemNotifications.Add(new Tuple<GlobalDelegates.Delegate5, SystemNotificationCode>(proc, code)); }