コード例 #1
0
ファイル: Bootstrapper.cs プロジェクト: runerys/DomaMove
        protected override void OnStartup(object sender, StartupEventArgs e)
        {
            base.OnStartup(sender, e);

            _settingsStorage = new ConnectionSettingsStorage();
            _sourceSettings = _settingsStorage.Load(Role.Source);
            _targetSettings = _settingsStorage.Load(Role.Target);

            var domaClientFactory = new DomaClientFactory();
            var imageDownloader = new ImageDownloader();

            var source = new DomaConnection(domaClientFactory, imageDownloader, _sourceSettings);
            var target = new DomaConnection(domaClientFactory, imageDownloader, _targetSettings);

            _tracker = new Tracker();

            if (ConfigurationManager.AppSettings.AllKeys.Any(x => x == "skiptracking") && ConfigurationManager.AppSettings["skiptracking"] == "true")
                _tracker = new NullTracker();

            if (ConfigurationManager.AppSettings.AllKeys.Any(x => x == "messageboxerrors") &&
                ConfigurationManager.AppSettings["messageboxerrors"] == "true")
                _messageboxOnError = true;

            var transferViewModel = new MoveViewModel(source, target, _tracker);
            var windowManager = (WindowManager)GetInstance(typeof(WindowManager), null);

            windowManager.ShowWindow(transferViewModel);
        }
コード例 #2
0
ファイル: Steps.cs プロジェクト: runerys/DomaMove
        public void GivenABlankInputField()
        {
            _clientFactory = A.Fake<DomaClientFactory>();

            A.CallTo(() => _clientFactory.Create(null)).Returns(A.Fake<DOMAServicePortType>());

            var imageDownloader = A.Fake<ImageDownloader>();

            _connection = new DomaConnection(_clientFactory, imageDownloader, _connectionSettings);
        }
コード例 #3
0
ファイル: DomaConnection.cs プロジェクト: runerys/DomaMove
        public DomaConnection(DomaClientFactory clientFactory, ImageDownloader imageDownloader, ConnectionSettings connectionSettings)
        {
            _clientFactory = clientFactory;
            _imageDownloader = imageDownloader;
            _connectionSettings = connectionSettings;

            Url = connectionSettings.Url;
            Username = connectionSettings.User;
            Password = connectionSettings.Password;

            Maps = new List<TransferMap>();
            Categories = new List<Category>();
        }