• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# AlertType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中AlertType的典型用法代码示例。如果您正苦于以下问题:C# AlertType类的具体用法?C# AlertType怎么用?C# AlertType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



AlertType类属于命名空间,在下文中一共展示了AlertType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: SettingManager

 private SettingManager() {
     this.alertType = AlertType.LatestOnly;
     this.alertAfterDate = DateTime.MinValue;
     this.svnUserName = "";
     this.svnPassword = "";
     this.listOfTrackingTarget = new List<TrackingTargetEntity>();
 }
开发者ID:kobluewater,项目名称:SVNAlert,代码行数:7,代码来源:SettingManager.cs


示例2: AlertMsg

 public AlertMsg(AlertType alertType, string title, string body)
     : base(typeof(AlertViewModel))
 {
     AlertType = alertType;
     Title = title;
     Body = body;
 }
开发者ID:flq,项目名称:Thawmadoce,代码行数:7,代码来源:Alerting.cs


示例3: Alert

 public Alert(AlertType type, AlertDirection direction, int? trigger, string queue)
 {
     Type = type;
     Direction = direction;
     Trigger = trigger;
     Queue = queue;
 }
开发者ID:sunloverz,项目名称:iron_dotnet,代码行数:7,代码来源:Alert.cs


示例4: Set

        public static SetAlert Set(string message, string strongMessage, AlertType typeOfAlert)
        {
            SetAlert alert = new SetAlert();

            alert.Message = message;
            alert.StrongMessage = strongMessage;

            switch (typeOfAlert)
            {
                case AlertType.Success:
                    alert.TypeOfAlert = "alert-success";
                    break;

                case AlertType.Danger:
                    alert.TypeOfAlert = "alert-danger";
                    break;

                case AlertType.Info:
                    alert.TypeOfAlert = "alert-info";
                    break;

                case AlertType.Warning:
                    alert.TypeOfAlert = "alert-warning";
                    break;
            }

            return alert;
        }
开发者ID:mknizewski,项目名称:SAP,代码行数:28,代码来源:SetAlert.cs


示例5: ShowAlert

        public void ShowAlert(AlertType type, string message)
        {
            HtmlGenericControl h4AlertHeading = (HtmlGenericControl)(this.Master).FindControl("h4AlertHeading");
            Label lblErrorMessage = (Label)(this.Master).FindControl("lblErrorMessage");
            Panel pnlAlert = (Panel)(this.Master).FindControl("pnlAlert");

            h4AlertHeading.Visible = false;
            lblErrorMessage.Text = message;
            switch (type)
            {
                case AlertType.Error:
                    pnlAlert.CssClass = BootstrapStyleConstant.AlertError;
                    break;
                case AlertType.Information:
                    pnlAlert.CssClass = BootstrapStyleConstant.AlertInfo;
                    break;
                case AlertType.Success:
                    pnlAlert.CssClass = BootstrapStyleConstant.AlertSuccess;
                    break;
                default:
                    pnlAlert.CssClass = BootstrapStyleConstant.AlertWarning;
                    break;
            }

            pnlAlert.Visible = true;
        }
开发者ID:Artnman,项目名称:Cloud,代码行数:26,代码来源:BasePageBackEnd.cs


示例6: CreateSingle

        /// <summary>
        /// Creates a list of AlertModels with a single item.
        /// </summary>
        /// <param name="type">The alert type.</param>
        /// <param name="message">The message.</param>
        /// <returns>A single item list of an AlertModel.</returns>
        public static List<AlertModel> CreateSingle(AlertType type, string message)
        {
            Guard.NotNull(() => type);
            Guard.NotNullOrEmpty(() => message);

            return new List<AlertModel> { new AlertModel(type, message) };
        }
开发者ID:mainthread-technology,项目名称:grand-maps-for-muzei-service,代码行数:13,代码来源:AlertModel.cs


示例7: Add

 public void Add(String message, AlertType alerttype)
 {
     if (frm != null)
     {
         frm.AddAlert(message, alerttype, scriptname);
     }                
 }
开发者ID:johnjohnsp1,项目名称:PoshSecFramework,代码行数:7,代码来源:psmethods.cs


