コード例 #1
0
 public void AddNotification(NotificationObject notification)
 {
     Clients.All.addNotification(JsonConvert.SerializeObject(notification,
                                                             new JsonSerializerSettings {
         ContractResolver = new CamelCasePropertyNamesContractResolver()
     }));
 }
コード例 #2
0
        static void AddNotification(string message)
        {
            var newNotification = new NotificationObject {
                Id = _notificationObjects.Count, Message = message
            };

            _notificationObjects.Add(newNotification);

            _hubProxy.Invoke("AddNotification", newNotification).Wait();
        }