2017-06-06 21:13:25 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
2017-07-22 19:27:41 +00:00
|
|
|
|
namespace Glove.INI {
|
2017-06-07 21:02:29 +00:00
|
|
|
|
public class Section : IEnumerable<Instance> {
|
2017-06-08 21:01:34 +00:00
|
|
|
|
private List<Instance> Instances = new List<Instance>();
|
2017-06-06 21:13:25 +00:00
|
|
|
|
|
2017-06-07 21:02:29 +00:00
|
|
|
|
internal Section() { }
|
|
|
|
|
|
|
|
|
|
internal Instance Push() {
|
|
|
|
|
Instances.Add(new Instance());
|
|
|
|
|
return Instances[Instances.Count - 1];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public string this[string key] {
|
|
|
|
|
get {
|
|
|
|
|
return Instances[0][key];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Instance this[int i] {
|
|
|
|
|
get {
|
|
|
|
|
return Instances[i];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int Count {
|
|
|
|
|
get {
|
|
|
|
|
return Instances.Count;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
IEnumerator IEnumerable.GetEnumerator() {
|
|
|
|
|
return Instances.GetEnumerator();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
IEnumerator<Instance> IEnumerable<Instance>.GetEnumerator() {
|
2017-06-06 21:13:25 +00:00
|
|
|
|
return Instances.GetEnumerator();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|