예제 #1
0
		/// <summary>
		/// Returns the zero-based index of the first occurrence of a value in the ObisItems.
		/// </summary>
		/// <param name="item">The item to locate.</param>
		/// <returns>The index where the item is located or -1 if it was not found.</returns>
		public int IndexOf(ObisItem item)
		{
			return List.IndexOf(item);
		}
예제 #2
0
		/// <summary>
		/// Copies the ObisItems or a portion of it to an array.
		/// </summary>
		/// <param name="array">The array that is the destination of the ObisItems.</param>
		/// <param name="index">The zero-based index in array at which copying begins.</param>
		public void CopyTo(ObisItem[] array, int index)
		{
			List.CopyTo(array, index);
		}
예제 #3
0
		/// <summary>
		/// Removes the first occurrence of a specific object from the ObisItems.
		/// </summary>
		/// <param name="item">The removed item.</param>
		public void Remove(ObisItem item)
		{
			List.Remove(item);
		}
예제 #4
0
		/// <summary>
		/// Determines whether the ObisItems contains a specific value.
		/// </summary>
		/// <param name="item">The item to locate.</param>
		/// <returns>True if the item was located.</returns>
		public bool Contains(ObisItem item)
		{
			return List.Contains(item);
		}
예제 #5
0
		/// <summary>
		/// Inserts an item to the ObisItems at the specified index.
		/// </summary>
		/// <param name="index">The index of the item.</param>
		/// <param name="item">The inserted item.</param>
		public void Insert(int index, ObisItem item)
		{
			List.Insert(index, item);
		}
예제 #6
0
		public int Add(ObisItem Item)
		{
			return List.Add(Item);
		}
예제 #7
0
		private ObisItem ParseObisItem(XmlNode obis)
		{
			ObisItem obit = new ObisItem();
			obit.LN = obis.Attributes["LN"].Value;
			XmlNode node = obis.Attributes["Attribute"];
			if (node != null)
			{
				obit.Attribute = int.Parse(node.Value);
			}
			obit.Type = int.Parse(obis.Attributes["Type"].Value);
			obit.Description = obis.Attributes["Description"].Value;
			foreach (XmlNode node2 in obis.ChildNodes)
			{
				if (node2 is XmlElement)
				{
					if (node2.Name == "Interface")
					{
						obit.Interfaces.Add(int.Parse(node2.Attributes["Type"].Value));
					}
					else if (node2.Name == "Values")
					{
						foreach (XmlNode node3 in node2.ChildNodes)
						{
							if (node3 is XmlElement)
							{
								obit.ValueItems.Add(new Gurux.DeviceEditor.GXValueItem(node3.Attributes["Device"].Value, node3.InnerText, -1));
							}
						}
					}
				}
			}
			return obit;
		}
예제 #8
0
		private void WriteXmlItem(ObisItem item, XmlTextWriter textWriter)
		{
			textWriter.WriteStartElement("obis");
			textWriter.WriteAttributeString("LN", item.LN);
			textWriter.WriteAttributeString("Attribute", item.Attribute.ToString());
			textWriter.WriteAttributeString("Type", item.Type.ToString());
			textWriter.WriteAttributeString("Description", item.Description);
			foreach (int iface in item.Interfaces)
			{
				textWriter.WriteStartElement("Interface");
				textWriter.WriteAttributeString("Type", iface.ToString());
				textWriter.WriteEndElement();
			}
			textWriter.WriteStartElement("Values");
			foreach (Gurux.DeviceEditor.GXValueItem val in item.ValueItems)
			{
				textWriter.WriteStartElement("Value");
				textWriter.WriteAttributeString("Device", val.Value);
				textWriter.WriteString(val.UIValue);
				textWriter.WriteEndElement();//<Value>
			}
			textWriter.WriteEndElement();//<Values>
			textWriter.WriteEndElement();
		}
예제 #9
0
		private ObisItem AddItem(ObisItems parent)
		{
			ObisItem item = new ObisItem("1.2.3", 0, "");
			parent.Add(item);
			return item;
		}