The default implementation of a IRequestFactory for Google Drive
Наследование: RestSharp.Portable.Microsoft.OneDrive.IRequestFactory
 /// <summary>
 /// Initializes a new instance of the <see cref="OneDriveFileSystem"/> class.
 /// </summary>
 /// <param name="service">The OneDrive service instance to use for communication with the OneDrive API</param>
 /// <param name="supportFactory">A support factory instance to create some classes in a platform-agnostic way</param>
 /// <param name="drive">The drive to use</param>
 /// <param name="rootFolder">The root folder to use</param>
 public OneDriveFileSystem([NotNull] OneDriveService service, [NotNull] OneDriveSupportFactory supportFactory, [NotNull] Drive drive, [NotNull] Item rootFolder)
 {
     Service = service;
     _supportFactory = supportFactory;
     Drive = drive;
     RootFolderItem = rootFolder;
     Root = new OneDriveDirectoryEntry(this, rootFolder, true);
 }
Пример #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="OneDriveFileSystem"/> class.
 /// </summary>
 /// <param name="service">The OneDrive service instance to use for communication with the OneDrive API</param>
 /// <param name="supportFactory">A support factory instance to create some classes in a platform-agnostic way</param>
 /// <param name="drive">The drive to use</param>
 /// <param name="rootFolder">The root folder to use</param>
 public OneDriveFileSystem([NotNull] OneDriveService service, [NotNull] OneDriveSupportFactory supportFactory, [NotNull] Drive drive, [NotNull] Item rootFolder)
 {
     Service         = service;
     _supportFactory = supportFactory;
     Drive           = drive;
     RootFolderItem  = rootFolder;
     Root            = new OneDriveDirectoryEntry(this, rootFolder, true);
 }
Пример #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="OneDriveFileSystemProvider"/> class.
 /// </summary>
 /// <param name="drive">The drive</param>
 /// <param name="rootFolder">The root folder entry</param>
 /// <param name="supportFactory">A <see cref="IRequestFactory"/> used to create <see cref="IRestClient"/> and <see cref="HttpWebRequest"/> objects</param>
 public OneDriveFileSystemProvider(Drive drive, Item rootFolder, OneDriveSupportFactory supportFactory)
 {
     _drive = drive;
     _rootFolder = rootFolder;
     _supportFactory = supportFactory;
 }
Пример #4
0
        public static async Task <OneDriveFileSystem> Create([NotNull] OneDriveService service, [NotNull] OneDriveSupportFactory supportFactory, [NotNull] Drive drive, CancellationToken cancellationToken)
        {
            var rootFolderInfo = await service.GetRootFolderAsync(drive.Id, cancellationToken);

            return(new OneDriveFileSystem(service, supportFactory, drive, rootFolderInfo));
        }
Пример #5
0
        public static async Task <OneDriveFileSystem> Create([NotNull] OneDriveService service, [NotNull] OneDriveSupportFactory supportFactory, CancellationToken cancellationToken)
        {
            var drive = await service.GetDefaultDriveAsync(cancellationToken);

            return(await Create(service, supportFactory, drive, cancellationToken));
        }
Пример #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="OneDriveFileSystemProvider"/> class.
 /// </summary>
 /// <param name="drive">The drive</param>
 /// <param name="rootFolder">The root folder entry</param>
 /// <param name="supportFactory">A <see cref="IRequestFactory"/> used to create <see cref="IRestClient"/> and <see cref="HttpWebRequest"/> objects</param>
 public OneDriveFileSystemProvider(Drive drive, Item rootFolder, OneDriveSupportFactory supportFactory)
 {
     _drive          = drive;
     _rootFolder     = rootFolder;
     _supportFactory = supportFactory;
 }