public PopupMessageWithAction(PopupMessageType messageType, string message, string leftButtonText, string rightButtonText, Action leftButtonAction, Action rightButtonAction, Action noButtonAction, HyperlinkButton hyperLink) : base(messageType, message, leftButtonText, rightButtonText, hyperLink) { this.LeftButtonAction = leftButtonAction; this.RightButtonAction = rightButtonAction; this.NoButtonAction = noButtonAction; }
public void ShowAlert(string message, PopupMessageType type) { this.Messages.Add(new PopupMessage() { Message = message, Type = type }); this.NotifyStateChanged(); }
public PopupMessage(PopupMessageType messageType, string message, string leftButtonText, string rightButtonText) { if (String.IsNullOrEmpty(message)) throw new Exception("Message cannot be empty"); this.Message = message; this.Caption = GetMesage(messageType); this.LeftButtonText = leftButtonText; this.RightButtonText = rightButtonText; }
public PopupMessage(PopupMessageType messageType, string message, string leftButtonText, string rightButtonText) { if (String.IsNullOrEmpty(message)) { throw new Exception("Message cannot be empty"); } this.Message = message; this.Caption = GetMesage(messageType); this.LeftButtonText = leftButtonText; this.RightButtonText = rightButtonText; }
private string GetMesage(PopupMessageType messageType) { switch (messageType) { case PopupMessageType.Error: return AppResources.PopupMessageTypeError; case PopupMessageType.Information: return AppResources.PopupMessageTypeInformation; case PopupMessageType.Warning: return AppResources.PopupMessageTypeWarning; case PopupMessageType.Sucess: return AppResources.PopupMessageTypeSuccess; default: return String.Empty; } }
public void ShowMessage(string message, PopupMessageType popupMessageType) { if (popupMessageType == PopupMessageType.Confirm) { btnOk.Visible = true; btnNo.Visible = true; btnNo.Text = "No"; } else { btnOk.Visible = false; btnNo.Text = "Ok"; btnNo.Visible = true; } ShowPopupMessage(message, popupMessageType); }
/// <summary> /// Details: Change modal popup image according to PopupMessageType /// </summary> /// <param name="message"></param> /// <param name="messageType"></param> private void ShowPopupMessage(string message, PopupMessageType messageType) { switch (messageType) { case PopupMessageType.Error: lblMessagePopupHeading.Text = "Error"; //Render image in literal control ltrMessagePopupImage.Text = "<img src='" + Page.ResolveUrl("~/Images/AlertIcons/Delete.png") + "' alt='' />"; break; case PopupMessageType.Confirm: lblMessagePopupHeading.Text = "Information"; ltrMessagePopupImage.Text = "<img src='" + Page.ResolveUrl("~/Images/AlertIcons/confirm.png") + "' alt='' />"; break; case PopupMessageType.Warning: lblMessagePopupHeading.Text = "Warning"; ltrMessagePopupImage.Text = "<img src='" + Page.ResolveUrl("~/Images/AlertIcons/Warning.png") + "' alt='' />"; break; case PopupMessageType.Success: lblMessagePopupHeading.Text = "Success"; ltrMessagePopupImage.Text = "<img src='" + Page.ResolveUrl("~/Images/AlertIcons/imgSuccess.png") + "' alt='' />"; break; case PopupMessageType.Information: lblMessagePopupHeading.Text = "Information"; ltrMessagePopupImage.Text = "<img src='" + Page.ResolveUrl("~/Images/AlertIcons/Info.png") + "' alt='' />"; break; default: lblMessagePopupHeading.Text = "Information"; ltrMessagePopupImage.Text = "<img src='" + Page.ResolveUrl("~/Images/AlertIcons/Info.png") + "' alt='' />"; break; } lblMessagePopupText.Text = message; mpeMessagePopup.Show(); }
/// <summary> /// returns CSS class associated with this message type. /// </summary> /// <param name="message">message type</param> /// <returns>CSS class</returns> public static string GetMessageClass(this PopupMessageType message) { switch (message) { case PopupMessageType.Error: return("error"); case PopupMessageType.Info: return("info"); case PopupMessageType.Warning: return("warning"); case PopupMessageType.Success: return("success"); } return(""); }
/// <summary> /// Details: Change modal popup image according to PopupMessageType /// </summary> /// <param name="message"></param> /// <param name="messageType"></param> private void ShowPopupMessage(string message, PopupMessageType messageType) { switch (messageType) { case PopupMessageType.Success: lblMessagePopupHeading.Text = "Success"; break; default: lblMessagePopupHeading.Text = "Information"; break; } lblMessagePopupText.Text = message; mpeMessagePopup.Show(); //formtop.Style.Add("display", "none"); }
private string GetMesage(PopupMessageType messageType) { switch (messageType) { case PopupMessageType.Error: return(AppResources.PopupMessageTypeError); case PopupMessageType.Information: return(AppResources.PopupMessageTypeInformation); case PopupMessageType.Warning: return(AppResources.PopupMessageTypeWarning); case PopupMessageType.Sucess: return(AppResources.PopupMessageTypeSuccess); default: return(String.Empty); } }
/// <summary> /// Отправляет внутренее всплывающее уведомление. /// </summary> /// <param name="content">Содержимое уведомления.</param> /// <param name="title">Заголовок уведомления.</param> /// <param name="type">Тип уведомления.</param> /// <param name="imageUrl">Путь к картинке уведомления.</param> /// <param name="duration">Длительность уведомления.</param> /// <param name="parameter">Параметр навигации для уведомления.</param> /// <param name="actionToDo">Делегат для выполнения при нажатии уведомления.</param> public static void SendInAppPush(string content, string title = null, PopupMessageType type = PopupMessageType.Default, string imageUrl = null, TimeSpan duration = default(TimeSpan), NavigateToPageMessage parameter = null, Action actionToDo = null) { var pop = new PopupMessage() { Title = title, Content = content, Type = type, ImageUrl = imageUrl, Parameter = parameter, ActionToDo = actionToDo }; if (duration != default(TimeSpan)) { pop.Duration = duration; } Messenger.Default.Send(pop); }
/// <summary> /// 显示一错误或提示信息 /// </summary> /// <param name="caption"></param> /// <param name="msg"></param> /// <param name="msgType"></param> /// <param name="showTime"></param> static public void ShowOneMessage(string caption, string msg, PopupMessageType msgType, int showTime) { if (showMessageEx != null) { showMessageEx(caption, msg, msgType, showTime); } else { if (showMessage != null) { showMessage(string.IsNullOrEmpty(caption) ? msg : string.Format("{0}|{1}", caption, msg), msgType); } else { if (msgType == PopupMessageType.Error || msgType == PopupMessageType.Exception) { //System.Windows.Forms.MessageBox.Show(msg); System.Diagnostics.Trace.WriteLine(msg); } } } }
public void AddMessage(string content, PopupMessageType msgType) { AddMessage(new PopupMessageViewModel(content, msgType)); }
/// <summary> /// 显示一条提示信息或错误信息 /// </summary> /// <param name="msg">提示或错误信息</param> /// <param name="msgType">信息类型1-提示 2-错误 3-例外中的错误</param> static public void ShowOneMessage(string msg, PopupMessageType msgType) { ShowOneMessage("", msg, msgType, 0); }
public PopupMessage(PopupMessageType messageType, string message, string leftButtonText, string rightButtonText, HyperlinkButton hyperLink) : this(messageType, message, leftButtonText, rightButtonText) { this.HyperLink = hyperLink; }
protected void AddMessage(string content, PopupMessageType type) { AddMessage(new PopupMessageViewModel(content, type)); }
public void ShowPopupMessage(FormationUnit unit, PopupMessageType type, string parameter = "", float ripOffset = 0) { PopupMessage popupMessage = Instantiate(popupText.gameObject).GetComponent<PopupMessage>(); popupMessage.RectTransform.SetParent(eventRect, false); Spine.Bone bone = unit.CurrentState.Skeleton.FindBone("fxhead") ?? unit.CurrentState.Skeleton.FindBone("fxskill"); switch(type) { case PopupMessageType.DeathBlow: popupMessage.SetColor(PopupColors["pop_text_deathblow"], PopupColors["pop_text_outline_deathblow"]); popupMessage.SetMessage(LocalizationManager.GetString("str_ui_deathblow")); popupMessage.SetRotation(new Vector3(0, 0, 8)); break; case PopupMessageType.DeathsDoor: bone = unit.CurrentState.Skeleton.FindBone("fxchest"); popupMessage.SetColor(PopupColors["pop_text_death_avoided"], PopupColors["pop_text_outline_death_avoided"]); popupMessage.SetMessage(LocalizationManager.GetString("str_ui_death_avoided")); popupMessage.SetIcon("poptext_death_avoided"); popupMessage.SetRotation(new Vector3(0, 0, 8)); FMODUnity.RuntimeManager.PlayOneShot("event:/general/combat/deaths_door"); break; case PopupMessageType.HeartAttack: popupMessage.SetColor(PopupColors["pop_text_heart_attack"], PopupColors["pop_text_outline_heart_attack"]); popupMessage.SetMessage(LocalizationManager.GetString("str_ui_heart_attack")); popupMessage.SetOffset(new Vector3(0, ripOffset, 0)); FMODUnity.RuntimeManager.PlayOneShot("event:/general/char/heart_attack"); break; case PopupMessageType.RetreatFailed: popupMessage.SetColor(PopupColors["pop_text_heart_attack"], PopupColors["pop_text_outline_heart_attack"]); popupMessage.SetMessage(LocalizationManager.GetString("retreat_fail_announcement")); popupMessage.SetOffset(new Vector3(0, ripOffset, 0)); FMODUnity.RuntimeManager.PlayOneShot("event:/general/combat/retreat_fail"); break; case PopupMessageType.Miss: popupMessage.SetColor(PopupColors["pop_text_miss"], PopupColors["pop_text_outline_miss"]); popupMessage.SetMessage(LocalizationManager.GetString("str_ui_miss")); popupMessage.SetOffset(new Vector3(0, ripOffset, 0)); break; case PopupMessageType.Dodge: popupMessage.SetColor(PopupColors["pop_text_miss"], PopupColors["pop_text_outline_miss"]); popupMessage.SetMessage(LocalizationManager.GetString("str_ui_dodge")); popupMessage.SetRotation(new Vector3(0, 0, 4)); popupMessage.SetOffset(new Vector3(0, ripOffset, 0)); break; case PopupMessageType.ZeroDamage: popupMessage.SetColor(PopupColors["pop_text_no_damage"], PopupColors["pop_text_outline_no_damage"]); popupMessage.SetMessage(LocalizationManager.GetString("str_ui_no_damage")); popupMessage.SetOffset(new Vector3(0, ripOffset, 0)); break; case PopupMessageType.Damage: popupMessage.SetColor(PopupColors["pop_text_damage"], PopupColors["pop_text_outline_damage"]); popupMessage.SetMessage(parameter); popupMessage.SetOffset(new Vector3(0, ripOffset, 0)); popupMessage.SkillMessage.fontSize = 70; break; case PopupMessageType.CritDamage: popupMessage.SetColor(PopupColors["pop_text_crit_damage"], PopupColors["pop_text_outline_crit_damage"]); popupMessage.SetMessage(LocalizationManager.GetString("str_ui_crittxt") + "\n" + parameter); popupMessage.SetOffset(new Vector3(0, ripOffset, 0)); popupMessage.SkillMessage.fontSize = 72; break; case PopupMessageType.Stress: popupMessage.SetColor(PopupColors["pop_text_stress_damage"], PopupColors["pop_text_outline_stress_damage"]); popupMessage.SetMessage(parameter); FMODUnity.RuntimeManager.PlayOneShot("event:/general/status/stress_up"); popupMessage.SkillMessage.fontSize = 70; break; case PopupMessageType.StressHeal: popupMessage.SetColor(PopupColors["pop_text_stress_reduce"], PopupColors["pop_text_outline_stress_reduce"]); popupMessage.SetMessage(parameter); FMODUnity.RuntimeManager.PlayOneShot("event:/general/status/stress_down"); popupMessage.SkillMessage.fontSize = 70; break; case PopupMessageType.Heal: popupMessage.SetColor(PopupColors["pop_text_heal"], PopupColors["pop_text_outline_heal"]); popupMessage.SetMessage(parameter); popupMessage.SkillMessage.fontSize = 70; break; case PopupMessageType.CritHeal: popupMessage.SetColor(PopupColors["pop_text_heal_crit"], PopupColors["pop_text_outline_heal_crit"]); popupMessage.SetMessage(parameter); popupMessage.SkillMessage.fontSize = 72; break; case PopupMessageType.Pass: popupMessage.SetColor(PopupColors["pop_text_pass"], PopupColors["pop_text_outline_pass"]); popupMessage.SetMessage(LocalizationManager.GetString("str_ui_pass")); FMODUnity.RuntimeManager.PlayOneShot("event:/general/char/pass"); break; case PopupMessageType.Tagged: popupMessage.SetColor(PopupColors["pop_text_tagged"], PopupColors["pop_text_outline_tagged"]); popupMessage.SetMessage(LocalizationManager.GetString("str_ui_tagged")); popupMessage.SetIcon("poptext_tagged"); FMODUnity.RuntimeManager.PlayOneShot("event:/general/status/marked"); break; case PopupMessageType.Untagged: popupMessage.SetColor(PopupColors["pop_text_tagged"], PopupColors["pop_text_outline_tagged"]); popupMessage.SetMessage(LocalizationManager.GetString("str_ui_untagged")); FMODUnity.RuntimeManager.PlayOneShot("event:/general/status/marked"); popupMessage.SetRotation(new Vector3(0, 0, 6)); break; case PopupMessageType.Bleed: popupMessage.SetColor(PopupColors["pop_text_bleed"], PopupColors["pop_text_outline_bleed"]); popupMessage.SetMessage(LocalizationManager.GetString("str_ui_bleed")); popupMessage.SetIcon("poptext_bleed"); FMODUnity.RuntimeManager.PlayOneShot("event:/general/status/bleed_onset"); break; case PopupMessageType.Poison: popupMessage.SetColor(PopupColors["pop_text_poison"], PopupColors["pop_text_outline_poison"]); popupMessage.SetMessage(LocalizationManager.GetString("str_ui_poison")); popupMessage.SetIcon("poptext_poison"); FMODUnity.RuntimeManager.PlayOneShot("event:/general/status/poison_onset"); break; case PopupMessageType.Buff: popupMessage.SetColor(PopupColors["pop_text_buff"], PopupColors["pop_text_outline_buff"]); popupMessage.SetMessage(LocalizationManager.GetString("str_ui_buff")); popupMessage.SetIcon("poptext_buff"); FMODUnity.RuntimeManager.PlayOneShot("event:/general/status/buff"); break; case PopupMessageType.Debuff: popupMessage.SetColor(PopupColors["pop_text_debuff"], PopupColors["pop_text_outline_debuff"]); popupMessage.SetMessage(LocalizationManager.GetString("str_ui_debuff")); popupMessage.SetIcon("poptext_debuff"); FMODUnity.RuntimeManager.PlayOneShot("event:/general/status/debuff"); break; case PopupMessageType.Stunned: popupMessage.SetColor(PopupColors["pop_text_stun"], PopupColors["pop_text_outline_stun"]); popupMessage.SetMessage(LocalizationManager.GetString("str_ui_stun")); FMODUnity.RuntimeManager.PlayOneShot("event:/general/status/stun_onset"); break; case PopupMessageType.Unstun: popupMessage.SetColor(PopupColors["pop_text_stun_clear"], PopupColors["pop_text_outline_stun_clear"]); popupMessage.SetMessage(LocalizationManager.GetString("str_ui_stun")); FMODUnity.RuntimeManager.PlayOneShot("event:/general/status/stun_off"); break; case PopupMessageType.Cured: popupMessage.SetColor(PopupColors["pop_text_cured"], PopupColors["pop_text_outline_cured"]); popupMessage.SetMessage(LocalizationManager.GetString("str_ui_cured")); FMODUnity.RuntimeManager.PlayOneShot("event:/general/status/cured"); break; case PopupMessageType.BleedResist: if(unit.Character.DisplayModifier != null && unit.Character.DisplayModifier.DisabledPopups.Contains("resist")) { Destroy(popupMessage.gameObject); return; } popupMessage.SetColor(PopupColors["pop_text_bleed_resist"], PopupColors["pop_text_outline_bleed_resist"]); popupMessage.SetMessage(LocalizationManager.GetString("str_ui_bleed_resist")); popupMessage.SetIcon("poptext_bleed_resist"); FMODUnity.RuntimeManager.PlayOneShot("event:/general/status/resist"); break; case PopupMessageType.PoisonResist: if (unit.Character.DisplayModifier != null && unit.Character.DisplayModifier.DisabledPopups.Contains("resist")) { Destroy(popupMessage.gameObject); return; } popupMessage.SetColor(PopupColors["pop_text_poison_resist"], PopupColors["pop_text_outline_poison_resist"]); popupMessage.SetMessage(LocalizationManager.GetString("str_ui_blight_resist")); popupMessage.SetIcon("poptext_poison_resist"); FMODUnity.RuntimeManager.PlayOneShot("event:/general/status/resist"); break; case PopupMessageType.StunResist: if (unit.Character.DisplayModifier != null && unit.Character.DisplayModifier.DisabledPopups.Contains("resist")) { Destroy(popupMessage.gameObject); return; } popupMessage.SetColor(PopupColors["pop_text_stun_resist"], PopupColors["pop_text_outline_stun_resist"]); popupMessage.SetMessage(LocalizationManager.GetString("str_ui_stun_resist")); popupMessage.SetIcon("poptext_stun_resist"); FMODUnity.RuntimeManager.PlayOneShot("event:/general/status/resist"); break; case PopupMessageType.MoveResist: if (unit.Character.DisplayModifier != null && unit.Character.DisplayModifier.DisabledPopups.Contains("resist")) { Destroy(popupMessage.gameObject); return; } popupMessage.SetColor(PopupColors["pop_text_move_resist"], PopupColors["pop_text_outline_move_resist"]); popupMessage.SetMessage(LocalizationManager.GetString("str_ui_move_resist")); popupMessage.SetIcon("poptext_move_resist"); FMODUnity.RuntimeManager.PlayOneShot("event:/general/status/resist"); break; case PopupMessageType.DebuffResist: if (unit.Character.DisplayModifier != null && unit.Character.DisplayModifier.DisabledPopups.Contains("resist")) { Destroy(popupMessage.gameObject); return; } popupMessage.SetColor(PopupColors["pop_text_debuff_resist"], PopupColors["pop_text_outline_debuff_resist"]); popupMessage.SetMessage(LocalizationManager.GetString("str_ui_debuff_resist")); popupMessage.SetIcon("poptext_debuff_resist"); FMODUnity.RuntimeManager.PlayOneShot("event:/general/status/resist"); break; case PopupMessageType.DiseaseResist: if (unit.Character.DisplayModifier != null && unit.Character.DisplayModifier.DisabledPopups.Contains("resist")) { Destroy(popupMessage.gameObject); return; } popupMessage.SetColor(PopupColors["pop_text_disease_resist"], PopupColors["pop_text_outline_disease_resist"]); popupMessage.SetMessage(LocalizationManager.GetString("str_ui_disease_resist")); popupMessage.SetIcon("poptext_disease_resist"); FMODUnity.RuntimeManager.PlayOneShot("event:/general/status/resist"); break; case PopupMessageType.Disease: popupMessage.SetColor(PopupColors["pop_text_disease_resist"], PopupColors["pop_text_outline_disease_resist"]); popupMessage.SetMessage(parameter); popupMessage.SetOffset(new Vector3(0, 70, 0)); FMODUnity.RuntimeManager.PlayOneShot("event:/general/char/quirk_neg"); break; case PopupMessageType.PositiveQuirk: popupMessage.SetColor(PopupColors["notable"], Color.black); popupMessage.SetMessage(parameter); popupMessage.SetOffset(new Vector3(0, 70, 0)); FMODUnity.RuntimeManager.PlayOneShot("event:/general/char/quirk_pos"); break; case PopupMessageType.NegativeQuirk: popupMessage.SetColor(PopupColors["harmful"], Color.black); popupMessage.SetMessage(parameter); popupMessage.SetOffset(new Vector3(0, 70, 0)); FMODUnity.RuntimeManager.PlayOneShot("event:/general/char/quirk_neg"); break; case PopupMessageType.QuirkRemoved: popupMessage.SetColor(PopupColors["notable"], Color.black); popupMessage.SetMessage(parameter + LocalizationManager.GetString("curio_announcement_purge_format")); popupMessage.SetOffset(new Vector3(0, 70, 0)); FMODUnity.RuntimeManager.PlayOneShot("event:/general/char/quirk_pos"); break; case PopupMessageType.DiseaseCured: popupMessage.SetMessage(string.Format(LocalizationManager.GetString("str_ui_disease_cured"), parameter)); popupMessage.SetColor(PopupColors["pop_text_disease_resist"], PopupColors["pop_text_outline_disease_resist"]); popupMessage.SetIcon("poptext_disease_resist"); popupMessage.SetOffset(new Vector3(0, 30, 0)); FMODUnity.RuntimeManager.PlayOneShot("event:/general/status/cured"); break; case PopupMessageType.Guard: popupMessage.SetColor(PopupColors["pop_text_guard"], PopupColors["pop_text_outline_guard"]); popupMessage.SetMessage(LocalizationManager.GetString("str_ui_guard")); popupMessage.SetIcon("poptext_guard"); FMODUnity.RuntimeManager.PlayOneShot("event:/general/status/guard"); break; case PopupMessageType.Riposte: popupMessage.SetColor(PopupColors["pop_text_riposte"], PopupColors["pop_text_outline_riposte"]); popupMessage.SetMessage(LocalizationManager.GetString("str_ui_riposte")); popupMessage.SetIcon("poptext_riposte"); FMODUnity.RuntimeManager.PlayOneShot("event:/general/status/riposte_enabled"); break; } Vector3 screenPosition = RaidSceneManager.DungeonPositionToScreen( unit.RectTransform.TransformPoint(bone.WorldX, bone.WorldY, 0)); popupMessage.RectTransform.position = new Vector3(screenPosition.x, screenPosition.y, 0); popupMessage.FollowXBone(bone, unit); popupMessage.gameObject.SetActive(true); }
public PopupMessageViewModel(string content, PopupMessageType messageType = PopupMessageType.Info) { Content = content; MessageType = messageType; }