Пример #1
0
        /// <summary>
        /// Given a <see cref="MobileServiceSystemProperties"/> enum value, returns the string value with the
        /// correct casing and system property prefix.
        /// </summary>
        /// <param name="systemProperty">The system property.</param>
        /// <returns>A string of the system property with the correct casing and system property prefix.</returns>
        private static string GetSystemPropertyString(MobileServiceSystemProperties systemProperty)
        {
            string enumAsString       = systemProperty.ToString();
            char   firstLetterAsLower = char.ToLowerInvariant(enumAsString[0]);

            return(string.Format("{0}{1}{2}", MobileServiceSerializer.SystemPropertyPrefix, firstLetterAsLower, enumAsString.Substring(1)));
        }
Пример #2
0
        /// <summary>
        /// Gets the system properties header value from the <see cref="MobileServiceSystemProperties"/>.
        /// </summary>
        /// <param name="properties">The system properties to set in the system properties header.</param>
        /// <returns>
        /// The system properties header value. Returns null if the systemProperty value is None.
        /// </returns>
        private static string GetSystemPropertiesString(MobileServiceSystemProperties properties)
        {
            if (properties == MobileServiceSystemProperties.None)
            {
                return(null);
            }
            if (properties == MobileServiceSystemProperties.All)
            {
                return("*");
            }

            string[] systemProperties = properties.ToString().Split(',');

            for (int i = 0; i < systemProperties.Length; i++)
            {
                string property           = systemProperties[i].Trim();
                char   firstLetterAsLower = char.ToLowerInvariant(property[0]);
                systemProperties[i] = MobileServiceSerializer.SystemPropertyPrefix + firstLetterAsLower + property.Substring(1);
            }

            string systemPropertiesString = string.Join(",", systemProperties);

            return(systemPropertiesString);
        }
        /// <summary>
        /// Gets the system properties header value from the <see cref="MobileServiceSystemProperties"/>.
        /// </summary>
        /// <param name="properties">The system properties to set in the system properties header.</param>
        /// <returns>
        /// The system properties header value. Returns null if the systemProperty value is None.
        /// </returns>
        private static string GetSystemPropertiesString(MobileServiceSystemProperties properties)
        {
            if (properties == MobileServiceSystemProperties.None)
            {
                return null;
            }
            if (properties == MobileServiceSystemProperties.All)
            {
                return "*";
            }

            string[] systemProperties = properties.ToString().Split(',');

            for (int i = 0; i < systemProperties.Length; i++)
            {
                string property = systemProperties[i].Trim();
                char firstLetterAsLower = char.ToLowerInvariant(property[0]);
                systemProperties[i] = MobileServiceSerializer.SystemPropertyPrefix + firstLetterAsLower + property.Substring(1);
            }

            string systemPropertiesString = string.Join(",", systemProperties);
            return systemPropertiesString;
        }
 /// <summary>
 /// Given a <see cref="MobileServiceSystemProperty"/> enum value, returns the string value with the 
 /// correct casing and system property prefix.
 /// </summary>
 /// <param name="systemProperty">The system property.</param>
 /// <returns>A string of the system property with the correct casing and system property prefix.</returns>
 private static string GetSystemPropertyString(MobileServiceSystemProperties systemProperty)
 {
     string enumAsString = systemProperty.ToString();
     char firstLetterAsLower = char.ToLowerInvariant(enumAsString[0]);
     return string.Format("{0}{1}{2}", MobileServiceSerializer.SystemPropertyPrefix, firstLetterAsLower, enumAsString.Substring(1));
 }