コード例 #1
0
        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);
        }
コード例 #2
0
 public SyncSourcePageViewModel(RelationshipEditorViewModel editorViewModel)
     : base(editorViewModel, true)
 {
     this.ErrorsChanged += (sender, args) =>
     {
         Logger.Warning("SyncSourcePageViewModel: HasErrors is now " + this.HasErrors);
     };
 }
コード例 #3
0
        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);
        }
コード例 #4
0
        public SyncOptionsPageViewModel(RelationshipEditorViewModel editorViewModel)
            : base(editorViewModel)
        {
            this.SelectedScopeType = SyncScopeType.SourceToDestination;

            this.ShowEncryptionSettingsDialogCommand = new DelegatedCommand(
                this.ShowEncryptionSettingsDialog,
                this.CanShowEncryptionSettingsDialog);
        }
コード例 #5
0
 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));
 }
コード例 #6
0
        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();
        }
コード例 #7
0
        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();
        }
コード例 #8
0
        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();
        }
コード例 #9
0
        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);
        }
コード例 #10
0
 public SyncDestinationPageViewModel(RelationshipEditorViewModel editorViewModel)
     : base(editorViewModel, false)
 {
 }
コード例 #11
0
 public SyncFilteringPageViewModel(RelationshipEditorViewModel editorViewModel)
     : base(editorViewModel)
 {
     this.SelectedScopeType = SyncScopeType.SourceToDestination;
 }
コード例 #12
0
 public SyncNamePageViewModel(RelationshipEditorViewModel editorViewModel)
     : base(editorViewModel)
 {
     this.CreateRelationshipCommand = new DelegatedCommand(this.CreateRelationship);
 }