private static void Main() { Thread.CurrentThread.Name = "MainThread"; Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); var treeView = new FilesTreeForm(); var treeModel = new FilesTreeModel(); var treePresenter = new FilesTreePresenter(treeView, treeModel); Application.Run(treeView); }
public FilesTreePresenter(IFilesTreeView view, FilesTreeModel model) { _view = view; _model = model; _view.TreeBuildingStarted += TreeBuildingStartedHandler; _view.TreeBuildingCanceled += TreeBuildingCanceledHandler; _view.ViewExceptionOccurred += ErrorOccurredHandler; view.TreeNodeSelected += TreeNodeSelectedHandler; _view.ResetFilesTree(); _model.ErrorOccurred += ErrorOccurredHandler; _model.TreeBuildingFinished += TreeBuildingFinishedHandler; _model.TreeElementAdded += TreeElementAddedHandler; }