Example #1
0
        internal void SendNotification(DextopNotification notification)
        {
            object sound = null;

            switch (notification.Sound)
            {
            case DextopNotificationSound.Standard:
                sound = true;
                break;

            case DextopNotificationSound.Custom:
                sound = notification.CustomSound;
                break;
            }

            if (!notification.Time.HasValue)
            {
                notification.Time = DateTime.Now;
            }

            Remote.SendMessage(new
            {
                type = "notification",
                data = new Notification
                {
                    alert      = notification.Alert,
                    message    = notification.Message,
                    sound      = sound,
                    stackTrace = notification.StackTrace,
                    time       = notification.Time,
                    type       = notification.Type.ToString().ToLower(),
                    title      = notification.Title
                }
            });
        }
Example #2
0
		/// <summary>
		/// Sends the notification to the client side.
		/// </summary>
		/// <param name="notification">The notification.</param>
		public void SendNotification(DextopNotification notification)
		{
			Session.SendNotification(notification);
		}
Example #3
0
 /// <summary>
 /// Sends the notification to the client side.
 /// </summary>
 /// <param name="notification">The notification.</param>
 public void SendNotification(DextopNotification notification)
 {
     Session.SendNotification(notification);
 }
		internal void SendNotification(DextopNotification notification)
		{
			object sound = null;
			switch (notification.Sound) {
				case DextopNotificationSound.Standard:
					sound = true;
					break;
				case DextopNotificationSound.Custom:
					sound = notification.CustomSound;
					break;
			}

			if (!notification.Time.HasValue)
				notification.Time = DateTime.Now;

			Remote.SendMessage(new
			{
				type = "notification",
				data = new Notification
				{
					alert = notification.Alert,
					message = notification.Message,
					sound = sound,
					stackTrace = notification.StackTrace,
					time = notification.Time,
					type = notification.Type.ToString().ToLower(),
					title = notification.Title
				}
			});
		}