private void FormatListViews() { RefreshListViews(); olvColOpen.IsButton = true; olvLinks.UseHyperlinks = true; olvPlaces.ButtonClick += delegate(object sender, CellClickEventArgs e) { DiskPlace _diskPlace = (DiskPlace)e.Model; if (_diskPlace.IsFile) { Process.Start(_diskPlace.Path); } else { Process.Start("explorer.exe", _diskPlace.Path); } }; olvColOpen.AspectToStringConverter = delegate(object x) { bool IsFile = (bool)x; if (IsFile) { return("Plik"); } else { return("Folder"); } }; }
private void btnOk_Click(object sender, EventArgs e) { if (String.IsNullOrWhiteSpace(txtDescription.Text)) { errorProvider1.SetError(txtDescription, "Pole nie może być puste"); } else { diskPlace = new DiskPlace(_chosenPath, txtDescription.Text, rdoIsAFile.Checked); this.DialogResult = DialogResult.OK; this.Close(); } }