本文整理汇总了C#中ArrayList.Get方法的典型用法代码示例。如果您正苦于以下问题:C# ArrayList.Get方法的具体用法?C# ArrayList.Get怎么用?C# ArrayList.Get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ArrayList
的用法示例。
在下文中一共展示了ArrayList.Get方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: setItems
public void setItems(ArrayList items) {
for(int i = 0;i != items.Size();i++){
//if(items.li == 1) {
items.Set(i, "0" + items.Get(i));
//}
}
this.items = items;
}
示例2: GetFirstItemTest
[TestMethod] // Получение первого элемента
public void GetFirstItemTest()
{
int n = 2;
ArrayList<object> data = new ArrayList<object>(n);
data.Append(9);
data.Append(5);
data.Get(0);
}
示例3: GetLastItemTest
[TestMethod] // Получение последнего элемента
public void GetLastItemTest()
{
int n = 2;
ArrayList<object> data = new ArrayList<object>(n);
data.Append(8);
data.Append(10);
data.Get(1);
}
示例4: Find
/**
* Find hyperlink assigned to the supplied shape
*
* @param shape <code>Shape</code> to lookup hyperlink in
* @return found hyperlink or <code>null</code>
*/
protected static Hyperlink Find(Shape shape){
ArrayList lst = new ArrayList();
SlideShow ppt = shape.Sheet.GetSlideShow();
//document-level Container which stores info about all links in a presentation
ExObjList exobj = ppt.GetDocumentRecord().GetExObjList();
if (exobj == null) {
return null;
}
EscherContainerRecord spContainer = shape.GetSpContainer();
for (Iterator<EscherRecord> it = spContainer.GetChildIterator(); it.HasNext(); ) {
EscherRecord obj = it.next();
if (obj.GetRecordId() == EscherClientDataRecord.RECORD_ID){
byte[] data = obj.Serialize();
Record[] records = Record.FindChildRecords(data, 8, data.Length-8);
if(records != null) Find(records, exobj, lst);
}
}
return lst.Count == 1 ? (Hyperlink)lst.Get(0) : null;
}
示例5: TestConstructor6
public void TestConstructor6()
{
ArrayList<String> strings = new ArrayList<String>();
for (int i = 0; i < SIZE; ++i)
{
strings.Add(i.ToString());
}
LinkedBlockingQueue<String> q = new LinkedBlockingQueue<String>(strings);
for (int i = 0; i < SIZE; ++i)
{
Assert.AreEqual(strings.Get(i), q.Poll());
}
}
示例6: TestAddAll5
public void TestAddAll5()
{
ArrayList<String> empty = new ArrayList<String>();
ArrayList<String> strings = new ArrayList<String>(SIZE);
for (int i = 0; i < SIZE; ++i)
{
strings.Add(i.ToString());
}
LinkedBlockingQueue<String> q = new LinkedBlockingQueue<String>(SIZE);
Assert.IsFalse(q.AddAll(empty));
Assert.IsTrue(q.AddAll(strings));
for (int i = 0; i < SIZE; ++i)
{
Assert.AreEqual(strings.Get(i), q.Poll());
}
}
示例7: loadMap
private void loadMap()
{
ArrayList<string> lines = new ArrayList<string>();
int width = 0;
int height = 0;
var scanner = new Scanner(SampleGame.map);
while (scanner.HasNextLine())
{
string line = scanner.NextLine();
// no more lines to read
if (line == null)
{
break;
}
if (!line.StartsWith("!"))
{
lines.Add(line);
width = Math.Max(width, line.Length);
}
}
height = lines.Size();
for (int j = 0; j < 12; j++)
{
string line = (string) lines.Get(j);
for (int i = 0; i < width; i++)
{
if (i < line.Length)
{
char ch = line[i];
Tile t = new Tile(i, j, char.GetNumericValue(ch));
tilearray.Add(t);
}
}
}
}