public static WicEncoder FromMimeType(string mimeType) { if (mimeType == null) { return(null); } return(AllComponents.OfType <WicEncoder>().FirstOrDefault(c => c.SupportsMimeType(mimeType))); }
private static HashSet <string> GetDecoderExtensions() { var dic = new HashSet <string>(StringComparer.OrdinalIgnoreCase); foreach (var dec in AllComponents.OfType <WicDecoder>()) { foreach (var ext in dec.FileExtensionsList) { dic.Add(ext); } } return(dic); }
public static WicEncoder FromFileExtension(string ext) { if (ext == null) { return(null); } if (!ext.StartsWith(".", StringComparison.Ordinal)) { ext = Path.GetExtension(ext); } return(AllComponents.OfType <WicEncoder>().FirstOrDefault(e => e.SupportsFileExtension(ext))); }
public static T FromName <T>(string name) where T : WicImagingComponent { if (name == null) { return(null); } var item = AllComponents.OfType <T>().FirstOrDefault(f => f.FriendlyName.EqualsIgnoreCase(name)); if (item != null) { return(item); } return(AllComponents.OfType <T>().FirstOrDefault(f => f.FriendlyName.Replace(" ", "").EqualsIgnoreCase(name))); }
public static WicEncoder FromName(string name) { if (name == null) { return(null); } var item = AllComponents.OfType <WicEncoder>().FirstOrDefault(c => c.FriendlyName.EqualsIgnoreCase(name)); if (item != null) { return(item); } return(AllComponents.OfType <WicEncoder>().FirstOrDefault(f => f.FriendlyName.ToLowerInvariant().Replace("encoder", "").Trim().EqualsIgnoreCase(name))); }
public static T FromContainerFormatGuid <T>(Guid guid) where T : WicCodec => AllComponents.OfType <T>().FirstOrDefault(c => c.ContainerFormat == guid);
public IEnumerable <WicPixelFormatConverter> GetPixelFormatConvertersTo(Guid targetFormat) => AllComponents.OfType <WicPixelFormatConverter>().Where(pf => pf.CanConvert(Guid, targetFormat));
/// <summary> /// Runs all matching api triggers, which matches the action window /// </summary> /// <param name="input"></param> /// <param name="args"></param> public void RunApiTrigger(string input, string[] args) { AllComponents.OfType <UrlTrigger>().Where(trigger => trigger.Action.Length > 0 && trigger.Action == input).ForEach(trigger => trigger.CallNext(args)); }
public static T FromFriendlyName <T>(string friendlyName) where T : WicMetadataHandler => AllComponents.OfType <T>().FirstOrDefault(c => c.FriendlyName.EqualsIgnoreCase(friendlyName));
public static T FromFormatGuid <T>(Guid guid) where T : WicMetadataHandler => AllComponents.OfType <T>().FirstOrDefault(c => c.Guid == guid);