Ejemplo n.º 1
0
    private static void OnConfigChange(object sender, SqlNotificationEventArgs e)
    {
        SqlDependency depend = (SqlDependency)sender;

        depend.OnChange -= OnConfigChange;
        if (e.Type == SqlNotificationType.Change)
        {
            LoadConfig();
        }
    }
Ejemplo n.º 2
0
        private void OnDependencyChange(object sender, SqlNotificationEventArgs e)
        {
            SqlDependency dependency = sender as SqlDependency;

            // Notices are only a one shot deal
            // so remove the existing one so a new
            // one can be added
            dependency.OnChange -= OnDependencyChange;
            OnScheduleChanged();
        }
Ejemplo n.º 3
0
        private void OnIncidentListChange(object sender, SqlNotificationEventArgs e)
        {
            if (e.Type == SqlNotificationType.Change)
            {
                SqlDependency dependency = sender as SqlDependency;
                dependency.OnChange -= OnIncidentListChange;

                UpdateGridViewIncidentList();
            }
        }
Ejemplo n.º 4
0
        public void Personas_Cambio(object sender, SqlNotificationEventArgs e)
        {
            if (e.Type == SqlNotificationType.Change)
            {
                string mensaje = ObtenerMensajeAMostrar(e);
                chatHub.Clients.All.SendAsync("ReceiveMessage", "Admin", mensaje);
            }

            SuscribirseALosCambiosDeLaTablaPersonas();
        }
        private void dependency_OnChange(object sender, SqlNotificationEventArgs e)
        {
            // SqlDependency dependency = sender as SqlDependency;
            // if (dependency != null) dependency.OnChange -= dependency_OnChange;

            if (e.Type == SqlNotificationType.Change)
            {
                BroadcastVotes(GetResultsFromDB());
            }
        }
Ejemplo n.º 6
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Dependency_OnChange(object sender, SqlNotificationEventArgs e)
        {
            SqlDependency dependency = sender as SqlDependency;

            dependency.OnChange -= Dependency_OnChange;
            if (e.Info != SqlNotificationInfo.Invalid)
            {
                InitSqlDependency();
            }
        }
Ejemplo n.º 7
0
        private void Dp_OnChange(object sender, SqlNotificationEventArgs e)
        {
            SqlDependency dp = sender as SqlDependency;

            dp.OnChange -= Dp_OnChange;
            if (OnNewForm != null)
            {
                OnNewForm();
            }
        }
Ejemplo n.º 8
0
 private void OnPersonEvent(object sender, SqlNotificationEventArgs e)
 {
     if (dependency.HasChanges && e.Info != SqlNotificationInfo.AlreadyChanged)
     {
         var dep = sender as SqlDependency;
         dep.OnChange -= OnPersonEvent;
         Console.WriteLine("Data Changed : {0}", e.Info.ToString());
     }
     StartNotification();
 }
Ejemplo n.º 9
0
        public void chartdetail_OnChange(object sender, SqlNotificationEventArgs e)
        {
            if (e.Type == SqlNotificationType.Change)
            {
                status3 = true;
                MessagesHub.SendMessages();

                notifchartdetail();
            }
        }
        private void de_OnChange(object sender, SqlNotificationEventArgs e)
        {
            SqlDependency de = sender as SqlDependency;

            de.OnChange -= de_OnChange;
            if (_Change != null)
            {
                _Change(this, new EventArgs());
            }
        }
Ejemplo n.º 11
0
        private void OnChage(object sender, SqlNotificationEventArgs e)
        {
            SqlDependency de = sender as SqlDependency;

            de.OnChange -= OnChage;
            if (OnGetNotify != null)
            {
                OnGetNotify();
            }
        }
Ejemplo n.º 12
0
 void sqlDep_onChange(object sender, SqlNotificationEventArgs e)
 {
     if (e.Info == SqlNotificationInfo.Insert)
     {
         SqlDependency sqldep = sender as SqlDependency;
         sqldep.OnChange += sqlDep_onChange;
         var notificationHub = GlobalHost.ConnectionManager.GetHubContext <NotificationHub>();
         notificationHub.Clients.All.notify("added");
     }
 }
Ejemplo n.º 13
0
        void dependency_messages_OnChange(object sender, SqlNotificationEventArgs e)
        {
            if (this.MessageDataChanged != null)
            {
                this.MessageDataChanged(this, null);
            }

            // reinitialize the dependency
            InitializeMessagesSqlDependency();
        }
Ejemplo n.º 14
0
        void dependency_user_OnChange(object sender, SqlNotificationEventArgs e)
        {
            if (this.UserDataChanged != null)
            {
                this.UserDataChanged(this, null);
            }

            // reinitialize the dependency
            InitializeUsersSqlDependency();
        }
Ejemplo n.º 15
0
        private void OnChange(object sender, SqlNotificationEventArgs e)
        {
            SqlDependency dependency = sender as SqlDependency;

            dependency.OnChange -= OnChange;
            if (OnNewMessage != null)
            {
                OnNewMessage();
            }
        }
