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

C# NotificationType类代码示例

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

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



NotificationType类属于命名空间,在下文中一共展示了NotificationType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
        }
开发者ID:JoshIBrown,项目名称:BidChuck,代码行数:35,代码来源:NotificationsController.cs


示例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;
        }
开发者ID:Zicore,项目名称:TradingPostNotifier,代码行数:25,代码来源:NotificationModel.cs


示例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;
            }
        }
开发者ID:scottroot2,项目名称:MagicMirror,代码行数:32,代码来源:NotificationManager.cs


示例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;
            }
        }
开发者ID:dpvreony-forks,项目名称:TFS.ServerPlugins,代码行数:31,代码来源:EnforceCheckInPoliciesSubscriber.cs


示例5: RegisterNotificationTypes

		public override void RegisterNotificationTypes (NotificationType _notificationTypes)
		{
			base.RegisterNotificationTypes(_notificationTypes);

			// Native call
			registerNotificationTypes((int)_notificationTypes);
		}
开发者ID:georgex1,项目名称:bp-unity-nuevo-proyecto,代码行数:7,代码来源:NotificationServiceIOS.cs


示例6: CanOnlyEnterNumbersLessThanSystemStart

        public async Task CanOnlyEnterNumbersLessThanSystemStart(NotificationType notificationType,
            UKCompetentAuthority competentAuthority, int number)
        {
            var notification = await factory.CreateLegacy(notificationType, competentAuthority, number);

            Assert.IsType<NotificationApplication>(notification);
        }
开发者ID:EnvironmentAgency,项目名称:prsd-iws,代码行数:7,代码来源:NotificationApplicationFactoryTests.cs


示例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);
     }
 }
开发者ID:openpeer,项目名称:ChatterBox,代码行数:28,代码来源:PushNotificationSender.cs


示例8: Notification

 protected Notification(int accountID, NotificationType type)
 {
     AccountID = accountID;
     TimeStamp = DateTime.Now;
     Type = type;
     Status = ReadStatus.Unread;
 }
开发者ID:Metapyziks,项目名称:fortitude-server,代码行数:7,代码来源:Notification.cs


示例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);
     }
 }
开发者ID:Kei-Nanigashi,项目名称:StarryEyes,代码行数:7,代码来源:NotificationProxyWrapper.cs


示例10: ScreenNotification

 public ScreenNotification(NotificationType type, string txt, DateTime dateTime, object obj)
 {
     _type = type;
     _txt = txt;
     _dateTime = dateTime;
     _obj = obj;
 }
开发者ID:mrommel,项目名称:MiRo.SimHexWorld,代码行数:7,代码来源:ScreenNotification.cs


示例11: NotificationEventArgs

 public NotificationEventArgs(int id, HotItem item, NotifierRule rule, NotificationType type)
 {
     this.Id = id;
     this.Item = item;
     this.Rule = rule;
     this.NotificationType = type;
 }
开发者ID:Zicore,项目名称:TradingPostNotifier,代码行数:7,代码来源:NotificationEventArgs.cs


示例12: NotificationMessage

 public NotificationMessage(NotificationType type, params String[] parts)
     : base(P3bbleEndpoint.Notification)
 {
     _type = type;
     _parts = parts.ToList();
     _length = 0;
 }
开发者ID:R1chChapp3rs,项目名称:P3bble,代码行数:7,代码来源:NotificationMessage.cs


示例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);
            }
        }
开发者ID:kristersz,项目名称:Tweetus,代码行数:28,代码来源:NotificationManager.cs


示例14: ShowNotification

 public static void ShowNotification(
     [NotNull] this IServiceProvider provider,
     [NotNull] string text,
     NotificationType notificationType)
 {
     provider.ShowNotification(null, text, notificationType);
 }
开发者ID:permyakov,项目名称:janus,代码行数:7,代码来源:NotificationHelper.cs


示例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);
        }
开发者ID:BackupTheBerlios,项目名称:mspace-svn,代码行数:7,代码来源:NotificationFactory.cs


示例16: RegisterNotificationTypes

		public override void RegisterNotificationTypes (NotificationType _notificationTypes)
		{
			base.RegisterNotificationTypes(_notificationTypes);

			// Registering
			m_notificationCenter.RegisterNotificationTypes(_notificationTypes);
		}
开发者ID:noahzaozao,项目名称:UnityAdmobAppEventDemo,代码行数:7,代码来源:NotificationServiceEditor.cs


示例17: Notify

        public void Notify(string title, string message = "", NotificationType notificationType = NotificationType.None)
        {
            switch (notificationType)
            {
                case NotificationType.Information:
                    System.Console.ForegroundColor = ConsoleColor.Cyan;
                    break;
                case NotificationType.Success:
                    System.Console.ForegroundColor = ConsoleColor.Green;
                    break;
                case NotificationType.Error:
                    System.Console.ForegroundColor = ConsoleColor.Red;
                    break;
                case NotificationType.Warning:
                    System.Console.ForegroundColor = ConsoleColor.DarkMagenta;
                    break;
                default:
                    System.Console.ForegroundColor = ConsoleColor.White;
                    break;
            }

            Console.WriteLine(title);
            System.Console.ForegroundColor = ConsoleColor.White;
            Console.WriteLine(message);
            Console.WriteLine();

            Console.ResetColor();
        }
开发者ID:jen20,项目名称:Jubilee,代码行数:28,代码来源:ConsoleNotification.cs


示例18: NotifyNewArrival

 public void NotifyNewArrival(TwitterStatus status, NotificationType type, string explicitSoundSource)
 {
     if (!_proxy.NotifyNewArrival(status, type, explicitSoundSource))
     {
         Next?.NotifyNewArrival(status, type, explicitSoundSource);
     }
 }
开发者ID:karno,项目名称:StarryEyes,代码行数:7,代码来源:NotificationProxyWrapper.cs


示例19: PushNotificationSender

 public PushNotificationSender(string chanellURI, NotificationType type)
 {
     _channelURI = chanellURI;
     _notificationType = type;
     listOfNotificationsForSending = new List<Dictionary<string, string>>();
     WNSAuthentication.Instance.OnAuthenticated += OnAuthenticated;
 }
开发者ID:openpeer,项目名称:ChatterBox,代码行数:7,代码来源:PushNotificationSender.cs


示例20: 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.Notification && notificationEventArgs is CheckinNotification)
                {
                    var checkinNotification = notificationEventArgs as CheckinNotification;
                    if (ShouldMergeItemsIfNecessary(requestContext, checkinNotification))
                    {
                        var changeset = requestContext.GetChangeset(checkinNotification.Changeset);
                        if (changeset != null)
                        {
                            TfsTeamProjectCollection impersonatedCollection = requestContext.GetImpersonatedCollection(changeset.Committer);
                            MergeWorkItems(impersonatedCollection, changeset.ChangesetId);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                TeamFoundationApplicationCore.LogException("Inmeta.TFS.MergeWorkItemEventHandler encountered an exception", ex);
            }

            return EventNotificationStatus.ActionPermitted;
        }
开发者ID:ChrisEelmaa,项目名称:TFS-2015-Merge-Work-Items-Event-Handler,代码行数:28,代码来源:MergeWorkItemsEventHandler.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# NotifyCollectionChangedAction类代码示例发布时间:2022-05-24
下一篇:
C# NotificationEventArgs类代码示例发布时间: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