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


C# ArrayList.Clear方法代码示例

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


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

示例1: SaveData

        public bool SaveData(ArrayList ParameterList, DataTable dt)
        {
            bool bResult = false;
            ArrayList Para = new ArrayList();
            try
            {
                //ParameterList[0] D_CREATEDATE
                //ParameterList[1] V_CREATEUID
                VAM21_DBO DBO = new VAM21_DBO(ref USEDB);

                Conn = USEDB.CreateConnection();
                Conn.Open();
                DBT = Conn.BeginTransaction();

                //先刪除已存在DB內的資料
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    if (dt.Rows[i]["CREATEDATE"].ToString().Trim() != "")
                    {
                        Para.Clear();
                        Para.Add(dt.Rows[i]["ID"].ToString().Trim());
                        DBO.DeleteData(Para, DBT);
                    }
                }

                //全部重新INSERT
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    if ((dt.Rows[i]["ENABLE"].ToString().Trim() == "1") && (dt.Rows[i]["VENDOR"].ToString().Trim() != ""))
                    {
                        Para.Clear();
                        Para.Add(dt.Rows[i]["VENDOR"].ToString().Trim());
                        Para.Add(ParameterList[0]);
                        Para.Add(ParameterList[1]);
                        DBO.InsertData(Para, DBT);
                    }
                }

                DBT.Commit();
                bResult = true;
            }
            catch (Exception ex)
            {
                if (DBT != null)
                    DBT.Rollback();
                throw ex;
            }
            finally
            {
                //獨立呼叫Transcation,關閉連線
                if (Conn.State == ConnectionState.Connecting)
                    Conn.Close();
            }
            return bResult;
        }
开发者ID:ChiangHanLung,项目名称:PIC_VDS,代码行数:55,代码来源:VAM21_BCO.cs

示例2: sendEmail

        public void sendEmail(string recipID, string msgBody)
        {
            ArrayList msgList = new ArrayList();

            msgList.Clear();
            msgList.Add(recipID);
                foreach (string item in msgList)
                {
                    try
                    {
                        MailMessage message = new MailMessage();
                        message.To.Add(item);
                        message.Subject = "Printable Integration Notication";
                        message.From = new MailAddress("[email protected]");
                        message.Body = msgBody;
                        message.ReplyTo = new MailAddress("[email protected]");
                        message.IsBodyHtml = true;
                        System.Net.Mail.SmtpClient smtp = Globals.get_smtpClient;
                        Console.ForegroundColor = ConsoleColor.Cyan;
                        Console.Write("Sending email to " + message.To.ToString());
                        smtp.Send(message);
                        Console.WriteLine(" - Success");
                        Console.ResetColor();
                        message.Dispose();
                    }
                    catch (Exception e)
                    {
                        Console.WriteLine("SendEmail Error - RecipID:" + recipID + " - Receiver:" + item + " - Msg:" + msgBody);
                        Console.WriteLine(e.ToString());
                        Console.Beep();
                        //errorLog("Email-1", e.ToString(), "SendEmail Error - RecipID:" + recipID + " - Receiver:" + item + " - Msg:" + msgBody);
                    }
                }
        }
开发者ID:FinelinePrintingGroup,项目名称:PTI_PackingSlip,代码行数:34,代码来源:Globals.cs

示例3: isPHPReady

        public bool isPHPReady()
        {            
            if (!File.Exists(var.strPHPTemplateConfigFilePath))
            {
            	MessageBox.Show("The PHP template file, " + var.strPHPTemplateConfigFilePath + " cannot be found");
            	return false;
            }
            /*if (!File.Exists(var.strPHPTSConfigFilePath))
            {
            	MessageBox.Show("The PHP configuration file, " +  var.strPHPTSConfigFilePath + " cannot be found");
            	return false;
            }
            if (!File.Exists(var.strPHPNTSConfigFilePath))
            {
            	MessageBox.Show("The PHP configuration file, " + var.strPHPNTSConfigFilePath + " cannot be found");
            	return false;
            }*/
        
            // Thread-safe PHP config
            ArrayList alReplace = new ArrayList();
            alReplace.Add(new string[]{";%INCLUDE_PATH%", "include_path=\".;"+var.strPHPTSFolderPath+"\\pear\""});
            alReplace.Add(new string[]{"%EXTDIR%", Path.Combine(var.strPHPTSFolderPath, "ext")});
			File.WriteAllText(var.strPHPTSConfigFilePath, var.replaceText(File.ReadAllText(var.strPHPTemplateConfigFilePath),alReplace));
			
			// Non thread-safe PHP config
			alReplace.Clear();
			alReplace.Add(new string[]{";%INCLUDE_PATH%", "include_path=\".;"+var.strPHPNTSFolderPath+"\\pear\""});
			alReplace.Add(new string[]{"%EXTDIR%", Path.Combine(var.strPHPNTSFolderPath, "ext")});
			File.WriteAllText(var.strPHPNTSConfigFilePath, var.replaceText(File.ReadAllText(var.strPHPTemplateConfigFilePath),alReplace));
			
			Environment.SetEnvironmentVariable("PHP_FCGI_MAX_REQUESTS",var.getString("PHP","numPHPRequests"));
			
			return true;
        }
