/// <summary> /// Display a message to the user. /// This method may be called from any thread. /// </summary> /// <param name="strMessage"></param> /// <param name="type"></param> public int NotifyUser(string strMessage, NotifyType type, NotifyButton button = NotifyButton.None) { if (button == NotifyButton.ContinueToNextTask) { ProceedButton.Visibility = Visibility.Visible; } else { ProceedButton.Visibility = Visibility.Collapsed; } if (button == NotifyButton.RestartDevice) { RestartDeviceButton.Visibility = Visibility.Visible; } else { RestartDeviceButton.Visibility = Visibility.Collapsed; } // If called from the UI thread, then update immediately. // Otherwise, schedule a task on the UI thread to perform the update. if (Dispatcher.HasThreadAccess) { UpdateStatus(strMessage, type); } else { var task = Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => UpdateStatus(strMessage, type)); } return(1); }
/// <summary> /// Initializes a new instance of the <see cref="NotifyForm"/> class. /// </summary> /// <param name="title">The title.</param> /// <param name="message">The message.</param> /// <param name="buttons">The buttons.</param> /// <param name="request">The request.</param> /// <param name="customButtonText">The custom button text if a custom button is needed.</param> /// <param name="customAction">The custom action if a custom button is needed.</param> public NotifyForm(string title, string message, NotifyButton buttons, string request = "", string customButtonText = "", Action customAction = null) : this() { this.Title = title; this.Message = message; this.Request = request; if ((buttons & NotifyButton.OK) == NotifyButton.OK) { this.btnOK.Visible = true; } if ((buttons & NotifyButton.Cancel) == NotifyButton.Cancel) { this.btnCancel.Visible = true; } if ((buttons & NotifyButton.Close) == NotifyButton.Close) { this.btnClose.Visible = true; } if ((buttons & NotifyButton.Shutdown) == NotifyButton.Shutdown) { this.btnShutdown.Visible = true; } if ((buttons & NotifyButton.Custom) == NotifyButton.Custom && !String.IsNullOrEmpty(customButtonText) && customAction != null) { this.btnCustom.Visible = true; this.CustomButtonText = customButtonText; this.CustomButtonAction = customAction; } SizeForm(); }
public void SetNotification(string title, string message, NotifyType type, NotifyButton button) { switch (button) { case NotifyButton.Ok: this.btnOK.Visibility = Visibility.Visible; this.btnCancel.Visibility = Visibility.Collapsed; break; case NotifyButton.Cancel: this.btnCancel.Visibility = Visibility.Visible; this.btnOK.Visibility = Visibility.Collapsed; break; case NotifyButton.OkAndCancel: this.btnOK.Visibility = Visibility.Visible; this.btnCancel.Visibility = Visibility.Visible; break; } switch (type) { case NotifyType.StatusMessage: mainGrid.Background = new SolidColorBrush(Windows.UI.Colors.Green); break; case NotifyType.ErrorMessage: mainGrid.Background = new SolidColorBrush(Windows.UI.Colors.Red); break; } txtStatusBlock.Text = title + Environment.NewLine + Environment.NewLine + message; }
/// <summary> /// Sends a pop-up dialog notification. /// </summary> /// <param name="title">The title.</param> /// <param name="message">The message.</param> /// <param name="buttons">The buttons.</param> /// <param name="blinkColor">Light stack colors that should blink until this popup is dismissed.</param> /// <param name="request">The operator request.</param> /// <param name="customButtonText">The custom button text if required.</param> /// <param name="customAction">The custom action if required.</param> /// <returns></returns> public static NotifyButton PopUp(string title, string message, NotifyButton buttons, LightStackColor blinkColor, string request = "", string customButtonText = "", Action customAction = null) { NotifyButton clickedButton = NotifyButton.Cancel; Form activeForm = Form.ActiveForm; if (activeForm == null && Application.OpenForms.Count > 0) { activeForm = Application.OpenForms[Application.OpenForms.Count - 1]; } UIUtility.Invoke(activeForm, () => { using (NotifyForm notify = new NotifyForm(title, message, buttons, request, customButtonText, customAction)) { LightStackColor prevColor = LightStackColor.Off; bool lightTowerSet = false; try { if (LightTower != null && blinkColor != LightStackColor.Off) { prevColor = LightTower.GetBlink(); LightTower.Off(LightStackColor.All); LightTower.Blink(blinkColor); lightTowerSet = true; } } catch (Exception) { } try { notify.ShowDialog(); clickedButton = notify.ClickedButton; if (lightTowerSet) { LightTower.Off(LightStackColor.All); LightTower.Blink(prevColor); } } catch (Exception) { } } }); return(clickedButton); }
async partial void btnNotifyMe_TouchUpInside(NotifyButton sender) { ResignFirstResponder(); if (Settings.IsRegistered) { Settings.IsRegistered = false; SetupUI2(); return; } progressBar.StartAnimating(); btnShare.Enabled = false; btnNotifyMe.Enabled = false; btnAddToCalendar.Enabled = false; await SaveTheDateHelper.RegisterForNotifications(tbxEmailAddress.Text); btnShare.Enabled = true; btnNotifyMe.Enabled = true; btnAddToCalendar.Enabled = true; progressBar.StopAnimating(); SetupUI2(); }
public void NotifyUser(string title, string message, NotifyType type, NotifyButton button) { PiNotify.GetInstance().SetNotification(title, message, type, button); _root.ShowNotify(); }
/// <summary> /// Sends a pop-up dialog notification. /// </summary> /// <param name="title">The title.</param> /// <param name="message">The message.</param> /// <param name="buttons">The buttons.</param> /// <param name="request">The operator request.</param> /// <param name="customButtonText">The custom button text if required.</param> /// <param name="customAction">The custom action if required.</param> /// <returns></returns> public static NotifyButton PopUp(string title, string message, NotifyButton buttons, string request = "", string customButtonText = "", Action customAction = null) { return(PopUp(title, message, buttons, LightStackColor.Yellow, request, customButtonText, customAction)); }
void ReleaseDesignerOutlets() { if (cnsBackgroundImageHeight != null) { cnsBackgroundImageHeight.Dispose(); cnsBackgroundImageHeight = null; } if (cnsBackgroundImageWidth != null) { cnsBackgroundImageWidth.Dispose(); cnsBackgroundImageWidth = null; } if (cnsDescriptionHeight != null) { cnsDescriptionHeight.Dispose(); cnsDescriptionHeight = null; } if (cnsDescriptionWidth != null) { cnsDescriptionWidth.Dispose(); cnsDescriptionWidth = null; } if (CountdownText != null) { CountdownText.Dispose(); CountdownText = null; } if (ivGenericBackground != null) { ivGenericBackground.Dispose(); ivGenericBackground = null; } if (ivRewardImage != null) { ivRewardImage.Dispose(); ivRewardImage = null; } if (lblClaimIt != null) { lblClaimIt.Dispose(); lblClaimIt = null; } if (lblDescriptionFooter != null) { lblDescriptionFooter.Dispose(); lblDescriptionFooter = null; } if (lblPointsButtonText != null) { lblPointsButtonText.Dispose(); lblPointsButtonText = null; } if (lblStatus != null) { lblStatus.Dispose(); lblStatus = null; } if (lblTapsCount != null) { lblTapsCount.Dispose(); lblTapsCount = null; } if (LockImage != null) { LockImage.Dispose(); LockImage = null; } if (LockImageStatus != null) { LockImageStatus.Dispose(); LockImageStatus = null; } if (NameText != null) { NameText.Dispose(); NameText = null; } if (NotifyButton != null) { NotifyButton.Dispose(); NotifyButton = null; } if (peopleIcon != null) { peopleIcon.Dispose(); peopleIcon = null; } if (RewardButton != null) { RewardButton.Dispose(); RewardButton = null; } if (scrlMainContent != null) { scrlMainContent.Dispose(); scrlMainContent = null; } if (statusTitleLabel != null) { statusTitleLabel.Dispose(); statusTitleLabel = null; } if (SubTitleText != null) { SubTitleText.Dispose(); SubTitleText = null; } if (UnitsAvailable != null) { UnitsAvailable.Dispose(); UnitsAvailable = null; } if (UnlockInTitle != null) { UnlockInTitle.Dispose(); UnlockInTitle = null; } if (UsersEligible != null) { UsersEligible.Dispose(); UsersEligible = null; } if (vBackgroundImageShadow != null) { vBackgroundImageShadow.Dispose(); vBackgroundImageShadow = null; } if (vBasis != null) { vBasis.Dispose(); vBasis = null; } if (vContentBasis != null) { vContentBasis.Dispose(); vContentBasis = null; } if (vEligibleRawBasis != null) { vEligibleRawBasis.Dispose(); vEligibleRawBasis = null; } if (vFiltersRawBasis != null) { vFiltersRawBasis.Dispose(); vFiltersRawBasis = null; } if (vMainContent != null) { vMainContent.Dispose(); vMainContent = null; } if (vRewardsButtonCenterBasis != null) { vRewardsButtonCenterBasis.Dispose(); vRewardsButtonCenterBasis = null; } if (vRewardUnlockTimeContainer != null) { vRewardUnlockTimeContainer.Dispose(); vRewardUnlockTimeContainer = null; } if (vRightBottomBasis != null) { vRightBottomBasis.Dispose(); vRightBottomBasis = null; } if (WebView != null) { WebView.Dispose(); WebView = null; } }