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


C# ArrayList.Add方法代码示例

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


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

示例1: Execute

        public IResponse Execute(ICruiseRequest request)
        {
            Hashtable velocityContext = new Hashtable();
            ArrayList links = new ArrayList();
            links.Add(new ServerLink(urlBuilder, request.ServerSpecifier, "Server Log", ActionName));

            ProjectStatusListAndExceptions projects = farmService.GetProjectStatusListAndCaptureExceptions(request.ServerSpecifier,
                request.RetrieveSessionToken());
            foreach (ProjectStatusOnServer projectStatusOnServer in projects.StatusAndServerList)
            {
                DefaultProjectSpecifier projectSpecifier = new DefaultProjectSpecifier(projectStatusOnServer.ServerSpecifier, projectStatusOnServer.ProjectStatus.Name);
                links.Add(new ProjectLink(urlBuilder, projectSpecifier, projectSpecifier.ProjectName, ServerLogProjectPlugin.ActionName));
            }
            velocityContext["projectLinks"] = links;
            if (string.IsNullOrEmpty(request.ProjectName))
            {
                velocityContext["log"] = HttpUtility.HtmlEncode(farmService.GetServerLog(request.ServerSpecifier, request.RetrieveSessionToken()));
            }
            else
            {
                velocityContext["currentProject"] = request.ProjectSpecifier.ProjectName;
                velocityContext["log"] = HttpUtility.HtmlEncode(farmService.GetServerLog(request.ProjectSpecifier, request.RetrieveSessionToken()));
            }

            return viewGenerator.GenerateView(@"ServerLog.vm", velocityContext);
        }
开发者ID:derrills1,项目名称:ccnet_gitmode,代码行数:26,代码来源:ServerLogServerPlugin.cs

示例2: Execute

        /// <summary>
        /// Action
        /// </summary>
        /// <param name="living"></param>
        public override void Execute(GameLiving living)
        {
            if (CheckPreconditions(living, DEAD | SITTING | MEZZED | STUNNED)) return;

            GamePlayer player = living as GamePlayer;
            if (player != null)
            {
                ArrayList targets = new ArrayList();
                if (player.Group == null)
                    targets.Add(player);
                else
                {
                    foreach (GamePlayer grpplayer in player.Group.GetPlayersInTheGroup())
                    {
                        if (player.IsWithinRadius(grpplayer, SpellRadius) && grpplayer.IsAlive)
                            targets.Add(grpplayer);
                    }
                }
                foreach (GamePlayer target in targets)
                {
                    //send spelleffect
                    if (!target.IsAlive) continue;
                    ValhallasBlessingEffect ValhallasBlessing = target.EffectList.GetOfType<ValhallasBlessingEffect>();
                    if (ValhallasBlessing != null)
                        ValhallasBlessing.Cancel(false);
                    new ValhallasBlessingEffect().Start(target);
                }
            }
            DisableSkill(living);
        }
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:34,代码来源:ValhallasBlessingAbility.cs

示例3: PRC_PersonasListasDePrecios

        public DataSet PRC_PersonasListasDePrecios()
        {
            ArrayList Parameters=new ArrayList(0);

            SqlParameter MODOParameter=new SqlParameter("@MODO",SqlDbType.Int);
            MODOParameter.Size=0;
            MODOParameter.Value=MODO;
            Parameters.Add(MODOParameter);

            SqlParameter PersonasListasDePrecios_IDParameter=new SqlParameter("@PersonasListasDePrecios_ID",SqlDbType.Int);
            PersonasListasDePrecios_IDParameter.Size=0;
            PersonasListasDePrecios_IDParameter.Value=PersonasListasDePrecios_ID;
            Parameters.Add(PersonasListasDePrecios_IDParameter);

            SqlParameter Personas_IDParameter=new SqlParameter("@Personas_ID",SqlDbType.Int);
            Personas_IDParameter.Size=0;
            Personas_IDParameter.Value=Personas_ID;
            Parameters.Add(Personas_IDParameter);

            SqlParameter ListasDePrecios_IDParameter=new SqlParameter("@ListasDePrecios_ID",SqlDbType.Int);
            ListasDePrecios_IDParameter.Size=0;
            ListasDePrecios_IDParameter.Value=ListasDePrecios_ID;
            Parameters.Add(ListasDePrecios_IDParameter);

            SqlParameter PersonasDirecciones_IDParameter=new SqlParameter("@PersonasDirecciones_ID",SqlDbType.Int);
            PersonasDirecciones_IDParameter.Size=0;
            PersonasDirecciones_IDParameter.Value=PersonasDirecciones_ID;
            Parameters.Add(PersonasDirecciones_IDParameter);

             DataSet dsResult=ExecuteStoredProcedure("[Grifo].[PRC_PersonasListasDePrecios]",ref Parameters);

            return dsResult;
        }
