private async void ServiceCallback_AuthorizedEvent(DeviceModel device) { await Dispatcher.RunTaskAsync(async() => { var d = new MessageDialog("SUCCESS"); await d.ShowAsync(); var list = await Proxy.GetAllEmployeesByDevice(); foreach (var item in list) { Employees.Add(item); } }); await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { this.IsEnabled = true; DisableLoadingControl(); if (device.Employee != null) { NotificationControl.Show($"Willkommen, {device.Employee.Alias}", 3500); SetCurrentEmployee(device.Employee); Proxy.Device = device; } if (device.Division != null) { SetCurrentDivision(device.Division); } }); }
private async void ButtonReload_Click(object sender, RoutedEventArgs e) { if (PlantOrder != null && DivisionComboBox.SelectedItem is DivisionModel division) { await GetElements(PlantOrder, division); NotificationControl.Show($"{PlantOrder.Number} - {PlantOrder.Name} - {PlantOrder.Section} wurde aktualisiert", 3500); } }
protected void Confirmbtn_Click(object sender, EventArgs e) { NotificationControl.NewNoteHeader = "Ooppsss....."; NotificationControl.NewMessage = "Are you sure you want to do this?"; NotificationControl.NoteVisible = true; NotificationControl.ConfirmNotification(); // Confirmbtn.Text =(NotificationControl.IsConfirmStatus == true) ? "True" : "False"; }
public NotificationControl() { if (instance != null) { throw(new System.Exception("Cannot create NotificationControl: Only one NotificationControl may exist!")); } instance = this; }
private async Task GetElements(PlantOrderModel plantOrder, DivisionModel division) { PlantOrder = plantOrder; List <ElementModel> elements; var filters = await Proxy.GetFiltersAsync(plantOrder.Id, CurrentEmployee.EmployeeId); FilterCollection.Load(filters); if (division.DivisionType.DivisionType == Contracts.Domain.Core.Enums.DivisionType.Profile) { elements = await Proxy.GetElementProfiles(plantOrder.Id, division.DivisionId); DataGridElementView.Columns[2].Header = "Profil"; } else { elements = await Proxy.GetElements(); DataGridElementView.Columns[2].Header = "Position"; foreach (var element in elements) { element.Contraction = (element.Count % 2 == 0) ? "Bl" : "Fl"; Random rnd = new Random(); element.Amount = Math.Round(rnd.NextDouble() * element.Count); } } for (int i = 0; i < DivisionComboBox.Items.Count; i++) { if (DivisionComboBox.Items[i] is DivisionModel item) { if (item.DivisionId == division.DivisionId) { DivisionComboBox.SelectedIndex = i; break; } } } PlantOrderHeaderText.Text = string.Format("{0:s} - {1:s} - {2:s} - {3:s}", plantOrder.Number, plantOrder.Name, plantOrder.Section, plantOrder.Description); LastRefreshText.Text = DateTime.Now.ToString("hh:mm:ss - ddd d MMM", CultureInfo.CreateSpecificCulture("de-DE")); var session = new ElementViewSession() { Divison = division, PlantOder = plantOrder }; if (await ElementViewSession.SaveAsync(session) == false) { NotificationControl.Show("Die aktuelle Sitzung konnte nicht gespeichert werden", 4000); } ElementCollection.Load(elements); }
private void AddNotificationToUi(ReminderData notification) { NotificationControl ctrl = new NotificationControl(); NotificationViewModel nvm = new NotificationViewModel(notification); nvm.OnRequireConfiguration += OpenEditor; nvm.OnRequireDeletion += RemoveReminding; ctrl.DataContext = nvm; _notifications.Add(ctrl); }
private bool InternetStatus() { switch (Global.CheckInternetConnection()) { case "None": if (MeteredNotification != null && MeteredNotification.GetHeight() > 0) { MeteredNotification.DestroyNotification(); } if (NoInternetConnection == null) { NoInternetConnection = this.Notifications.CreateNotification("NoInternetNotification", "No internet connection", "Error", false); } if (NoInternetConnection != null && NoInternetConnection.GetHeight() == 0) { NoInternetConnection.ShowNotification(); } return(false); case "Metered": if (NoInternetConnection != null && NoInternetConnection.GetHeight() > 0) { NoInternetConnection.DestroyNotification(); } if (ConnectionDismiss == false) { if (MeteredNotification == null) { MeteredNotification = this.Notifications.CreateNotification("MeteredNotification", "On metered connection", "Warning"); } if (MeteredNotification != null && MeteredNotification.GetHeight() == 0) { MeteredNotification.ShowNotification(); } } break; case "Wifi": ConnectionDismiss = false; if (NoInternetConnection != null && NoInternetConnection.GetHeight() > 0) { NoInternetConnection.DestroyNotification(); } if (MeteredNotification != null && MeteredNotification.GetHeight() > 0) { MeteredNotification.DestroyNotification(); } break; default: break; } return(true); }
void Awake() { if (SceneInstance == null) { SceneInstance = this; } else { Destroy(this); } }
// Constructor public App() { // Global handler for uncaught exceptions. UnhandledException += Application_UnhandledException; // Standard Silverlight initialization InitializeComponent(); // Change default styles InitializeStyleChanges(); // Phone-specific initialization InitializePhoneApplication(); // Set the template for the RootFrame to the new template we created in the Application.Resources in App.xaml RootFrame.Template = Resources["NewFrameTemplate"] as ControlTemplate; RootFrame.ApplyTemplate(); NotificationPopup = (VisualTreeHelper.GetChild(RootFrame, 0) as FrameworkElement).FindName("notifyControl") as NotificationControl; NotificationPopup.CloseRequested += NotificationPopup_CloseRequested; // Show graphics profiling information while debugging. if (System.Diagnostics.Debugger.IsAttached) { // Display the current frame rate counters. //Application.Current.Host.Settings.EnableFrameRateCounter = true; // Show the areas of the app that are being redrawn in each frame. //Application.Current.Host.Settings.EnableRedrawRegions = true; // Enable non-production analysis visualization mode, // which shows areas of a page that are handed off to GPU with a colored overlay. //Application.Current.Host.Settings.EnableCacheVisualization = true; // Disable the application idle detection by setting the UserIdleDetectionMode property of the // application's PhoneApplicationService object to Disabled. // Caution:- Use this under debug mode only. Application that disable user idle detection will continue to run // and consume battery power when the user is not using the phone. PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled; //Application.Current.Host.Settings.EnableCacheVisualization = true; //Application.Current.Host.Settings.EnableRedrawRegions = true; } #if DEBUG SetupMockIAP(); #endif //SharingViewModel.Instance.UIDispatcher = (a) => RootFrame.Dispatcher.BeginInvoke(a); }
protected void Checkbtn_Click(object sender, EventArgs e) { NotificationControl.NoteType = "error"; NotificationControl.NewNoteHeader = "Oopss....."; NotificationControl.NewMessage = "it works"; NotificationControl.NoteVisible = true; NotificationControl.ShowNotification(); //NotificationControl //notificationdiv.Visible = true; // notediv.Visible = true; //notediv.Attributes["class"]= "alert alert-danger alert-dismissible fade show"; //notediv.InnerHtml = "<button type='button' class='close' data-dismiss='alert' aria-label='Close'><span aria-hidden='true'>×</span></button> <strong> Holy guacamole!</strong> You should check in on some of those fields below."; }
public static NotificationControl CreateNotification(this StackPanel StackPanel, string Name, string Text, string Type = "Success", bool Dismissable = true) { NotificationControl notification = new NotificationControl(); notification.Name = Name; notification.Text = Text; notification.Type = Type; notification.Dismissable = Dismissable; notification.ParentType = "StackPanel"; StackPanel.Children.Add(notification); return(notification); }
private void ClientServiceOnRecievedNotificationEvent(NotificationObservable notificationObservable) { Current.Dispatcher.Invoke(delegate { var notification = new NotificationControl { Sender = notificationObservable.Sender.Substring(5) + " - " + notificationObservable.DateSent, Subject = notificationObservable.Subject, NotificationId = notificationObservable.Id }; _notifyIcon.ShowCustomBalloon(notification, PopupAnimation.Slide, 6000); _clientService.ConfirmNotified(notificationObservable.Id); }); }
private async Task ElementAmountChanged(ElementModel element, double newAmount) { var result = await Proxy.UpdateProfileAmount(element.Id, newAmount); if (result > 0) { element.Amount = result; NotificationControl.Show($"Von '{element.Position}' sind nun '{result}' fertiggemeldet", 6000); } else { var dialog = new InfoDialog($"Der Vorgang konnte nicht ausgeführt werden.", "Information", InfoDialogType.Error); await dialog.ShowAsync(); } }
private void ShowNofificationMessage(string message, bool error = false) { if (error) { NotificationTextSuccess.Visibility = Visibility.Collapsed; NotificationTextFailed.Visibility = Visibility.Visible; } else { NotificationTextFailed.Visibility = Visibility.Collapsed; NotificationTextSuccess.Visibility = Visibility.Visible; } NotificationText.Text = message; NotificationControl.Show(3500); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { notificationControl = new NotificationControl(); if (Request.Form["check"] == null) { notificationRepeater.DataSource = notificationControl.NotificationList; notificationRepeater.DataBind(); notificationControl.SetToReadAll(); } else { Response.Write(notificationControl.GetTotalUnread()); } } }
/// <summary> /// Constructor for the Application object. /// </summary> public App() { // Global handler for uncaught exceptions. UnhandledException += Application_UnhandledException; // Standard XAML initialization InitializeComponent(); // Phone-specific initialization InitializePhoneApplication(); // Set the template for the RootFrame to the new template we created in the Application.Resources in App.xaml RootFrame.Template = Resources["NewFrameTemplate"] as ControlTemplate; RootFrame.ApplyTemplate(); NotificationPopup = (VisualTreeHelper.GetChild(RootFrame, 0) as FrameworkElement).FindName("notifyControl") as NotificationControl; NotificationPopup.CloseRequested += NotificationPopup_CloseRequested; // Language display initialization InitializeLanguage(); // Show graphics profiling information while debugging. if (Debugger.IsAttached) { // Display the current frame rate counters. Application.Current.Host.Settings.EnableFrameRateCounter = false; // Show the areas of the app that are being redrawn in each frame. //Application.Current.Host.Settings.EnableRedrawRegions = true; // Enable non-production analysis visualization mode, // which shows areas of a page that are handed off to GPU with a colored overlay. //Application.Current.Host.Settings.EnableCacheVisualization = true; // Prevent the screen from turning off while under the debugger by disabling // the application's idle detection. // Caution:- Use this under debug mode only. Application that disables user idle detection will continue to run // and consume battery power when the user is not using the phone. PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled; } SharingViewModel.Instance.UIDispatcher = (a) => RootFrame.Dispatcher.BeginInvoke(a); }
private void FrmCLI_Load(object sender, EventArgs e) { var notificationControl = new NotificationControl(); this.Controls.Add(_progressbarMain); this.Controls.Add(notificationControl); this.Width = (this.Width - this.ClientSize.Width) + _progressbarMain.Width; this.Height = (this.Height - this.ClientSize.Height) + _progressbarMain.Height; this.Text = "Exporting..."; this.Icon = BrandingManager.MainForm_Icon; this.StartPosition = FormStartPosition.Manual; var firstNetfabbProcess = Process.GetProcessesByName("netfabb").FirstOrDefault(); //develop if (firstNetfabbProcess == null) { firstNetfabbProcess = Process.GetProcessesByName("autodesknetfabb_debug").FirstOrDefault(); } if (firstNetfabbProcess != null) { foreach (var handle in NATIVE.EnumerateProcessWindowHandles(firstNetfabbProcess.Id)) { var windowTextLength = NATIVE.GetWindowTextLength(handle); var windowText = new StringBuilder(windowTextLength + 1); NATIVE.GetWindowText(handle, windowText, windowTextLength); if (windowText.ToString().ToLower().Contains("autodesk netfabb")) { var windowInfo = new NATIVE.WINDOWINFO(); var result = NATIVE.GetWindowInfo(handle, ref windowInfo); this.Left = windowInfo.rcClient.Left + ((windowInfo.rcWindow.Right - windowInfo.rcWindow.Left) / 2) - (this.Width / 2); this.Top = windowInfo.rcWindow.Top + ((windowInfo.rcWindow.Bottom - windowInfo.rcWindow.Top) / 2) + (this.Height / 2); break; } } } }
public static void DestroyNotification(this NotificationControl Notification) { Notification.DestroyNotification(null, null); Notification = null; }
/// <summary> /// Invoked when the application is launched normally by the end user. Other entry points /// will be used when the application is launched to open a specific file, to display /// search results, and so forth. /// </summary> /// <param name="args">Details about the launch request and process.</param> protected override void OnLaunched(LaunchActivatedEventArgs args) { if (Window.Current.Content == null) { RootFrame = new Frame(); // Set the template for the RootFrame to the new template we created in the Application.Resources in App.xaml RootFrame.Template = Resources["NewFrameTemplate"] as ControlTemplate; RootFrame.ApplyTemplate(); NotificationPopup = (VisualTreeHelper.GetChild(RootFrame, 0) as FrameworkElement).FindName("notifyControl") as NotificationControl; NotificationPopup.CloseRequested += NotificationPopup_CloseRequested; RootFrame.Navigate(typeof(AlbumsView), args); Window.Current.Content = RootFrame; } else { RootFrame = Window.Current.Content as Frame; RootFrame.Navigate(typeof(AlbumsView), args); } // Ensure the current window is active Window.Current.Activate(); }
public static void Initialize(NotificationControl control) { _control = control; }
private void OnNotificationPublished(string message) { NotificationControl.PushNotification(new NotificationItem { Content = message }); }