SECI  1
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events
ComponentList.cs
Go to the documentation of this file.
1 using System;
2 using System.Collections;
3 using System.Collections.Generic;
4 using System.Text;
5 using System.Xml;
6 using System.Xml.Serialization;
7 using Seci.Definitions;
8 
9 namespace Seci
10 {
17  public class ComponentList
18  {
19  private List<Configuration> _compsList = new List<Configuration>();
20 
26  [XmlElement]
27  public String[] Components
28  {
29  get
30  {
31  String[] CompNames = new String[_compsList.Count];
32 
33  for (int i = 0; i < _compsList.Count; ++i)
34  {
35  CompNames[i] = _compsList[i].ConfigName;
36  }
37 
38  return CompNames;
39  }
40  set
41  {
42  if (value != null)
43  {
44  for (int i = 0; i < value.GetLength(0); ++i)
45  {
46  Configuration tmp = new Configuration();
47  tmp.ConfigName = value[i];
48  _compsList.Add(tmp);
49  }
50  }
51  }
52  }
53 
59  public Configuration this[int index]
60  {
61  get
62  {
63  return _compsList[index];
64  }
65  set
66  {
67  _compsList[index] = value;
68  }
69 
70  }
71 
77  public Configuration this[String name]
78  {
79  get
80  {
81  for (int i = 0; i < _compsList.Count; ++i)
82  {
83  if (name == ((Configuration)_compsList[i]).ConfigName)
84  {
85  return (Configuration)_compsList[i];
86  }
87  }
88  return null;
89  }
90  set
91  {
92  for (int i = 0; i < _compsList.Count; ++i)
93  {
94  if (name == ((Configuration)_compsList[i]).ConfigName)
95  {
96  _compsList[i] = value;
97  }
98  }
99  }
100 
101  }
102 
106  public int Count { get { return _compsList.Count; } }
107 
112  public void Add(Configuration item)
113  {
114  _compsList.Add(item);
115  }
116 
122  public Boolean Remove(Configuration item)
123  {
124  return _compsList.Remove(item);
125  }
126 
131  public void RemoveAt(int index)
132  {
133  _compsList.RemoveAt(index);
134  }
135 
141  public void Insert(int index, Configuration item)
142  {
143  _compsList.Insert(index, item);
144  }
145 
149  public void Clear()
150  {
151  _compsList.Clear();
152  }
153 
154  }
155 }
A serialisable list for containing objects of type SeciConfiguration. This class wraps a standard Lis...
void Insert(int index, Configuration item)
This a wrapper for the standard List &quot;Insert&quot; command.
This class contains all the information that defines the configuration at the SECI level and contains...
int Count
This a wrapper for the standard List &quot;Count&quot; command.
Boolean Remove(Configuration item)
This a wrapper for the standard List &quot;Remove&quot; command.
void RemoveAt(int index)
This a wrapper for the standard List &quot;RemoveAt&quot; command.
void Add(Configuration item)
This a wrapper for the standard List Add command.
List< Configuration > _compsList
String[] Components
This property is purely for serialising and deserialising the names of any components in the configur...
void Clear()
This a wrapper for the standard List &quot;Clear&quot; command.