void ValidateMpnsHeaders()

in src/Microsoft.Azure.NotificationHubs/WindowsPhoneTemplateRegistrationDescription.cs [334:354]


        void ValidateMpnsHeaders()
        {
            if (this.MpnsHeaders == null ||
                !this.MpnsHeaders.ContainsKey(MpnsTemplateRegistrationDescription.NotificationClass) ||
                string.IsNullOrWhiteSpace(this.MpnsHeaders[MpnsTemplateRegistrationDescription.NotificationClass]))
            {
                throw new InvalidDataContractException(
                    string.Format(SRClient.MissingMpnsHeader, MpnsTemplateRegistrationDescription.NotificationClass));
            }

            // MPNS headers validation
            foreach (string header in this.MpnsHeaders.Keys)
            {
                if (string.IsNullOrWhiteSpace(this.MpnsHeaders[header]))
                {
                    throw new InvalidDataContractException(string.Format(SRClient.MpnsHeaderIsNullOrEmpty, header));
                }

                ExpressionEvaluator.Validate(this.MpnsHeaders[header]);
            }
        }