开发者ID:Boycce,项目名称:surfstack-wamp,代码行数:34,代码来源:PHPConfig.cs

示例4: BuildNumber

 public override string BuildNumber(int Num)
 {
     Random random = new Random();
     StringBuilder builder = new StringBuilder();
     ArrayList al = new ArrayList();
     for (int i = 0; i < Num; i++)
     {
         al.Clear();
         for (int j = 0; j < 5; j++)
         {
             int ball = 0;
             while ((ball == 0) || base.isExistBall(al, ball))
             {
                 ball = random.Next(1, 0x17);
             }
             al.Add(ball.ToString().PadLeft(2, '0'));
         }
         LotteryBase.CompareToAscii comparer = new LotteryBase.CompareToAscii();
         al.Sort(comparer);
         string str = "";
         for (int k = 0; k < al.Count; k++)
         {
             str = str + al[k].ToString() + " ";
         }
         builder.Append(str.Trim() + "\n");
     }
     string str2 = builder.ToString();
     return str2.Substring(0, str2.Length - 1);
 }
开发者ID:NoobSkie,项目名称:taobao-shop-helper,代码行数:29,代码来源:HNFC22X5.cs

示例5: Query

        public Query(Query another)
        {
            formula = new ArrayList();
            Oid refOid = null;

            try
            {
                if (another.Oid != null)
                {
                    refOid = (Oid)another.Oid.Clone();
                }

                if (another.Formula != null)
                {
                    QueryFormula[] items = (QueryFormula[])another.Formula.Clone();
                    formula.Clear();
                    foreach (QueryFormula item in items)
                    {
                        formula.Add(new QueryFormula(item));
                    }
                }
            }
            catch (Exception e)
            {
                e.ToString();
            }

            oid = refOid;
        }
开发者ID:erdembey,项目名称:ooRuleML,代码行数:29,代码来源:Query.cs

示例6: CompareDocuments

        public static ArrayList CompareDocuments(string document1, string document2)
        {
            Common.SetLicense();

            ArrayList result = new ArrayList();
            try
            {
                // Create a temporary folder
                string comparisonDocument = GetCompareDocumentName(document1, document2);

                // Call the util class for comparison
                DocumentComparisonUtil docCompUtil = new DocumentComparisonUtil();
                int added = 0, deleted = 0;
                docCompUtil.Compare(document1, document2, comparisonDocument, ref added, ref deleted);

                result.Add(Common.Success); // 0. Result
                result.Add((comparisonDocument)); // 1. Path of the comparison document
                result.Add(added); // 2. Number of additions
                result.Add(deleted); // 3. Number of deletions
            }
            catch (Exception ex)
            {
                result.Clear();
                result.Add(Common.Error + ": " + ex.Message); // 0. Result
            }
            return result;
        }
开发者ID:joyang1,项目名称:Aspose_Words_NET,代码行数:27,代码来源:Default.aspx.cs

示例7: ReadSettings

		public static void ReadSettings( out bool enabled , out bool toast , ArrayList processActions )
		{
			PriorityManagerSettings p;

			try
			{
				XmlSerializer deSerialiser = new XmlSerializer( typeof(PriorityManagerSettings) );

				IsolatedStorageFileStream fileStream  = new IsolatedStorageFileStream( SettingsFileName , FileMode.Open , FileAccess.Read , FileShare.None ); 

				System.IO.StreamReader reader = new System.IO.StreamReader( fileStream );

				p = (PriorityManagerSettings)deSerialiser.Deserialize( reader );

				enabled			= p.Enabled ;
				toast			= p.ToastEnabled;
				
				lock ( processActions.SyncRoot )
				{
					processActions.Clear();
					processActions.AddRange( p.ProcessActions );
				}
	
				reader.Close();
			}
			catch
			{	
				// hard coded defaults...
				toast			= true;
				enabled			= true;
				processActions	= new ArrayList();
			}
		}
开发者ID:ehershey,项目名称:development,代码行数:33,代码来源:PriorityManagerSettings.cs

