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


C# Collections.ArrayList类代码示例

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


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

示例1: insertToDB

 private int insertToDB()
 {
     DTO.Invoice invoice = new DTO.Invoice();
     System.Collections.ArrayList details = new System.Collections.ArrayList();
     for (int i = 0; i < grdItems.Rows.Count; i++)
     {
         DTO.InvoiceDetail d = new DTO.InvoiceDetail();
         DTO.Product p = new DTO.Product();
         p.Productid = int.Parse(grdItems.Rows[i].Cells[7].Value.ToString());
         d.Quantity = int.Parse(grdItems.Rows[i].Cells[2].Value.ToString());
         d.Priceout = decimal.Parse(grdItems.Rows[i].Cells[3].Value.ToString());
         d.Dicount = decimal.Parse(grdItems.Rows[i].Cells[4].Value.ToString());
         d.Pricein = decimal.Parse(grdItems.Rows[i].Cells[8].Value.ToString());
         d.Product = p;
         details.Add(d);
     }
     
     DTO.Member member = new DTO.Member();
     member.Memberid = (int)cboMember.SelectedValue;            ///
     invoice.Staff = UserSession.Session.Staff;
     invoice.Member = member;
     invoice.Remark = "";
     invoice.Discount = decimal.Parse(txtDiscount.Text.Replace("%", "").Replace(" ",""));
     invoice.InvoiceDetail = details;
     return new DAO.InvoiceDAO().addInvoice(invoice);
 }
开发者ID:KH4IT,项目名称:MakeOver-Paris,代码行数:26,代码来源:FrmFrontSaleOffice.cs

示例2: TestExecute

        public void TestExecute()
        {
            SpreadsheetCompiler converter = new SpreadsheetCompiler();
            System.IO.Stream stream = Assembly.GetAssembly(this.GetType()).GetManifestResourceStream("org.drools.dotnet.examples.resources.data.IntegrationExampleTest.xls");
            System.String drl = converter.Compile(stream, InputType.XLS);
            Assert.IsNotNull(drl);
            //COMPILE
            PackageBuilder builder = new PackageBuilder();
            builder.AddPackageFromDrl(drl);

            Package pkg = builder.GetPackage();
            Assert.IsNotNull(pkg);
            System.Console.Out.WriteLine(pkg.GetErrorSummary());
            Assert.AreEqual(0, builder.GetErrors().Length);

            RuleBase rb = RuleBaseFactory.NewRuleBase();
            rb.AddPackage(pkg);

            WorkingMemory wm = rb.NewWorkingMemory();

            //ASSERT AND FIRE
            wm.assertObject(new Cheese("stilton", 42));
            wm.assertObject(new Person("michael", "stilton", 42));
            System.Collections.IList list = new System.Collections.ArrayList();
            wm.setGlobal("list", list);
            wm.fireAllRules();
            Assert.AreEqual(1, list.Count);
        }
开发者ID:happy280684,项目名称:droolsdotnet,代码行数:28,代码来源:SpreadsheetIntegrationTest.cs

示例3: PerformPathping

 /// <summary>
 /// Performs a pathping
 /// </summary>
 /// <param name="ipaTarget">The target</param>
 /// <param name="iHopcount">The maximum hopcount</param>
 /// <param name="iTimeout">The timeout for each ping</param>
 /// <returns>An array of PingReplys for the whole path</returns>
 public static PingReply[] PerformPathping(IPAddress ipaTarget, int iHopcount, int iTimeout)
 {
     System.Collections.ArrayList arlPingReply = new System.Collections.ArrayList();
     Ping myPing = new Ping();
     PingReply prResult = null;
     int iTimeOutCnt = 0;
     for (int iC1 = 1; iC1 < iHopcount && iTimeOutCnt<5; iC1++)
     {
         prResult = myPing.Send(ipaTarget, iTimeout, new byte[10], new PingOptions(iC1, false));
         if (prResult.Status == IPStatus.Success)
         {
             iC1 = iHopcount;
             iTimeOutCnt = 0;
         }
         else if (prResult.Status == IPStatus.TtlExpired)
         {
             iTimeOutCnt = 0;
         }
         else if (prResult.Status == IPStatus.TimedOut)
         {
             iTimeOutCnt++;
         }
         arlPingReply.Add(prResult);
     }
     PingReply[] prReturnValue = new PingReply[arlPingReply.Count];
     for (int iC1 = 0; iC1 < arlPingReply.Count; iC1++)
     {
         prReturnValue[iC1] = (PingReply)arlPingReply[iC1];
     }
     return prReturnValue;
 }
