Example #1
0
 /// <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);
 }
Example #2
0
        /// <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);
        }