开发者ID:ANGELCUSI,项目名称:MCHTSIT,代码行数:33,代码来源:PersonasListasDePrecios.cs

示例4: aListOfPoint

 public IList aListOfPoint()
 {
     IList list = new ArrayList();
     list.Add(new System.Drawing.Point(0,0));
     list.Add(new System.Drawing.Point(5,5));
     return list;
 }
开发者ID:vaibhavsapre,项目名称:fitsharp,代码行数:7,代码来源:SystemUnderTest.cs

示例5: NDataReader

		/// <summary>
		/// Creates a NDataReader from a <see cref="IDataReader" />
		/// </summary>
		/// <param name="reader">The <see cref="IDataReader" /> to get the records from the Database.</param>
		/// <param name="isMidstream"><see langword="true" /> if we are loading the <see cref="IDataReader" /> in the middle of reading it.</param>
		/// <remarks>
		/// NHibernate attempts to not have to read the contents of an <see cref="IDataReader"/> into memory until it absolutely
		/// has to.  What that means is that it might have processed some records from the <see cref="IDataReader"/> and will
		/// pick up the <see cref="IDataReader"/> midstream so that the underlying <see cref="IDataReader"/> can be closed 
		/// so a new one can be opened.
		/// </remarks>
		public NDataReader(IDataReader reader, bool isMidstream)
		{
			ArrayList resultList = new ArrayList(2);

			try
			{
				// if we are in midstream of processing a DataReader then we are already
				// positioned on the first row (index=0)
				if (isMidstream)
				{
					currentRowIndex = 0;
				}

				// there will be atleast one result 
				resultList.Add(new NResult(reader, isMidstream));

				while (reader.NextResult())
				{
					// the second, third, nth result is not processed midstream
					resultList.Add(new NResult(reader, false));
				}

				results = (NResult[]) resultList.ToArray(typeof(NResult));
			}
			catch (Exception e)
			{
				throw new ADOException("There was a problem converting an IDataReader to NDataReader", e);
			}
			finally
			{
				reader.Close();
			}
		}
开发者ID:tkellogg,项目名称:NHibernate3-withProxyHooks,代码行数:44,代码来源:NDataReader.cs

示例6: GetByCriteria

        public DataTable GetByCriteria(IEntityBase value)
        {
            EConcepRemu objE = (EConcepRemu)value;

            try
            {

                ArrayList arrPrm = new ArrayList();

                arrPrm.Add(DataHelper.CreateParameter("@pidEmpresa", SqlDbType.Char, 3, objE.IdEmpresa));
                arrPrm.Add(DataHelper.CreateParameter("@pidConRemu", SqlDbType.Char, 3, objE.IdConRemu));
                arrPrm.Add(DataHelper.CreateParameter("@pdsConRemu", SqlDbType.VarChar, 50, objE.DsConRemu));
                arrPrm.Add(DataHelper.CreateParameter("@pidTipConcep", SqlDbType.Char, 3, objE.IdTipConcep));
                arrPrm.Add(DataHelper.CreateParameter("@pstCtaCte", SqlDbType.Char, 1, objE.StCtaCte));

                DataTable dt = this.ExecuteDatatable("RH_ConcepRemu_qry01", arrPrm);

                return dt;

            }
            catch (Exception ex)
            {

                ServerObjectException objEx = (ServerObjectException)this.GetException(MethodBase.GetCurrentMethod(), ex);
                throw objEx;

            }
        }
开发者ID:ArquitecturaSoftware,项目名称:texfinadev,代码行数:28,代码来源:ConcepRemu.cs

