internal static void SaveRepositorys ( ) { System. IO. DirectoryInfo myDirectory = appDirectory ( ); foreach ( CommandRepository file in repositorys ) { CommandRepository repository = new CommandRepository ( ); repository. Save ( ); repositorys. Add ( repository ); } }
internal static void LoadRepositorys ( ) { System. IO. DirectoryInfo myDirectory = appDirectory ( ); List<System. IO. FileInfo> xmlFiles = myDirectory. GetFiles ( "*.xml", System. IO. SearchOption. TopDirectoryOnly ). ToList ( ); xmlFiles. Sort ( ( x, y ) => string. Compare ( x. Name, y. Name ) ); repositorys = new ObservableCollection<CommandRepository> ( ); foreach ( System. IO. FileInfo file in xmlFiles ) { CommandRepository repository = new CommandRepository ( ); repository. Load ( file. FullName ); repositorys. Add ( repository ); } }