예제 #1
0
 public ApplicationPropertyRegistry(ShellApplication context, ConfigurationFile config)
     : base(context)
 {
     this.config = config;
 }
예제 #2
0
 public InputFileStream(ConfigurationFile file, HashAlgorithm algorithm)
     : base(file._configFile, FileMode.Open, FileAccess.Read, FileShare.Read)
 {
     this.file = file;
     this.algorithm = algorithm;
     readStream = new MemoryStream();
 }
예제 #3
0
 public ApplicationPropertyRegistry(ShellApplication context, ConfigurationFile config)
     : base(context)
 {
     this.config = config;
 }
예제 #4
0
        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");
        }
예제 #5
0
        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");
            }
        }
예제 #6
0
 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;
 }
예제 #7
0
        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;
        }
예제 #8
0
 protected void CreateHistoryFile(string fileName)
 {
     history = new ConfigurationFile(fileName);
 }