private TreeNode PopulateTreeview(TreeNodeCollection parent, PackageItem item) { if (item.Hidden) { return(null); } TreeNode node = new TreeNode() { Checked = item.IsEnabled, Tag = item, Text = item.ToString(), ToolTipText = GetToolTipText(item) }; parent.Add(node); Group c = item as Group; if (c != null) { foreach (PackageItem set in c.Children) { PopulateTreeview(node.Nodes, set); } foreach (Operation op in c.Operations) { PopulateTreeview(node.Nodes, op); } } return(node); }
public frmCarWash() { InitializeComponent(); try { loadDataPackageItemsFromFile(); loadDataFragranceItemsFromFile(); LoadInteriorOptionsFromFile(); loadExteriorOptionsFromFile(); this.Load += new EventHandler(frmCarWash_Load); foreach (PackageItem packageItem in _packageItems) { cboPackage.Items.Add(packageItem.ToString()); } foreach (FragranceItem fragranceItem in _fragranceItems) { cboFragrance.Items.Add(fragranceItem.ToString()); } } catch (FileNotFoundException exception) { AutomotiveManager.ErrorLog(exception, "Error reading from car wash data file."); showError(); } catch (IOException exception) { AutomotiveManager.ErrorLog(exception, "Error reading from car wash data file."); showError(); } cboPackage.SelectedIndexChanged += new EventHandler(cboPackage_SelectedIndexChanged); cboFragrance.SelectedIndexChanged += new EventHandler(cboFragrance_SelectedIndexChanged); mnuGenerateInvoice.Click += new EventHandler(mnuGenerateInvoice_Click); }