/// <summary> /// Function to unload the selected plug in assemblies. /// </summary> private void DoUnloadPlugInAssemblies() { try { IReadOnlyList <CodecSetting> selected = SelectedCodecs.ToArray(); IReadOnlyList <GorgonSpriteCodecPlugIn> plugIns = selected.Select(item => item.PlugIn).ToArray(); MessageResponse response = MessageResponse.None; if (plugIns.Count == 0) { return; } foreach (GorgonSpriteCodecPlugIn plugIn in plugIns) { if ((response != MessageResponse.YesToAll) && (response != MessageResponse.NoToAll)) { response = _messageDisplay.ShowConfirmation(string.Format(Resources.GORSPR_CONFIRM_REMOVE_CODECS, Path.GetFileName(plugIn.PlugInPath)), toAll: plugIns.Count > 1); } if (response == MessageResponse.NoToAll) { return; } _busyService.SetBusy(); if (response == MessageResponse.No) { continue; } _codecs.RemoveCodecPlugIn(plugIn); foreach (CodecSetting setting in selected) { SelectedCodecs.Remove(setting); CodecPlugInPaths.Remove(setting); } _busyService.SetIdle(); } // Store the settings now. DoWriteSettings(); } catch (Exception ex) { _messageDisplay.ShowError(ex, Resources.GORSPR_ERR_CANNOT_UNLOAD_CODECS); } finally { _busyService.SetIdle(); } }
/// <summary>Function to perform an import of an image into the current image mip level and array index/depth slice.</summary> /// <returns>The source file information, image data, the virtual file entry for the working file and the original pixel format of the file.</returns> public (FileInfo file, IGorgonImage image, IGorgonVirtualFile workingFile, BufferFormat originalFormat) ImportImage() { string importPath = _importDialog.GetFilename(); if (string.IsNullOrWhiteSpace(importPath)) { return(null, null, null, BufferFormat.Unknown); } try { _busyState.SetBusy(); return(ImportImage(_importDialog.SelectedCodec, importPath)); } finally { _busyState.SetIdle(); } }