开发者ID:Hagser,项目名称:csharp,代码行数:38,代码来源:Diag.cs

示例4: MultiFormatOneDReader

		public MultiFormatOneDReader(System.Collections.Hashtable hints)
		{
			System.Collections.ArrayList possibleFormats = hints == null?null:(System.Collections.ArrayList) hints[DecodeHintType.POSSIBLE_FORMATS];
			bool useCode39CheckDigit = hints != null && hints[DecodeHintType.ASSUME_CODE_39_CHECK_DIGIT] != null;
			readers = System.Collections.ArrayList.Synchronized(new System.Collections.ArrayList(10));
			if (possibleFormats != null)
			{
				if (possibleFormats.Contains(BarcodeFormat.EAN_13) || possibleFormats.Contains(BarcodeFormat.UPC_A) || possibleFormats.Contains(BarcodeFormat.EAN_8) || possibleFormats.Contains(BarcodeFormat.UPC_E))
				{
					readers.Add(new MultiFormatUPCEANReader(hints));
				}
				if (possibleFormats.Contains(BarcodeFormat.CODE_39))
				{
					readers.Add(new Code39Reader(useCode39CheckDigit));
				}
				if (possibleFormats.Contains(BarcodeFormat.CODE_128))
				{
					readers.Add(new Code128Reader());
				}
				if (possibleFormats.Contains(BarcodeFormat.ITF))
				{
					readers.Add(new ITFReader());
				}
			}
			if ((readers.Count == 0))
			{
				readers.Add(new MultiFormatUPCEANReader(hints));
				readers.Add(new Code39Reader());
				readers.Add(new Code128Reader());
				readers.Add(new ITFReader());
			}
		}
开发者ID:jaychouzhou,项目名称:Ydifisofidosfj,代码行数:32,代码来源:MultiFormatOneDReader.cs

示例5: loadComment

        public void loadComment(int idNews)
        {
            DataTable dt = daoNews.GetListComment(idNews);
            PagedDataSource pgitems = new PagedDataSource();
            System.Data.DataView dv = new System.Data.DataView(dt);
            pgitems.DataSource = dv;
            pgitems.AllowPaging = true;
            pgitems.PageSize = 20;
            if (PageNumber >= pgitems.PageCount) PageNumber = 0;
            pgitems.CurrentPageIndex = PageNumber;
            if (pgitems.PageCount > 1)
            {
                rptPagesComment.Visible = true;
                System.Collections.ArrayList pages = new System.Collections.ArrayList();
                for (int i = 0; i < pgitems.PageCount; i++)
                    pages.Add((i + 1).ToString());
                rptPagesComment.DataSource = pages;
                rptPagesComment.DataBind();
            }
            else
                rptPagesComment.Visible = false;

            rptComment.DataSource = pgitems;
            rptComment.DataBind();

            lblNumberComment.Text = "("+ dt.Rows.Count +")";
        }
开发者ID:DinhHue,项目名称:savvyplatform,代码行数:27,代码来源:NewsDetail.aspx.cs

示例6: JrpcgenProgramInfo

		/// <summary>
		/// Construct a new <code>JrpcgenProgramInfo</code> object containing the
		/// programs's identifier and number, as well as the versions defined
		/// for this particular ONC/RPC program.
		/// </summary>
		/// <remarks>
		/// Construct a new <code>JrpcgenProgramInfo</code> object containing the
		/// programs's identifier and number, as well as the versions defined
		/// for this particular ONC/RPC program.
		/// </remarks>
		/// <param name="programId">Identifier defined for this ONC/RPC program.</param>
		/// <param name="programNumber">Program number assigned to this ONC/RPC program.</param>
		/// <param name="versions">Vector of versions defined for this ONC/RPC program.</param>
		public JrpcgenProgramInfo(string programId, string programNumber, System.Collections.ArrayList
			 versions)
		{
			this.programId = programId;
			this.programNumber = programNumber;
			this.versions = versions;
		}
开发者ID:mushuanli,项目名称:nekodrive,代码行数:20,代码来源:JrpcgenProgramInfo.cs

