Exemplo n.º 1
0
        /// <summary>
        /// �C�x���g�𔭓����郁�\�b�h�B
        /// </summary>
        /// <param name="e"></param>
        private void OnNotificationEventHandler(NotificationEventArgs e)
        {
            NotificationEvent handler = null;
            lock (this)
            {
                handler = _notificationEventHandler;
            }

            if (handler != null)
            {
                handler(this, e);
            }
        }
        /// <summary>
        /// Notification���M�����Ƃ��̏����B
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OnReceiveNotification(object sender, NotificationEventArgs e)
        {
            if (e == null || e.ServerEnv == null || e.NotificationList == null)
            {
                return;
            }

            ServerEnv env = e.ServerEnv;
            ArrayList list = e.NotificationList;

            foreach (Notification notif in list)
            {
                switch (notif.Type)
                {
                    case NotificationType.DatabaseReplaced:
                        DataSet ds_full = (DataSet)notif.Tag;
                        OnDatabaseReplaced(env, ds_full);
                        break;
                    case NotificationType.DatabaseMerged:
                        DataSet ds_diff = (DataSet)notif.Tag;
                        OnDatabaseMerged(env, ds_diff);
                        break;
                    case NotificationType.Log:
                        LogInfo info = (LogInfo)notif.Tag;
                        break;
                    default:
                        break;
                }

                RefreshLog(GetListViewItemFromNotification(notif));
            }
        }