本文整理汇总了C#中AList.Clear方法的典型用法代码示例。如果您正苦于以下问题:C# AList.Clear方法的具体用法?C# AList.Clear怎么用?C# AList.Clear使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AList
的用法示例。
在下文中一共展示了AList.Clear方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ExportByteCode
/// <exception cref="Kirikiri.Tjs2.TJSException"></exception>
private void ExportByteCode(BinaryStream output)
{
byte[] filetag = FILE_TAG;
byte[] codetag = new byte[] { (byte)('T'), (byte)('J'), (byte)('S'), (byte)('2') };
byte[] objtag = new byte[] { (byte)('O'), (byte)('B'), (byte)('J'), (byte)('S') };
byte[] datatag = new byte[] { (byte)('D'), (byte)('A'), (byte)('T'), (byte)('A') };
int count = mInterCodeGeneratorList.Count;
AList<ByteBuffer> objarray = new AList<ByteBuffer>(count * 2);
ConstArrayData constarray = new ConstArrayData();
int objsize = 0;
for (int i = 0; i < count; i++)
{
InterCodeGenerator obj = mInterCodeGeneratorList[i];
ByteBuffer buf = obj.ExportByteCode(this, constarray);
objarray.AddItem(buf);
objsize += buf.Capacity() + TAG_SIZE + CHUNK_SIZE_LEN;
}
// tag + size
objsize += TAG_SIZE + CHUNK_SIZE_LEN + 4 + 4;
// OBJS tag + size + toplevel + count
ByteBuffer dataarea = constarray.ExportBuffer();
int datasize = dataarea.Capacity() + TAG_SIZE + CHUNK_SIZE_LEN;
// DATA tag + size
int filesize = objsize + datasize + FILE_TAG_SIZE + CHUNK_SIZE_LEN;
// TJS2 tag + file size
byte[] filesizearray = new byte[] { unchecked((byte)(filesize & unchecked((int)(0xff
)))), unchecked((byte)(((int)(((uint)filesize) >> 8)) & unchecked((int)(0xff))))
, unchecked((byte)(((int)(((uint)filesize) >> 16)) & unchecked((int)(0xff)))), unchecked(
(byte)(((int)(((uint)filesize) >> 24)) & unchecked((int)(0xff)))) };
byte[] datasizearray = new byte[] { unchecked((byte)(datasize & unchecked((int)(0xff
)))), unchecked((byte)(((int)(((uint)datasize) >> 8)) & unchecked((int)(0xff))))
, unchecked((byte)(((int)(((uint)datasize) >> 16)) & unchecked((int)(0xff)))), unchecked(
(byte)(((int)(((uint)datasize) >> 24)) & unchecked((int)(0xff)))) };
byte[] objsizearray = new byte[] { unchecked((byte)(objsize & unchecked((int)(0xff
)))), unchecked((byte)(((int)(((uint)objsize) >> 8)) & unchecked((int)(0xff)))),
unchecked((byte)(((int)(((uint)objsize) >> 16)) & unchecked((int)(0xff)))), unchecked(
(byte)(((int)(((uint)objsize) >> 24)) & unchecked((int)(0xff)))) };
byte[] objcountarray = new byte[] { unchecked((byte)(count & unchecked((int)(0xff
)))), unchecked((byte)(((int)(((uint)count) >> 8)) & unchecked((int)(0xff)))), unchecked(
(byte)(((int)(((uint)count) >> 16)) & unchecked((int)(0xff)))), unchecked((byte)
(((int)(((uint)count) >> 24)) & unchecked((int)(0xff)))) };
int toplevel = -1;
if (mTopLevelGenerator != null)
{
toplevel = GetCodeIndex(mTopLevelGenerator);
}
byte[] toparray = new byte[] { unchecked((byte)(toplevel & unchecked((int)(0xff))
)), unchecked((byte)(((int)(((uint)toplevel) >> 8)) & unchecked((int)(0xff)))),
unchecked((byte)(((int)(((uint)toplevel) >> 16)) & unchecked((int)(0xff)))), unchecked(
(byte)(((int)(((uint)toplevel) >> 24)) & unchecked((int)(0xff)))) };
output.Write(filetag);
output.Write(filesizearray);
output.Write(datatag);
output.Write(datasizearray);
output.Write(dataarea);
output.Write(objtag);
output.Write(objsizearray);
output.Write(toparray);
output.Write(objcountarray);
for (int i_1 = 0; i_1 < count; i_1++)
{
ByteBuffer buf = objarray[i_1];
int size = buf.Capacity();
byte[] bufsizearray = new byte[] { unchecked((byte)(size & unchecked((int)(0xff))
)), unchecked((byte)(((int)(((uint)size) >> 8)) & unchecked((int)(0xff)))), unchecked(
(byte)(((int)(((uint)size) >> 16)) & unchecked((int)(0xff)))), unchecked((byte)(
((int)(((uint)size) >> 24)) & unchecked((int)(0xff)))) };
output.Write(codetag);
output.Write(bufsizearray);
output.Write(buf);
}
output.Close();
output = null;
objarray.Clear();
objarray = null;
constarray = null;
dataarea = null;
}
示例2: Update
/// <summary>Update this remote's definition within the configuration.</summary>
/// <remarks>Update this remote's definition within the configuration.</remarks>
/// <param name="rc">the configuration file to store ourselves into.</param>
public virtual void Update(Config rc)
{
IList<string> vlst = new AList<string>();
vlst.Clear();
foreach (URIish u in URIs)
{
vlst.AddItem(u.ToPrivateString());
}
rc.SetStringList(SECTION, Name, KEY_URL, vlst);
vlst.Clear();
foreach (URIish u_1 in PushURIs)
{
vlst.AddItem(u_1.ToPrivateString());
}
rc.SetStringList(SECTION, Name, KEY_PUSHURL, vlst);
vlst.Clear();
foreach (RefSpec u_2 in FetchRefSpecs)
{
vlst.AddItem(u_2.ToString());
}
rc.SetStringList(SECTION, Name, KEY_FETCH, vlst);
vlst.Clear();
foreach (RefSpec u_3 in PushRefSpecs)
{
vlst.AddItem(u_3.ToString());
}
rc.SetStringList(SECTION, Name, KEY_PUSH, vlst);
Set(rc, KEY_UPLOADPACK, UploadPack, DEFAULT_UPLOAD_PACK);
Set(rc, KEY_RECEIVEPACK, ReceivePack, DEFAULT_RECEIVE_PACK);
Set(rc, KEY_TAGOPT, TagOpt.Option(), NGit.Transport.TagOpt.AUTO_FOLLOW.Option());
Set(rc, KEY_MIRROR, mirror, DEFAULT_MIRROR);
Set(rc, KEY_TIMEOUT, timeout, 0);
if (!oldName.Equals(name))
{
rc.UnsetSection(SECTION, oldName);
oldName = name;
}
}