Пример #1
0
        /// <summary>
        /// Unit test entry point for <see cref="ExternalCollection"/> serialization.
        /// </summary>
        internal static string Serialize(ExternalCollection obj)
        {
            if (obj == null)
            {
                return(string.Empty);
            }

            using (StringWriter writer = new StringWriter())
            {
                XmlSerializer xmlSerializer = new XmlSerializer(obj.GetType());
                xmlSerializer.Serialize(writer, obj);
                return(writer.ToString());
            }
        }
Пример #2
0
 public static void ReloadSavedExternals()
 {
     try
     {
         ExternalsConfigurationSettings settings = ExternalsConfigurationSettings.Default;
         _savedExternals = settings.Externals;
         if (_savedExternals == null)
         {
             _savedExternals = new ExternalCollection();
         }
     }
     catch (Exception)
     {
         // make sure that the SavedExternals property is never simply null
         _savedExternals = new ExternalCollection();
         throw;
     }
 }