本文整理汇总了C#中NotifyType类的典型用法代码示例。如果您正苦于以下问题:C# NotifyType类的具体用法?C# NotifyType怎么用?C# NotifyType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NotifyType类属于命名空间,在下文中一共展示了NotifyType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: NotifyUserFromBackground
public async void NotifyUserFromBackground(string strMessage, NotifyType type)
{
await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
{
NotifyUser(strMessage, type);
});
}
示例2: NotifyUser
/// <summary>
/// Used to display messages to the user
/// </summary>
/// <param name="strMessage"></param>
/// <param name="type"></param>
public void NotifyUser(string strMessage, NotifyType type)
{
if (StatusBlock != null)
{
switch (type)
{
case NotifyType.StatusMessage:
StatusBorder.Background = new SolidColorBrush(Windows.UI.Colors.Green);
break;
case NotifyType.ErrorMessage:
StatusBorder.Background = new SolidColorBrush(Windows.UI.Colors.Red);
break;
}
StatusBlock.Text = strMessage;
// Collapse the StatusBlock if it has no text to conserve real estate.
if (StatusBlock.Text != String.Empty)
{
StatusBorder.Visibility = Windows.UI.Xaml.Visibility.Visible;
}
else
{
StatusBorder.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
}
}
}
示例3: Notify
/// <summary>
/// 處理傳遞訊息的控制邏輯
/// </summary>
/// <param name="notifytype">enum: System, User</param>
/// <param name="sendertype">enum: Email, Line</param>
/// <param name="message">訊息物件</param>
/// <returns></returns>
public string Notify(NotifyType notifytype, SenderType sendertype, Message message)
{
string procResult = "";
// 判斷需產出哪一個 RefinedAbstraction 的子類別物件
switch (notifytype)
{
case NotifyType.System :
notifier = new SystemNotifier();
break;
case NotifyType.User :
notifier = new UserNotifier();
break;
}
// 判斷需哪個實作 MessageSender 介面的實作物件來服務
// 實務上會設計如 List or Hastable 集合儲存這些實作物件,並透過 Key 來取得相對應的實作物件
switch (sendertype)
{
case SenderType.Email :
notifier.sender = mailSender;
break;
case SenderType.Line :
notifier.sender = lineSender;
break;
}
// 回傳執行結果,藉此觀察使用哪一個 Notifier 子類別物件與 MessengSender 物件
procResult = notifier.Notify(message);
return procResult;
}
示例4: DisplayStatus
public void DisplayStatus(string message, NotifyType type)
{
Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
{
switch (type)
{
case NotifyType.StatusMessage:
StatusBorder.Background = new SolidColorBrush(Windows.UI.Colors.Green);
break;
case NotifyType.ErrorMessage:
StatusBorder.Background = new SolidColorBrush(Windows.UI.Colors.Red);
break;
}
StatusBlock.Text = message;
// Collapse the StatusBlock if it has no text to conserve real estate.
StatusBorder.Visibility = !string.IsNullOrEmpty(StatusBlock.Text) ? Visibility.Visible : Visibility.Collapsed;
if (!string.IsNullOrEmpty(StatusBlock.Text))
{
StatusBorder.Visibility = Visibility.Visible;
StatusPanel.Visibility = Visibility.Visible;
}
else
{
StatusBorder.Visibility = Visibility.Collapsed;
StatusPanel.Visibility = Visibility.Collapsed;
}
}).AsTask();
}
示例5: SetNotification
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;
}
示例6: OnNotify
public void OnNotify(string message, NotifyType type)
{
if (Notify != null)
{
Notify(this, new NotifyEventArgs(message, type));
}
}
示例7: Show
public void Show(NotifyType type, string header, string body, Action activated, Action<Exception> failed = null)
{
foreach (var x in this.notifiers)
{
x.Show(type, header, body, activated, failed);
}
}
示例8: NotifyUser
public void NotifyUser(string strMessage, NotifyType type)
{
switch (type)
{
case NotifyType.StatusMessage:
StatusBorder.Background = new SolidColorBrush(Windows.UI.Colors.Green);
break;
case NotifyType.ErrorMessage:
StatusBorder.Background = new SolidColorBrush(Windows.UI.Colors.Red);
break;
}
StatusBlock.Text = strMessage;
StatusBorder.Visibility = (StatusBlock.Text != String.Empty) ? Visibility.Visible : Visibility.Collapsed;
if (StatusBlock.Text != String.Empty)
{
StatusBorder.Visibility = Visibility.Visible;
StatusPanel.Visibility = Visibility.Visible;
}
else
{
StatusBorder.Visibility = Visibility.Collapsed;
StatusPanel.Visibility = Visibility.Collapsed;
}
}
示例9: NotifyCallbackEventArgs
public NotifyCallbackEventArgs(NotifyType notifyType, string statusId)
{
if (statusId.Length > 1)
{
this.StatusId = long.Parse(statusId);
this.NotifyType = notifyType;
}
}
示例10: NotifyUser
public async void NotifyUser(string message, NotifyType type)
{
// Always dispatch to UI thread
await rootPage.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
{
rootPage.NotifyUser(message, type);
});
}
示例11: SaveNotification
public void SaveNotification(string sessionId, string notificationMessage, NotifyType notificationType)
{
var notification = new StickyNotificationRecord();
_notificationRepository.Create(notification);
notification.SessionId = sessionId;
notification.NotificationMessage = notificationMessage;
notification.NotificationType = notificationType;
}
示例12: AlertAttivita
/// <summary>
/// Crea un Alert attività valido
/// </summary>
public AlertAttivita(NotifyType tipoAvviso, Referente destinatario, Attivita attivita)
{
TipoAvviso = tipoAvviso;
Destinatario = destinatario;
Attivita = attivita;
if (Attivita != null)
Attivita.Alert.Add(this);
}
示例13: Show
public void Show(NotifyType type, string header, string body, Action activated, Action<Exception> failed = null)
{
var toast = new Toast(header, body);
toast.Activated += (sender, args) => activated();
if (failed != null)
toast.ToastFailed += (sender, args) => failed(args.ErrorCode);
sound.SoundOutput(header, true);
toast.Show();
}
示例14: ShowMessage
public void ShowMessage(String message, NotifyType type)
{
DISPATCHER.ExecuteAsync(delegate()
{
var frame = (Frame)Window.Current.Content;
var container = frame.Content as MainPage;
container.NotifyUser(message, type);
});
}
示例15: ListOfEventSummariesType
public ListOfEventSummariesType(ObjectId objectIdentifier, EventState eventState, EventTransitionBits acknowledgedTransitions, ReadOnlyArray<TimeStamp> eventTimeStamps, NotifyType notifyType, EventTransitionBits eventEnable, ReadOnlyArray<uint> eventPriorities)
{
this.ObjectIdentifier = objectIdentifier;
this.EventState = eventState;
this.AcknowledgedTransitions = acknowledgedTransitions;
this.EventTimeStamps = eventTimeStamps;
this.NotifyType = notifyType;
this.EventEnable = eventEnable;
this.EventPriorities = eventPriorities;
}