/// <summary> /// Parameterized class constructor. /// </summary> public BrowseRequest(IPathModel newLocation, CancellationToken cancelToken = default(CancellationToken)) : this() { NewLocation = newLocation.Clone() as IPathModel; CancelTok = cancelToken; }
/// <summary> /// class constructor /// </summary> /// <param name="model"></param> /// <param name="itemName"></param> public FolderItemViewModel(IPathModel model, string itemName) : this() { _PathObject = model.Clone() as IPathModel; ItemName = itemName; }
/// <summary> /// Method executes when item is renamed /// -> model name is required to be renamed and dependend /// properties are updated. /// </summary> /// <param name="model"></param> private void ResetModel(IPathModel model) { var oldModel = _Model; _Model = model.Clone() as IPathModel; if (oldModel == null && model == null) { return; } if (oldModel == null && model != null || oldModel != null && model == null) { RaisePropertyChanged(() => ItemType); RaisePropertyChanged(() => ItemName); RaisePropertyChanged(() => ItemPath); return; } if (oldModel.PathType != _Model.PathType) { RaisePropertyChanged(() => ItemType); } if (string.Compare(oldModel.Name, _Model.Name, true) != 0) { RaisePropertyChanged(() => ItemName); } if (string.Compare(oldModel.Path, _Model.Path, true) != 0) { RaisePropertyChanged(() => ItemPath); } }
/// <summary> /// class constructor /// </summary> /// <param name="model"></param> /// <param name="itemName"></param> /// <param name="isReadOnly"></param> public LVItemViewModel(IPathModel model, string itemName, bool isReadOnly = false) : this() { _PathObject = model.Clone() as IPathModel; ItemName = itemName; IsReadOnly = isReadOnly; }
private void SetCurrentLocation(IPathModel pmodel) { try { _CurrentFolder = pmodel.Clone() as IPathModel; } catch { } RaisePropertyChanged(() => CurrentFolder); }
/// <summary> /// Construct an item viewmodel from a path. /// </summary> /// <param name="model"></param> /// <param name="parent"></param> /// <returns></returns> public TreeItemViewModel(IPathModel model, ITreeItemViewModel parent) : this() { _Parent = parent; _Folders.AddItem(DummyChild); _Model = model.Clone() as IPathModel; // Names of Logical drives cannot be changed with this if (_Model.PathType == FSItemType.LogicalDrive) { this.IsReadOnly = true; } }