当前位置: 首页>>代码示例>>C#>>正文


C# INotificationService.SendNotification方法代码示例

本文整理汇总了C#中INotificationService.SendNotification方法的典型用法代码示例。如果您正苦于以下问题:C# INotificationService.SendNotification方法的具体用法?C# INotificationService.SendNotification怎么用?C# INotificationService.SendNotification使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在INotificationService的用法示例。


在下文中一共展示了INotificationService.SendNotification方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Post

        public HttpResponseMessage Post([FromBody]JToken jsonbody)
        {
            // Process the jsonbody
            var requestStream = HttpContext.Current.Request.InputStream;

            Stream req = requestStream;
            req.Seek(0, System.IO.SeekOrigin.Begin);

            string json = jsonbody.ToString();

            ActionRequest ar = null;
            try
            {
                // assuming JSON.net/Newtonsoft library from http://json.codeplex.com/
                ar = JsonConvert.DeserializeObject<ActionRequest>(json);
            }
            catch
            {
                // Try and handle malformed POST body
                return new HttpResponseMessage(HttpStatusCode.BadRequest);
            }

            _notificationService = new NotificationService();
            ProgressState ps = ar.ToProgressObject(ar, ar.StateString);
            _notificationService.SendNotification(ps);

            _progressHub.sendProgressUpdate(ps);

            return new HttpResponseMessage(HttpStatusCode.Created);
        }
开发者ID:sogeti,项目名称:Site-provisioning,代码行数:30,代码来源:UpdateController.cs

示例2: NotifyUsers

 private static void NotifyUsers()
 {
     _notificationService = new NotificationService();
     var engineers = new List<User>
                         {
                             new User("Xing"),
                             new User("Saurav"),
                             new User("Saurabh"),
                             new User("Gerry"),
                             new User("Te"),
                             new User("Rupesh"),
                             new User("Chris"),
                             new User("Micheal"),
                             new User("Will"),
                             new User("Eric"),
                             new User("Ray"),
                             new User("Sameeri")
                         };
     _notificationService.SendNotification(engineers);
 }
开发者ID:chris-gibson,项目名称:solid,代码行数:20,代码来源:Program.cs

示例3: SendNotification

        private async Task SendNotification(NotificationRequest request,
            INotificationService service,
            string title,
            string description,
            User user,
            CancellationToken cancellationToken)
        {
            var notification = new UserNotification
            {
                Date = request.Date,
                Description = description,
                Level = request.Level,
                Name = title,
                Url = request.Url,
                User = user
            };

            _logger.Debug("Sending notification via {0} to user {1}", service.Name, user.Name);

            try
            {
                await service.SendNotification(notification, cancellationToken).ConfigureAwait(false);
            }
            catch (Exception ex)
            {
                _logger.ErrorException("Error sending notification to {0}", ex, service.Name);
            }
        }
开发者ID:jmarsh0507,项目名称:MediaBrowser,代码行数:28,代码来源:NotificationManager.cs


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