Esempio n. 1
0
        private void LoadConfig()
        {
            if (!this.configFile.Exists)
            {
                return;
            }
            ConfigXmlDocument configXmlDocument = new ConfigXmlDocument();

            ((XmlDocument)configXmlDocument).Load(this.configFile.FullName);
            IEnumerator enumerator = configXmlDocument.StartupScripts.GetEnumerator();

            try
            {
                while (enumerator.MoveNext())
                {
                    this.startupScripts.Add(new ScriptKey(((StartupScriptXmlNode)enumerator.Current).Path.GetValue(this.scriptsDirectory)));
                }
            }
            finally
            {
                IDisposable disposable = enumerator as IDisposable;
                if (disposable != null)
                {
                    disposable.Dispose();
                }
            }
        }
Esempio n. 2
0
        private void SaveConfig()
        {
            ConfigXmlDocument configXmlDocument = new ConfigXmlDocument();

            foreach (ScriptKey scriptKey in this.startupScripts)
            {
                configXmlDocument.StartupScripts.Add(scriptKey.File, this.scriptsDirectory);
            }
            ((XmlDocument)configXmlDocument).Save(this.configFile.FullName);
        }