ArrayList a = new ArrayList();
a.Add(4);
a.Add(5);
a.Add(6);
a.Add(7);
a.Add(8);
int [] arr = new int[a.Count];
int cntr = 0;
arr = (int []) a.ToArray(typeof(int));
foreach ( int n in arr )
{
Console.WriteLine(n.ToString());
}
Monday, March 22, 2004
ArrayList Method to Array
at 5:11 PM 0 comments Posted by roni schuetz
Friday, March 19, 2004
very good site for patterns
http://www.dofactory.com/Patterns/Patterns.aspx#list
at 9:04 PM 0 comments Posted by roni schuetz
some language dictonories
dic hebrew - english: http://milon.morfix.co.il/MorDictFirstPage.htm
dic deutsch - englisch: http://dict.leo.org/
at 9:03 PM 0 comments Posted by roni schuetz
Some ideas how to iterate throw Controls
Some ideas:
A) use FindControl on the object you added your control to:
Control empPeriod = this.LoadControl("EmploymentPeriod.ascx");
empPeriod.id="empPeriodId";
emp1.Controls.Add(empPeriod);
.Control empPeriod1 = empPeriod.FindControl("empPeriodId");
B) create an arraylist of the controls you've added, then use that later:
ArrayList list = new ArrayList();
for (i = 0; i < 10; i++)
{
Control empPeriod = this.LoadControl("EmploymentPeriod.ascx");
list.Add(empPeriod);
emp1.Controls.Add(empPeriod);
}
...
for (i = 0; i < 10; i++)
{
Control empPeriod1 = (Control)list[i];
......
}
C) do a recursive search for your controls
public void iterate(Control c)
{
if (c is YourType)
{
do_something(c);
}
forech (Control c1 in c.Controls)
{
iterate(c1);
}
}
at 9:00 PM 0 comments Posted by roni schuetz