public static RegistroDeIncidencias InsertarRegistroIncidencia(RegIncidenciaParams Params) { var incidencias = UtilsApp.GenerarXML(Params.REGLAS, Params.INFRACCIONES); var xmlIncidencias = Extensiones.SerializeToXml <UtilsApp.Incidencias>(incidencias); var puntosDescontados = UtilsApp.GenerarPuntos(Params.REGLAS, Params.INFRACCIONES); var parametros = SearchRec.ToSqlParams(new { ROTULO = Params.ROTULO, RNTT = Params.RNTT, FULL_NAME = Params.FULL_NAME, CEDULA = Params.CEDULA, EMPRESA = Params.EMPRESA, FECHA = Params.FECHA, INCIDENTES = xmlIncidencias.ToString(), DESCRIPCION = Params.DESCRIPCION, CREATED_BY = Params.CREATED_BY, CREATED_DATE = DateTime.Now, PUNTOS_DESCONTADOS = puntosDescontados }); var result = Database.DataServer.ExecReaderSelSP <RegistroDeIncidencias>("SP_InsertarRegistroIncidente", parametros); return(result.FirstOrDefault()); }
public static bool TryParse(string texto, out CambiarMapaAccion accion) { string[] partes = texto.Split('|'); string total_partes = partes[Extensiones.get_Nuevo_Random(0, partes.Length)]; Match match = Regex.Match(total_partes, @"(?<direccion>arriba|derecha|abajo|izquierda)\((?<celda>\d{1,3})\)"); if (match.Success) { accion = new CambiarMapaAccion((MapaTeleportCeldas)Enum.Parse(typeof(MapaTeleportCeldas), match.Groups["direccion"].Value, true), short.Parse(match.Groups["celda"].Value)); return(true); } else { match = Regex.Match(total_partes, @"(?<direccion>arriba|derecha|abajo|izquierda)"); if (match.Success) { accion = new CambiarMapaAccion((MapaTeleportCeldas)Enum.Parse(typeof(MapaTeleportCeldas), match.Groups["direccion"].Value, true), -1); return(true); } else { match = Regex.Match(total_partes, @"(?<celda>\d{1,3})"); if (match.Success) { accion = new CambiarMapaAccion(MapaTeleportCeldas.NINGUNO, short.Parse(match.Groups["celda"].Value)); return(true); } } } accion = null; return(false); }
public MenuExtensiones(IReadOnlyCollection <IExtensionMenu> extensiones, IProveedorExtensionMenuView proveedorExtensionMenuView) { Extensiones = extensiones ?? throw new ArgumentNullException(nameof(extensiones)); ProveedorExtensionMenuView = proveedorExtensionMenuView ?? throw new ArgumentNullException(nameof(proveedorExtensionMenuView)); ExtensionesViews = Extensiones.Select(proveedorExtensionMenuView.Para).ToArray(); ExtensionSeleccionada = ExtensionesViews.Select(e => e.Seleccionada.Select(s => (e.Extension, s))).Merge(); }
public bool ProcesarDependenciasCM(ProcesoDto ProcDto, string Ruta) { bool respuesta = false; ParseadorCM PCM = new ParseadorCM(); Proceso proc = new Proceso(); try { if (validadatos(ProcDto.UsuarioID, ProcDto.ProcesoID, Ruta)) { string Extensiones; DataTable ExtensionesApp = proc.Consultas(1, ProcDto.AplicacionID); if (ExtensionesApp == null || ExtensionesApp.Rows.Count < 1) { ErrLog.EscribeLogWS("No se encontraron los datos de lenguaje de la Aplicación"); ExtensionesApp = null; } else { DataRow Lenguaje = ExtensionesApp.Rows[0]; Extensiones = Lenguaje["Extensiones"].ToString(); string[] extArray = Extensiones.ToLower().Split(','); List <string> Archivos = new List <string>(); foreach (string Extension in extArray) { string tipo = "*." + Extension; string[] ArchivosArray = Directory.GetFiles(Ruta, tipo, SearchOption.AllDirectories); for (int i = 0; i <= ArchivosArray.Count() - 1; i++) { Archivos.Add(ArchivosArray[i].ToString()); } } HashSet <string> InventarioCM = new HashSet <string>(); foreach (string Archivo in Archivos) { InventarioCM = PCM.GenerarInventarioCM(Archivo, ProcDto); } ProcesoAvanceDto pdtoA = new ProcesoAvanceDto(); proc.SeteaAvance("En Proceso", "OK", "OK", "72", "70", "", "Inventario CM Generado", pdtoA, ProcDto); proc.ActualizaProcesoAvance(pdtoA, ProcDto); PCM.GenerarSalidaCM(InventarioCM, Archivos, ProcDto.AplicacionID.ToString(), ProcDto); proc.SeteaAvance("Terminado", "OK", "OK", "OK", "OK", "", "Parseo Terminado", pdtoA, ProcDto); proc.ActualizaProcesoAvance(pdtoA, ProcDto); respuesta = true; } } } catch (Exception Err) { ErrLog.EscribeLogWS("WSDependencias.ProcesaDependenciasCM " + Err.Message.ToString()); } return(respuesta); }
public JsonResult InsertUser(Dictionary <string, object> data) { RespGeneric resp = new RespGeneric("KO"); try { //comprobar formato correcto de email String expresion; expresion = "\\w+([-+.']\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*"; if (Regex.IsMatch(Convert.ToString(data["email"]), expresion)) { if (Regex.Replace(Convert.ToString(data["email"]), expresion, String.Empty).Length == 0) { //comprobar si usuario que se va a crear esta en la base de datos if (Webapp.Data.Empleados.getByEmail(data["email"].ToString()) == null) { //funcion que genera un codigo alfanumerico aleatorio e irrepetib int longitud = 7; Guid miGuid = Guid.NewGuid(); string token = Convert.ToBase64String(miGuid.ToByteArray()); token = token.Replace("=", "").Replace("+", ""); Console.WriteLine(token.Substring(0, longitud)); data.Add("invitacion", token); Webapp.Data.Empleados.InsertUser(data); resp.cod = "OK"; //enviar email a la direccion email dentro del data Extensiones.sendEmail(to: (Convert.ToString(data["email"])), subject: (Convert.ToString(data["invitacion"])), body: "Introduce el codigo que te hemos enviado junto con tus datos para finalizar el registro <a href=http://localhost:51934/Account/FormularioRegistro> link de registro </a> ", file: ""); } else { resp.msg = "Ya existe un usuario con ese Email"; } } else { resp.msg = "El Email no es Valido"; } } else { resp.msg = "El Email no es Valido"; } } catch (Exception e) { if (e.Message != "") { resp.msg = e.Message; } } return(Json(resp)); }
public async Task <IActionResult> Post(TransaccionDtoRequest transaccionDtoRequest) { var resultadoValidacion = Extensiones.MonedaValida(transaccionDtoRequest.MonedaCompra); if (!string.IsNullOrWhiteSpace(resultadoValidacion)) { _logger.LogError(resultadoValidacion); return(BadRequest(resultadoValidacion)); } if (await _transaccionMoneda.GenerarTransaccion(transaccionDtoRequest)) { return(Ok()); } return(BadRequest()); }
public List <PresupuestoMaterialBE> PresupuestosFerreterias(int IdObra, decimal Area, string Latitud, string Longitud, int IdEstablecimiento) { try { var lista = new List <PresupuestoMaterialBE>(); var reader = db.Database.SqlQuery <sp_PresupuestoMaterial_Result>("sp_PresupuestoMaterial @param1, @param2, @param3,@param4", new SqlParameter("param1", Area), new SqlParameter("param2", IdObra), new SqlParameter("param3", Latitud), new SqlParameter("param4", Longitud) ); foreach (var item in reader) { var PresupuestoMaterialBE = new PresupuestoMaterialBE() { EstablecimientoBE = new EstablecimientoBE() { IdEstablecimiento = item.IdEstablecimiento, NombreComercial = item.NombreComercial, RazonSocial = item.RazonSocial, Direccion = item.Direccion, Latitud = item.Latitud, Longitud = item.Longitud, RUC = item.RUC }, SubTotal = (decimal)item.SubTotal, }; lista.Add(PresupuestoMaterialBE); } List <PresupuestoMaterialBE> lista2 = new List <PresupuestoMaterialBE>(); if (IdEstablecimiento == 0) { float lat = float.Parse(Latitud, CultureInfo.InvariantCulture); float longit = float.Parse(Longitud, CultureInfo.InvariantCulture); lista2 = lista.OrderBy(t => Extensiones.DistanciaKm(new Posicion(lat, longit), new Posicion(float.Parse(t.EstablecimientoBE.Latitud, CultureInfo.InvariantCulture), float.Parse(t.EstablecimientoBE.Longitud, CultureInfo.InvariantCulture)))).Take(5).ToList(); } else { lista2 = lista.Where(t => t.EstablecimientoBE.IdEstablecimiento == IdEstablecimiento).ToList(); } return(lista2.OrderBy(t => t.SubTotal).ToList()); } catch (Exception ex) { throw ex; } }
public static Recompensas EntregarRecompensa(EntregarRecompensaParams e) { var recompensas = UtilsApp.GenerarXMLRecompensas(e.RECOMPENSAS); var xmlRecompesas = Extensiones.SerializeToXml <UtilsApp.Recompensas>(recompensas); var parametros = SearchRec.ToSqlParams(new { RNTT = e.RNTT, RECOMPENSAS = xmlRecompesas.ToString(), PUNTOS_RECOMPENSAS_T = e.PUNTOS_TOTALES, CREATED_DATE = DateTime.Now, CREATED_BY = e.CREATED_BY }); var result = Database.DataServer.ExecReaderSelSP <Recompensas>("SP_EntregarRecompensa", parametros); return(result.FirstOrDefault()); }
public JsonResult forgotPass(Dictionary <string, object> data) { RespGeneric resp = new RespGeneric("KO"); //comprobar formato correcto de email String expresion; expresion = "\\w+([-+.']\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*"; if (Regex.IsMatch(Convert.ToString(data["email"]), expresion)) { if (Regex.Replace(Convert.ToString(data["email"]), expresion, String.Empty).Length == 0) { if (Webapp.Data.Empleados.getByEmail(data["email"].ToString()) != null) { //funcion que genera un codigo alfanumerico aleatorio e irrepetible int longitud = 4; Guid miGuid = Guid.NewGuid(); string token = Convert.ToBase64String(miGuid.ToByteArray()); token = token.Replace("=", "").Replace("+", ""); Console.WriteLine(token.Substring(0, longitud)); data.Add("codigo", token); resp.cod = "OK"; //insertar codigo olvidar contraseña en la bd Webapp.Data.Empleados.InsertCodigoPass(data); //enviar correo Extensiones.sendEmail(to: (Convert.ToString(data["email"])), subject: (Convert.ToString(data["codigo"])), body: "Introduce el codigo que te hemos enviado para restablecer tu contraseña <a href=http://localhost:51934/Account/ForgotPass> link de registro </a> ", file: ""); } else { //correo no encontrado resp.msg = "correo electronico no encontrado"; }; } else { //correo electronico no valido resp.msg = "correo electronico no valido"; }; } return(Json(resp)); }
public static CambiosRegistroUpdate UpdateRegistroIncidencia(UpdateRegistroParams cc) { var cambios = UtilsApp.GenerarXMLCambiosRegistro(cc.CambiosList); var xmlCambios = Extensiones.SerializeToXml <CambiosRegistroUpdate>(cambios); var parametros = SearchRec.ToSqlParams(new { cc.ID_REGISTRO, cc.ROTULO, cc.FECHA_INCIDENTE, cc.DESCRIPCION, CAMBIOS = xmlCambios.ToString(), cc.USER }); var result = Database.DataServer.ExecReaderSelSP <CambiosRegistroUpdate>("SP_UpdateRegistro", parametros); return(result.FirstOrDefault()); }
public async Task <IActionResult> GetCotizacion(string moneda) { var resultadoValidacion = Extensiones.MonedaValida(moneda); if (!string.IsNullOrWhiteSpace(resultadoValidacion)) { _logger.LogError(resultadoValidacion); throw new Exception(resultadoValidacion); } var cotizacion = await _cotizacionMoneda.GetCotizacion(moneda); if (cotizacion == null) { return(NoContent()); } return(Ok(cotizacion)); }
private HechizoStats get_Datos_Hechizo(int id_hechizo, int nivel_hechizo) { XElement xml = XElement.Parse(Resources.hechizos); HechizoStats hechizo_stats = new HechizoStats(); List <string> datos_hechizo = Extensiones.get_Dividir_Matrices(xml.Elements("HECHIZO").Where(e => int.Parse(e.Element("id").Value) == id_hechizo).Elements("nivel" + nivel_hechizo).Select(e => e.Value).FirstOrDefault(), '[', ']', ','); hechizo_stats.coste_pa = datos_hechizo[2] == "null" ? Convert.ToByte(0) : byte.Parse(datos_hechizo[2]); hechizo_stats.alcanze_minimo = datos_hechizo[3] == "null" ? Convert.ToByte(0) : byte.Parse(datos_hechizo[3]); hechizo_stats.alcanze_maximo = datos_hechizo[4] == "null" ? Convert.ToByte(0) : byte.Parse(datos_hechizo[4]); hechizo_stats.es_lanzado_linea = datos_hechizo[7] == "null" ? false : bool.Parse(datos_hechizo[7]); hechizo_stats.es_lanzado_con_vision = datos_hechizo[8] == "null" ? false : bool.Parse(datos_hechizo[8]); hechizo_stats.es_celda_vacia = datos_hechizo[9] == "null" ? false : bool.Parse(datos_hechizo[9]); hechizo_stats.es_alcanze_modificable = datos_hechizo[10] == "null" ? false : bool.Parse(datos_hechizo[10]); hechizo_stats.lanzamientos_por_turno = datos_hechizo[12] == "null" ? Convert.ToByte(0) : byte.Parse(datos_hechizo[12]); hechizo_stats.lanzamientos_por_objetivo = datos_hechizo[13] == "null" ? Convert.ToByte(0) : byte.Parse(datos_hechizo[13]); hechizo_stats.intervalo = datos_hechizo[14] == "null" ? Convert.ToByte(0) : byte.Parse(datos_hechizo[14]); hechizo_stats.areaAfectados = datos_hechizo[15] == "null" ? new Zonas[0] : Zonas.get_Analizar_Zonas(datos_hechizo[15]); return(hechizo_stats); }
public bool get_Cambiar_Mapa(MapaTeleportCeldas direccion) { if (cuenta.esta_ocupado || personaje.inventario.porcentaje_pods >= 100) { return(false); } List <Celda> celdas_teleport = cuenta.juego.mapa.celdas.Where(celda => celda.es_Teleport()).ToList(); while (celdas_teleport.Count > 0) { Celda celda = celdas_teleport[Extensiones.get_Nuevo_Random(0, celdas_teleport.Count)]; if (get_Cambiar_Mapa(direccion, celda)) { return(true); } celdas_teleport.Remove(celda); } return(false); }
public JsonResult envioEmail(Dictionary <string, object> email) { RespGeneric resp = new RespGeneric("KO"); resp.msg = string.Empty; if (string.IsNullOrEmpty(resp.msg)) { try { //enviar email a la direccion email dentro del data Extensiones.envioEmail(to: (Convert.ToString(email["email"])), subject: (Convert.ToString(email["invitacion"])), body: "Introduce el codigo que te hemos enviado junto con tus datos para finalizar el registro <a href=http://localhost:51934/Account/FormularioRegistro> link de registro </a> ", file: ""); resp.d.Add("email", Data.Vacaciones.envioEmail(email)); resp.cod = "OK"; } catch (Exception e) { resp.msg = e.Message; } } return(Json(resp)); }
private void Inicializar(Archivos archivo, string seccion, string tipoaventura, int?indice, PanelMostrarArchivos mostrararchivos = null) { NombreArchivo = archivo.NombreArchivo; DireccionArchivo = archivo.Direccion; if (File.Exists(DireccionArchivo)) { BotonUbicacion.IsEnabled = true; ImagenUbicacion.Source = new BitmapImage(new Uri("/Images/icons/icons8-folder.png", UriKind.Relative)); } else { BotonUbicacion.IsEnabled = false; ImagenUbicacion.Source = new BitmapImage(new Uri("/Images/icons/icons8-lock.png", UriKind.Relative)); } UrlArchivo = archivo.Url; if (ComprobarUrl().Result) { BotonUrl.IsEnabled = true; ImagenUrl.Source = new BitmapImage(new Uri("/Images/icons/icons8-web.png", UriKind.Relative)); } else { BotonUrl.IsEnabled = false; ImagenUrl.Source = new BitmapImage(new Uri("/Images/icons/icons8-lock.png", UriKind.Relative)); } IconoExtension.Source = Extensiones.IconoExtension(archivo.Extension); IconoExtension.Width = 35; Extension = archivo.Extension; this.Seccion = seccion; this.TipoAventura = tipoaventura; this.Indice = indice.Value; this.MostrarArchivos = mostrararchivos; }
public List <EstablecimientoBE> Listar(string Latitud, string Longitud) { float lat = float.Parse(Latitud, CultureInfo.InvariantCulture); float longit = float.Parse(Longitud, CultureInfo.InvariantCulture); var lista = (from t in db.SG_Establecimiento where (t.Latitud != null && !t.Latitud.Equals("")) && (t.Longitud != null && !t.Longitud.Equals("")) select new EstablecimientoBE() { IdEstablecimiento = t.IdEstablecimiento, RazonSocial = t.RazonSocial, NombreComercial = t.NombreComercial, Latitud = t.Latitud, Longitud = t.Longitud, Direccion = t.Direccion, }).ToList(); var lista2 = lista.Where(t => Extensiones.DistanciaKm(new Posicion(lat, longit), new Posicion(float.Parse(t.Latitud, CultureInfo.InvariantCulture), float.Parse(t.Longitud, CultureInfo.InvariantCulture))) < 7).ToList(); return(lista2); }
private void SetMyLayerBase(Window owner, object content, string title, MyLayerOptions options, bool isDiaglog, Action action) { if (options == null) { options = MYUI.DefaultAyLayerOptions; } _options = options; this.Title = title ?? ""; //this.Topmost = true; //this.ShowInTaskbar = true; //if (owner != null) //{ // Owner = owner; //} Owner = owner ?? Application.Current.MainWindow; //userPresenter.Content = content; var fram = content as FrameworkElement; if (fram != null) { userPresenter.Width = fram.Width; userPresenter.Height = fram.Height; } if (options.CanDrag) { MouseDragElementBehavior m = new MouseDragElementBehavior(); m.Attach(body); //body.MouseMove += new MouseEventHandler(Element_MouseMove); //body.MouseLeftButtonDown += new MouseButtonEventHandler(Element_MouseLeftButtonDown); //body.MouseLeftButtonUp += new MouseButtonEventHandler(Element_MouseLeftButtonUp); } if (options.IsContainsTitleBar) { d.Height = Extensiones.ToGridLength("42.00"); Border b = new Border(); if (options.LayerCornerRadius.HasValue) { b.Margin = new Thickness(-1, -1, -1, 0); b.CornerRadius = new CornerRadius(options.LayerCornerRadius.Value.TopLeft, options.LayerCornerRadius.Value.TopRight, 0, 0); } b.HorizontalAlignment = HorizontalAlignment.Stretch; b.VerticalAlignment = VerticalAlignment.Stretch; //b.SetResourceReference(Border.BackgroundProperty, Colors.CadetBlue); b.Background = SolidColorBrushConverter.From16JinZhi("#F0F1F2"); Grid g = new Grid(); if (!string.IsNullOrWhiteSpace(title)) { TextBlock tb = new TextBlock(); tb.Width = 200; tb.VerticalAlignment = VerticalAlignment.Center; tb.HorizontalAlignment = HorizontalAlignment.Left; tb.Margin = new Thickness(10, 0, 0, 0); tb.TextWrapping = TextWrapping.NoWrap; tb.FontSize = 14; tb.TextTrimming = TextTrimming.CharacterEllipsis; //tb.Foreground = SolidColorBrushConverter.From16JinZhi("#99FFFFFF"); Binding binding = new Binding { Path = new PropertyPath("Title"), Source = this, Mode = BindingMode.TwoWay }; tb.SetBinding(TextBlock.TextProperty, binding); g.Children.Add(tb); } MyImageButton ab = new MyImageButton(); ab.RenderMode = MyImageButtonMode.HorizonFour; ab.SnapsToDevicePixels = true; ab.Margin = new Thickness(0, 0, 10, 0); ab.Height = ab.Width = 26; ab.VerticalAlignment = VerticalAlignment.Center; ab.HorizontalAlignment = HorizontalAlignment.Right; ab.Padding = new Thickness(0); ab.Icon = new BitmapImage(new Uri("pack://application:,,,/MyWPFUI;component/Resources/Images/closebtn.png")); ab.Click += closewindow_Click; ab.VerticalContentAlignment = VerticalAlignment.Center; ab.HorizontalContentAlignment = HorizontalAlignment.Center; //ab.Foreground = SolidColorBrushConverter.From16JinZhi("#99FFFFFF"); //ab.Content = "关闭"; g.Children.Add(ab); b.Child = g; bodyConent.Children.Add(b); } Console.WriteLine("开始触发options.MaskBrush"); if (options.MaskBrush.IsNotNull()) { layoutMain.Background = options.MaskBrush; } if (isDiaglog) { if (options.MaskBrush.IsNull()) { layoutMain.Background = SolidColorBrushConverter.From16JinZhi("#05FFFFFF"); } layoutMain.MouseLeftButtonDown += LayoutMain_MouseLeftButtonDown; } Console.WriteLine("开始触发options.IsShowLayerBorder"); if (options.IsShowLayerBorder) { body.SetResourceReference(Border.BorderBrushProperty, "Ay.Brush14"); if (options.LayerBorderThickness.HasValue) { body.BorderThickness = options.LayerBorderThickness.Value; } else { body.BorderThickness = new Thickness(1); } } Console.WriteLine("开始触发options.LayerCornerRadius"); if (options.LayerCornerRadius.HasValue) { body.CornerRadius = options.LayerCornerRadius.Value; } options.LayerBackground.Freeze(); body.Background = options.LayerBackground; Console.WriteLine("开始触发options.ShowAnimateIndex"); if (options.ShowAnimateIndex == 0) { ShowShadow(options); body.Visibility = Visibility.Visible; this.ContentRendered += (e, f) => { userPresenter.Content = content; if (action != null) { MyTime.SetTimeout(20, action); } }; } else if (options.ShowAnimateIndex == 1) { var sc = new MyAniScale(body, () => { ShowShadow(options); }); sc.AnimateSpeed = 750; sc.ScaleXFrom = 0; sc.ScaleYFrom = 0; sc.ScaleXTo = 1; sc.ScaleYTo = 1; sc.EasingFunction = new System.Windows.Media.Animation.CubicEase { EasingMode = EasingMode.EaseOut }; sc.Animate().End(); sc.story.Completed += (c, d) => { userPresenter.Content = content; if (action != null) { MyTime.SetTimeout(20, action); } }; } else if (options.ShowAnimateIndex == 2) { var sc = new MyAniSlideInDown(body, () => { ShowShadow(options); }); sc.AnimateSpeed = 750; sc.FromDistance = -4000; sc.OpacityNeed = false; sc.EasingFunction = new System.Windows.Media.Animation.CubicEase { EasingMode = EasingMode.EaseOut }; sc.Animate().End(); sc.story.Completed += (c, d) => { userPresenter.Content = content; if (action != null) { MyTime.SetTimeout(20, action); } }; } else if (options.ShowAnimateIndex == 3) { var sc = new MyAniSlideInUp(body, () => { ShowShadow(options); }); sc.AnimateSpeed = 750; sc.FromDistance = 4000; sc.OpacityNeed = false; sc.EasingFunction = new System.Windows.Media.Animation.CubicEase { EasingMode = EasingMode.EaseOut }; sc.Animate().End(); sc.story.Completed += (c, d) => { userPresenter.Content = content; if (action != null) { MyTime.SetTimeout(20, action); } }; } else if (options.ShowAnimateIndex == 4) { var sc = new MyAniSlideInLeft(body, () => { ShowShadow(options); }); sc.AnimateSpeed = 750; sc.FromDistance = -4000; sc.OpacityNeed = false; sc.EasingFunction = new System.Windows.Media.Animation.CubicEase { EasingMode = EasingMode.EaseOut }; sc.Animate().End(); sc.story.Completed += (c, d) => { userPresenter.Content = content; if (action != null) { MyTime.SetTimeout(20, action); } }; } else if (options.ShowAnimateIndex == 5) { var sc = new MyAniSlideInRight(body, () => { ShowShadow(options); }); sc.AnimateSpeed = 750; sc.FromDistance = 4000; sc.OpacityNeed = false; sc.EasingFunction = new System.Windows.Media.Animation.CubicEase { EasingMode = EasingMode.EaseOut }; sc.Animate().End(); sc.story.Completed += (c, d) => { userPresenter.Content = content; if (action != null) { MyTime.SetTimeout(20, action); } }; } else if (options.ShowAnimateIndex == 6) { var sc = new MyAniBounceInDown(body, () => { ShowShadow(options); }); sc.Animate().End(); sc.story.Completed += (c, d) => { userPresenter.Content = content; if (action != null) { MyTime.SetTimeout(20, action); } }; } else if (options.ShowAnimateIndex == 7) { var sc = new MyAniBounceInUp(body, () => { ShowShadow(options); }); sc.Animate().End(); sc.story.Completed += (c, d) => { userPresenter.Content = content; if (action != null) { MyTime.SetTimeout(20, action); } }; } else if (options.ShowAnimateIndex == 8) { var sc = new MyAniBounceInLeft(body, () => { ShowShadow(options); }); sc.Animate().End(); sc.story.Completed += (c, d) => { userPresenter.Content = content; if (action != null) { MyTime.SetTimeout(20, action); } }; } else if (options.ShowAnimateIndex == 9) { var sc = new MyAniBounceInRight(body, () => { ShowShadow(options); }); sc.Animate().End(); sc.story.Completed += (c, d) => { userPresenter.Content = content; if (action != null) { MyTime.SetTimeout(20, action); } }; } else if (options.ShowAnimateIndex == 10) { var sc = new MyAniRotateIn(body, () => { ShowShadow(options); }); sc.AnimateSpeed = 750; sc.EasingFunction = new System.Windows.Media.Animation.CubicEase { EasingMode = EasingMode.EaseOut }; sc.Animate().End(); sc.story.Completed += (c, d) => { userPresenter.Content = content; if (action != null) { MyTime.SetTimeout(20, action); } }; } else if (options.ShowAnimateIndex == 11) { var sc = new MyAniBounceIn(body, () => { ShowShadow(options); }); sc.AnimateSpeed = 750; sc.Animate().End(); sc.story.Completed += (c, d) => { userPresenter.Content = content; if (action != null) { MyTime.SetTimeout(20, action); } }; } //else if (options.ShowAnimateIndex == 12) //{ // var sc = new MyAniSlideOutDown(body, () => // { // ShowShadow(options); // }); // sc.AnimateSpeed = 750; // sc.Animate().End(); // sc.story.Completed += (c, d) => // { // userPresenter.Content = content; // if (action != null) // MyTime.SetTimeout(20, action); // }; //} //else if (options.ShowAnimateIndex == 13) //{ // var sc = new MyAniSlideOutRight(body, () => // { // ShowShadow(options); // }); // sc.AnimateSpeed = 750; // sc.Animate().End(); // sc.story.Completed += (c, d) => // { // userPresenter.Content = content; // if (action != null) // MyTime.SetTimeout(20, action); // }; //} //else if (options.ShowAnimateIndex == 14) //{ // var sc = new MyAniSlideOutUp(body, () => // { // ShowShadow(options); // }); // sc.AnimateSpeed = 750; // sc.Animate().End(); // sc.story.Completed += (c, d) => // { // userPresenter.Content = content; // if (action != null) // MyTime.SetTimeout(20, action); // }; //} //else if (options.ShowAnimateIndex == 15) //{ // var sc = new MyAniSlideOutLeft(body, () => // { // ShowShadow(options); // }); // sc.AnimateSpeed = 750; // sc.Animate().End(); // sc.story.Completed += (c, d) => // { // userPresenter.Content = content; // if (action != null) // MyTime.SetTimeout(20, action); // }; //} }