private void Authentication_LoggedIn(object sender, AuthenticationEventArgs e) { if (WebContext.Current.User.IsAuthenticated) { Event.Visibility = Visibility.Visible; Event.Children[1].Visibility = System.Windows.Visibility.Collapsed; Event.Children[1].Visibility = System.Windows.Visibility.Visible; tabMain2.Visibility = Visibility.Visible; tabMain3.Visibility = Visibility.Visible; tabMain4.Visibility = Visibility.Visible; tabMain5.Visibility = Visibility.Visible; tabMain6.Visibility = Visibility.Visible; tabMain4.IsSelected = true; login = WebContext.Current.User.Name; PseudoEventContext EventContext = new PseudoEventContext(); Global.duplex.ReceptReceived += new EventHandler<ReceptReceivedEventArgs>(duplex_ReceptReceived); Global.duplex.EnvoiAsync(1, login, null, null, 0); timer = new System.Threading.Timer(MStayAlive, null, 0, 3000); NbConnexions.Visibility = Visibility.Visible; } } public void MStayAlive(object Null) { MessageBox.Show("J'envoi 1"); Global.duplex.EnvoiAsync(1, WebContext.Current.User.Name, null, null, 0); }
if (WebContext.Current.User.IsAuthenticated)soit faux.
timer = new System.Threading.Timer(MStayAlive, null, 0, 3000);
timer.Start();
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionSystem.Threading.Timer t = new System.Threading.Timer(MStayAlive, null, 0, 1000);
Il n'y a pas de .Start() pour ce type de timer.
System.Threading.TimerCallback tcb = MStayAlive; System.Threading.Timer montTimer = new System.Threading.Timer(tcb, null, 0, 1000);