示例7: MaxSize

		public void MaxSize()
		{
			IKernel kernel = new DefaultKernel();
			kernel.AddComponent("a", typeof(PoolableComponent1));

			ArrayList instances = new ArrayList();

			instances.Add(kernel["a"] as PoolableComponent1);
			instances.Add(kernel["a"] as PoolableComponent1);
			instances.Add(kernel["a"] as PoolableComponent1);
			instances.Add(kernel["a"] as PoolableComponent1);
			instances.Add(kernel["a"] as PoolableComponent1);

			PoolableComponent1 other1 = kernel["a"] as PoolableComponent1;

			Assert.IsNotNull(other1);
			Assert.IsTrue(!instances.Contains(other1));

			foreach(object inst in instances)
			{
				kernel.ReleaseComponent(inst);
			}

			kernel.ReleaseComponent(other1);

			PoolableComponent1 other2 = kernel["a"] as PoolableComponent1;
			Assert.IsNotNull(other2);
			Assert.IsTrue(other1 != other2);
			Assert.IsTrue(instances.Contains(other2));

			kernel.ReleaseComponent(other2);
		}
开发者ID:ralescano,项目名称:castle,代码行数:32,代码来源:PooledLifestyleManagerTestCase.cs

示例8: CrearHorasSubsidio

        /// <summary>
        /// Crea Horas Para Subsidio
        /// </summary>
        /// <param name="value"></param>
        /// <returns></returns>
        public int CrearHorasSubsidio(IEntityBase value)
        {
            EProcPlaCalc objE = (EProcPlaCalc)value;

              try
              {

              ArrayList arrPrm = new ArrayList();

              arrPrm.Add(DataHelper.CreateParameter("@pidPeriodo", SqlDbType.Char, 4, objE.IdPeriodo));
              arrPrm.Add(DataHelper.CreateParameter("@pidEmpresa", SqlDbType.Char, 3, objE.IdEmpresa));
              arrPrm.Add(DataHelper.CreateParameter("@pidPlanilla", SqlDbType.Char, 3, objE.IdPlanilla));
              arrPrm.Add(DataHelper.CreateParameter("@pidForPago", SqlDbType.Char, 3, objE.IdForPago));
              arrPrm.Add(DataHelper.CreateParameter("@pnuProcAnual", SqlDbType.SmallInt, objE.NuProcAnual));

              int intRes = this.ExecuteNonQuery("RH_ProcPlaCalc_ope08", arrPrm);

              return intRes;

              }
              catch (Exception ex)
              {

              ServerObjectException objEx = (ServerObjectException)this.GetException(MethodBase.GetCurrentMethod(), ex);
              throw objEx;

              }
        }
开发者ID:ArquitecturaSoftware,项目名称:texfinadev,代码行数:33,代码来源:ProcPlaCalc.cs

示例9: GetByCriteria

        public DataTable GetByCriteria(IEntityBase value)
        {
            EEmpPeriodo objE = (EEmpPeriodo) value;

            try
            {

                ArrayList arrPrm = new ArrayList();

                arrPrm.Add(DataHelper.CreateParameter("@pidEmpresa", SqlDbType.Char,3, objE.IdEmpresa));
                arrPrm.Add(DataHelper.CreateParameter("@pidPeriodo", SqlDbType.Char,4, objE.IdPeriodo));

                DataTable dt = this.ExecuteDatatable("SY_EmpPeriodo_qry01", arrPrm);

                return dt;

            }
            catch(Exception ex)
            {

                ServerObjectException objEx = (ServerObjectException) this.GetException(MethodBase.GetCurrentMethod(), ex);
                throw objEx;

            }
        }
开发者ID:ArquitecturaSoftware,项目名称:texfinadev,代码行数:25,代码来源:EmpPeriodo.cs

示例10: GetDataByDealer

        public ArrayList GetDataByDealer(int id)
        {
            SqlConnection con = new SqlConnection("Data Source=.\\sqlexpress;Initial Catalog=egas;Integrated Security=True;Pooling=False");
            SqlDataAdapter da = new SqlDataAdapter("select * from customer", con);
            DataSet ds = new DataSet();
            da.Fill(ds, "customer");

            ArrayList arr = new ArrayList();

            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                if ((int.Parse(dr[10].ToString()) != id)||(dr[13].ToString() == "PENDING" ))
                {
                    dr.Delete();
                    continue; 
                }
            }

            arr.Add(da);
            arr.Add(ds);
            return arr;



        }
开发者ID:koustuvsinha,项目名称:asp.net,代码行数:25,代码来源:customer_keeper.cs

