public void ErrorEnEliminarNoSePuede(ErrorMsgArgs e) { Console.WriteLine("Error en eliminar, no es posible"); var intento = this.intentoEliminaNoSePuede; Action accion = () => { var resBorder = this.TryFindResource("tipoIncidenteEliminarMsgErrorNoSePuede") as Border; resBorder.DataContext = this.intentoEliminaNoSePuede; var count = 5; intento.segundo = e.Motivo + "\n(" + count + " segs)."; this.f.Children.Add(resBorder); var tmrCuentaRegresiva = new DispatcherTimer(DispatcherPriority.Render, Application.Current.Dispatcher) { Interval = new TimeSpan(0, 0, 1) }; tmrCuentaRegresiva.Tick += (x, y) => { if (!intento.dejarAbierto) { tmrCuentaRegresiva.Stop( ); this.f.Children.Remove(resBorder); return; } if (count == 0) { tmrCuentaRegresiva.Stop( ); return; } count--; intento.segundo = e.Motivo + "\n(" + count + " segs)."; if (count == 0) { this.f.Children.Remove(resBorder); } }; tmrCuentaRegresiva.Start( ); }; App.Current?.Dispatcher?.BeginInvoke(accion, DispatcherPriority.Render); Thread.Sleep(5100); }
public void ErrorEnEliminarNoSePuede(ErrorMsgArgs e) => throw new NotImplementedException( );
public void ErrorEnActualizar(ErrorMsgArgs e) => throw new NotImplementedException( );
public void ErrorEnEliminar(ErrorMsgArgs e) { Console.WriteLine("Error en eliminar, sin conexion"); e.Reintentar = Errores(this.intentoEliminarSinConexion, "tipoIncidenteEliminarMsgError"); }
//public void ErrorHappen (BLL.ErrorMsgArgs e) { // //if () { // e.Reintentar = !(++iii.intento >= 3); // //} // var r = iii.intento; // Action n = ( ) => { var resBorder = this.TryFindResource ("tipoIncidenteMsgError") as // Border; resBorder.DataContext = iii; var content = new ContentControl ( ) { Content = // resBorder, HorizontalAlignment = HorizontalAlignment.Right, VerticalAlignment = // VerticalAlignment.Bottom }; // //var border = new Border ( ) { // HorizontalAlignment = HorizontalAlignment.Right, // // VerticalAlignment = VerticalAlignment.Bottom, // Background = Brushes.LightCoral, // Child // = new TextBlock ( ) { // Text = "No hay conexion a la red. \nVolviendo a intentar de // nuevo. (5 segs)" // }, // CornerRadius = new CornerRadius (5), // Padding = new Thickness // (5), //}; Grid.SetColumnSpan (content, 3); // switch (iii.intento) { case 1: iii.msg1 = "Primer intento"; break; case 2: iii.msg1 = // "Segundo intento"; break; default: iii.msg1 = "Ultimo intento"; break; } // iii.segundo = 5; // this.f.Children.Add (content); // var nnn = new DispatcherTimer (DispatcherPriority.Render, Application.Current.Dispatcher); // var count = 5; nnn.Interval = new TimeSpan (0, 0, 1); nnn.Tick += (x, y) => { if // (!iii.intentar) { nnn.Stop ( ); this.f.Children.Remove (content); return; } // if (count == 0) { nnn.Stop ( ); return; // count = 1; } // count--; // iii.segundo = count; if (count == 0) { this.f.Children.Remove (content); } // }; nnn.Start ( ); // }; App.Current?.Dispatcher?.BeginInvoke (n, DispatcherPriority.Render); // Thread.Sleep (5100); // e.Reintentar = iii.intentar; Console.WriteLine ("Error conexion"); //} public void ErrorEnActualizar(ErrorMsgArgs e) { Console.WriteLine("Error al actualizar, sin conexion"); e.Reintentar = Errores(this.intentoActualizarSinConexion, "tipoIncidenteMsgError"); }