Esempio n. 1
0
        internal static IXmlDocument GetDocument(IToastNotificationManager manager, IPredefinedToastNotificationInfo info)
        {
            var content = manager.GetTemplateContent(info.ToastTemplateType);

            for (uint i = 0; i < info.Lines.Length; i++)
            {
                SetTextLine(content, i, info.Lines[i]);
            }
            if (!string.IsNullOrEmpty(info.ImagePath))
            {
                SetImageSrc(content, new System.Uri(info.ImagePath).AbsoluteUri);
            }
            NotificationDuration actualDuration = info.Duration;

            if (info.Sound != PredefinedSound.Notification_Default)
            {
                SetSound(content, info.Sound);
                if (IsLoopingSound(info.Sound))
                {
                    actualDuration = NotificationDuration.Long;
                }
            }
            if (actualDuration != NotificationDuration.Default)
            {
                SetDuration(content, actualDuration);
            }
            return(content);
        }
 internal static IToastNotificationManager GetDefaultManager()
 {
     if (defaultManager == null)
     {
         defaultManager = ComFunctions.RoGetActivationFactory <IToastNotificationManager>();
     }
     return(defaultManager);
 }
Esempio n. 3
0
 public static IToastNotificationManager GetInstanceForCurrentApplication()
 {
     if (_instance == null)
     {
         if (App.Library.Common.DeviceInfoHelper.GetCurrentPlatform() == global::Windows.Foundation.Metadata.Platform.WindowsPhone)
         {
             _instance = new WindowsPhone.ToastNotificationManager();
         }
         else
         {
             _instance = new Windows.ToastNotificationManager();
         }
     }
     return(_instance);
 }
Esempio n. 4
0
        internal static IXmlDocument GetDocument(IToastNotificationManager manager, IPredefinedToastNotificationInfo info)
        {
            var content = manager.GetTemplateContent(GetToastTemplateType(info));

            if (ToastNotificationManager.IsGenericTemplateSupported)
            {
                UpdateTemplate(content, info);
                UpdateAttributionText(content, info);
                UpdateDisplayTimestamp(content, info);
                UpdateAppLogoImage(info, content);
                UpdateHeroImage(info, content);
            }
            UpdateText(content, info);
            UpdateInlineImage(info, content);
            UpdateSound(content, info);
            UpdateDuration(content, info);
            UpdateContent(content, info);
            return(content);
        }
 public ToastNotificationAdapter(string appId, IToastNotificationManager manager)
 {
     this.appId   = appId;
     this.manager = manager;
 }
 internal static Window.Data.Xml.Dom.IXmlDocument GetDocument(IToastNotificationManager manager, IPredefinedToastNotificationInfo info)
 {
     return(WinRTToastNotificationContent.GetDocument(manager, info));
 }
 public ToastNotificationAdapter(string appId, IToastNotificationManager manager) {
     this.appId = appId;
     this.manager = manager;
 }
 internal static Window.Data.Xml.Dom.IXmlDocument GetDocument(IToastNotificationManager manager, IPredefinedToastNotificationInfo info) {
     return WinRTToastNotificationContent.GetDocument(manager, info);
 }
 internal static IToastNotificationManager GetDefaultManager() {
     if(defaultManager == null)
         defaultManager = ComFunctions.RoGetActivationFactory<IToastNotificationManager>();
     return defaultManager;
 }
 internal static IXmlDocument GetDocument(IToastNotificationManager manager, IPredefinedToastNotificationInfo info) {
     var content = manager.GetTemplateContent(info.ToastTemplateType);
     for(uint i = 0; i < info.Lines.Length; i++) {
         SetTextLine(content, i, info.Lines[i]);
     }
     if(!string.IsNullOrEmpty(info.ImagePath)) {
         SetImageSrc(content, "file:///" + info.ImagePath);
     }
     NotificationDuration actualDuration = info.Duration;
     if(info.Sound != PredefinedSound.Notification_Default) {
         SetSound(content, info.Sound);
         if(IsLoopingSound(info.Sound)) {
             actualDuration = NotificationDuration.Long;
         }
     }
     if(actualDuration != NotificationDuration.Default) {
         SetDuration(content, actualDuration);
     }
     return content;
 }