private void LoadState() { string path = "xpl_" + this.Source + ".instance" + this.InstanceNumber.ToString() + ".3.0.xml"; this.LogInfo("Loading state from " + path + "..."); this.ConfigItems = new XplConfigItems(); this.mFilters = new XplFilters(this.ConfigItems); bool flag = false; try { if (!File.Exists(path)) { this.LogInfo("The config file " + path + " does not exist. Going into remote config mode."); } else { XmlTextReader reader = new XmlTextReader(path); while (reader.Read()) { if ((reader.NodeType == XmlNodeType.Element) & (reader.Name == "configItem")) { this.ConfigItems.Add(reader.GetAttribute("key"), reader.GetAttribute("value"), (xplConfigTypes)int.Parse(reader.GetAttribute("cfgtype"))); } } reader.Close(); flag = true; this.LogInfo("Configuration loaded OK."); } } catch (Exception exception) { this.LogError("Loading did not succeed: " + exception.Message); } if (!flag) { string str2 = Environment.MachineName.ToLowerInvariant().Replace("-", "").Replace("_", ""); if (str2.Length > 14) { str2 = str2.Substring(0, 14); } this.InstanceName = str2 + this.InstanceNumber.ToString(); this.HBeat_Interval = 5; this.bConfigOnly = true; this.LogInfo("Awaiting configuration."); } }
public XplFilters(XplConfigItems ConfigItems) { this.mConfigItems = ConfigItems; this.mMatchTarget = true; this.mAlwaysPassMessages = false; }