示例8: CastFunc

		public void CastFunc()
		{
			IList args = new ArrayList();

			CastFunction cf = new CastFunction();
			try
			{
				SqlString t = cf.Render(args, factoryImpl);
				Assert.Fail("No exception if no argument");
			}
			catch (QueryException)
			{
				//correct
			}

			args.Add("'123'");
			args.Add("long");
			string expected =
				string.Format("cast({0} as {1})", args[0], factoryImpl.Dialect.GetCastTypeName(SqlTypeFactory.Int64));
			Assert.AreEqual(expected, cf.Render(args, factoryImpl).ToString());

			args.Clear();
			args.Add("'123'");
			args.Add("NO_TYPE");
			try
			{
				SqlString t = cf.Render(args, factoryImpl);
				Assert.Fail("Ivalid type accepted");
			}
			catch (QueryException)
			{
				//correct
			}
		}
开发者ID:nhibernate,项目名称:nhibernate-core,代码行数:34,代码来源:SimpleFunctionsTest.cs

示例9: btnInhoadon_Click

        private void btnInhoadon_Click(object sender, EventArgs e)
        {
            ArrayList listdv = new ArrayList();
            ArrayList listp = new ArrayList();
            listdv.Clear();
            listp.Clear();
            if (flagtinhtien == true)
            {

                listdv = new ArrayList(inhddvBUS.inhoadondv(labMaHD.Text));
                listp = new ArrayList(inhdpBUS.InHoaDonPhong(labMaHD.Text));
                qlks3lopDataSet.InhoadonDichVuDataTable dtdv = new qlks3lopDataSet.InhoadonDichVuDataTable();
                qlks3lopDataSet.InhoadonPhongDataTable dtp = new qlks3lopDataSet.InhoadonPhongDataTable();
                foreach (InHoaDonDichVuDTO hddv in listdv)
                {
                    dtdv.Rows.Add(hddv.Maphieuthue, hddv.Tendichvu, hddv.Gia, hddv.Donvitinh, hddv.Soluong, hddv.MaPhong, hddv.Mahoadon, hddv.Ngay);
                }
                foreach (InHoaDonPhongDTO hdp in listp)
                {
                    dtp.Rows.Add(hdp.Mahoadon, hdp.Tenkhachhang, hdp.Songayo, hdp.CMND, hdp.Diachi, hdp.Coquan, hdp.Sodienthoai, hdp.Email, hdp.Ngayden, hdp.Ngaydi, hdp.Sotiendatcoc, hdp.Gia, hdp.Maphong, hdp.Tennhanvien, hdp.Tongtien);
                }
                InHoaDon frmInHoaDon = new InHoaDon();
                frmInHoaDon.dtdv = dtdv;
                frmInHoaDon.dtp = dtp;
                frmInHoaDon.ShowDialog();
                //show_MaPT();
            }
            else MessageBox.Show("Thanh toán trước khi in hóa đơn");
        }
开发者ID:Delelope,项目名称:WebService,代码行数:29,代码来源:FormHoaDon.cs

示例10: GetGameObjectBlendshapes

		/**
		 * Adds all possible blendshape targets of the game object
		 * curGameObject and its sub-objects (recursively) to the
		 * list of target blendshapes.
		 */
		public static void GetGameObjectBlendshapes(GameObject curGameObject, ArrayList blendshape_infos) {
		
			if (blendshape_infos != null) blendshape_infos.Clear();

			// Iterate over game object itself and over children and add blendshapes
			Transform [] children = curGameObject.GetComponentsInChildren<Transform>();
			foreach (Transform child in children)
			{
				string transformPath = CalculateTransformPath(child, curGameObject.transform);
				SkinnedMeshRenderer meshRenderer = (SkinnedMeshRenderer)child.GetComponent(typeof(SkinnedMeshRenderer));
				if (meshRenderer != null)
				{
					if (meshRenderer.sharedMesh != null)
					{
						//Debug.Log("Number of blend shapes: " + meshRenderer.sharedMesh.blendShapeCount);
						for (int blend_shape_nr = 0; blend_shape_nr < meshRenderer.sharedMesh.blendShapeCount; blend_shape_nr++) {
							string blend_shape_name = meshRenderer.sharedMesh.GetBlendShapeName(blend_shape_nr);
							//Debug.Log("Path: '" + transformPath + "', blend shape: '" + blend_shape_name + "'");
							if (blendshape_infos != null) {
								BlendshapeInfo blendshape_info = new BlendshapeInfo();
								blendshape_info.m_path = transformPath;
								blendshape_info.m_name = blend_shape_name;
								blendshape_info.m_index = blend_shape_nr;
								blendshape_info.m_mesh_renderer = meshRenderer;
								blendshape_infos.Add (blendshape_info);
							}
						}
					}
				}
			}
		}
开发者ID:tommyfriday,项目名称:ITP_Storytelling,代码行数:36,代码来源:Utils.cs