示例8: GetAlerts

        public static MvcHtmlString GetAlerts(this HtmlHelper helper, AlertType alertType, AlertLocation alertLocation)
        {
            var alertData = helper.ViewContext.TempData.InitializeAlertData();

            List<string> messages = alertData[alertLocation][alertType];
            if (messages.Count > 0)
            {
                var outerBuilder = new TagBuilder("div");
                outerBuilder.AddCssClass("container-fluid");
                foreach (var message in messages)
                {
                    var builder = new TagBuilder("div");
                    builder.AddCssClass("alert");
                    builder.AddCssClass("in");
                    builder.AddCssClass("fade");
                    builder.AddCssClass(alertType.GetDescription());

                    builder.SetInnerText(message);

                    var closeButton = new TagBuilder("a");
                    closeButton.AddCssClass("close");
                    closeButton.MergeAttribute("data-dismiss", "alert");
                    closeButton.MergeAttribute("href", "#");
                    closeButton.InnerHtml += "&times;";

                    builder.InnerHtml += closeButton.ToString(TagRenderMode.Normal);

                    outerBuilder.InnerHtml += builder.ToString(TagRenderMode.Normal);
                }
                return outerBuilder.ToString(TagRenderMode.Normal).ToMvcHtmlString();
            }

            return string.Empty.ToMvcHtmlString();
        }
开发者ID:vcardins,项目名称:CoolApp,代码行数:34,代码来源:HtmlExtensions.Alerts.cs


示例9: AlertModel

        /// <summary>
        /// Initializes a new instance of the <see cref="AlertModel" /> class.
        /// </summary>
        /// <param name="type">The type of the alert.</param>
        /// <param name="message">The message.</param>
        public AlertModel(AlertType type, string message)
        {
            Guard.NotNull(() => type);
            Guard.NotNullOrEmpty(() => message);

            this.Type = type;
            this.Message = message;
        }
开发者ID:mainthread-technology,项目名称:grand-maps-for-muzei-service,代码行数:13,代码来源:AlertModel.cs


示例10: Alert

 /// <summary>
 /// Create an alert box of the specified type
 /// </summary>
 /// <param name="html">The current HtmlHelper instance</param>
 /// <param name="message">The message to show</param>
 /// <param name="alertType">The type of alert to show.</param>
 public static MvcHtmlString Alert(this HtmlHelper html, string message, AlertType alertType)
 {
     var div = new TagBuilder("div");
     div.AddCssClass("alert-box");
     div.AddCssClass(alertType.GetStringValue());
     div.InnerHtml = message;
     div.InnerHtml += "<a href=\"#\" class=\"close\">&times;</a>";
     return new MvcHtmlString(div.ToString(TagRenderMode.Normal));
 }
开发者ID:danielvanhouten,项目名称:MVC-3-Extensions-for-Zurb-Foundation,代码行数:15,代码来源:AlertBoxExtensions.cs


示例11: AddMessage

        private static void AddMessage(TempDataDictionary tempData, AlertType type, string message,
            AlertLocation location)
        {
            var alertData = tempData.InitializeAlertData();

            alertData[location][type].Add(message);

            tempData["AlertData"] = alertData;
        }
开发者ID:havearun,项目名称:ScaffR-Generated,代码行数:9,代码来源:TempDataExtensions.Alerts.cs


示例12: AddAlert

        /// <summary>
        ///     Adds an alert of the specified type with the specified message
        /// </summary>
        /// <param name="controller">
        ///     The <see cref="Controller"/> to use to add the alert
        /// </param>
        /// <param name="type">
        ///     The <see cref="AlertType"/> for the alert
        /// </param>
        /// <param name="message">
        ///     The message for the alert
        /// </param>
        public static void AddAlert(
            this Controller controller, AlertType type, string message)
        {
            List<AlertMessage> alerts = controller.TempData[ALERT_MESSAGE_KEY] as List<AlertMessage> ??
                new List<AlertMessage>();

            alerts.Add(new AlertMessage() { Type = type, Message = message});
            controller.TempData["AlertMessages"] = alerts;
        }
开发者ID:kylezimmerman,项目名称:prog3050,代码行数:21,代码来源:AlertHelper.cs


示例13: MessageBoxForm

			public MessageBoxForm (IWin32Window owner, string text, string caption,
					       MessageBoxButtons buttons, MessageBoxIcon icon,
					       bool displayHelpButton)
			{
				show_help = displayHelpButton;

				switch (icon) {
					case MessageBoxIcon.None: {
						icon_image = null;
						alert_type = AlertType.Default;
						break;
					}

					case MessageBoxIcon.Error: {		// Same as MessageBoxIcon.Hand and MessageBoxIcon.Stop
						icon_image = SystemIcons.Error;
						alert_type = AlertType.Error;
						break;
					}

					case MessageBoxIcon.Question: {
 						icon_image = SystemIcons.Question;
						alert_type = AlertType.Question;
						break;
					}

					case MessageBoxIcon.Asterisk: {		// Same as MessageBoxIcon.Information
						icon_image = SystemIcons.Information;
						alert_type = AlertType.Information;
						break;
					}

					case MessageBoxIcon.Warning: {		// Same as MessageBoxIcon.Exclamation:
						icon_image = SystemIcons.Warning;
						alert_type = AlertType.Warning;
						break;
					}
				}

				msgbox_text = text;
				msgbox_buttons = buttons;
				msgbox_default = MessageBoxDefaultButton.Button1;

				if (owner != null) {
					Owner = Control.FromHandle(owner.Handle).FindForm();
				} else {
					if (Application.MWFThread.Current.Context != null) {
						Owner = Application.MWFThread.Current.Context.MainForm;
					}
				}
				this.Text = caption;
				this.ControlBox = true;
				this.MinimizeBox = false;
				this.MaximizeBox = false;
				this.ShowInTaskbar = (Owner == null);
				this.FormBorderStyle = FormBorderStyle.FixedDialog;
			}
