当前位置: 首页>>代码示例>>C#>>正文


C# System.Collections.Generic.List.get_Item方法代码示例

本文整理汇总了C#中System.Collections.Generic.System.Collections.Generic.List.get_Item方法的典型用法代码示例。如果您正苦于以下问题:C# System.Collections.Generic.List.get_Item方法的具体用法?C# System.Collections.Generic.List.get_Item怎么用?C# System.Collections.Generic.List.get_Item使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Collections.Generic.System.Collections.Generic.List的用法示例。


在下文中一共展示了System.Collections.Generic.List.get_Item方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: bckWrkrProcessSpliting_DoWork

 private void bckWrkrProcessSpliting_DoWork(object sender, DoWorkEventArgs e)
 {
     int num3;
     int num4;
     ObjectList<Apartment> list = new ObjectList<Apartment>();
     foreach (Apartment apartment in this.bsNewApartments)
     {
         list.Add(apartment);
     }
     ObjectList<Account> list2 = new ObjectList<Account>();
     foreach (Account account in this.bsNewAccounts)
     {
         list2.Add(account);
     }
     int num = System.Convert.ToInt32(this.numApartmentCount.Value);
     decimal[] numArray = new decimal[num];
     System.Collections.Generic.Dictionary<Apartment, ApartmentArea> dictionary = new System.Collections.Generic.Dictionary<Apartment, ApartmentArea>(num);
     string[] strArray = new string[num];
     int index = 0;
     foreach (System.Windows.Forms.DataGridViewRow row in (System.Collections.IEnumerable) this.dgvAccounts.Rows)
     {
         numArray[index] = System.Convert.ToDecimal(row.Cells.get_Item("clmnShare").get_Value());
         ApartmentArea area = new ApartmentArea {
             Total = System.Convert.ToDecimal(row.Cells.get_Item("clmnTotalSquare").get_Value()),
             Living = System.Convert.ToDecimal(row.Cells.get_Item("clmnLivingSquare").get_Value()),
             Heating = System.Convert.ToDecimal(row.Cells.get_Item("clmnHeatingSquare").get_Value()),
             Balcony = System.Convert.ToDecimal(row.Cells.get_Item("clmnBalconySquare").get_Value())
         };
         dictionary.Add(list.get_Item(index), area);
         strArray[index] = (row.Cells.get_Item("clmnFlatName").get_Value() == null) ? string.Empty : row.Cells.get_Item("clmnFlatName").get_Value().ToString();
         index = (int) (index + 1);
     }
     System.Collections.Generic.List<ObjectList<ApartmentResident>> list3 = new System.Collections.Generic.List<ObjectList<ApartmentResident>>(num);
     for (index = 0; index < num; index = (int) (index + 1))
     {
         list3.Add(new ObjectList<ApartmentResident>());
     }
     foreach (System.Windows.Forms.DataGridViewRow row2 in (System.Collections.IEnumerable) this.dgvNewApartmentResidents.Rows)
     {
         if (int.TryParse(row2.Cells.get_Item("clmnNumberAprtment").get_Value().ToString(), ref num3))
         {
             list3.get_Item((int) (num3 - 1)).Add(this.bsNewApartmentResidents.get_Item(this.dgvNewApartmentResidents.Rows.IndexOf(row2)) as ApartmentResident);
         }
     }
     System.Collections.Generic.List<ObjectList<ApartmentEquipment>> list4 = new System.Collections.Generic.List<ObjectList<ApartmentEquipment>>(num);
     for (index = 0; index < num; index = (int) (index + 1))
     {
         list4.Add(new ObjectList<ApartmentEquipment>());
     }
     foreach (System.Windows.Forms.DataGridViewRow row3 in (System.Collections.IEnumerable) this.dgvNewApartmentEquipment.Rows)
     {
         if (int.TryParse(row3.Cells.get_Item("clmnApartmentNumberEq").get_Value().ToString(), ref num3))
         {
             list4.get_Item((int) (num3 - 1)).Add(this.bsNewApartmentEquipment.get_Item(this.dgvNewApartmentEquipment.Rows.IndexOf(row3)) as ApartmentEquipment);
         }
         else if (row3.Cells.get_Item("clmnApartmentNumberEq").get_Value().ToString() == "На все")
         {
             foreach (ObjectList<ApartmentEquipment> list5 in list4)
             {
                 list5.Add((this.bsNewApartmentEquipment.get_Item(this.dgvNewApartmentEquipment.Rows.IndexOf(row3)) as ApartmentEquipment).Clone<ApartmentEquipment>());
             }
         }
     }
     if ((this.cbCashlessAccounts.get_Enabled() && (this.cbCashlessAccounts.get_SelectedItem() != null)) && int.TryParse(this.cbCashlessAccounts.get_SelectedItem().ToString(), ref num4))
     {
         num4 = (int) (num4 - 1);
     }
     else
     {
         num4 = -1;
     }
     try
     {
         object[] objArray = new object[] { this.m_OldAccount, this.dtpSplitDate.Value, list, list2, this.m_NewApartmentOwners, list3, list4, numArray, dictionary, strArray, (int) num4, this._apartmentOwnerLinks, this._apartmentResidentLinks, this._equipmentLinks, this.m_AccountHouseHolders };
         base.Invoke(this.SplitApartment, objArray);
         e.set_Result(null);
     }
     catch (System.Exception exception)
     {
         e.set_Result(exception);
     }
 }
