本文整理汇总了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);
}
示例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);
}
示例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;
}
示例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;
}
示例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();
}
}
示例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;
}
}
示例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);
}
示例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;
}
}
示例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;
}
}
示例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;
}
示例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)));
}
示例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;
}
}
示例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;
}
示例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
{
}
}
示例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));
}