public int CompareTo(object obj, string propertyName) { if (obj == null) { return(1); } Item item = obj as Item; if (item == null) { throw new ArgumentException("Object is not an Item"); } int result = 0; switch (propertyName) { case "Path": result = Path.CompareTo(item.Path); break; case "Size": case "HumanReadableSize": result = Size.CompareTo(item.Size); break; case "AverageFileSize": case "HumanReadableAverageFileSize": result = AverageFileSize.CompareTo(item.AverageFileSize); break; case "NumberOfFiles": result = NumberOfFiles.CompareTo(item.NumberOfFiles); break; case "NumberOfDirectories": result = NumberOfDirectories.CompareTo(item.NumberOfDirectories); break; case "Name": result = Name.CompareTo(item.Name); break; case "Target": result = Target.CompareTo(item.Target); break; case "IsSymLink": result = IsSymLink.CompareTo(item.IsSymLink); break; case "IsDisabled": result = IsDisabled.CompareTo(item.IsDisabled); break; } if (result == 0) { if (propertyName == null || !propertyName.Equals("Path")) { result = Path.CompareTo(item.Path); } if (result == 0) { result = Info.FullName.CompareTo(item.FullName); } } return(result); }
public void ShowTaskDetails() { try { if (NumberOfFiles > 0) { NewFileNameValueLabel.Text = FileNewName; FileNameValueLabel.Text = FileName; FileExtensionValueLabel.Text = FileExtension; MatchedFileGroupBox.Text = "Matched File [" + CurrentFile.ToString() + "/" + NumberOfFiles.ToString() + "]"; ((TaskRunnerButton)TasksFlowPanel.Controls[TaskIndex]).ChangePercentageDone((float)CurrentFile / (float)NumberOfFiles); } else if (NumberOfFiles == -1) { NewFileNameValueLabel.Text = "Loading..."; FileNameValueLabel.Text = "Loading..."; FileExtensionValueLabel.Text = "Loading..."; MatchedFileGroupBox.Text = "Matched File"; } } catch { } }