Example #1
0
 protected void Notification(string message, NotifyStatus status)
 {
     if (Notify != null)
     {
         Notify(this, new NotifyEventArgs()
         {
             Message = message,
             Status = status
         });
     }
 }
 public void RaiseNotifyEvent(string message, NotifyStatus status)
 {
     Notification(message, status);
 }
Example #3
0
 private NotifyStatus StatusCompareExchange(NotifyStatus newValue, NotifyStatus oldvalue)
 {
     return (NotifyStatus)Interlocked.CompareExchange(ref _status, (int)newValue, (int)oldvalue);
 }
Example #4
0
        private NotifyStatus ModifyStatus(NotifyStatus[] map)
        {
            int oldStatus, newStatus;
            do
            {
                oldStatus = _status;
                newStatus = (int)map[_status];
            } while (Interlocked.CompareExchange(ref _status, newStatus, oldStatus) != oldStatus);

            return (NotifyStatus)oldStatus;
        }