Пример #1
0
        //Fit extension to MIME type.
        //(*) When there is no corresponding extension (including "*"), it is ignored (= as it is at present).
        //(*) If there are multiple corresponding extensions, [0] is used.
        //
        //拡張子を MIME type に合わせる。
        //※対応する拡張子がないとき("*"も含む)は無視される(=現状のまま)。
        //※複数の対応拡張子がある場合、[0] が使われる。
        private void SyncFileNameExtension()
        {
            if (string.IsNullOrEmpty(FileName))
            {
                return;
            }

            var ext = AndroidMimeType.GetExtension(MimeTypes[0]);  //nothing or all(*) = null

            if (ext != null && ext.Length > 0)                     //Ignore if not found (It will stay at the current setting)
            {
                FileName = Path.ChangeExtension(fileName, ext[0]); //'.' can be either with or without it
            }
        }
Пример #2
0
 public static void GetExtToMimeList(out List <string> ext, out List <string[]> mime)
 {
     AndroidMimeType.GetExtToMimeList(ConstantValues, out ext, out mime);
 }
Пример #3
0
 public static void GetMimeToExtList(out List <string> mime, out List <string[]> ext)
 {
     AndroidMimeType.GetMimeToExtList(ConstantValues, out mime, out ext);
 }