开发者ID:u4097,项目名称:SQLScript,代码行数:82,代码来源:SplitApartmentForm.cs

示例2: ProcessDataPassporter

 private static long[] ProcessDataPassporter(AIS.SN.Model.localhost.ExchangeRequestAddress[] addresses)
 {
     System.Collections.Generic.List<long> list = new System.Collections.Generic.List<long>();
     AIS.SN.Model.localhost.ExchangeRequestAddress[] addressArray = addresses;
     for (int i = 0; i < addressArray.Length; i = (int) (i + 1))
     {
         AIS.SN.Model.localhost.ExchangeRequestAddress address = addressArray[i];
         long[] outs = address.Outs;
         for (int k = 0; k < outs.Length; k = (int) (k + 1))
         {
             long num = outs[k];
             list.Add(num);
         }
         AIS.SN.Model.DomainObjects.Views.ExchangeRequestAddress snAddress = GetAddresses(address);
         if (!IsRejected(snAddress))
         {
             string str = Serializer.ToXml<AIS.SN.Model.DomainObjects.Views.ExchangeRequestAddress>(snAddress, (System.Text.Encoding) System.Text.Encoding.Unicode);
             new ExchangeRequest { QueryId = "", Type = -1, XmlIn = str, Status = ExchangeStatus.Received, DateIn = System.DateTime.Now, OperationDate = snAddress.LastChangeDate, OutId = snAddress.FlatCardId }.SaveChanges();
         }
     }
     long[] numArray = new long[list.get_Count()];
     for (int j = 0; j < list.get_Count(); j = (int) (j + 1))
     {
         numArray[j] = list.get_Item(j);
     }
     return numArray;
 }
开发者ID:u4097,项目名称:SQLScript,代码行数:27,代码来源:ExchangeRequestAddress.cs

示例3: RemoveNodesByLocalAddress

 public void RemoveNodesByLocalAddress(ObjectList<LocalAddress> addressesSource, ObjectList<LocalAddress> la)
 {
     System.Collections.Generic.List<LocalAddress> list = new System.Collections.Generic.List<LocalAddress>();
     foreach (LocalAddress address in la)
     {
         LocalAddress address2 = address;
         while (true)
         {
             LocalAddress parent = address2.GetParent();
             if (parent == LocalAddress.Null)
             {
                 break;
             }
             list.Add(parent);
             address2 = parent;
         }
         if (list.get_Count() == 0)
         {
             this.Load(addressesSource, false);
             return;
         }
         for (int i = (int) (list.get_Count() - 1); i >= 0; i = (int) (i - 1))
         {
             this.GetNodeByAddress(list.get_Item(i)).OnBeforeExpand();
         }
         AddressesNode nodeByAddress = this.GetNodeByAddress(address);
         if (nodeByAddress != null)
         {
             this.RemoveNode(nodeByAddress);
         }
         list.Clear();
     }
     if (this.OnChangeSelectAddresses != null)
     {
         this.OnChangeSelectAddresses();
     }
 }
开发者ID:u4097,项目名称:SQLScript,代码行数:37,代码来源:AreaAddressesTree.cs


注:本文中的System.Collections.Generic.System.Collections.Generic.List.get_Item方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。