Пример #1
0
 public OneDriveThumbAsset(string parentpath, OneDriveFileSystem fs, string name, string url, int width, int height, string mime) : base(parentpath, fs)
 {
     _name  = name;
     _mime  = mime;
     Width  = width;
     Height = height;
     _url   = url;
 }
Пример #2
0
        public async Task <FileSystemResult <IFileSystem> > InitAsync(string fname, IOAuthProvider provider, Dictionary <string, object> settings, string userauthorization = null)
        {
            FileSystemResult <OneDriveFileSystem> r = await OneDriveFileSystem.Create(fname, provider, settings, Name, userauthorization);

            if (!r.IsOk)
            {
                return(new FileSystemResult <IFileSystem>(r.Error));
            }
            OneDriveFileSystem f = r.Result;

            return(new FileSystemResult <IFileSystem>(f));
        }
Пример #3
0
        public static async Task <FileSystemResult <OneDriveFileSystem> > Create(string fname, IOAuthProvider provider, Dictionary <string, object> settings, string pluginanme, string userauthorization = null)
        {
            OneDriveFileSystem am = new OneDriveFileSystem(provider);

            am.FS                  = am;
            am.OAuth.OAuthUrl      = OneDriveOAuth;
            am.OAuth.EndPointUrl   = null;
            am.OAuth.OAuthLoginUrl = OneDriveOAuthLogin;
            am.OAuth.DefaultScopes = OneDriveScopes;
            bool userauth = !string.IsNullOrEmpty(userauthorization);

            if (userauth)
            {
                am.DeserializeAuth(userauthorization);
            }
            FileSystemResult r = await am.OAuth.Login(settings, pluginanme, userauth, true);

            if (!r.IsOk)
            {
                return(new FileSystemResult <OneDriveFileSystem>(r.Error));
            }
            r = await am.OAuth.MayRefreshToken();

            if (!r.IsOk)
            {
                return(new FileSystemResult <OneDriveFileSystem>(r.Error));
            }
            r = await am.QuotaAsync();

            if (!r.IsOk)
            {
                return(new FileSystemResult <OneDriveFileSystem>(r.Error));
            }
            r = await am.PopulateAsync();

            if (!r.IsOk)
            {
                return(new FileSystemResult <OneDriveFileSystem>(r.Error));
            }
            return(new FileSystemResult <OneDriveFileSystem>(am));
        }
Пример #4
0
 public OneDriveDirectory(string parentpath, OneDriveFileSystem fs) : base(parentpath, fs, OneDriveMappings.Maps)
 {
     IsPopulated = false;
 }
Пример #5
0
 public OneDriveObject(string parentname, OneDriveFileSystem fs, Mappings maps) : base(parentname, maps)
 {
     FS = fs;
 }
Пример #6
0
 public OneDriveFile(string parentpath, OneDriveFileSystem fs) : base(parentpath, fs, OneDriveMappings.Maps)
 {
 }
Пример #7
0
 public OneDriveRoot(OneDriveFileSystem fs) : base(string.Empty, fs)
 {
     IsRoot = true;
 }