private void showSelectedToolStripMenuItem_Click(object sender, EventArgs e) { PathSelectionList selectionList = shellControlConnector1.SelectionList; string selection = shellControlConnector1.SelectionList.ToString(); if (selection.Length == 0) { selection = "Nothing is currently checked."; if (!(enabledToolStripMenuItem.Checked)) { selection += " You need to enable checkboxes."; } MessageBox.Show(selection, "Selectionlist"); } //See also the event //selectionList.CompletedSizeCalculation += ... else { string text = string.Empty; if (recursivelyScanSelectedToolStripMenuItem.Checked) { text = selection + Environment.NewLine + "Additional values retrieved in background:" + Environment.NewLine + selectionList.FileCount + " files" + Environment.NewLine + selectionList.FolderCount + " folders" + Environment.NewLine + selectionList.Size + " bytes" + Environment.NewLine + Environment.NewLine + "Note: If you selected a large folder, it may take some time to calculate. However the values in this MessageBox are not refreshed automatically. Please open again for updated values."; } else { text = selection + Environment.NewLine + "To retrieve additional information (like filecount or size) for the selection,\n" + "enbable Checkboxes --> Recursively Scan Selected"; } MessageBox.Show(text, "Selectionlist"); } }
/// <summary> /// Opens a MessageBox containing information on the currently checkboxed items. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ShowSelectedToolStripMenuItem_Click(object sender, EventArgs e) { PathSelectionList selectionList = shellControlConnector1.SelectionList; string selection = shellControlConnector1.SelectionList.ToString(); if (selection.Length == 0) { selection = "Nothing is currently checked."; if (!(toggleCheckboxesToolStripMenuItem.Checked)) { selection += " You need to enable checkboxes."; } MessageBox.Show(selection, "Selectionlist"); } else { string text = string.Empty; if (scanRecursivelyToolStripMenuItem.Checked) { text = selection + Environment.NewLine + "Additional values retrieved in background:" + Environment.NewLine + selectionList.FileCount + " files" + Environment.NewLine + selectionList.FolderCount + " folders" + Environment.NewLine + selectionList.Size + " bytes" + Environment.NewLine + Environment.NewLine; if (CheckboxListIsCalculatingSize) { text += "Note: File Scanning is not yet complete, please check back later to see the final results."; } } else { text = selection + Environment.NewLine + "To retrieve additional information (like filecount or size) for the selection,\n" + "enbable Checkboxes --> Recursively Scan Selected"; } MessageBox.Show(text, "Selectionlist"); } }