public static Dictionary <string, KeyValuePair <HashSet <string>, HashSet <Guid> > > GetExtensions(Remote remote) { Dictionary <string, KeyValuePair <HashSet <string>, HashSet <Guid> > > res = remote == null ? new Dictionary <string, KeyValuePair <HashSet <string>, HashSet <Guid> > >(StringComparer.OrdinalIgnoreCase) : remote.GetExtensions(); foreach (IWICBitmapCodecInfo ci in AllComponentsRuleGroup.GetComponentInfos(WICComponentType.WICDecoder)) { Guid cf; ci.GetContainerFormat(out cf); foreach (string ext in Extensions.GetString(ci.GetFileExtensions).Split(',')) { KeyValuePair <HashSet <string>, HashSet <Guid> > data; if (!res.TryGetValue(ext, out data)) { data = new KeyValuePair <HashSet <string>, HashSet <Guid> >(new HashSet <string>(StringComparer.OrdinalIgnoreCase), new HashSet <Guid>()); res.Add(ext, data); } foreach (string mime in Extensions.GetString(ci.GetMimeTypes).Split(',')) { data.Key.Add(mime); } data.Value.Add(cf); } } return(res); }
public KeyValuePair <Guid, string>[] GetComponentInfoPairs(WICComponentType type) { return(AllComponentsRuleGroup.GetComponentInfoPairs(type, null).ToArray()); }