Esempio n. 1
0
        /// <summary>
        /// Adds the converter.
        /// </summary>
        /// <param name="settings">The settings.</param>
        /// <param name="converter">The converter.</param>
        /// <param name="replace">if set to <c>true</c> [replace].</param>
        internal static void AddConverter(AjaxSettings settings, JavaScriptConverter converter, bool replace)
        {
            Type t;

            for (int i = 0; i < converter.SerializableTypes.Length; i++)
            {
                t = converter.SerializableTypes[i];

                if (settings.SerializableConverters.ContainsKey(t))
                {
                    if (replace)
                        settings.SerializableConverters[t] = converter;
                    continue;
                }

                settings.SerializableConverters.Add(t, converter);
            }

            for (int i = 0; i < converter.DeserializableTypes.Length; i++)
            {
                t = converter.DeserializableTypes[i];

                if (settings.DeserializableConverters.ContainsKey(t))
                {
                    if (replace)
                        settings.DeserializableConverters[t] = converter;
                    continue;
                }

                settings.DeserializableConverters.Add(t, converter);
            }
        }
Esempio n. 2
0
 /// <summary>
 /// Adds the converter.
 /// </summary>
 /// <param name="settings">The settings.</param>
 /// <param name="converter">The converter.</param>
 internal static void AddConverter(AjaxSettings settings, JavaScriptConverter converter)
 {
     AddConverter(settings, converter, false);
 }
Esempio n. 3
0
 /// <summary>
 /// Adds the converter.
 /// </summary>
 /// <param name="settings">The settings.</param>
 /// <param name="converter">The converter.</param>
 internal static void AddConverter(AjaxSettings settings, JavaScriptConverter converter)
 {
     AddConverter(settings, converter, false);
 }