Ejemplo n.º 1
0
 internal void Setup()
 {
     try
     {
         ViewModel.Trace("Entering Setup");
         ViewModel.ConsumerUpdateConfiguration = new RestartCommand(Restart);
         ConfigurationFactory = new ConsumerConfigurationFactory();
         //MessageHandlerFactory = new MessageHandlerFactory();
         MainWindowModel _model = new MainWindowModel()
         {
             ViewModelBindingFactory = ViewModel
         };
         BindingFactory  = _model;
         EncodingFactory = _model;
         ViewModel.Trace("Initialize consumer engine and start receiving UDP frames.");
         Start();
         ViewModel.ConsumerErrorMessage = "Running";
     }
     catch (Exception ex)
     {
         string _errorMessage = $"Error: {ex.Message}";
         ViewModel.Trace(_errorMessage);
         ViewModel.ConsumerErrorMessage = _errorMessage;
         Dispose();
     }
 }
 internal void Setup()
 {
     try
     {
         ReferenceApplicationEventSource.Log.Initialization($"{nameof(ConsumerDataManagementSetup)}.{nameof(Setup)} starting");
         ViewModel.ConsumerUpdateConfiguration = new RestartCommand(Restart); //TODO Remove reference of ConsumerDataManagementSetup System.Windows  #239
         ConfigurationFactory = new ConsumerConfigurationFactory();
         MainWindowModel _model = new MainWindowModel()
         {
             ViewModelBindingFactory = ViewModel
         };
         BindingFactory  = _model;
         EncodingFactory = _model;
         Start();
         ViewModel.ConsumerErrorMessage = "Running";
         ReferenceApplicationEventSource.Log.Initialization($" consumer engine and starting receiving data acomplished");
     }
     catch (Exception _ex)
     {
         ReferenceApplicationEventSource.Log.LogException(_ex);
         ViewModel.ConsumerErrorMessage = "ERROR";
         Dispose();
     }
 }