• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Collections.ArrayList类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: getHL7Messages

		/// <summary> Given a string that contains HL7 messages, and possibly other junk, 
		/// returns an array of the HL7 messages.  
		/// An attempt is made to recognize segments even if there is other 
		/// content between segments, for example if a log file logs segments 
		/// individually with timestamps between them.  
		/// 
		/// </summary>
		/// <param name="theSource">a string containing HL7 messages 
		/// </param>
		/// <returns> the HL7 messages contained in theSource
		/// </returns>
        private static System.String[] getHL7Messages(System.String theSource)
        {
            System.Collections.ArrayList messages = new System.Collections.ArrayList(20);
            Match startMatch = new Regex("^MSH", RegexOptions.Multiline).Match(theSource);

            foreach (Group group in startMatch.Groups)
            {
                System.String messageExtent = getMessageExtent(theSource.Substring(group.Index), "^MSH");

                char fieldDelim = messageExtent[3];

                Match segmentMatch = Regex.Match(messageExtent, "^[A-Z]{3}\\" + fieldDelim + ".*$", RegexOptions.Multiline);

                System.Text.StringBuilder msg = new System.Text.StringBuilder();
                foreach (Group segGroup in segmentMatch.Groups)
                {
                    msg.Append(segGroup.Value.Trim());
                    msg.Append('\r');
                }

                messages.Add(msg.ToString());
            }

            String[] retVal = new String[messages.Count];
            messages.CopyTo(retVal);

            return retVal;
        }
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:39,代码来源:NuGenHl7InputStreamReader.cs


示例17: Main

        static void Main(string[] args)
        {
            Toy doll = new Toy();
            doll.Make = "rubber";
            doll.Model = "barbie";
            doll.Name = "Elsa";

            Toy car = new Toy();
            car.Make = "plastic";
            car.Model = "BMW";
            car.Name = "SPUR";

            System.Collections.ArrayList myArrayList = new System.Collections.ArrayList();
            myArrayList.Add(doll);
            myArrayList.Add(car);

            System.Collections.Specialized.ListDictionary myDictionary
                = new System.Collections.Specialized.ListDictionary();

            myDictionary.Add(doll.Name, doll);
            myDictionary.Add(car.Name, car);
            foreach (object o in myArrayList)
            {
                Console.WriteLine(((Toy)o).Name);
            }

            Console.WriteLine(((Toy)myDictionary["Elsa"]).Model);
            Console.ReadLine();
        }
开发者ID:ScavengerAsh,项目名称:cs492,代码行数:29,代码来源:Program.cs


示例18: StartUIACacheRequestCommand

        public StartUIACacheRequestCommand()
        {
            System.Collections.ArrayList defaultPropertiesList =
                new System.Collections.ArrayList();
            defaultPropertiesList.Add("Name");
            defaultPropertiesList.Add("AutomationId");
            defaultPropertiesList.Add("ClassName");
            defaultPropertiesList.Add("ControlType");
            defaultPropertiesList.Add("NativeWindowHandle");
            defaultPropertiesList.Add("BoundingRectangle");
            defaultPropertiesList.Add("ClickablePoint");
            defaultPropertiesList.Add("IsEnabled");
            defaultPropertiesList.Add("IsOffscreen");
            this.Property = (string[])defaultPropertiesList.ToArray(typeof(string));

            System.Collections.ArrayList defaultPatternsList =
                new System.Collections.ArrayList();
            defaultPatternsList.Add("ExpandCollapsePattern");
            defaultPatternsList.Add("InvokePattern");
            defaultPatternsList.Add("ScrollItemPattern");
            defaultPatternsList.Add("SelectionItemPattern");
            defaultPatternsList.Add("SelectionPattern");
            defaultPatternsList.Add("TextPattern");
            defaultPatternsList.Add("TogglePattern");
            defaultPatternsList.Add("ValuePattern");
            this.Pattern = (string[])defaultPatternsList.ToArray(typeof(string));

            this.Scope = "SUBTREE";

            this.Filter = "RAW";
        }
开发者ID:krisdages,项目名称:STUPS,代码行数:31,代码来源:StartUIACacheRequestCommand.cs


示例19: CalcolaCF_return_correct_fiscalcode

 public void CalcolaCF_return_correct_fiscalcode()
 {
     var listaErrori = new System.Collections.ArrayList();
     var codice = new CodiceFiscale();
     var codiceFiscale = codice.CalcolaCF("LUCIANO", "BENASSI", 'M', "09/10/1955", "G972", listaErrori);
     Assert.IsTrue(codiceFiscale == "BNSLCN55R09G972K");
 }
开发者ID:gipasoft,项目名称:Sfera,代码行数:7,代码来源:CodiceFiscaleTests.cs


示例20: InitXR

	private static void InitXR()
	{
		try
		{
			string FILEP = "file:\\";
			string EXT = "-netz.resources";
			string path = Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location);
			if(path.StartsWith(FILEP)) path = path.Substring(FILEP.Length, path.Length - FILEP.Length);
			string[] files = Directory.GetFiles(path, "*" + EXT);
			if((files != null) && (files.Length > 0))
			{
				xrRm = new System.Collections.ArrayList();
				for(int i = 0; i < files.Length; i++)
				{
					string name = Path.GetFileName(files[i]);
					name = name.Substring(0, name.Length - EXT.Length);
					ResourceManager temp = ResourceManager.CreateFileBasedResourceManager(name + "-netz", path, null);
					if(temp != null)
					{
						xrRm.Add(temp);
					}
				}
			}
		}catch
		{
			// fail silently here if something bad with regard to permissions happens
		}
	}
开发者ID:transformersprimeabcxyz,项目名称:_TO-DO-msnet-netz-compressor-madebits,代码行数:28,代码来源:starter.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Collections.BitArray类代码示例发布时间:2022-05-24
下一篇:
C# System.Collections类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap