예제 #1
0
        private void CreateAppFolder()
        {
            Google.Apis.Drive.v3.DriveService service = GoogleDriveFiles.GetDriveService();
            bool isRootFolderExists = GoogleDriveFiles.CheckFolder(OAuthConstants.AppName, service);

            if (isRootFolderExists == false)
            {
                GoogleDriveFiles.CreateAppFolder(OAuthConstants.AppName, service);
            }



            FilesResource.ListRequest listRequest         = service.Files.List();
            IList <Google.Apis.Drive.v3.Data.File> mfiles = listRequest.Execute().Files;

            foreach (var file in mfiles)
            {
                if (file.Name == OAuthConstants.AppName)
                {
                    LFLens.Helpers.Settings.RootFolderID = file.Id;
                }
                if (file.Name == OAuthConstants.PhotosFolderName)
                {
                    LFLens.Helpers.Settings.PhotosFolderID = file.Id;
                }
            }
        }