示例#1
0
        /// <summary>
        /// This method handles StartStop Sycn button in tray menu.
        /// </summary>
        private async void StartStopSync(FullSyncService syncService)
        {
            if (!sycnStopped)
            {
                await syncService.StopAsync();

                sycnStopped = true;
                StatusToSyncStopped();
            }
            else
            {
                await syncService.StartAsync();

                sycnStopped = false;
                StatusToIdle();
            }
        }
        /// <inheritdoc/>
        public virtual async Task SetEnabledAsync(bool enabled)
        {
            if (enabled)
            {
                // Start periodical synchronyzation between client and server,
                // in case any changes are lost because the client or the server were unavailable.
                await SyncService.StartAsync();

                // Start monitoring pinned/unpinned attributes and files/folders creation in user file system.
                await userFileSystemMonitor.StartAsync();
            }
            else
            {
                await SyncService.StopAsync();

                await userFileSystemMonitor.StopAsync();
            }
        }