public void Start(ILog logger)
        {
            _logger = logger;
            ReaderWriter readerWriter = new ReaderWriter(ServiceName);

            _settings = readerWriter.Read();
            try
            {
                _serverConnector = new ServerConnector(_settings);

                var objectModifier = new ObjectModifier(_serverConnector);
                _objectUploader = new ObjectUploader(objectModifier, _serverConnector);

                _connectProvider = new ConnectProvider(_logger, _settings, _serverConnector);
                _connectProvider.Connect();

                _revitShareListener = new RevitShareListener(_objectUploader, _settings);

                _pipeServer = new PipeServer(_logger, readerWriter, _connectProvider, _objectUploader, _revitShareListener);
                _pipeServer.Start();

                _logger.InfoFormat("{0} Started Successfully", ServiceName);
            }
            catch (Exception)//in case of incorrect settings.xml
            {
                _pipeServer = new PipeServer(_logger, readerWriter, _connectProvider, _objectUploader, null);
                _pipeServer.Start();
            }
        }
예제 #2
0
 public PipeServer(ILog logger, ReaderWriter readerWriter, ConnectProvider reconnectProvider, ObjectUploader objectUploader, RevitShareListener revitShareListener)
 {
     _logger             = logger;
     _settings           = readerWriter.Settings;
     _readerWriter       = readerWriter;
     _reconnectProvider  = reconnectProvider;
     _objectUploader     = objectUploader;
     _revitShareListener = revitShareListener;
     _isWaitingResponse  = false;
 }
예제 #3
0
        public void Start(ILog logger)
        {
            _logger = logger;
            try
            {
                _settings        = SettingsReader.Read();
                _serverConnector = new ServerConnector(_settings);

                _remoteStorage = new RemoteStorageThread(_serverConnector);
                _remoteStorage.Start();

                var objectModifier = new ObjectModifier(_serverConnector, _serverConnector.PersonId);
                var objectUploader = new ObjectUploader(_remoteStorage, objectModifier, _serverConnector);

                _revitShareListener = new RevitShareListener(objectUploader, _settings);

                _logger.InfoFormat("{0} Started Successfully", ServiceName);
            }
            catch (Exception ex)
            {
                _logger.Error("OnStart Failed", ex);
            }
        }
예제 #4
0
 private void CreateNewListener()
 {
     _revitShareListener?.Dispose();
     _revitShareListener = new RevitShareListener(_objectUploader, _settings);
 }