private static WindowsPhoneTilePushNotificationMessage GetValidWindowsPhoneTilePushNotificationMessage()
        {
            var message = new WindowsPhoneTilePushNotificationMessage()
            {
                Count = 98,
                NotificationUri = WindowsPhonePushNotificationMessageUnitTest.ChannelUri,
                Title = "Tile",
            };

            return message;
        }
コード例 #2
0
        /// <summary>
        /// Validates the Windows Phone Tile Notification Message for the rules set forth by the Notification System.
        /// </summary>
        /// <param name="windowsPhoneTilePushNotificationMessage">The notification message to be validated.</param>
        /// <param name="vrs">The uber validation results.</param>
        private static void ValidateWindowsPhoneTilePushNotificationMessage(WindowsPhoneTilePushNotificationMessage windowsPhoneTilePushNotificationMessage, ValidationResults vrs)
        {
            if (windowsPhoneTilePushNotificationMessage.DeviceType != DeviceType.WindowsPhone7_1)
            {
                if (!String.IsNullOrWhiteSpace(windowsPhoneTilePushNotificationMessage.BackBackgroundImageUri))
                {
                    vrs.Add(new ValidationResult()
                    {
                        ValidationMessageType = ValidationMessageType.Warning,
                        MessageWithCode       = StringResources.Code_0005,
                    });
                }

                if (!String.IsNullOrWhiteSpace(windowsPhoneTilePushNotificationMessage.BackTitle))
                {
                    vrs.Add(new ValidationResult()
                    {
                        ValidationMessageType = ValidationMessageType.Warning,
                        MessageWithCode       = StringResources.Code_0006,
                    });
                }

                if (!String.IsNullOrWhiteSpace(windowsPhoneTilePushNotificationMessage.BackContent))
                {
                    vrs.Add(new ValidationResult()
                    {
                        ValidationMessageType = ValidationMessageType.Warning,
                        MessageWithCode       = StringResources.Code_0007,
                    });
                }
            }

            if (windowsPhoneTilePushNotificationMessage.Count > 99)
            {
                vrs.Add(new ValidationResult()
                {
                    ValidationMessageType = ValidationMessageType.Warning,
                    MessageWithCode       = StringResources.Code_0008,
                });
            }
        }