/// <summary> /// CTor /// </summary> /// <param name="view"></param> /// <param name="model"></param> public ControllerWorkspace(IViewWorkspace view, IModelWorkspace model) { _view = view; _model = model; _view.setController(this); _model.attach((IModelWorkspaceObserver)_view); _view.rootpathChanged += new ViewWorkspaceHandler <IViewWorkspace>(this.rootpathChanged); }
/// <summary> /// CTor /// </summary> /// <param name="viewWorkspace"></param> /// <param name="viewMain"></param> /// <param name="model"></param> public ControllerWorkspace(IViewWorkspace viewWorkspace, IViewMain viewMain, IModel model) { _viewWorkspace = viewWorkspace; _viewMain = viewMain; _model = model; _viewWorkspace.setController(this); _viewMain.setController(this); _model.attachWorkspace((IModelObserverWorkspace)_viewWorkspace); _model.attachMain((IModelObserverMain)_viewMain); //Workspace eventhandler _viewWorkspace.workspaceChanged += new ViewWorkspaceHandler <IViewWorkspace>(this.workspaceChanged); _viewWorkspace.workspaceChoosed += new ViewWorkspaceHandler <IViewWorkspace>(this.workspaceChoosed); _viewWorkspace.newWorkspaceChoosed += new ViewWorkspaceHandler <IViewWorkspace>(this.newWorkspaceChoosed); //Main eventhandler _viewMain.createRsaKeys += new ViewMainHandler <IViewMain>(this.createRsaKeys); _viewMain.exportRsaKey += new ViewMainHandler <IViewMain>(this.exportRsaKey); _viewMain.encryptFile += new FileHandler <IViewMain>(this.encryptFile); _viewMain.decryptFile += new FileHandler <IViewMain>(this.decryptFile); _viewMain.deleteAllFiles += new ViewMainHandler <IViewMain>(this.deleteAllFiles); }
/// <summary> /// Triggered method if the 'newWorkspaceChoosed'-event is fired. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void newWorkspaceChoosed(IViewWorkspace sender, WorkspaceEventArgs e) { createNewWorkspace(e.workspacePath); }
/// <summary> /// Triggered method if the 'workspaceChanged'-event is fired. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void workspaceChanged(IViewWorkspace sender, WorkspaceEventArgs e) { chooseWorkspace(e.workspacePath); }
private void rootpathChanged(IViewWorkspace sender, ViewEventArgs e) { chooseWorkspace(e.rootpath); }