本文整理汇总了C#中NotifyType类的典型用法代码示例。如果您正苦于以下问题:C# NotifyType类的具体用法?C# NotifyType怎么用?C# NotifyType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NotifyType类属于命名空间,在下文中一共展示了NotifyType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: NotifyUserFromBackground
public async void NotifyUserFromBackground(string strMessage, NotifyType type)
{
await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
{
NotifyUser(strMessage, type);
});
}
开发者ID:polarapfel,项目名称:Windows-universal-samples,代码行数:7,代码来源:SampleConfiguration.cs
示例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;
}
}
}
开发者ID:elijahdsouza,项目名称:MSA,代码行数:31,代码来源:MainPage.xaml.cs
示例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;
}
开发者ID:hzleihuan,项目名称:HSDcDesingPatternCourse,代码行数:39,代码来源:傳送訊息DemoControl.cs
示例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();
}
开发者ID:styniu2,项目名称:InfernoUni,代码行数:29,代码来源:MainPage.xaml.cs
示例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;
}
开发者ID:D4rkF4ce,项目名称:PiOs-UVA,代码行数:30,代码来源:PiNotify.xaml.cs
示例6: OnNotify
public void OnNotify(string message, NotifyType type)
{
if (Notify != null)
{
Notify(this, new NotifyEventArgs(message, type));
}
}
开发者ID:JohnBloom,项目名称:NHapiSampleApplication,代码行数:7,代码来源:TcpListenerHelper.cs
示例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);
}
}
开发者ID:JohnnyKaime,项目名称:KanColleViewer,代码行数:7,代码来源:AggregateNotifier.cs
示例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;
}
}
开发者ID:poiiii,项目名称:QBox-1,代码行数:25,代码来源:MainPage.xaml.cs
示例9: NotifyCallbackEventArgs
public NotifyCallbackEventArgs(NotifyType notifyType, string statusId)
{
if (statusId.Length > 1)
{
this.StatusId = long.Parse(statusId);
this.NotifyType = notifyType;
}
}
开发者ID:opentween,项目名称:OpenTween,代码行数:8,代码来源:Growl.cs
示例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);
});
}
开发者ID:C-C-D-I,项目名称:Windows-universal-samples,代码行数:8,代码来源:WiFiDirectServiceManager.cs
示例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;
}
开发者ID:Lombiq,项目名称:Smart-Notifications,代码行数:8,代码来源:NotificationManager.cs
示例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);
}
开发者ID:gipasoft,项目名称:Sfera,代码行数:12,代码来源:AlertAttivita.cs
示例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();
}
开发者ID:Sinwee,项目名称:KanColleViewer,代码行数:9,代码来源:Windows8Notifier.cs
示例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);
});
}
开发者ID:AkshayMShepHertz,项目名称:WNS-Sample,代码行数:9,代码来源:WNSCallback.cs
示例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;
}
开发者ID:LorenVS,项目名称:bacstack,代码行数:10,代码来源:GetEventInformationAck.cs
示例16: AddNotification
public static void AddNotification(this Controller context, NotifyType type, string message, bool persistForTheNextRequest)
{
string dataKey = string.Format("afa.notifications.{0}", type);
if (persistForTheNextRequest)
{
context.TempData[dataKey] = message;
}
else
{
context.ViewData[dataKey] = message;
}
}
开发者ID:America4Animals,项目名称:AFA,代码行数:12,代码来源:NotificationHelper.cs
示例17: Show
public void Show(NotifyType type, string header, string body, Action activated, Action<Exception> failed = null)
{
try
{
this.notifier.Show(type, header, body, activated, failed);
}
catch(Exception ex)
{
System.Diagnostics.Debug.WriteLine(ex);
KanColleClient.Current.CatchedErrorLogWriter.ReportException(ex.Source, ex);
}
}
开发者ID:Sinwee,项目名称:KanColleViewer,代码行数:12,代码来源:WindowsNotifier.cs
示例18: NotifyUser
public void NotifyUser(string strMessage, NotifyType type)
{
switch (type)
{
case NotifyType.StatusMessage:
StatusBlock.Foreground = new SolidColorBrush(Colors.Green);
break;
case NotifyType.ErrorMessage:
StatusBlock.Foreground = new SolidColorBrush(Colors.Red);
break;
}
StatusBlock.Text = strMessage;
}
开发者ID:thongvo,项目名称:myfiles,代码行数:13,代码来源:Window_AddEditContact.xaml.cs
示例19: Show
public void Show(NotifyType type, string header, string body, Action activated, Action<Exception> failed = null)
{
//Grabacr07.KanColleViewer.ViewModels.Contents.ShipyardViewModel sy = new Grabacr07.KanColleViewer.ViewModels.Contents.ShipyardViewModel();
//logger.WriteLine(sy.BuildingDocks[0].Ship);
logger.WriteLine("Notified:");
logger.WriteLine(header);
logger.WriteLine(body);
LCD.raiseAlarm(header+" at: " + DateTime.Now.ToString(), body);
logger.WriteLine(DateTime.Now.ToString());
//legalább műxik
//MessageBox.Show(Grabacr07.KanColleWrapper.KanColleClient.Current.Homeport.Admiral.Comment);
}
开发者ID:ProfRoxas,项目名称:KCV-LCD,代码行数:13,代码来源:Plugin.cs
示例20: GetNotifyQueueMessageData
public static Dictionary<string, long> GetNotifyQueueMessageData(NotifyType emailType, Nullable<long> SourceCustomerID, Nullable<long> TargetCustomerID, Nullable<long> ChallengeID)
{
Dictionary<string, long> data = new Dictionary<string, long>();
data.Add("nType", (long)emailType);
if (SourceCustomerID != null)
data.Add("SrcID", SourceCustomerID.GetValueOrDefault());
if(TargetCustomerID!=null)
data.Add("TgtID", TargetCustomerID.GetValueOrDefault());
if(ChallengeID!=null)
data.Add("ChaID", ChallengeID.GetValueOrDefault());
return data;
}
开发者ID:mchambers,项目名称:Daremeto,代码行数:14,代码来源:Email.cs
注:本文中的NotifyType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论