示例11: ImportComComponent

 internal bool ImportComComponent(string path, OutputMessageCollection outputMessages, string outputDisplayName)
 {
     ComImporter importer = new ComImporter(path, outputMessages, outputDisplayName);
     if (importer.Success)
     {
         ArrayList list = new ArrayList();
         if (this.typeLibs != null)
         {
             list.AddRange(this.typeLibs);
         }
         if (importer.TypeLib != null)
         {
             list.Add(importer.TypeLib);
         }
         this.typeLibs = (TypeLib[]) list.ToArray(typeof(TypeLib));
         list.Clear();
         if (this.comClasses != null)
         {
             list.AddRange(this.comClasses);
         }
         if (importer.ComClasses != null)
         {
             list.AddRange(importer.ComClasses);
         }
         this.comClasses = (ComClass[]) list.ToArray(typeof(ComClass));
     }
     return importer.Success;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:28,代码来源:FileReference.cs

示例12: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //
                //Setup Criteria
                //
                RestrictValueCount = RestrictValueOptions.OnlyOne_Period;

                //
                // Setup cmbDistrict
                //
                cmbDistrict.Attributes.Add("CriteriaName", CriteriaName);
                cmbDistrict.OnClientSelectedIndexChanged = CriteriaName + "Controller.OnComboChanged";

                cmbDistrict.OnClientLoad = CriteriaName + "Controller.PopulateControls";

                ValueDisplayTemplateName = "DistrictCriteriaValueDisplayTemplate";

                //
                // Create Json array strings for populating our dropdownlist controls, and register them as javascript;
                //
                var serializer = new JavaScriptSerializer();
                var arry = new ArrayList();

                // data for cmbDistrict
                arry.Clear();
                // todo: mpf - populate district data. //arry = Semester.BuildJsonArray();
                ScriptManager.RegisterStartupScript(this, typeof(string), CriteriaName + "DependencyData", "var " + CriteriaName + "DependencyData = " + serializer.Serialize(arry) + ";", true);
            }

            ConfigureCriteriaHeader(CriteriaHeader, RadToolTip1);
        }
开发者ID:ezimaxtechnologies,项目名称:ASP.Net,代码行数:33,代码来源:DistrictCriteria.ascx.cs

示例13: Equivalent

        public Equivalent(Equivalent another)
        {
            torso = new ArrayList();

            Oid refOid = null;
            torso = new ArrayList();

            try
            {
                if (another.Oid != null)
                {
                    refOid = (Oid)another.Oid.Clone();
                }

                if (another.Torso != null)
                {
                    Torso[] items = (Torso[])another.Torso.Clone();
                    torso.Clear();
                    foreach (Torso item in items)
                    {
                        torso.Add(new Torso(item));
                    }
                }
            }
            catch (Exception e)
            {
                e.ToString();
            }

            oid = refOid;
        }
开发者ID:erdembey,项目名称:ooRuleML,代码行数:31,代码来源:Equivalent.cs

示例14: train

 public train(formDelegate sender, ArrayList from)
 {
     trainDelegate = sender;
     toolTip = Convert.ToBoolean(from[0]);
     from.Clear();
     InitializeComponent();
 }
开发者ID:karl-erikB,项目名称:TeboCam_OpenSource,代码行数:7,代码来源:train.cs

示例15: AddClassFrm

 private void 添加分类ToolStripMenuItem_Click(object sender, EventArgs e)
 {
     AddClassFrm addclass = new AddClassFrm();
     if (addclass.ShowDialog() == DialogResult.OK)
     {
         string classStr = addclass.textBox1.Text.ToUpper().ToString();
         ArrayList selectedlist = new ArrayList();
         foreach (DataGridViewRow dr in this.dataGridView1.Rows)
         {
             if (dr.Selected == true)
             {
                 selectedlist.Add(dr.Index);
             }
         }
         for (int i = 0; i < selectedlist.Count; i++)
         {
             int index = int.Parse(selectedlist[i].ToString());
             string projectidStr = this.dataGridView1.Rows[index].Cells["项目号"].Value.ToString();
             string drawingStr = this.dataGridView1.Rows[index].Cells["图纸号"].Value.ToString();
             string spoolStr = this.dataGridView1.Rows[index].Cells["小票号"].Value.ToString();
             WorkShopStatusFlow.AddTrayORClass("SP_ADDCLASSIFICATION", projectidStr, drawingStr, spoolStr, classStr);
             this.dataGridView1.Rows[index].Cells["分类"].Value = classStr;
         }
         selectedlist.Clear();
         MessageBox.Show("--------完成--------");
     }
 }
开发者ID:freudshow,项目名称:raffles-codes,代码行数:27,代码来源:TrayClassCtl.cs


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