internal FileVM(
            File file,
            IVirtualDirectoryHubClientTwoWayComm virtualDirectoryHubClientTwoWayComm,
            ObservableCollection <FolderVM> folderCollection) : base(virtualDirectoryHubClientTwoWayComm)
        {
            _file = file;
            VirtualDirectoryHubClientTwoWayComm.FileUpdated += UpdateData;
            FolderCollection = folderCollection;

            DeleteCommand = new DelegateCommand(Delete);
            SaveCommand   = new DelegateCommand(Save, arg => IsModified && !HasErrors);

            CopyDataFromDataModel();
        }
Пример #2
0
        public VirtualDirectoryVM(IVirtualDirectoryHubClientTwoWayComm virtualDirectoryHubClientTwoWayComm)
        {
            _virtualDirectoryHubClientTwoWayComm              = virtualDirectoryHubClientTwoWayComm;
            _virtualDirectoryHubClientTwoWayComm.FileCreated += OnFileCreated;
            _virtualDirectoryHubClientTwoWayComm.FileDeleted += OnFileDeleted;

            _virtualDirectoryHubClientTwoWayComm.FolderCreated += OnFolderCreated;
            _virtualDirectoryHubClientTwoWayComm.FolderDeleted += OnFolderDeleted;

            ExplorerVM = new ExplorerVM(_fileCollection, _folderCollection);

            CreateFileCommand   = new DelegateCommand(CreateFile);
            CreateFolderCommand = new DelegateCommand(CreateFolder);
        }