public static void LoadMasterConfig() { try { FileStream stream = File.OpenRead(GetConfigFileName()); StreamReader textReader = new StreamReader(stream); XmlSerializer serializer = new XmlSerializer(typeof(Configuration)); masterConfig = serializer.Deserialize(textReader) as Configuration; stream.Flush(); stream.Close(); } catch { } if (masterConfig == null) { masterConfig = new Configuration(); } if (masterConfig.DataEditors == null) { masterConfig.DataEditors = new CustomHandler[0]; } if (masterConfig.TypeConverters == null) { masterConfig.TypeConverters = new CustomHandler[0]; } if (masterConfig.WsdlSettings == null) { masterConfig.WsdlSettings = new WsdlProperties(); } if (masterConfig.UiSettings == null) { masterConfig.UiSettings = new UiProperties(); } }
static Configuration() { masterConfig = null; }
public static void LoadMasterConfig() { try { FileStream stream1 = File.OpenRead(GetConfigFileName()); StreamReader reader1 = new StreamReader(stream1); XmlSerializer serializer1 = new XmlSerializer(typeof (Configuration)); masterConfig = serializer1.Deserialize(reader1) as Configuration; stream1.Flush(); stream1.Close(); } catch { } if (masterConfig == null) { masterConfig = new Configuration(); } if (masterConfig.DataEditors == null) { masterConfig.DataEditors = new CustomHandler[0]; } if (masterConfig.TypeConverters == null) { masterConfig.TypeConverters = new CustomHandler[0]; } if (masterConfig.WsdlSettings == null) { masterConfig.WsdlSettings = new WsdlProperties(); } if (masterConfig.UiSettings == null) { masterConfig.UiSettings = new UiProperties(); } if (masterConfig.AuthenticationHeaderSettings == null) { masterConfig.AuthenticationHeaderSettings = new AuthenticationHeaderProperties(); } if (masterConfig.BatchUpdateAssemblySettings == null) { masterConfig.BatchUpdateAssemblySettings = new BatchUpdateAssemblyPropetties(); } if (masterConfig.OtherSettings == null) { masterConfig.OtherSettings = new OtherProperties(); } if (masterConfig.ServerHistory == null) { masterConfig.ServerHistory = new ServerHistoryProperties(); } }