Beispiel #1
0
 private void OnPHmiChanged(PHmiAbstract newValue)
 {
     if (_pHmi != null)
     {
         var collection = (INotifyCollectionChanged)_pHmi.Reporter.Notifications;
         collection.CollectionChanged -= NotificationsCollectionChanged;
     }
     _pHmi = newValue;
     if (_pHmi == null)
     {
         _paginator.PaginationService = null;
     }
     else
     {
         _paginator.PaginationService = new PaginationService(_pHmi);
         var collection = (INotifyCollectionChanged)_pHmi.Reporter.Notifications;
         collection.CollectionChanged += NotificationsCollectionChanged;
         NotificationsCollectionChanged(null, null);
     }
 }
Beispiel #2
0
 public PaginationService(PHmiAbstract pHmi)
 {
     _pHmi = pHmi;
 }
Beispiel #3
0
        protected override void EstablishContext()
        {
            base.EstablishContext();
            ReporterFactory              = new Mock <INotificationReporterFactory>();
            ServiceClientFactory         = new Mock <IServiceClientFactory>();
            RunnerFactory                = new Mock <ICyclicRunnerFactory>();
            UsersRunTarget               = new Mock <IUsersRunTarget>();
            TagServiceFactory            = new Mock <ITagServiceFactory>();
            PHmiRunTargetFactory         = new Mock <IPHmiRunTargetFactory>();
            BeforeUpdateRunTarget        = new Mock <IEventRunTarget>();
            AfterUpdateRunTarget         = new Mock <IEventRunTarget>();
            TimeService                  = new Mock <ITimeService>();
            TimerService                 = new Mock <ITimerService>();
            UpdateStatusRunTargetFactory = new Mock <IUpdateStatusRunTargetFactory>();
            UpdateStatusRunTarget        = new Mock <IUpdateStatusRunTarget>();
            UpdateStatusRunTargetFactory.Setup(f => f.Create(TimeService.Object)).Returns(UpdateStatusRunTarget.Object);

            Reporter = new Mock <INotificationReporter>();
            ReporterFactory.Setup(f => f.Create(TimeService.Object))
            .Returns(Reporter.Object);
            TagService = new Mock <ITagService>();
            TagServiceFactory.Setup(f => f.Create(Reporter.Object)).Returns(TagService.Object);
            AlarmServiceFactory = new Mock <IAlarmServiceFactory>();
            AlarmService        = new Mock <IAlarmService>();
            AlarmServiceFactory.Setup(f => f.Create(Reporter.Object)).Returns(AlarmService.Object);
            TrendsServiceFactory = new Mock <ITrendsServiceFactory>();
            TrendsService        = new Mock <ITrendsService>();
            TrendsServiceFactory.Setup(f => f.Create(Reporter.Object)).Returns(TrendsService.Object);
            LogService    = new Mock <ILogService>();
            PHmiRunTarget = new Mock <IPHmiRunTarget>();
            PHmiRunTargetFactory.Setup(f => f.Create(
                                           Reporter.Object,
                                           ServiceClientFactory.Object,
                                           BeforeUpdateRunTarget.Object,
                                           UpdateStatusRunTarget.Object,
                                           UsersRunTarget.Object,
                                           TagService.Object,
                                           AlarmService.Object,
                                           TrendsService.Object,
                                           LogService.Object,
                                           AfterUpdateRunTarget.Object))
            .Returns(PHmiRunTarget.Object);
            Runner = new Mock <ICyclicRunner>();
            RunnerFactory.Setup(f => f.Create(PHmiRunTarget.Object)).Returns(Runner.Object);

            PHmi = new PHmiBase(
                ReporterFactory.Object,
                ServiceClientFactory.Object,
                RunnerFactory.Object,
                PHmiRunTargetFactory.Object,
                TimeService.Object,
                TimerService.Object,
                BeforeUpdateRunTarget.Object,
                UpdateStatusRunTargetFactory.Object,
                UsersRunTarget.Object,
                TagServiceFactory.Object,
                AlarmServiceFactory.Object,
                TrendsServiceFactory.Object,
                LogService.Object,
                AfterUpdateRunTarget.Object);
        }
