当前位置: 首页>>代码示例>>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;未经允许,请勿转载。