public ApplicationPropertyRegistry(ShellApplication context, ConfigurationFile config) : base(context) { this.config = config; }
public InputFileStream(ConfigurationFile file, HashAlgorithm algorithm) : base(file._configFile, FileMode.Open, FileAccess.Read, FileShare.Read) { this.file = file; this.algorithm = algorithm; readStream = new MemoryStream(); }
protected void SaveSettings(string fileName) { if (!HandlesSettings) return; if (!File.Exists(fileName)) File.Create(fileName); IDictionary<string, string> toWrite = new Dictionary<string, string>(); foreach (KeyValuePair<string, string> entry in settings.Variables) toWrite.Add(entry.Key, entry.Value); foreach (string variable in settings.SpecialVariables) toWrite.Remove(variable); ConfigurationFile configFile = new ConfigurationFile(fileName); foreach (KeyValuePair<string, string> entry in toWrite) configFile.SetValue(entry.Key, entry.Value); configFile.Save("Settings"); }
protected void SavePlugins(string fileName) { if (this is IPluginHandler) { if (!File.Exists(fileName)) File.Create(fileName); ConfigurationFile configFile = new ConfigurationFile(fileName); foreach(KeyValuePair<string, Command> plugin in plugins) { configFile.SetValue(plugin.Key, plugin.Value.GetType().FullName); } configFile.Save("Plugins"); } }
protected ApplicationSettings LoadSettings(string fileName) { if (HandlesSettings && File.Exists(fileName)) { ConfigurationFile confFile = new ConfigurationFile(fileName); foreach(KeyValuePair<string, string> pair in confFile.Properties) { settings.SetVariable(pair.Key, pair.Value); } } return settings; }
protected PropertyRegistry LoadProperties(string fileName) { if (this is IPropertyHandler && File.Exists(fileName)) { ConfigurationFile confFile = new ConfigurationFile(fileName); foreach(KeyValuePair<string, string> property in confFile.Properties) { properties.SetProperty(property.Key, property.Value); } } return properties; }
protected void CreateHistoryFile(string fileName) { history = new ConfigurationFile(fileName); }