本文整理汇总了C#中NotificationType类的典型用法代码示例。如果您正苦于以下问题:C# NotificationType类的具体用法?C# NotificationType怎么用?C# NotificationType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NotificationType类属于命名空间,在下文中一共展示了NotificationType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: buildNoticeLink
private string buildNoticeLink(NotificationType noticeType, int entityId, EntityType entityType)
{
string result = "";
switch (entityType)
{
case EntityType.Project:
switch (noticeType)
{
case NotificationType.BidSubmitted:
result = string.Format("/Project/{0}/Bid/Received", entityId);
break;
case NotificationType.InvitationRequest:
result = string.Format("/Project/{0}/Invitation/Requests", entityId);
break;
case NotificationType.InvitationResponse:
case NotificationType.InvitationToBid:
case NotificationType.ProjectChange:
result = string.Format("/Project/Details/{0}", entityId);
break;
}
break;
case EntityType.Company:
switch (noticeType)
{
case NotificationType.ConnectionAccepted:
case NotificationType.RequestToConnect:
result = string.Format("/Company/Profile/{0}", entityId);
break;
}
break;
}
return result;
}
示例2: NotificationModel
public NotificationModel(GemManager gemManager, GemRuleViewModel item, NotifierRule rule, String message, DateTime timeStamp, NotificationType notificationType)
{
this.DataId = 0;
this.IsGemNotification = true;
this.NotificationType = notificationType;
this.TimeStamp = timeStamp;
this.Message = message;
if (gemManager != null)
{
this.BuyMoney = gemManager.BuyGemPriceMoney;
this.SellMoney = gemManager.BuyGoldPriceMoney;
}
this.Rule = rule;
if (NotificationType == NotificationType.BuyGems)
{
}
else if (NotificationType == NotificationType.BuyGold)
{
this.DataId = -1;
}
Name = message;
}
示例3: ScheduleNotification
/// <summary>
/// Schedule a notification of the specified date and type.
/// </summary>
/// <param name="noticeText"></param>
/// <param name="dueTime"></param>
/// <param name="notificationType"></param>
public static void ScheduleNotification(string noticeText, DateTime dueTime, NotificationType notificationType)
{
switch (notificationType)
{
case NotificationType.Toast:
string toast = string.Format("<toast>"
+ "<visual>"
+ "<binding template = \"ToastGeneric\" >"
+ "<image placement=\"appLogoOverride\" src=\"Assets\\CompanionAppIcon44x44.png\" />"
+ "<text>{0}</text>"
+ "</binding>"
+ "</visual>"
+ "</toast>", noticeText);
XmlDocument toastDOM = new XmlDocument();
toastDOM.LoadXml(toast);
ScheduledToastNotification toastNotification = new ScheduledToastNotification(toastDOM, dueTime) { Id = "Note_Reminder" };
ToastNotificationManager.CreateToastNotifier().AddToSchedule(toastNotification);
break;
case NotificationType.Tile:
//TODO: Tile updates
throw new NotImplementedException();
default:
break;
}
}
示例4: ProcessEvent
public EventNotificationStatus ProcessEvent(TeamFoundationRequestContext requestContext, NotificationType notificationType, object notificationEventArgs, out int statusCode, out string statusMessage, out ExceptionPropertyCollection properties)
{
statusCode = 0;
properties = null;
statusMessage = string.Empty;
try
{
if (notificationType == NotificationType.DecisionPoint &&
notificationEventArgs is CheckinNotification)
{
var args = notificationEventArgs as
CheckinNotification;
if (args.PolicyOverrideInfo.PolicyFailures.Length > 0)
{
statusMessage = "Policy Overriding is not allowed.";
return EventNotificationStatus.ActionDenied;
}
}
return EventNotificationStatus.ActionPermitted;
}
catch (Exception ex)
{
// log the error and fail the check in
statusMessage = "Error in plugin '" + this.Name + "', error details: "
+ ex;
EventLog.WriteEntry("TFS Service", statusMessage,
EventLogEntryType.Error);
return EventNotificationStatus.ActionDenied;
}
}
示例5: RegisterNotificationTypes
public override void RegisterNotificationTypes (NotificationType _notificationTypes)
{
base.RegisterNotificationTypes(_notificationTypes);
// Native call
registerNotificationTypes((int)_notificationTypes);
}
示例6: CanOnlyEnterNumbersLessThanSystemStart
public async Task CanOnlyEnterNumbersLessThanSystemStart(NotificationType notificationType,
UKCompetentAuthority competentAuthority, int number)
{
var notification = await factory.CreateLegacy(notificationType, competentAuthority, number);
Assert.IsType<NotificationApplication>(notification);
}
示例7: SendNotification
public async void SendNotification(string channelURI, string payload, NotificationType type = NotificationType.Raw)
{
if (WNSAuthentication.Instance.oAuthToken.AccessToken != null && !WNSAuthentication.Instance.IsRefreshInProgress)
{
using (var client = new WebClient())
{
SetHeaders(type, client);
try
{
await client.UploadStringTaskAsync(new Uri(channelURI), payload);
}
catch (WebException webException)
{
if (webException?.Response != null)
HandleError(((HttpWebResponse)webException.Response).StatusCode, channelURI, payload);
Debug.WriteLine(String.Format("Failed WNS authentication. Error: {0}", webException.Message));
}
catch (Exception)
{
HandleError(HttpStatusCode.Unauthorized, channelURI, payload);
}
}
}
else
{
StoreNotificationForSending(channelURI, payload);
}
}
示例8: Notification
protected Notification(int accountID, NotificationType type)
{
AccountID = accountID;
TimeStamp = DateTime.Now;
Type = type;
Status = ReadStatus.Unread;
}
示例9: NotifyNewArrival
public void NotifyNewArrival(TwitterStatus status, NotificationType type, string explicitSoundSource)
{
if (!_proxy.NotifyNewArrival(status, type, explicitSoundSource) && this.Next != null)
{
this.Next.NotifyNewArrival(status, type, explicitSoundSource);
}
}
示例10: ScreenNotification
public ScreenNotification(NotificationType type, string txt, DateTime dateTime, object obj)
{
_type = type;
_txt = txt;
_dateTime = dateTime;
_obj = obj;
}
示例11: NotificationEventArgs
public NotificationEventArgs(int id, HotItem item, NotifierRule rule, NotificationType type)
{
this.Id = id;
this.Item = item;
this.Rule = rule;
this.NotificationType = type;
}
示例12: NotificationMessage
public NotificationMessage(NotificationType type, params String[] parts)
: base(P3bbleEndpoint.Notification)
{
_type = type;
_parts = parts.ToList();
_length = 0;
}
示例13: CreateNewNotification
public async Task CreateNewNotification(ObjectId notifiedUserId, NotificationType type, ObjectId userId, ObjectId? tweetId)
{
var existingUserNotification = await _repository.UserNotifications.Find(n => n.UserId == notifiedUserId).FirstOrDefaultAsync();
var newNotification = new Notification();
newNotification.Type = (int)type;
newNotification.UserId = userId;
newNotification.CreatedOn = DateTime.Now;
if (tweetId.HasValue)
newNotification.TweetId = tweetId.Value;
if (existingUserNotification == null)
{
var userNotification = new UserNotifications();
userNotification.UserId = notifiedUserId;
userNotification.Notifications = new List<Notification>() { newNotification };
await _repository.UserNotifications.InsertOneAsync(userNotification);
}
else
{
existingUserNotification.Notifications.Add(newNotification);
await _repository.UserNotifications.ReplaceOneAsync(n => n.Id == existingUserNotification.Id, existingUserNotification);
}
}
示例14: ShowNotification
public static void ShowNotification(
[NotNull] this IServiceProvider provider,
[NotNull] string text,
NotificationType notificationType)
{
provider.ShowNotification(null, text, notificationType);
}
示例15: ShowMessageNotification
public static void ShowMessageNotification(string header, string body,
int timeout, int width,
int height, NotificationType type,
TimerEndedHandler thandler)
{
ShowSvgNotification (null, NotificationSource.Text, header, body, timeout, width, height, type, thandler);
}