本文整理汇总了C#中System.Collections.ArrayList.get_Count方法的典型用法代码示例。如果您正苦于以下问题:C# ArrayList.get_Count方法的具体用法?C# ArrayList.get_Count怎么用?C# ArrayList.get_Count使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Collections.ArrayList
的用法示例。
在下文中一共展示了ArrayList.get_Count方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Import
public string Import(out bool error)
{
error = false;
int num = 0;
int num2 = 0;
string text = "";
string reason = "Imported " + DateTime.get_Now();
VehicleModule vehicleModule = new VehicleModule();
this.ImportVBF();
num2 = this.Params.get_Count();
if (num2 <= 0)
{
throw new CarConfigException("No bytes loaded, invalid VBF file?");
}
VehiclePrototype vehiclePrototype = new VehiclePrototype(this.VehicleInstId);
IEnumerator enumerator = vehiclePrototype.Modules.GetEnumerator();
try
{
while (enumerator.MoveNext())
{
VehicleModule vehicleModule2 = (VehicleModule)enumerator.get_Current();
if (vehicleModule2.ID == this.ModuleID)
{
vehicleModule = vehicleModule2;
break;
}
}
}
finally
{
IDisposable disposable = enumerator as IDisposable;
if (disposable != null)
{
disposable.Dispose();
}
}
int noOfBytes = vehicleModule.NoOfBytes;
if (noOfBytes > 0)
{
if (vehiclePrototype.VBFType == 1)
{
if (noOfBytes > num2)
{
text = "More bytes in database than imported, database records will remain unchanged for extra bytes [00]. File loaded.";
}
else if (num2 > noOfBytes)
{
text = "More bytes imported than available in the database, " + (num2 - noOfBytes).ToString() + " ignored! Check you selected the correct module!";
error = true;
}
enumerator = vehicleModule.Parameters.GetEnumerator();
try
{
while (enumerator.MoveNext())
{
ConfigByte configByte = (ConfigByte)enumerator.get_Current();
if (num >= num2)
{
break;
}
configByte.Update(this.VehicleInstId, ((ConfigByte)this.Params.get_Item(num)).ParamValue, this.UserName, reason);
num++;
}
goto IL_7D3;
}
finally
{
IDisposable disposable = enumerator as IDisposable;
if (disposable != null)
{
disposable.Dispose();
}
}
}
int num3 = 1;
int num4 = 0;
int num5 = 8;
int num6 = 0;
int num7 = 0;
int num8 = 1;
DataSet dataSet = new DataSet();
VDF vDF = new VDF();
ArrayList arrayList = new ArrayList();
VDFBlock vDFBlock = new VDFBlock();
enumerator = this.Params.GetEnumerator();
try
{
while (enumerator.MoveNext())
{
ConfigByte configByte2 = (ConfigByte)enumerator.get_Current();
if (num3 == 1)
{
vDF.CRC = (ushort)(configByte2.ParamValue << 8);
}
else if (num3 == 2)
{
vDF.CRC = (ushort)((int)vDF.CRC | configByte2.ParamValue);
}
else if (num3 == 3)
{
//.........这里部分代码省略.........
示例2: VDF
public VDF(int version, ArrayList vehicleParams, string eraseLength, ArrayList blocks)
{
int num = 0;
int num2 = 8;
int num3 = num2 + blocks.get_Count() * 4;
ArrayList arrayList = new ArrayList();
this.VDFVersion = version;
this.DataBlockSize = vehicleParams.get_Count() + num3;
if (eraseLength == "")
{
num = this.DataBlockSize;
}
else
{
try
{
num = int.Parse(eraseLength.Replace("0x", ""), 515);
if (num < this.DataBlockSize)
{
num = this.DataBlockSize;
}
}
catch
{
num = this.DataBlockSize;
}
}
this.Blocksize = num / 64;
arrayList.Add(new ConfigByte(0, this.DataBlockSize >> 8));
arrayList.Add(new ConfigByte(0, this.DataBlockSize & 255));
arrayList.Add(new ConfigByte(0, this.VDFVersion >> 8));
arrayList.Add(new ConfigByte(0, this.VDFVersion & 255));
arrayList.Add(new ConfigByte(0, this.Blocksize >> 8));
arrayList.Add(new ConfigByte(0, this.Blocksize & 255));
int num4 = num3;
IEnumerator enumerator = blocks.GetEnumerator();
try
{
while (enumerator.MoveNext())
{
VDFBlock vDFBlock = (VDFBlock)enumerator.get_Current();
arrayList.Add(new ConfigByte(0, vDFBlock.Type >> 8));
arrayList.Add(new ConfigByte(0, vDFBlock.Type & 255));
arrayList.Add(new ConfigByte(0, num4 >> 8));
arrayList.Add(new ConfigByte(0, num4 & 255));
num4 += vDFBlock.Size;
}
}
finally
{
IDisposable disposable = enumerator as IDisposable;
if (disposable != null)
{
disposable.Dispose();
}
}
this.Data.AddRange(arrayList);
this.Data.AddRange(vehicleParams);
this.CRC = Checksum.CreateCRC16(this.Data);
this.Data.Insert(0, new ConfigByte(0, (int)this.CRC >> 8));
this.Data.Insert(1, new ConfigByte(0, (int)this.CRC & 255));
for (int i = this.DataBlockSize; i < num; i++)
{
this.Data.Add(new ConfigByte(0, 255));
}
}
示例3: GetHeaderVariables
private void GetHeaderVariables(ArrayList fileLines)
{
StringBuilder stringBuilder = new StringBuilder();
char[] array = new char[]
{
Convert.ToChar(10),
Convert.ToChar(13),
Convert.ToChar(32)
};
for (int i = 0; i < fileLines.get_Count(); i++)
{
string text = fileLines.get_Item(i).ToString();
stringBuilder.Append(text + Convert.ToChar(13).ToString() + Convert.ToChar(10).ToString());
string text2 = text.Trim(array);
text2 = text2.Replace(" ", "");
if (!text2.StartsWith("//"))
{
if (text2.IndexOf(Constants.VBFVariableNames.ECUAddress) >= 0)
{
string text3 = this.TrimValue(text2.Substring(text2.IndexOf(Constants.VBFVariableNames.ECUAddress) + Constants.VBFVariableNames.ECUAddress.get_Length()));
this.ECUAddress = text3;
}
else if (text2.IndexOf(Constants.VBFVariableNames.SWPartNo) >= 0)
{
string text3 = this.TrimValue(text2.Substring(text2.IndexOf(Constants.VBFVariableNames.SWPartNo) + Constants.VBFVariableNames.SWPartNo.get_Length()));
this.PartNo = text3;
}
else if (text2.IndexOf(Constants.VBFVariableNames.SWPartType) >= 0)
{
string text3 = this.TrimValue(text2.Substring(text2.IndexOf(Constants.VBFVariableNames.SWPartType) + Constants.VBFVariableNames.SWPartType.get_Length()));
this.PartType = text3;
}
else if (text2.IndexOf(Constants.VBFVariableNames.Network) >= 0)
{
string text3 = this.TrimValue(text2.Substring(text2.IndexOf(Constants.VBFVariableNames.Network) + Constants.VBFVariableNames.Network.get_Length()));
this.Network = text3;
}
else if (text2.IndexOf(Constants.VBFVariableNames.FileChecksum) >= 0)
{
string text3 = this.TrimValue(text2.Substring(text2.IndexOf(Constants.VBFVariableNames.FileChecksum) + Constants.VBFVariableNames.FileChecksum.get_Length()));
this._FileChecksum = text3;
}
}
}
this.Header = stringBuilder.ToString() + Convert.ToChar(13).ToString() + Convert.ToChar(10).ToString() + "}";
}