예제 #1
0
        public MainForm(IConfigProvider configProvider,
                        IWdcStoryContainer storyContainer,
                        IStorySyncWorker syncWorker,
                        SimpleInjector.Container diContainer,
                        IStoryFileStore fileStore,
                        IGuiContext guiContext
                        )
        {
            _configProvider = configProvider;
            _storyContainer = storyContainer;
            _diContainer    = diContainer;
            _syncWorker     = syncWorker;
            _fileStore      = fileStore;
            _guiContext     = guiContext;

            InitializeComponent();

            // Set a few things up
            InitStoryList();
            RefreshStoryList();
            UpdateStatusMessage(_syncWorker.GetCurrentStatus().Message);

            // Subscribe to some events
            LogManager.OnLogEvent            += new EventHandler <LogEventArgs>(OnLogEvent);
            _storyContainer.OnUpdate         += new EventHandler <WdcStoryContainerEventArgs>(OnStoryContainerUpdate);
            _syncWorker.OnWorkerStatusChange += new EventHandler <StorySyncWorkerStatusEventArgs>(OnSyncWorkerStatusEvent);
            _syncWorker.OnStoryStatusChange  += new EventHandler <StorySyncWorkerStoryStatusEventArgs>(OnSyncWorkerStoryStatusEvent);

            CheckInitialSetupRequired();
        }
 public WdcStoryContainer(IStoryFileStore fileStore)
 {
     _fileStore       = fileStore;
     _storyCollection = new Collection <WdcStoryContainerWrapper>();
 }