private void AddDefaultChecks() { var appPath = String.Format( "{0}{1}", Application.StartupPath, Properties.Settings.Default.DefaultChecksFolder ); string[] files = Directory.GetFiles( appPath ); var settingsManager = new SettingsManager(); //System.Collections.Generic.IList //IList<ScannerSetting> setf = settingsManager.GetSettings(); //foreach( var set in setf) // settingsManager.DeleteCheck( foreach( var file in files ) { string fname = Path.GetFileName(file.Substring(Application.StartupPath.Length)).Split( '.' )[ 0 ]; if(settingsManager.IsSettingExists(fname)) settingsManager.DeleteCheck( settingsManager.GetSettingByName(fname,false) ); var defaultCheck = new ScannerSetting { InputFile = file.Substring(Application.StartupPath.Length), CheckName = Path.GetFileName( file ).Split( '.' )[ 0 ], ResponseTypes = "200 OK" }; settingsManager.SaveCheck( defaultCheck ); } }
public FmScanner() { this._settingsManager = new SettingsManager(); this.InitializeComponent(); this.InitializeMembers(); }