开发者ID:ngraziano,项目名称:mono,代码行数:56,代码来源:MessageBox.cs


示例14: Alarm

 public Alarm(string name, AlertType alertType, bool playSound, bool focusClient, bool pauseBot, bool disconnect)
 {
     this._name = name;
     this._alertType = alertType;
     this._playSound = playSound;
     this._focusClient = focusClient;
     this._pauseBot = pauseBot;
     this._disconnect = disconnect;
     this._buttonVisibility = Visibility.Hidden;
 }
开发者ID:PimentelM,项目名称:extibiabot,代码行数:10,代码来源:Alarm.cs


示例15: HighlightModel

        /// <summary>
        /// Initializes a new instance of the <see cref="HighlightModel" /> class.
        /// </summary>
        /// <param name="style">The row style.</param>
        /// <param name="partition">The items partition.</param>
        /// <param name="row">The items row key.</param>
        public HighlightModel(AlertType style, string partition, string row)
        {
            Guard.NotNull(() => style);
            Guard.NotNullOrEmpty(() => row);
            Guard.NotNullOrEmpty(() => partition);

            this.Style = style;
            this.Partition = partition;
            this.Row = row;
        }
开发者ID:mainthread-technology,项目名称:grand-maps-for-muzei-service,代码行数:16,代码来源:HighlightModel.cs


示例16: AddMessageToTempData

        private static void AddMessageToTempData(ControllerBase controller, AlertType type, string title, string message)
        {
            var alertMessage = new AlertMessage
            {
                Title = title,
                Message = message,
                CssClass = type.CssClass
            };

            controller.TempData["alert"] = alertMessage.AsJson();
        }
开发者ID:RichieRich69,项目名称:StormStryker,代码行数:11,代码来源:FlashHelpers.cs


示例17: Alert

        public static MvcHtmlString Alert(this HtmlHelper html, string shortTitle, string message, AlertType alertType)
        {
            var div = new TagBuilder("div");
            var alertTypeCSS = string.Format("alert-{0}", alertType.ToString().ToLower());
            div.AddCssClass("alert");
            div.AddCssClass(alertTypeCSS);

            var a = new TagBuilder("a");
            a.AddCssClass("close");
            a.Attributes.Add("data-dismiss", "alert");
            a.InnerHtml = "&times;";

            div.InnerHtml = string.Format("{0}<strong>{1} </strong>{2}", a.ToString(), shortTitle, message);
            return new MvcHtmlString(div.ToString());
        }
开发者ID:Steffkn,项目名称:ASP.NET,代码行数:15,代码来源:CustomHelpers.cs


示例18: SetAlert

        public static void SetAlert(
            this NancyContext context,
            string message,
            AlertType? type = null)
        {
            var hash = MD5(message);

            context.Request.Session[String.Concat("alert-", hash)] = new Alert
            {
                Message = message,
                Type = type ?? AlertType.NotSpecified
            };

            context.Items["alert-hash"] = hash;
        }
开发者ID:half-ogre,项目名称:rpg-rooms,代码行数:15,代码来源:SetAlert.cs


示例19: GetAlerts

        public static ICollection<Alert> GetAlerts(this TempDataDictionary tempData, AlertType? type = null)
        {
            if (!tempData.ContainsKey(AlertsKey))
            {
                tempData[AlertsKey] = new List<Alert>();
            }

            var alerts = (ICollection<Alert>)tempData[AlertsKey];

            if (type.HasValue)
            {
                alerts = alerts.Where(a => a.Type == type.Value).ToList();
            }

            return alerts;
        }
开发者ID:plamenyovchev,项目名称:Bloggable,代码行数:16,代码来源:TempDataDictionaryExtensions.cs


示例20: convertTypeToString

        private static string convertTypeToString(AlertType a)
        {
            switch (a)
            {
                case AlertType.Danger:
                    return "danger";
                case AlertType.Warning:
                    return "warning";
                case AlertType.Info:
                    return "info";
                case AlertType.Success:
                    return "success";
            }

            return "";
        }
开发者ID:znittzel,项目名称:MurvasBokhandel,代码行数:16,代码来源:AlertView.cs



注:本文中的AlertType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Algorithm类代码示例发布时间:2022-05-24
下一篇:
C# Alert类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap