/// <summary> /// Read array of SafeBool data from stream /// </summary> /// <returns>array of SafeBool</returns> public SafeBool[] ReadSafeBooleanArray() { int length = ReadInt(); SafeBool[] array = new SafeBool[length]; for (int i = 0; i < length; i++) { array[i] = ReadBoolean(); } return(array); }
/// <summary> /// Read data of given XmlElement as array of SafeBool /// </summary> /// <param name="e">XmlElement contains data</param> /// <returns>array of bool</returns> public SafeBool[] ReadSafeBooleanArray(XmlElement e) { string lenghtStr = e.GetAttribute("Lenght"); int length = 0; if (!int.TryParse(lenghtStr, out length)) { length = 0; } SafeBool[] array = new SafeBool[length]; XmlElement element = e.FirstChild as XmlElement; int index = 0; while (element != null) { array[index++] = ReadBoolean(element); element = e.GetNextSibling(element); } return(array); }