當前位置: 首頁>>代碼示例>>C#>>正文


C# System.Collections.Generic.List.LastIndexOf方法代碼示例

本文整理匯總了C#中System.Collections.Generic.System.Collections.Generic.List.LastIndexOf方法的典型用法代碼示例。如果您正苦於以下問題:C# System.Collections.Generic.List.LastIndexOf方法的具體用法?C# System.Collections.Generic.List.LastIndexOf怎麽用?C# System.Collections.Generic.List.LastIndexOf使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Collections.Generic.System.Collections.Generic.List的用法示例。


在下文中一共展示了System.Collections.Generic.List.LastIndexOf方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: tsbEditSelected_Click

 private void tsbEditSelected_Click(object sender, System.EventArgs e)
 {
     if (this.dgvHouses.SelectedCells.get_Count() == 0)
     {
         System.Windows.Forms.MessageBox.Show("Выберите элементы для редактирования", "Ошибка", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Hand);
     }
     HouseArea houseAreas = new HouseArea();
     HistoryHouseAreasAddChangeForm form = new HistoryHouseAreasAddChangeForm(houseAreas, false);
     if (form.ShowDialog() == System.Windows.Forms.DialogResult.OK)
     {
         HouseArea houseArea = form.GetHouseArea();
         System.Collections.Generic.List<int> list = new System.Collections.Generic.List<int>();
         foreach (System.Windows.Forms.DataGridViewCell cell in this.dgvHouses.SelectedCells)
         {
             if (list.LastIndexOf(cell.get_RowIndex()) == -1)
             {
                 if (houseArea.Total != 0M)
                 {
                     this.dgvHouses.Rows.get_Item(cell.get_RowIndex()).Cells.get_Item("NewTotalSquare").set_Value(houseArea.Total);
                 }
                 if (houseArea.Heating != 0M)
                 {
                     this.dgvHouses.Rows.get_Item(cell.get_RowIndex()).Cells.get_Item("NewHeating").set_Value(houseArea.Heating);
                 }
                 if (houseArea.Living != 0M)
                 {
                     this.dgvHouses.Rows.get_Item(cell.get_RowIndex()).Cells.get_Item("NewLiving").set_Value(houseArea.Living);
                 }
                 if (houseArea.Floor != 0M)
                 {
                     this.dgvHouses.Rows.get_Item(cell.get_RowIndex()).Cells.get_Item("NewFloor").set_Value(houseArea.Floor);
                 }
                 if (houseArea.TotalOi != 0M)
                 {
                     this.dgvHouses.Rows.get_Item(cell.get_RowIndex()).Cells.get_Item("NewTotalOi").set_Value(houseArea.TotalOi);
                 }
                 if (houseArea.LivingMkd != 0M)
                 {
                     this.dgvHouses.Rows.get_Item(cell.get_RowIndex()).Cells.get_Item("NewLivingMkd").set_Value(houseArea.LivingMkd);
                 }
                 if (houseArea.TotalMkd != 0M)
                 {
                     this.dgvHouses.Rows.get_Item(cell.get_RowIndex()).Cells.get_Item("NewTotalMKd").set_Value(houseArea.TotalMkd);
                 }
                 if (houseArea.NotLivingMkd != 0M)
                 {
                     this.dgvHouses.Rows.get_Item(cell.get_RowIndex()).Cells.get_Item("NewNotLivingMKd").set_Value(houseArea.NotLivingMkd);
                 }
                 if (houseArea.NotSubscribe != 0M)
                 {
                     this.dgvHouses.Rows.get_Item(cell.get_RowIndex()).Cells.get_Item("NewNotSubscribe").set_Value(houseArea.NotSubscribe);
                 }
                 list.Add(cell.get_RowIndex());
             }
         }
     }
     this.btnSave.set_Enabled(this.ValidateSavingOptions());
 }
開發者ID:u4097,項目名稱:SQLScript,代碼行數:58,代碼來源:HouseSquareMultipleEditForm.cs


注:本文中的System.Collections.Generic.System.Collections.Generic.List.LastIndexOf方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。