//=========================================================== // ISerializable //=========================================================== private FontManager(Serial::SerializationInfo info, Serial::StreamingContext context) { this.f = null; this.fontname = (string)info.GetValue("fontname", typeof(string)); this._size = info.GetSingle("_size"); this.style = (Gdi::FontStyle)info.GetValue("style", typeof(Gdi::FontStyle)); }
void Serial::ISerializable.GetObjectData(Serial::SerializationInfo info, Serial::StreamingContext context) { info.AddValue("hasName", this.hasName); if (this.hasName) { info.AddValue("color", (int)c_values[this.color]); info.AddValue("name", c_names[this.color]); } else { info.AddValue("color", this.color); } }
//=========================================================== // Serialization //=========================================================== private ColorName(Serial::SerializationInfo info, Serial::StreamingContext context) { if (this.hasName = info.GetBoolean("hasName")) { string name = info.GetString("name"); int index; if (c_indices.TryGetValue(name, out index)) { this.color = index; } else { this.color = RegisterColor(name, info.GetInt32("color")); } } else { this.color = info.GetInt32("color"); } }
void Serial::ISerializable.GetObjectData(Serial::SerializationInfo info, Serial::StreamingContext context) { info.AddValue("vals", this.vals); }
MatrixR8(Serial::SerializationInfo info, Serial::StreamingContext context) : this((Rational[, ])info.GetValue("vals", typeof(Rational[, ]))) { }
void Serial::ISerializable.GetObjectData(Serial::SerializationInfo info, Serial::StreamingContext context) { info.AddValue("fontname", this.fontname); info.AddValue("_size", this._size); info.AddValue("style", this.style); }