コード例 #1
0
ファイル: MonitorViewModel.cs プロジェクト: oduma/MySynch
        public MonitorViewModel(IDistributorMonitorProxy distributorMonitorProxy,ListAvailableChannelsResponse listAvailableComponentsTreeResponse, int localDistributorPort)
        {
            _localDistributorPort = localDistributorPort;
            _distributorMonitorProxy = distributorMonitorProxy;
            DistributorName = listAvailableComponentsTreeResponse.Name;
            var availableChannels = listAvailableComponentsTreeResponse.Channels;
            AvailableChannels = new ObservableCollection<AvailableChannelViewModel>();
            AvailableChannels = availableChannels.AddToChannels(AvailableChannels);

            _timer = new Timer();
            _timer.Interval = 10000;
        }
コード例 #2
0
ファイル: ClientHelper.cs プロジェクト: oduma/MySynch
 public void ConnectToADistributor(EventHandler<ProgressChangedEventArgs> progressChanged, int localDistributorPort, out IDistributorMonitorProxy distributorMonitorProxy, out ListAvailableChannelsResponse availableComponents)
 {
     progressChanged(this, new ProgressChangedEventArgs(0, "Connecting to Distributor at port: " + localDistributorPort));
     distributorMonitorProxy = new DistributorMonitorClient();
     distributorMonitorProxy.InitiateUsingPort(localDistributorPort);
     progressChanged(this, new ProgressChangedEventArgs(0, "Connected to Distributor at port: " + localDistributorPort + " checking registrations..."));
     availableComponents = distributorMonitorProxy.ListAvailableChannels();
     progressChanged(this,
                     new ProgressChangedEventArgs(0,
                                                  string.Format(
                                                      "{0} channels registered at the distributor",
                                                      availableComponents.Channels.Count())));
 }
コード例 #3
0
ファイル: MonitorView.xaml.cs プロジェクト: oduma/MySynch
 public MonitorView(int localDistributorPort,IDistributorMonitorProxy distributorProxy=null,ListAvailableChannelsResponse listAvailableComponentsTreeResponse=null)
 {
     InitializeComponent();
     try
     {
         var monitorViewModel = new MonitorViewModel(distributorProxy,listAvailableComponentsTreeResponse,localDistributorPort);
         monitorViewModel.InitiateView();
         this.DataContext = monitorViewModel;
     }
     catch (Exception ex)
     {
         LoggingManager.LogMySynchSystemError(ex);
         throw;
     }
 }
コード例 #4
0
 public NotificationDetailsViewModel(IDistributorMonitorProxy distributorMonitorProxy)
 {
     using (LoggingManager.LogMySynchPerformance())
     {
         TreeReady = Visibility.Hidden;
         TreeNotReady = Visibility.Visible;
         _timer= new Timer();
         _timer.Interval = 10000;
         _distributorMonitorProxy = distributorMonitorProxy;
         BackgroundWorker backgroundWorker = new BackgroundWorker();
         backgroundWorker.DoWork += new DoWorkEventHandler(backgroundWorker_DoWork);
         backgroundWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(backgroundWorker_RunWorkerCompleted);
         backgroundWorker.ProgressChanged += new ProgressChangedEventHandler(backgroundWorker_ProgressChanged);
         backgroundWorker.RunWorkerAsync();
     }
 }
コード例 #5
0
ファイル: ClientHelper.cs プロジェクト: oduma/MySynch
 public void DisconnectFromADistributor(EventHandler<ProgressChangedEventArgs> progressChanged, int localDistributorPort, IDistributorMonitorProxy distributorMonitorProxy)
 {
     progressChanged(this, new ProgressChangedEventArgs(0, "Disconnecting from Distributor at port: " + localDistributorPort));
     distributorMonitorProxy.DestroyAtPort(localDistributorPort);
     progressChanged(this, new ProgressChangedEventArgs(0, "Disconnected from Distributor at port: " + localDistributorPort + " checking registrations..."));
 }