コード例 #1
0
        private void Load()
        {
            this.Items.Clear();

            var conflictedFilesCount = this.alertsManager.ConflictedFiles.Count;

            if (conflictedFilesCount > 0)
            {
                var vm = new ConflictsAlertViewModel(conflictedFilesCount);
                vm.OpenConflictResolverClicked += (o, e2) => this.OpenConflictResolver();
                this.Items.Add(vm);
            }

            var foldersWithFailedTransferFiles = this.alertsManager.FoldersWithFailedTransferFiles;

            if (foldersWithFailedTransferFiles.Count > 0)
            {
                var vm = new FailedTransfersAlertViewModel(foldersWithFailedTransferFiles);
                this.Items.Add(vm);
            }

            var pausedDeviceIds = this.alertsManager.PausedDeviceIdsFromMetering;

            if (pausedDeviceIds.Count > 0)
            {
                var pausedDeviceNames = new List <string>();
                foreach (var deviceId in pausedDeviceIds)
                {
                    if (this.syncthingManager.Devices.TryFetchById(deviceId, out var device))
                    {
                        pausedDeviceNames.Add(device.Name);
                    }
                }

                var vm = new PausedDevicesFromMeteringViewModel(pausedDeviceNames);
                this.Items.Add(vm);
            }

            var configuration = this.configurationProvider.Load();

            if (!configuration.DisableHardwareRendering && !configuration.HideIntelXeWarningMessage && this.graphicsCardDetector.IsIntelXe)
            {
                this.Items.Add(this.intelXeGraphicsAlertViewModelFactory());
            }
        }
コード例 #2
0
        private void Load()
        {
            this.Items.Clear();

            var conflictedFilesCount = this.alertsManager.ConflictedFiles.Count;

            if (conflictedFilesCount > 0)
            {
                var vm = new ConflictsAlertViewModel(conflictedFilesCount);
                vm.OpenConflictResolverClicked += (o, e2) => this.OpenConflictResolver();
                this.Items.Add(vm);
            }

            var foldersWithFailedTransferFiles = this.alertsManager.FoldersWithFailedTransferFiles;

            if (foldersWithFailedTransferFiles.Count > 0)
            {
                var vm = new FailedTransfersAlertViewModel(foldersWithFailedTransferFiles);
                this.Items.Add(vm);
            }

            var pausedDeviceIds = this.alertsManager.PausedDeviceIdsFromMetering;

            if (pausedDeviceIds.Count > 0)
            {
                var pausedDeviceNames = new List <string>();
                foreach (var deviceId in pausedDeviceIds)
                {
                    Device device;
                    if (this.syncthingManager.Devices.TryFetchById(deviceId, out device))
                    {
                        pausedDeviceNames.Add(device.Name);
                    }
                }

                var vm = new PausedDevicesFromMeteringViewModel(pausedDeviceNames);
                this.Items.Add(vm);
            }
        }