protected virtual void OnListSelectionChanged(CustomListViewSelectionChangedEventArgs args) { if (ListSelectionChanged != null) { ListSelectionChanged(this, args); } }
private void lvFiles_ListSelectionChanged(object sender, CustomListViewSelectionChangedEventArgs e) { if (e.Selected.Count > 0) { ListViewItem item = e.Selected[0]; lvFiles.DeselectItems(); if (item != null) { this.Enabled = false; Application.DoEvents(); string fullPath = currentDocPath; if (!fullPath.EndsWith("\\")) fullPath += "\\"; fullPath += Path.GetFileName(item.Text); string ext = Path.GetExtension(item.Text); if (Directory.Exists(fullPath)) { OpenDirectory(fullPath); } else if (File.Exists(fullPath)) { PrintBoxApp.instance.LoadDocument(fullPath); } this.Enabled = true; } } }