コード例 #1
0
ファイル: ShowClient.cs プロジェクト: AlexSneg/VIRD-1.0
 //!! Метод Вызывается из Дизайнера!!
 public void InitializeFromDisigner(IClientConfiguration configuration)
 {
     try
     {
         _configuration = configuration;
         _showNotifier = new ShowNotifier(_configuration);
         _showNotifier.OnPreparationFinished += _showNotifier_OnPreparationFinished;
         _showNotifier.OnProgressChanged += _showNotifier_OnProgressChanged;
         _showNotifier.OnEquipmentStateChanged += _showNotifier_OnEquipmentStateChanged;
         _showNotifier.OnNotEnoughSpace += _showNotifier_OnNotEnoughSpace;
         _showNotifier.OnShownStatusChanged += (_showNotifier_OnShownStatusChanged);
         _showNotifier.OnReceiveAgentResourcesList += _showNotifier_OnReceiveAgentResourcesList;
         _showNotifier.OnUploadSpeed += new Action<double, string, string>(_showNotifier_OnUploadSpeed);
         _showNotifier.OnPreparationForDisplayEnded += new Action<string, bool>(_showNotifier_OnPreparationForDisplayEnded);
         _showNotifier.OnLogMessage+=new Action<string>(_showNotifier_OnLogMessage);
         _svc = new DuplexClient<IShowCommon>(new InstanceContext(_showNotifier), _pingInterval);
         _svc.Open();
         _created = true;
     }
     catch (CommunicationException)
     {
         _svc.Dispose();
         _svc = null;
         _created = false;
     }
 }
コード例 #2
0
ファイル: ShowClient.cs プロジェクト: AlexSneg/VIRD-1.0
 public bool InitializeFromPlayer(IPlayerConfiguration configuration)
 {
     _configuration = configuration;
     _showNotifier = new ShowNotifier(_configuration);
     _showNotifier.OnPreparationFinished += _showNotifier_OnPreparationFinished;
     _showNotifier.OnProgressChanged += _showNotifier_OnProgressChanged;
     _showNotifier.OnReceiveAgentResourcesList += _showNotifier_OnReceiveAgentResourcesList;
     _showNotifier.OnUploadSpeed +=new Action<double,string, string>(_showNotifier_OnUploadSpeed);
     _showNotifier.OnPreparationForDisplayEnded += new Action<string, bool>(_showNotifier_OnPreparationForDisplayEnded);
     _showNotifier.OnEquipmentStateChanged += _showNotifier_OnEquipmentStateChanged;
     _showNotifier.OnNotEnoughSpace += _showNotifier_OnNotEnoughSpace;
     _showNotifier.OnLogMessage += new Action<string>(_showNotifier_OnLogMessage);
     _showNotifier.OnExternalSystemCommand += _showNotifier_OnExternalSystemCommand;
     _svc = new DuplexClient<IShowCommon>(new InstanceContext(_showNotifier), configuration.PingInterval);
     try
     {
         _svc.Open();
     }
     catch (Exception /*ex*/)
     {
         _svc.Dispose();
         _svc = null;
         return false;
     }
     return true;
 }