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


C# AList.Clear方法代碼示例

本文整理匯總了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;
 }
開發者ID:fantasydr,項目名稱:krkr-cs,代碼行數:79,代碼來源:Compiler.cs

示例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;
			}
		}
開發者ID:LunarLanding,項目名稱:ngit,代碼行數:41,代碼來源:RemoteConfig.cs


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