public void VerifyDragOver() { var vm = new RelationshipEditorViewModel(this.iteration, this.participant, this.session.Object, this.thingDialogNavigationService.Object, this.panelNavigationService.Object, null, null); this.dropinfo.Setup(x => x.Payload).Returns(this.domain); vm.DragOver(this.dropinfo.Object); this.dropinfo.VerifySet(x => x.Effects = It.IsAny <DragDropEffects>(), Times.Once); }
public SyncSourcePageViewModel(RelationshipEditorViewModel editorViewModel) : base(editorViewModel, true) { this.ErrorsChanged += (sender, args) => { Logger.Warning("SyncSourcePageViewModel: HasErrors is now " + this.HasErrors); }; }
public void VerifyThatPropertiesAreSet() { var viewmodel = new RelationshipEditorViewModel(this.iteration, this.participant, this.session.Object, this.thingDialogNavigationService.Object, this.panelNavigationService.Object, null, null); Assert.That(viewmodel.Caption, Is.Not.Null.Or.Empty); Assert.That(viewmodel.ToolTip, Is.Not.Null.Or.Empty); Assert.IsNotNull(viewmodel.RelationshipRules); }
public SyncOptionsPageViewModel(RelationshipEditorViewModel editorViewModel) : base(editorViewModel) { this.SelectedScopeType = SyncScopeType.SourceToDestination; this.ShowEncryptionSettingsDialogCommand = new DelegatedCommand( this.ShowEncryptionSettingsDialog, this.CanShowEncryptionSettingsDialog); }
protected SyncAdaptersPageViewModel(RelationshipEditorViewModel editorViewModel, bool isSourceAdapter) : base(editorViewModel) { //this.SyncAdapters.Add(AmazonS3SyncTargetViewModel.CreateFromRelationship(this.EditorViewModel.SyncRelationship, isSourceAdapter)); this.SyncAdapters.Add(WindowsFileSystemAdapterViewModel.CreateFromRelationship(this.EditorViewModel.Relationship, isSourceAdapter)); this.SyncAdapters.Add(OneDriveAdapterViewModel.CreateFromRelationship(this.EditorViewModel.Relationship, isSourceAdapter)); this.SyncAdapters.Add(GoogleDriveAdapterViewModel.CreateFromRelationship(this.EditorViewModel.Relationship, isSourceAdapter)); this.SyncAdapters.Add(BackblazeB2AdapterViewModel.CreateFromRelationship(this.EditorViewModel.Relationship, isSourceAdapter)); this.SyncAdapters.Add(MicrosoftAzureStorageAdapterViewModel.CreateFromRelationship(this.EditorViewModel.Relationship, isSourceAdapter)); }
public SyncTriggeringPageViewModel(RelationshipEditorViewModel editorViewModel) : base(editorViewModel) { // Set default values that will be used when nothing is loaded from context this.SelectedTriggering = SyncTriggerType.Manual; this.SelectedScheduleInterval = TriggerScheduleInterval.Hourly; this.HourlyIntervalValue = 1; this.HourlyMinutesPastSyncTime = 0; this.DailyIntervalValue = 1; this.DailyStartTime = DateTime.Now.Date; this.WeeklyIntervalValue = 1; this.WeeklyStartTime = DateTime.Now.Date; this.WeeklyDaysOfWeekSelection = new DaysOfWeekSelection(); }
protected override void InvokeCommand(object obj) { SyncRelationship newRelationship = SyncRelationship.Create(); newRelationship.Description = string.Format("Sync relationship created on {0:MM/dd/yyyy} at {0:h:mm tt}", DateTime.Now); // The relationship object is not populated, so dont load the context in the view model SyncRelationshipViewModel syncRelationshipViewModel = new SyncRelationshipViewModel(newRelationship, false); RelationshipEditorViewModel viewModel = new RelationshipEditorViewModel(syncRelationshipViewModel, false); EditorWindow editorWindow = new EditorWindow { DataContext = viewModel }; editorWindow.ShowDialog(); }
public SyncPerformancePageViewModel(RelationshipEditorViewModel editorViewModel) : base(editorViewModel) { this.ThrottlingValueText = "1"; this.ThrottlingUnits = new List <ThrottlingUnit> { new ThrottlingUnit { ScaleFactor = 0x1, DisplayName = "B/sec" }, new ThrottlingUnit { ScaleFactor = 0x400, DisplayName = "KB/sec" }, new ThrottlingUnit { ScaleFactor = 0x100000, DisplayName = "MB/sec" } }; this.SelectedThrottlingUnit = this.ThrottlingUnits.Last(); }
public void VerifyThatSubscriptionsWork() { var viewmodel = new RelationshipEditorViewModel(this.iteration, this.participant, this.session.Object, this.thingDialogNavigationService.Object, this.panelNavigationService.Object, null, null); Assert.AreEqual(0, viewmodel.RelationshipRules.Count); var newBinaryRule = new BinaryRelationshipRule(Guid.NewGuid(), this.cache, this.uri); var newMultiRule = new MultiRelationshipRule(Guid.NewGuid(), this.cache, this.uri); CDPMessageBus.Current.SendObjectChangeEvent(newBinaryRule, EventKind.Added); Assert.AreEqual(1, viewmodel.RelationshipRules.Count); CDPMessageBus.Current.SendObjectChangeEvent(newMultiRule, EventKind.Added); Assert.AreEqual(2, viewmodel.RelationshipRules.Count); CDPMessageBus.Current.SendObjectChangeEvent(newBinaryRule, EventKind.Removed); Assert.AreEqual(1, viewmodel.RelationshipRules.Count); CDPMessageBus.Current.SendObjectChangeEvent(newMultiRule, EventKind.Removed); Assert.AreEqual(0, viewmodel.RelationshipRules.Count); }
public SyncDestinationPageViewModel(RelationshipEditorViewModel editorViewModel) : base(editorViewModel, false) { }
public SyncFilteringPageViewModel(RelationshipEditorViewModel editorViewModel) : base(editorViewModel) { this.SelectedScopeType = SyncScopeType.SourceToDestination; }
public SyncNamePageViewModel(RelationshipEditorViewModel editorViewModel) : base(editorViewModel) { this.CreateRelationshipCommand = new DelegatedCommand(this.CreateRelationship); }