public void AddFileCommand() { string source = GetFolderDestinationHandler(); parent.CurrentSource = source; if (!parent.FileSources.Any(i => i.Location == parent.CurrentSource) && !String.IsNullOrEmpty(source)) { ZipFileModel newFolder = (new ZipFileModel(parent.CurrentSource)); parent.FileSources.Add(newFolder); parent.NotifyText = null; } else { string errorText; if (String.IsNullOrEmpty(source)) { errorText = "Please select a folder"; } else { errorText = "That item already exists"; } parent.NotifyText = errorText.ToUpper(); parent.CurrentSource = null; } setCopyBtnBg(parent); }
public void RemoveFileCommand(object param) { ObservableCollection <ZipFileModel> FileSources = parent.FileSources; ZipFileModel currentFile = (ZipFileModel)param; FileSources.Remove(FileSources.Where(i => i.Location == currentFile.Location).First()); setCopyBtnBg(parent); }