示例7: MultiFormatOneDReader

 public MultiFormatOneDReader(System.Collections.Hashtable hints)
 {
     System.Collections.ArrayList possibleFormats = hints == null ? null : (System.Collections.ArrayList) hints[DecodeHintType.POSSIBLE_FORMATS];
     readers = new System.Collections.ArrayList();
     if (possibleFormats != null) {
       if (possibleFormats.Contains(BarcodeFormat.EAN_13) ||
           possibleFormats.Contains(BarcodeFormat.UPC_A) ||
           possibleFormats.Contains(BarcodeFormat.EAN_8) ||
           possibleFormats.Contains(BarcodeFormat.UPC_E))
       {
         readers.Add(new MultiFormatUPCEANReader(hints));
       }
       if (possibleFormats.Contains(BarcodeFormat.CODE_39)) {
           readers.Add(new Code39Reader());
       }
       if (possibleFormats.Contains(BarcodeFormat.CODE_128))
       {
           readers.Add(new Code128Reader());
       }
       if (possibleFormats.Contains(BarcodeFormat.ITF))
       {
           readers.Add(new ITFReader());
       }
     }
     if (readers.Count==0) {
         readers.Contains(new MultiFormatUPCEANReader(hints));
         readers.Contains(new Code39Reader());
         readers.Contains(new Code128Reader());
       // TODO: Add ITFReader once it is validated as production ready, and tested for performance.
       //readers.addElement(new ITFReader());
     }
 }
开发者ID:andrejpanic,项目名称:win-mobile-code,代码行数:32,代码来源:MultiFormatOneDReader.cs

示例8: QueryTermVector

		public QueryTermVector(System.String queryString, Analyzer analyzer)
		{
			if (analyzer != null)
			{
				TokenStream stream = analyzer.TokenStream("", new System.IO.StringReader(queryString));
				if (stream != null)
				{
					System.Collections.ArrayList terms = new System.Collections.ArrayList();
					try
					{
						bool hasMoreTokens = false;
						
						stream.Reset();
						TermAttribute termAtt = (TermAttribute) stream.AddAttribute(typeof(TermAttribute));
						
						hasMoreTokens = stream.IncrementToken();
						while (hasMoreTokens)
						{
							terms.Add(termAtt.Term());
							hasMoreTokens = stream.IncrementToken();
						}
						ProcessTerms((System.String[]) terms.ToArray(typeof(System.String)));
					}
					catch (System.IO.IOException e)
					{
					}
				}
			}
		}
开发者ID:Inzaghi2012,项目名称:teamlab.v7.5,代码行数:29,代码来源:QueryTermVector.cs

示例9: XYPlotStyleCollectionController

 public XYPlotStyleCollectionController(G2DPlotStyleCollection doc)
 {
   _doc = doc;
   _tempdoc = new System.Collections.ArrayList();
   for(int i=0;i<_doc.Count;i++)
     _tempdoc.Add(_doc[i]);
 }
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:7,代码来源:XYPlotStyleCollectionController.cs

示例10: GetCacheEntries

		public virtual CacheEntry[] GetCacheEntries()
		{
			System.Collections.IList result = new System.Collections.ArrayList(17);
			System.Collections.IEnumerator outerKeys = caches.Keys.GetEnumerator();
			while (outerKeys.MoveNext())
			{
				System.Type cacheType = (System.Type) outerKeys.Current;
				Cache cache = (Cache) caches[cacheType];
				System.Collections.IEnumerator innerKeys = cache.readerCache.Keys.GetEnumerator();
				while (innerKeys.MoveNext())
				{
					// we've now materialized a hard ref
					System.Object readerKey = innerKeys.Current;
					// innerKeys was backed by WeakHashMap, sanity check
					// that it wasn't GCed before we made hard ref
					if (null != readerKey && cache.readerCache.Contains(readerKey))
					{
						System.Collections.IDictionary innerCache = ((System.Collections.IDictionary) cache.readerCache[readerKey]);
						System.Collections.IEnumerator entrySetIterator = new System.Collections.Hashtable(innerCache).GetEnumerator();
						while (entrySetIterator.MoveNext())
						{
							System.Collections.DictionaryEntry mapEntry = (System.Collections.DictionaryEntry) entrySetIterator.Current;
							Entry entry = (Entry) mapEntry.Key;
							result.Add(new CacheEntryImpl(readerKey, entry.field, cacheType, entry.type, entry.custom, entry.locale, mapEntry.Value));
						}
					}
				}
			}
			return (CacheEntry[]) new System.Collections.ArrayList(result).ToArray(typeof(CacheEntry));
		}