Ejemplo n.º 16
0
        private static void dependency_OnChange(object sender, SqlNotificationEventArgs e)
        {
            SqlNotificationInfo s          = e.Info;
            List <Scope>        listScopes = ScopeRepository.GetAllCompletedScopes();

            foreach (Scope obj in listScopes)
            {
                ScopeHub.Show(obj);
            }
        }
Ejemplo n.º 17
0
        private void CaptureLowres_OnChange(object sender, SqlNotificationEventArgs e)

        {
            if (e.Type == SqlNotificationType.Change)

            {
                CapLowresHub nHub = new CapLowresHub();
                nHub.SendCaptureLowresItems();
            }
        }
        private void OnDependencyChange(object sender, SqlNotificationEventArgs e)
        {
            var sonuc = e.Source.ToString() + " " + e.Info.ToString() + " ";

            DispatcherOperation op = Dispatcher.BeginInvoke((Action)(() => {
                l1.Content = "çalıştı " + sonuc + DateTime.Now;

                verileriYukle();
            }));
        }
        private void OnChange(object sender, SqlNotificationEventArgs e)
        {
            SqlDependency oldDependency = (SqlDependency)sender;

            oldDependency.OnChange -= OnChange;

            Setup();

            _categories = GetData();
        }
Ejemplo n.º 20
0
        public void de_OnChange(object sender, SqlNotificationEventArgs e)
        {
            SqlDependency de = sender as SqlDependency;

            de.OnChange -= de_OnChange;
            if (bangGiaDelegate != null)
            {
                bangGiaDelegate();
            }
        }
        public void de_OnChange(object sender, SqlNotificationEventArgs e)
        {
            SqlDependency de = sender as SqlDependency;

            de.OnChange -= de_OnChange;
            if (OnNewHome != null)
            {
                OnNewHome();
            }
        }
Ejemplo n.º 22
0
        public void OnDependencyChange(object sender, SqlNotificationEventArgs e)
        {
            //remember alter database enable broker service
            SqlDependency sqlDependency = sender as SqlDependency;

            sqlDependency.OnChange -= OnDependencyChange;
            UpdateData updateData = new UpdateData(LoadData);

            this.Invoke(updateData, null);
        }
Ejemplo n.º 23
0
 private void Dependency_OnChangeEmploye(object sender, SqlNotificationEventArgs e)
 {
     if (e.Info != SqlNotificationInfo.Invalid)
     {
         dgEmployes(QRE);
     }
     dgGroup(QRG);
     dgCabinetes(QRC);
     dgTerritory(QRT);
 }
Ejemplo n.º 24
0
        private void Personas_Cambio(object sender, SqlNotificationEventArgs e)
        {
            if (e.Type == SqlNotificationType.Change)
            {
                string mesanje = ObtenerMensajeAMostar(e);
                chatHub.Clients.All.SendAsync("ReceiveMessage", "Admin", mesanje);
            }

            SuscribirseAlosCambiosDeLaTablaPersonas();//hay que volver a suscribirse para cualquier cambio de nuevo en la tabla.
        }
Ejemplo n.º 25
0
        public void dependency_OnChange(object sender, SqlNotificationEventArgs e)
        {
            if (e.Type == SqlNotificationType.Change)
            {
                status3 = true;
                MessagesHub.SendMessages();

                notifdep();
            }
        }
Ejemplo n.º 26
0
 void sd_OnChange(object sender, SqlNotificationEventArgs e)
 {
     if (e.Type == SqlNotificationType.Change)
     {
         SqlDependency sd = sender as SqlDependency;
         sd.OnChange -= sd_OnChange;
         var myHub = GlobalHost.ConnectionManager.GetHubContext <MyHub>();
         myHub.Clients.All.message("newrecord");
     }
 }
Ejemplo n.º 27
0
        private void OnDatabaseChange(object sender, SqlNotificationEventArgs args)
        {
            SqlNotificationInfo info = args.Info;

            if (SqlNotificationInfo.Insert.Equals(info) || SqlNotificationInfo.Update.Equals(info))
            {
                dataGridView1.Rows.Clear();
                LoadData();
            }
            WatchingQuery();
        }
Ejemplo n.º 28
0
        private void sqlDependency_OnChange(object sender, SqlNotificationEventArgs e)
        {
            if (e.Info == SqlNotificationInfo.Invalid)
            {
                throw new HelperClasses.LibraryException("A statement was provided that cannot be notified.");
            }

            BindSqlDependency();

            this.OnCollectionChanged(e);
        }
Ejemplo n.º 29
0
        // Handler method
        void OnDependencyChange(object sender,
                                SqlNotificationEventArgs e)
        {
            // Handle the event (for example, invalidate this cache entry).

            string trigger = "a change occured now!";

            //execute another query:
            //where
            //subscribeBroker();
        }
Ejemplo n.º 30
0
        private void sqlDependency_OnChange(object sender, SqlNotificationEventArgs e)
        {
            MessageBox.Show($"OnChange Event fired. SqlNotificationEventArgs: Info={e.Info}, Source={e.Source}, Type={e.Type}\r\n");

            //resubscribe only if valid
            if ((e.Info != SqlNotificationInfo.Invalid) &&
                (e.Type != SqlNotificationType.Subscribe))
            {
                SearchUserLog();
            }
        }