/// <summary> /// Muestra una notificación /// </summary> internal void ShowNotification(SystemControllerEnums.NotificationType type, string applicationName, string title, string message, TimeSpan expiration, string urlImage = null) { Windows.Data.Xml.Dom.XmlDocument xmlToast = new Windows.Data.Xml.Dom.XmlDocument(); // Carga el XML xmlToast.LoadXml(GetTemplate(title, message, GetUrlImage(type, urlImage))); // Muestra la notificación ShowNotification(xmlToast, applicationName); }
/// <summary> /// Muestra una notificación: si está marcada como error o si la configuración así lo permite /// </summary> public void ShowNotification(SystemControllerEnums.NotificationType type, string title, string message) { if (DbStudioViewsManager.ConfigurationController.ShowWindowNotifications || type == SystemControllerEnums.NotificationType.Error) { DbStudioViewsManager.MainWindowsController.HostController.SystemController.ShowNotification(type, title, message, TimeSpan.FromSeconds(5)); } else { DbStudioViewsManager.MainWindowsController.Logger.Default.LogItems.Add(new Libraries.LibLogger.Models.Log.LogModel(null, Libraries.LibLogger.Models.Log.LogModel.LogType.Info, title + ". " + message)); } }
/// <summary> /// Obtiene la URL de la imagen dependiendo del tipo /// </summary> private string GetUrlImage(SystemControllerEnums.NotificationType type, string urlImage) { return(string.Empty); /* * if (!string.IsNullOrWhiteSpace(urlImage)) * return urlImage; * else * switch (type) * { * case SystemControllerEnums.NotificationType.Error: * return "ms-appx:///Themes/Images/Error.png"; * case SystemControllerEnums.NotificationType.Warning: * return "ms-appx:///Themes/Images/Warning.png"; * case SystemControllerEnums.NotificationType.Other: * return "ms-appx:///Themes/Images/Info.png"; * default: * return "ms-appx:///Themes/Images/Info.png"; * } */ }
/// <summary> /// Muestra una notificación /// </summary> public virtual Task ShowNotificationAsync(SystemControllerEnums.NotificationType type, string title, string message, TimeSpan expiration, string urlImage = null) { throw new NotImplementedException(); }
/// <summary> /// Muestra una notificación /// </summary> public virtual void ShowNotification(SystemControllerEnums.NotificationType type, string title, string message, TimeSpan expiration, string urlImage = null) { ShowMessage(message); }
/// <summary> /// Muestra una notificación /// </summary> public async Task ShowNotificationAsync(SystemControllerEnums.NotificationType type, string title, string message, TimeSpan expiration, string urlImage = null) { // UserDialogs.Instance.Toast("Toast message: <3", TimeSpan.FromMilliseconds(millis)); await ShowMessageAsync(message); }
/// <summary> /// Muestra una notificación /// </summary> public virtual void ShowNotification(SystemControllerEnums.NotificationType type, string title, string message, TimeSpan expiration, string urlImage = null) { new Notifications.NotificationsManager().ShowNotification(type, ApplicationName, title, message, expiration, urlImage); }