public StorySyncWorker(IWdcStoryContainer storyContainer, IWdcReader wdcReader, IWdcClient wdcClient, IConfigProvider configProvider, IFileDumper fileDumper, IGuiContext guiContext ) { _storyContainer = storyContainer; _wdcReader = wdcReader; _wdcClient = wdcClient; _configProvider = configProvider; _fileDumper = fileDumper; _gui = guiContext; SetSettings(configProvider.GetSection <StorySyncWorkerSettings>()); // Init some stuff _storyStatusList = new Dictionary <string, StorySyncWorkerStoryStatus>(); _ctSource = new CancellationTokenSource(); _status = new StorySyncWorkerStatus(); // TODO add functionality to react to configuration changes. E.g. Cancel process, update settings, start again. // Subscribe to some events _storyContainer.OnUpdate += new EventHandler <WdcStoryContainerEventArgs>(OnStoryContainerChanged); _configProvider.OnSectionChanged += new EventHandler <ConfigSectionChangedEventArgs>(OnSettingsChanged); }
public AddStoryWdcForm(IWdcClient client, IWdcReader reader, IWdcStoryContainer storyContainer) { _wdcClient = client; _wdcReader = reader; _wdcStoryContainer = storyContainer; _ctSourceWdcClient = new CancellationTokenSource(); InitializeComponent(); // Set the form SetFormState(AddStoryFormState.ReadToGetStory); }
public WdcReaderTests() { TestUtil.SetupLogging(); _client = new DummyWdcClient("Data"); _reader = new WdcReader(); }