public static XmlConfigFile LoadXml(string filename) { if (!Path.IsPathRooted(filename)) { filename = Path.Combine(Utils.ExtensionsDirectory, filename); } bool canCache = ActiveConfig.DB.CanCache; try { UniqueIDCache.ClearIdCache(); ActiveConfig.DB.CanCache = true; // XmlConfigFile configFile = Serializer.Read<XmlConfigFile>(filename); XmlConfigFile configFile = Serializer.Read <XmlConfigFile>(filename, "acma", "http://lithnet.local/Lithnet.Acma/v1/"); configFile.FileName = filename; ActiveConfig.XmlConfig = configFile; if (ActiveConfig.XmlConfigChanged != null) { ActiveConfig.XmlConfigChanged(null, new EventArgs()); } } finally { ActiveConfig.DB.CanCache = canCache; } return(ActiveConfig.XmlConfig); }
public static void OpenDatabase(string server, string database) { ActiveConfig.DB = new AcmaDatabase(string.Format("Data Source={0};Initial Catalog={1};Integrated Security=True", server, database)); ActiveConfig.DB.CanCache = true; if (ActiveConfig.DatabaseConnectionChanged != null) { ActiveConfig.DatabaseConnectionChanged(null, new EventArgs()); } }
static ActiveConfig() { ActiveConfig.ReadRegistrySettings(); ActiveConfig.XmlConfig = new XmlConfigFile(); }