Beispiel #4
0
        protected override void EstablishContext()
        {
            base.EstablishContext();
            ReporterFactory = new Mock<INotificationReporterFactory>();
            ServiceClientFactory = new Mock<IServiceClientFactory>();
            RunnerFactory = new Mock<ICyclicRunnerFactory>();
            UsersRunTarget = new Mock<IUsersRunTarget>();
            TagServiceFactory = new Mock<ITagServiceFactory>();
            PHmiRunTargetFactory = new Mock<IPHmiRunTargetFactory>();
            BeforeUpdateRunTarget = new Mock<IEventRunTarget>();
            AfterUpdateRunTarget = new Mock<IEventRunTarget>();
            TimeService = new Mock<ITimeService>();
            TimerService = new Mock<ITimerService>();
            UpdateStatusRunTargetFactory = new Mock<IUpdateStatusRunTargetFactory>();
            UpdateStatusRunTarget = new Mock<IUpdateStatusRunTarget>();
            UpdateStatusRunTargetFactory.Setup(f => f.Create(TimeService.Object)).Returns(UpdateStatusRunTarget.Object);

            Reporter = new Mock<INotificationReporter>();
            ReporterFactory.Setup(f => f.Create(TimeService.Object))
                .Returns(Reporter.Object);
            TagService = new Mock<ITagService>();
            TagServiceFactory.Setup(f => f.Create(Reporter.Object)).Returns(TagService.Object);
            AlarmServiceFactory = new Mock<IAlarmServiceFactory>();
            AlarmService = new Mock<IAlarmService>();
            AlarmServiceFactory.Setup(f => f.Create(Reporter.Object)).Returns(AlarmService.Object);
            TrendsServiceFactory = new Mock<ITrendsServiceFactory>();
            TrendsService = new Mock<ITrendsService>();
            TrendsServiceFactory.Setup(f => f.Create(Reporter.Object)).Returns(TrendsService.Object);
            LogService = new Mock<ILogService>();
            PHmiRunTarget = new Mock<IPHmiRunTarget>();
            PHmiRunTargetFactory.Setup(f => f.Create(
                Reporter.Object,
                ServiceClientFactory.Object,
                BeforeUpdateRunTarget.Object,
                UpdateStatusRunTarget.Object,
                UsersRunTarget.Object,
                TagService.Object,
                AlarmService.Object,
                TrendsService.Object,
                LogService.Object,
                AfterUpdateRunTarget.Object))
                .Returns(PHmiRunTarget.Object);
            Runner = new Mock<ICyclicRunner>();
            RunnerFactory.Setup(f => f.Create(PHmiRunTarget.Object)).Returns(Runner.Object);

            PHmi = new PHmiBase(
                ReporterFactory.Object,
                ServiceClientFactory.Object,
                RunnerFactory.Object,
                PHmiRunTargetFactory.Object,
                TimeService.Object,
                TimerService.Object,
                BeforeUpdateRunTarget.Object,
                UpdateStatusRunTargetFactory.Object,
                UsersRunTarget.Object,
                TagServiceFactory.Object,
                AlarmServiceFactory.Object,
                TrendsServiceFactory.Object,
                LogService.Object,
                AfterUpdateRunTarget.Object);
        }
Beispiel #5
0
 public LogOnDialog(PHmiAbstract pHmi)
 {
     _pHmi = pHmi;
 }
Beispiel #6
0
 public ChangePasswordDialog(PHmiAbstract pHmi)
 {
     _pHmi = pHmi;
 }
Beispiel #7
0
 public ChangePasswordDialog(PHmiAbstract pHmi)
 {
     _pHmi = pHmi;
 }
Beispiel #8
0
 public LogOnDialog(PHmiAbstract pHmi)
 {
     _pHmi = pHmi;
 }
Beispiel #9
0
 private void TrendViewerUnloaded(object sender, RoutedEventArgs e)
 {
     if (_loaded)
     {
         UnloadPens();
         _pHmi.AfterUpdate -= PHmiAfterUpdate;
         _pHmi = null;
     }
     _loaded = false;
 }
Beispiel #10
0
 private void TrendViewerLoaded(object sender, RoutedEventArgs e)
 {
     if (!_loaded)
     {
         _pHmi = (PHmiAbstract) DataContext;
         _pHmi.AfterUpdate += PHmiAfterUpdate;
         LoadPens();
         if (CurrentTrendPen == null)
         {
             CurrentTrendPen = _trendPens.FirstOrDefault();
         }
         UpdateTrend();
     }
     _loaded = true;
 }