开发者ID:Mpdreamz,项目名称:lucene.net,代码行数:30,代码来源:FieldCacheImpl.cs

示例11: CharacterSafeString

        /// <summary>
        /// Makes string safe for xml parsing, replacing control chars with '?'
        /// </summary>
        /// <param name="encodedString">string to make safe</param>
        /// <returns>xml safe string</returns>
        private static string CharacterSafeString(string encodedString)
        {
            /*The default code page for the system will be used.
            Since all code pages use the same lower 128 bytes, this should be sufficient
            for finding uprintable control characters that make the xslt processor error.
            We use characters encoded by the default code page to avoid mistaking bytes as
            individual characters on non-latin code pages.*/
            char[] encodedChars = System.Text.Encoding.Default.GetChars(System.Text.Encoding.Default.GetBytes(encodedString));

            System.Collections.ArrayList pos = new System.Collections.ArrayList();
            for (int x = 0; x < encodedChars.Length; x++)
            {
                char currentChar = encodedChars[x];
                //unprintable characters are below 0x20 in Unicode tables
                //some control characters are acceptable. (carriage return 0x0D, line feed 0x0A, horizontal tab 0x09)
                if (currentChar < 32 && (currentChar != 9 && currentChar != 10 && currentChar != 13))
                {
                    //save the array index for later replacement.
                    pos.Add(x);
                }
            }
            foreach (int index in pos)
            {
                encodedChars[index] = '?';//replace unprintable control characters with ?(3F)
            }
            return System.Text.Encoding.Default.GetString(System.Text.Encoding.Default.GetBytes(encodedChars));
        }
开发者ID:archnaut,项目名称:Lighthouse,代码行数:32,代码来源:NUnitXmlResultsFileCreator.cs

示例12: JrpcgenVersionInfo

		/// <summary>
		/// Constructs a new <code>JrpcgenVersionInfo</code> object containing
		/// information about a programs' version and a set of procedures
		/// defined by this program version.
		/// </summary>
		/// <remarks>
		/// Constructs a new <code>JrpcgenVersionInfo</code> object containing
		/// information about a programs' version and a set of procedures
		/// defined by this program version.
		/// </remarks>
		/// <param name="versionId">
		/// Identifier defined for this version of a
		/// particular ONC/RPC program.
		/// </param>
		/// <param name="versionNumber">Version number.</param>
		/// <param name="procedures">Vector of procedures defined for this ONC/RPC program.</param>
		public JrpcgenVersionInfo(string versionId, string versionNumber, System.Collections.ArrayList
			 procedures)
		{
			this.versionId = versionId;
			this.versionNumber = versionNumber;
			this.procedures = procedures;
		}
开发者ID:mushuanli,项目名称:nekodrive,代码行数:23,代码来源:JrpcgenVersionInfo.cs

示例13: Tokenizer

 public Tokenizer(string source, string delimiters)
 {
     this.elements = new System.Collections.ArrayList();
     this.delimiters = delimiters;
     this.source = source;
     this.ReTokenize();
 }
开发者ID:sleighter,项目名称:dicom-sharp,代码行数:7,代码来源:Tokenizer.cs

示例14: ListInit

 public void ListInit()
 {
     var l = new System.Collections.ArrayList()
     {
         1, 2, 3, 4
     };
 }
开发者ID:rexzh,项目名称:SharpJs,代码行数:7,代码来源:JsonObjectInitializer.cs

示例15: GetFiles

        /// <summary>
        /// Anche nelle sottodirectory
        /// </summary>
        /// <param name="path"></param>
        /// <param name="pattern"></param>
        /// <returns></returns>
        public static System.Collections.ArrayList GetFiles(string path, string pattern)
        {
            System.Collections.ArrayList list = new System.Collections.ArrayList();
            try
            {
                list.AddRange(System.IO.Directory.GetFiles(path, pattern));
            }
            catch { }

            string[] dirs = null;
            try
            {
                dirs = System.IO.Directory.GetDirectories(path);
            }
            catch { }

            if (dirs != null)
            {
                foreach (string dir in dirs)
                {
                    list.AddRange(GetFiles(dir, pattern));
                }
            }
            return list;
        }
开发者ID:faze79,项目名称:rmo-rugbymania,代码行数:31,代码来源:MyDir.cs


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