Пример #1
0
        public void RoundtripRepositorySettingsWithRepo()
        {
            var backupSettings = new BackupSettings(new DirectoryInfo(@"C:\Temp\Gu.Settings\" + GetType().Name + @"\Backup"));
            var directory      = new DirectoryInfo(@"C:\Temp\Gu.Settings\" + GetType().Name);
            var settings       = new XmlRepositorySettings(directory, true, true, backupSettings, ".cfg", ".tmp");
            var repository     = new XmlRepository(settings);

            repository.Save(settings);
            var repositorySettings = repository.Read <XmlRepositorySettings>();
        }
        private void UiCommandFired(object obj)
        {
            switch (obj as string)
            {
            case @"1":
                _type.ConfigName = @"D:\demofile.type";
                _repo.Create(_type);
                Messages.Add($"geschrieben: {_type.ConfigName}");
                break;

            case @"2":

                var file = _repo.Read(@"D:\demofile.type");
                Messages.Add($"gelesen: {_type.ConfigName}");
                break;
            }
        }