Пример #1
0
 internal void DisposeMenu(Menu menuToDispose)
 {
     if (menuToDispose != null)
     {
         DataGridView dgv = menuToDispose.GetDataGridView();
         foreach (DataGridViewRow row in dgv.Rows)
         {
             RowData rowData = (RowData)row.Cells[2].Value;
             rowData.Dispose();
             DisposeMenu(rowData.SubMenu);
         }
         dgv.ClearSelection();
         menuToDispose.Dispose();
     }
 }