Пример #1
0
        public Controller()
        {
            _graphics           = new ConsoleGraphics();
            _userActionListener = new UserActionListener();
            _modularWindow      = new ModularWindow(_graphics);
            _fileSystemService  = new FileSystemService();

            _tabs = new List <Tab>()
            {
                new Tab(Settings.LeftWindowCoordinateX, Settings.WindowCoordinateY, _userActionListener, _fileSystemService)
                {
                    IsActive = true
                },
                new Tab(Settings.RigthWindowCoordinateX, Settings.WindowCoordinateY, _userActionListener, _fileSystemService)
            };

            _systemItemView = new SystemItemView(_graphics);
            _tabView        = new TabView(_tabs, _graphics, _systemItemView);
            _hints          = new Hints(_graphics);

            _userActionListener.TabSwitching         += SelectNextTab;
            _userActionListener.PropertyRequest      += GetProperty;
            _userActionListener.FileServiceOperation += OperationEventHandler;
            _userActionListener.CompletionOfWork     += () => Exit = true;
        }
Пример #2
0
 public Tab(int coordinateX, int coordinateY, UserActionListener listener, FileSystemService fileSystemService)
 {
     CoordinateX    = coordinateX;
     CoordinateY    = coordinateY;
     CurrentPath    = string.Empty;
     _folderContent = new List <SystemItem>();
     _drives        = new List <DriveInfo>();
     _drives.AddRange(DriveInfo.GetDrives().Where(drive => drive.DriveType == DriveType.Fixed));
     _listener          = listener;
     _fileSystemService = fileSystemService;
 }