Ejemplo n.º 1
0
        public static async Task PushModifiedItemsToTheCLoud()
        {
            foreach (var workingDirFile in _workingDirFiles)
            {
                if (_odAppFolderItems.ContainsKey(workingDirFile.Key))
                {
                    var props = await workingDirFile.Value.GetBasicPropertiesAsync();

                    if (props.DateModified <= _odAppFolderItems[workingDirFile.Key].LastModifiedDateTime)
                    {
                        continue;
                    }
                    var stream = await workingDirFile.Value.OpenStreamForReadAsync();

                    await
                    OneDriveConnectionHelper.CreateFile(OneDriveConnectionHelper.AppFolder,
                                                        workingDirFile.Value.Name, stream
                                                        );
                }
                else
                {
                    var stream = await workingDirFile.Value.OpenStreamForReadAsync();

                    await
                    OneDriveConnectionHelper.CreateFile(OneDriveConnectionHelper.AppFolder,
                                                        workingDirFile.Value.Name, stream
                                                        );
                }
            }
        }
Ejemplo n.º 2
0
        public static async Task GetFilesFromCloud()
        {
            await OneDriveConnectionHelper.GetAppFolder();

            var list = await OneDriveConnectionHelper.GetODItemsFromAppFolder();

            foreach (var odItem in list)
            {
                _odAppFolderItems.Add(odItem.Name, odItem);
            }
        }
Ejemplo n.º 3
0
        public static async void Initialise(string directoryPath)
        {
            await OneDriveConnectionHelper.Login();

            WorkingDirectoryString = directoryPath;
            await CheckWorkingDirExistsElseCreateIt();
            await GetFilesFromCloud();
            await GetFileFromWorkingDirectory();
            await GetNewFilesFromCloud();
            await GetUpdatedFilesFromCloud();
        }