コード例 #1
0
        public void ExportFolderList()
        {
            var file = _dialogCreator.AskForFileToSave("Save Folder List File", OSPSuite.Core.Domain.Constants.Filter.JSON_FILE_FILTER, CoreConstants.DirectoryKey.BATCH_OUTPUT);

            if (string.IsNullOrEmpty(file))
            {
                return;
            }

            var settings = new PKSimJsonSerializerSettings();

            File.WriteAllText(file, JsonConvert.SerializeObject(_snapshotFolderListDTO.Folders.Select(x => x.Folder), Formatting.Indented, settings));
        }
コード例 #2
0
        public void ImportFolderList()
        {
            var file = _dialogCreator.AskForFileToOpen("Open Folder List File", OSPSuite.Core.Domain.Constants.Filter.JSON_FILE_FILTER, CoreConstants.DirectoryKey.BATCH_INPUT);

            if (string.IsNullOrEmpty(file))
            {
                return;
            }

            ClearFolderList();
            var settings = new PKSimJsonSerializerSettings();
            var folders  = JsonConvert.DeserializeObject <IEnumerable <string> >(File.ReadAllText(file), settings);

            _snapshotFolderListDTO.AddFolders(folders);
        }