Exemplo n.º 1
0
 /// <include file="../../docs/Microsoft.Maui.Essentials/FileBase.xml" path="//Member[@MemberName='.ctor']/Docs" />
 public FileBase(FileBase file)
 {
     FullPath    = file.FullPath;
     ContentType = file.ContentType;
     FileName    = file.FileName;
     PlatformInit(file);
 }
Exemplo n.º 2
0
        internal static AndroidUri GetShareableFileUri(FileBase file)
        {
            Java.IO.File sharedFile;
            if (FileProvider.IsFileInPublicLocation(file.FullPath))
            {
                // we are sharing a file in a "shared/public" location
                sharedFile = new Java.IO.File(file.FullPath);
            }
            else
            {
                var root = FileProvider.GetTemporaryRootDirectory();

                var tmpFile = FileSystem.GetEssentialsTemporaryFile(root, file.FileName);

                System.IO.File.Copy(file.FullPath, tmpFile.CanonicalPath);

                sharedFile = tmpFile;
            }

            // create the uri, if N use file provider
            if (HasApiLevelN)
            {
                return(FileProvider.GetUriForFile(sharedFile));
            }

            // use the shared file path created
            return(AndroidUri.FromFile(sharedFile));
        }
Exemplo n.º 3
0
 internal void PlatformInit(FileBase file)
 {
 }
Exemplo n.º 4
0
 internal void PlatformInit(FileBase file)
 {
     File = file.File;
 }
Exemplo n.º 5
0
 public OpenFileRequest(string title, FileBase file)
 {
     Title = title;
     File  = new ReadOnlyFile(file);
 }
Exemplo n.º 6
0
 internal void PlatformInit(FileBase file) =>
 throw ExceptionUtils.NotSupportedOrImplementedException;
Exemplo n.º 7
0
 public EmailAttachment(FileBase file)
     : base(file)
 {
 }