示例11: HandlePacket

		//rewritten by Corillian so if it doesn't work you know who to yell at ;)
		public void HandlePacket(GameClient client, GSPacketIn packet)
		{
			byte grouped = (byte)packet.ReadByte();
			ArrayList list = new ArrayList();
			if (grouped != 0x00)
			{
				ArrayList groups = GroupMgr.ListGroupByStatus(0x00);
				if (groups != null)
				{
					foreach (Group group in groups)
						if (GameServer.ServerRules.IsAllowedToGroup(group.Leader, client.Player, true))
						{
							list.Add(group.Leader);
						}
				}
			}

			ArrayList Lfg = GroupMgr.LookingForGroupPlayers();

			if (Lfg != null)
			{
				foreach (GamePlayer player in Lfg)
				{
					if (player != client.Player && GameServer.ServerRules.IsAllowedToGroup(client.Player, player, true))
					{
						list.Add(player);
					}
				}
			}

			client.Out.SendFindGroupWindowUpdate((GamePlayer[])list.ToArray(typeof(GamePlayer)));
		}
开发者ID:boscorillium,项目名称:dol,代码行数:33,代码来源:LookingForAGroupHandler.cs

示例12: GenNewCode

        public string GenNewCode(IEntityBase value)
        {
            ETablaCorre objE = (ETablaCorre)value;

             try
             {
            ArrayList arrPrm = new ArrayList();

            arrPrm.Add(DataHelper.CreateParameter("@pidPeriodo", SqlDbType.Char, 4, objE.IdPeriodo));
            arrPrm.Add(DataHelper.CreateParameter("@pidEmpresa", SqlDbType.Char, 3, objE.IdEmpresa));
            arrPrm.Add(DataHelper.CreateParameter("@pidTabla", SqlDbType.VarChar, 25, objE.IdTabla));

            DataTable dt = this.ExecuteDatatable("SY_TablaCorre_mnt10", arrPrm);

            int intCode = 0;
            string strFmt = "";

            foreach (DataRow dr in dt.Rows)
            {
               intCode = Convert.ToInt32(dr[0]);
               strFmt = dr[1].ToString();
            }

            return intCode.ToString(strFmt);

             }
             catch (Exception ex)
             {
            ServerObjectException objEx = (ServerObjectException)this.GetException(MethodBase.GetCurrentMethod(), ex);
            throw objEx;

             }
        }
开发者ID:ArquitecturaSoftware,项目名称:texfinadev,代码行数:33,代码来源:TablaCorre.cs

示例13: 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

示例14: Listener

        public Listener( int port )
        {
            m_ThisPort = port;
            m_Disposed = false;
            m_Accepted = new Queue();
            m_OnAccept = new AsyncCallback( OnAccept );

            m_Listener = Bind( IPAddress.Any, port );

            try
            {
                IPHostEntry iphe = Dns.Resolve( Dns.GetHostName() );

                ArrayList list = new ArrayList();
                list.Add( IPAddress.Loopback );

                Console.WriteLine( "Address: {0}:{1}", IPAddress.Loopback, port );

                IPAddress[] ips = iphe.AddressList;

                for ( int i = 0; i < ips.Length; ++i )
                {
                    if ( !list.Contains( ips[i] ) )
                    {
                        list.Add( ips[i] );

                        Console.WriteLine( "Address: {0}:{1}", ips[i], port );
                    }
                }
            }
            catch
            {
            }
        }
开发者ID:BackupTheBerlios,项目名称:sunuo-svn,代码行数:34,代码来源:Listener.cs

示例15: Split

		public static string[] Split( string src, char delimiter, params char[] quotedelims )
		{
			ArrayList		strings = new ArrayList();
			StringBuilder	sb = new StringBuilder();
			ArrayList		ar = new ArrayList(quotedelims);
			char			quote_open = Char.MinValue;

			foreach (char c in src) 
			{
				if (c == delimiter && quote_open == Char.MinValue) 
				{
					strings.Add( sb.ToString() );
					sb.Remove( 0, sb.Length );
				}
					
				else if (ar.Contains(c)) 
				{
					if (quote_open == Char.MinValue)
						quote_open = c;
					else if (quote_open == c)
						quote_open = Char.MinValue;
					sb.Append(c);
				}
				else
					sb.Append( c );
			}

			if (sb.Length > 0)
				strings.Add( sb.ToString());

			return (string[])strings.ToArray(typeof(string));
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:32,代码来源:StringUtility.cs


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