internal Sitemap(REST aRest, System.IO.BinaryReader aReader) { Name = aReader.ReadString(); Link = new Uri(aReader.ReadString()); Homepage = new Uri(aReader.ReadString()); var count = aReader.ReadInt32(); for (var idx = 0; idx < count; ++idx) { Item item; if (aRest.Items.TryGetValue(aReader.ReadString(), out item)) Items[item.Name] = item; } Page page; count = aReader.ReadInt32(); for (var idx = 0; idx < count; ++idx) { if (aRest.Pages.TryGetValue(aReader.ReadString(), out page)) Pages[page.Id] = page; } if (aRest.Pages.TryGetValue(aReader.ReadString(), out page)) Page = page; }
public override void ReadXml(System.Xml.Linq.XElement element) { X = new DrawingExpression(this, "Center X =", element.ReadString("X")); Y = new DrawingExpression(this, "Center Y =", element.ReadString("Y")); R = new DrawingExpression(this, "Radius =", element.ReadString("R")); base.ReadXml(element); }
public void Read(System.IO.BinaryReader reader) { // read the Id from string format string guid = reader.ReadString(); Guid parsedId; if (Guid.TryParse(guid, out parsedId)) { Id = parsedId; } else { Id = Guid.NewGuid(); } // read the name Name = reader.ReadString(); // read the Contacts Contacts = new List<Contact>(); int contactsCount = reader.ReadInt32(); if (contactsCount > 0) { for (int i = 0; i < contactsCount; ++i) { var contact = new Contact(); contact.Read(reader); Contacts.Add(contact); } } }
internal Texture2D( Scene _Owner, System.IO.BinaryReader _Reader ) { m_Owner = _Owner; m_ID = _Reader.ReadInt32(); m_URL = _Reader.ReadString(); m_OpacityURL = _Reader.ReadString(); }
/// <summary> /// deserialize from the reader to recreate the struct /// </summary> /// <param name="r">BinaryReader</param> void IBinarySerialize.Read(System.IO.BinaryReader r) { _delimiter = r.ReadString(); _accumulator = new StringBuilder(r.ReadString()); if (_accumulator.Length != 0) this.IsNull = false; }
public void Read(System.IO.BinaryReader reader) { // read the name Name = reader.ReadString(); // read the number Number = reader.ReadString(); }
public void SetDataFrom(System.IO.BinaryReader reader) { CorrelationId = new Guid(reader.ReadString()); Port = reader.ReadInt32(); NUnitTestRunner = reader.ReadString(); MsTestRunner = reader.ReadString(); LoggingEnabled = reader.ReadBoolean(); StartedPaused = reader.ReadBoolean(); }
public override object Deserialize(System.IO.BinaryReader binaryReader) { bool hasValue = binaryReader.ReadBoolean (); if (!hasValue) return null; int typeID = binaryReader.ReadByte (); switch (typeID) { case 1: return binaryReader.ReadBoolean (); case 2: return binaryReader.ReadByte (); case 128: return binaryReader.ReadSByte (); case 3: return binaryReader.ReadInt16 (); case 129: return binaryReader.ReadUInt16 (); case 4: return binaryReader.ReadInt32 (); case 130: return binaryReader.ReadUInt32 (); case 5: return binaryReader.ReadInt64 (); case 131: return binaryReader.ReadUInt64 (); case 9: return binaryReader.ReadDouble (); case 16: return binaryReader.ReadString (); case 144: return binaryReader.ReadChar (); case 24: return new DateTime (binaryReader.ReadInt64 ()); case 32: return new Guid (binaryReader.ReadBytes (16)); case 36: return binaryReader.ReadBytes (binaryReader.ReadInt32 ()); case 37: { int count = binaryReader.ReadInt32 (); string[] r = new string[count]; for (int n = 0; n != count; n++) r [n] = binaryReader.ReadString (); return r; } case 38: { int count = binaryReader.ReadInt32 (); long[] r = new long[count]; for (int n = 0; n != count; n++) r [n] = binaryReader.ReadInt64 (); return r; } default: throw new Exception (string.Format ("Serialization for type <{0}> is not supported", typeID)); } }
/// <summary> /// deserialize from the reader to recreate the struct /// </summary> /// <param name="reader">BinaryReader</param> void IBinarySerialize.Read(System.IO.BinaryReader reader) { this.delimiter = reader.ReadString(); this.accumulator = new StringBuilder(reader.ReadString()); if (this.accumulator.Length != 0) { this.IsNull = false; } }
internal static Bestilling Load(System.IO.BinaryReader br) { Bestilling best = new Bestilling(); best.koli = br.ReadInt32(); best.fraktnr = br.ReadInt32(); best.sender = br.ReadString(); best.mottakerpers = br.ReadString(); best.transportertav = br.ReadString(); best.sendt = DateTime.Parse(br.ReadString()); return best; }
public override object Deserialize(Type type, System.IO.BinaryReader reader) { if (typeof(PrimaryCacheKey) == type) { var uri = reader.ReadString(); var method = reader.ReadString(); return new PrimaryCacheKey(uri, method); } throw new NotImplementedException(); }
public void ReadFrom(System.Xml.XmlReader x) { while(x.Read()) switch (x.LocalName) { case "CompilerArg": CompilerArguments = x.ReadString(); break; case "LinkerArgs": LinkerArguments = x.ReadString(); break; } }
public Lesson(System.IO.BinaryReader reader) { DayIndex = reader.ReadByte(); PeriodIndex = reader.ReadByte(); YearIndex = reader.ReadByte(); FormIndex = reader.ReadByte(); TeacherAbbreviation = reader.ReadString(); SubjectAbbreviation = reader.ReadString(); RoomCode = reader.ReadString(); homeworkAmount = reader.ReadByte(); invisible = reader.ReadBoolean(); locked = reader.ReadBoolean(); }
public void ReadXml(System.Xml.XmlReader reader) { if (reader.LocalName != "argument" && !reader.ReadToDescendant("argument")) throw new InvalidDataException(); var dict = new Dictionary<string, Action>() { {"name", () => this.Name = reader.ReadString()}, {"direction", () => this.Direction = reader.ReadString()}, {"relatedStateVariable", () => this.RelatedStateVariable = reader.ReadString()} }; XmlHelper.ParseXml(reader, dict); }
public override void Load(System.Xml.XmlReader reader) { string accountGroupNameBuffer = null; List<Command> commandBuffer = new List<Command>(); while (reader.Read()) { var content = reader.MoveToContent(); if (content == System.Xml.XmlNodeType.Element) { if (reader.Name == "AccountGroup") { if (accountGroupNameBuffer != null) throw new Exception("AccountGroup nodes cannot be nested"); accountGroupNameBuffer = reader.GetAttribute("name"); commandBuffer.Clear(); } else if (reader.Name == "Command") { if (accountGroupNameBuffer == null) throw new Exception("Command nodes cannot be nested in non-AccountGroup nodes"); string commandName = reader.ReadString(); commandBuffer.Add(Command.GetCommand(commandName)); if (commandBuffer[commandBuffer.Count - 1] == null) throw new Exception("Command '" + commandName + "' not found"); } else if (reader.Name == "Account") { if (accountGroupNameBuffer != null) throw new Exception("Account nodes cannot be nested in AccountGroup nodes"); string group = reader.GetAttribute("group"); string accountName = reader.ReadString(); accounts.Add(accountName, group); } } else if (content == System.Xml.XmlNodeType.EndElement) { if (reader.Name == "AccountGroup") { if (accountGroupNameBuffer != null) accountGroups.Add(accountGroupNameBuffer, commandBuffer.ToArray()); accountGroupNameBuffer = null; } } } }
public void ReadXml(System.Xml.XmlReader reader) { if (reader.LocalName != "stateVariable" && !reader.ReadToDescendant("stateVariable")) throw new InvalidDataException(); if (reader.HasAttributes) this.SendEvents = ((reader.GetAttribute("sendEvents") ?? "no") == "yes"); XmlHelper.ParseXml(reader, new XmlParseSet { {"name", () => this.Name = reader.ReadString()}, {"dataType", () => this.DataType = reader.ReadString()} }); }
/// <summary> /// Lê comando. /// </summary> /// <param name="p_reader">Objeto XML.</param> private void ReadCommand(System.Xml.XmlReader p_reader) { System.Xml.XmlReader v_item; this.v_cmd = new Spartacus.Database.Command(); while (p_reader.Read()) { if (p_reader.IsStartElement()) { switch (p_reader.Name) { case "sql": this.v_cmd.v_text = p_reader.ReadString(); break; case "parameter": v_item = p_reader.ReadSubtree(); this.ReadParameter(v_item); v_item.Close(); break; default: break; } } } }
/// <summary> /// ReadXml /// </summary> /// <param name="reader"></param> void IXmlSerializable.ReadXml(System.Xml.XmlReader reader) { //(@update 04-nov-2005, vedi errata korrige) this.text = reader.ReadString(); //reader.Read() }
public override void ReadXML(System.Xml.XmlReader input) { input.ReadToDescendant("min"); var s = input.ReadString().Split(new char[] { ',' }); if (s.Length != 3) throw new FormatException("Bounding box vector value formatted incorrectly."); this.MinX = float.Parse(s[0].Trim()); this.MinY = float.Parse(s[1].Trim()); this.MinZ = float.Parse(s[2].Trim()); input.ReadToNextSibling("max"); s = input.ReadString().Split(new char[] { ',' }); if (s.Length != 3) throw new FormatException("Bounding box vector value formatted incorrectly."); this.MaxX = float.Parse(s[0].Trim()); this.MaxY = float.Parse(s[1].Trim()); this.MaxZ = float.Parse(s[2].Trim()); }
public override void Deserialize(System.IO.BinaryReader reader) { base.Deserialize(reader); Speed = reader.ReadSingle(); FirstMarker = reader.ReadString(); }
/// <summary> /// Generates an object from its XML representation. /// </summary> /// <param name="reader">The <see cref="XmlReader" /> stream from which the object is deserialized.</param> public void ReadXml(System.Xml.XmlReader reader) { // Read the opening tag of the encapsulating element reader.ReadStartElement(); reader.ReadStartElement("body"); this.Body = reader.ReadString(); reader.ReadEndElement(); reader.ReadStartElement("app-id"); this.AppId = reader.ReadString(); reader.ReadEndElement(); // Read the end tag of the encapsulating element reader.ReadEndElement(); }
public override void Deserialize(System.IO.BinaryReader reader) { base.Deserialize(reader); ParticleTemplate = new Particle(); ParticleTemplate.Template = true; ParticleTemplate.Color = new Color(reader.ReadByte(), reader.ReadByte(), reader.ReadByte(), reader.ReadByte()); ParticleTemplate.Texture = Texture2D.FromStream(Engine.graphicsDevice, System.IO.File.OpenRead(reader.ReadString())); ParticleTemplate.Velocity = new Vector2(reader.ReadSingle(), reader.ReadSingle()); ParticleTemplate.FadeColor = new Color(reader.ReadByte(), reader.ReadByte(), reader.ReadByte(), reader.ReadByte()); ParticleTemplate.FadeStartTime = reader.ReadInt32(); ParticleTemplate.FadeTime = reader.ReadInt32(); ParticleTemplate.Rotation = reader.ReadInt32(); ParticleTemplate.RotationSpeed = reader.ReadInt32(); InitialVelocity = new Vector2(reader.ReadSingle(), reader.ReadSingle()); InitialRandom = new Vector2(reader.ReadSingle(), reader.ReadSingle()); Time = reader.ReadInt32(); Amount = reader.ReadInt32(); StartEnabled = reader.ReadBoolean(); }
public override void Deserialize(System.IO.BinaryReader reader) { base.Deserialize(reader); Stop = reader.ReadBoolean(); NextMarker = reader.ReadString(); }
/// <summary> /// Creates a scene node from a stream /// </summary> /// <param name="_Owner"></param> /// <param name="_Parent"></param> /// <param name="_Reader"></param> internal Node( Scene _Owner, Node _Parent, System.IO.BinaryReader _Reader ) { m_Owner = _Owner; // m_NodeType = _Reader.ReadInt32(); // Don't read back the node type as it has already been consumed by the parent m_ID = _Reader.ReadInt32(); m_Owner.RegisterNodeID( this ); m_Name = _Reader.ReadString(); m_Parent = _Parent; if ( _Parent != null ) m_Parent.AddChild( this ); // Read the matrix m_Local2Parent.m[0,0] = _Reader.ReadSingle(); m_Local2Parent.m[0,1] = _Reader.ReadSingle(); m_Local2Parent.m[0,2] = _Reader.ReadSingle(); m_Local2Parent.m[0,3] = _Reader.ReadSingle(); m_Local2Parent.m[1,0] = _Reader.ReadSingle(); m_Local2Parent.m[1,1] = _Reader.ReadSingle(); m_Local2Parent.m[1,2] = _Reader.ReadSingle(); m_Local2Parent.m[1,3] = _Reader.ReadSingle(); m_Local2Parent.m[2,0] = _Reader.ReadSingle(); m_Local2Parent.m[2,1] = _Reader.ReadSingle(); m_Local2Parent.m[2,2] = _Reader.ReadSingle(); m_Local2Parent.m[2,3] = _Reader.ReadSingle(); m_Local2Parent.m[3,0] = _Reader.ReadSingle(); m_Local2Parent.m[3,1] = _Reader.ReadSingle(); m_Local2Parent.m[3,2] = _Reader.ReadSingle(); m_Local2Parent.m[3,3] = _Reader.ReadSingle(); // Read specific data LoadSpecific( _Reader ); // Read children int ChildrenCount = _Reader.ReadInt32(); for ( int ChildIndex=0; ChildIndex < ChildrenCount; ChildIndex++ ) { NODE_TYPE ChildType = (NODE_TYPE) _Reader.ReadByte(); switch ( ChildType ) { case NODE_TYPE.NODE: new Node( _Owner, this, _Reader ); break; case NODE_TYPE.MESH: new Mesh( _Owner, this, _Reader ); break; case NODE_TYPE.LIGHT: new Light( _Owner, this, _Reader ); break; case NODE_TYPE.CAMERA: new Camera( _Owner, this, _Reader ); break; } } }
public override void Deserialize(System.IO.BinaryReader reader) { base.Deserialize(reader); Text = reader.ReadString(); Color = new Color(reader.ReadByte(), reader.ReadByte(), reader.ReadByte(), reader.ReadByte()); DisplayTime = reader.ReadInt32(); }
public bool UnpersistExportEdgeAttributes(System.Xml.XmlReader reader) { // Assumes reader has started the read of element "ExportEdgeAttributes" reader.ReadStartElement(ExportNetworkParamBag._ExportEdgeAttributes_ParamName); string valStr = reader.ReadString(); reader.ReadEndElement(); return XmlConvert.ToBoolean(valStr); }
public override void ReadXML(System.Xml.XmlReader input) { var tid = input.GetAttribute("tableid"); var iid = input.GetAttribute("instanceid"); this.TableId = tid==null ? 0 : SporeMaster.NameRegistry.Files.toHash( tid ); this.InstanceId = iid==null ? 0 : SporeMaster.NameRegistry.Files.toHash( iid ); this.PlaceholderText = input.ReadString(); }
/// <summary> /// Assumes the reader is right at the start element with the name <paramref name="startElName"/> /// and reads in the value and end element and returns it as an integer. If the element value is invalid then an /// exception is thrown there is no default. /// </summary> /// <param name="reader">System.Xml.XmlReader</param> /// <param name="startElName">The name of the element containing a string value to be read</param> /// <returns>string</returns> public string UnpersistString(System.Xml.XmlReader reader, string startElName) { // Assumes reader has started the read of element startElName reader.ReadStartElement(startElName); string valStr = reader.ReadString(); reader.ReadEndElement(); return valStr; }
public string UnpersistFileName(System.Xml.XmlReader reader) { // Assumes reader has started the read of element "FileNameValue" reader.ReadStartElement(ImportNetworkParamBag._FileName_ParamName); string valStr = reader.ReadString(); reader.ReadEndElement(); return valStr; }
public void DeserializePacket(System.IO.BinaryReader reader) { Version = reader.ReadString(); var packetCount = reader.ReadInt32(); for (var i = 0; i < packetCount; i++) CustomPackets.Add(reader.ReadInt16()); }