本文整理汇总了C#中AlertType类的典型用法代码示例。如果您正苦于以下问题:C# AlertType类的具体用法?C# AlertType怎么用?C# AlertType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AlertType类属于命名空间,在下文中一共展示了AlertType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SettingManager
private SettingManager() {
this.alertType = AlertType.LatestOnly;
this.alertAfterDate = DateTime.MinValue;
this.svnUserName = "";
this.svnPassword = "";
this.listOfTrackingTarget = new List<TrackingTargetEntity>();
}
示例2: AlertMsg
public AlertMsg(AlertType alertType, string title, string body)
: base(typeof(AlertViewModel))
{
AlertType = alertType;
Title = title;
Body = body;
}
示例3: Alert
public Alert(AlertType type, AlertDirection direction, int? trigger, string queue)
{
Type = type;
Direction = direction;
Trigger = trigger;
Queue = queue;
}
示例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;
}
示例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;
}
示例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) };
}
示例7: Add
public void Add(String message, AlertType alerttype)
{
if (frm != null)
{
frm.AddAlert(message, alerttype, scriptname);
}
}
示例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 += "×";
builder.InnerHtml += closeButton.ToString(TagRenderMode.Normal);
outerBuilder.InnerHtml += builder.ToString(TagRenderMode.Normal);
}
return outerBuilder.ToString(TagRenderMode.Normal).ToMvcHtmlString();
}
return string.Empty.ToMvcHtmlString();
}
示例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;
}
示例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\">×</a>";
return new MvcHtmlString(div.ToString(TagRenderMode.Normal));
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}