﻿<?xml version="1.0" encoding="utf-8"?><Type Name="ISerializable" FullName="System.Runtime.Serialization.ISerializable"><TypeSignature Maintainer="auto" Language="C#" Value="public interface ISerializable" /><TypeSignature Language="ILAsm" Value=".class public interface auto ansi abstract ISerializable" /><AssemblyInfo><AssemblyName>mscorlib</AssemblyName><AssemblyPublicKey>[00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00]</AssemblyPublicKey><AssemblyVersion>1.0.5000.0</AssemblyVersion><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><ThreadSafetyStatement>Gtk# is thread aware, but not thread safe; See the &lt;link location="node:gtk-sharp/programming/threads"&gt;Gtk# Thread Programming&lt;/link&gt; for details.</ThreadSafetyStatement><Interfaces /><Attributes><Attribute><AttributeName>System.Runtime.InteropServices.ComVisible(true)</AttributeName></Attribute></Attributes><Docs><remarks><attribution license="cc4" from="Microsoft" modified="false" /><para>Any class that might be serialized must be marked with the <see cref="T:System.SerializableAttribute" />. If a class needs to control its serialization process, it can implement the <see cref="T:System.Runtime.Serialization.ISerializable" /> interface. The <see cref="T:System.Runtime.Serialization.Formatter" /> calls the <see cref="M:System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)" /> at serialization time and populates the supplied <see cref="T:System.Runtime.Serialization.SerializationInfo" /> with all the data required to represent the object. The <see cref="T:System.Runtime.Serialization.Formatter" /> creates a <see cref="T:System.Runtime.Serialization.SerializationInfo" /> with the type of the object in the graph. Objects that need to send proxies for themselves can use the <see cref="P:System.Runtime.Serialization.SerializationInfo.FullTypeName" /> and <see cref="P:System.Runtime.Serialization.SerializationInfo.AssemblyName" /> methods on <see cref="T:System.Runtime.Serialization.SerializationInfo" /> to change the transmitted information.</para><para>In the case of class inheritance, it is possible to serialize a class that derives from a base class that implements <see cref="T:System.Runtime.Serialization.ISerializable" />. In this case, the derived class should call the base class implementation of <see cref="M:System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)" /> inside its implementation of <see cref="M:System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)" />. Otherwise, the data from the base class will not be serialized.</para><para>The <see cref="T:System.Runtime.Serialization.ISerializable" /> interface implies a constructor with the signature constructor (<see cref="T:System.Runtime.Serialization.SerializationInfo" /> information, <see cref="T:System.Runtime.Serialization.StreamingContext" /> context). At deserialization time, the current constructor is called only after the data in the <see cref="T:System.Runtime.Serialization.SerializationInfo" /> has been deserialized by the formatter. In general, this constructor should be protected if the class is not sealed.</para><para>The order in which objects are deserialized cannot be guaranteed. For example, if one type references a type that has not been deserialized yet, an exception will occur. If you are creating types that have such dependencies, you can work around the problem by implementing the IDeserializationCallback interface and the OnDeserialization method.</para><para>The serialization architecture handles object types that extend <see cref="T:System.MarshalByRefObject" /> the same as types that extend <see cref="T:System.Object" />. These types can be marked with the <see cref="T:System.SerializableAttribute" /> and implement the <see cref="T:System.Runtime.Serialization.ISerializable" /> interface as any other object type. Their object state will be captured and persisted onto the stream.</para><para>When these types are being used through <see cref="N:System.Runtime.Remoting" />, the remoting infrastructure provides a surrogate that preempts typical serialization and instead serializes a proxy to the <see cref="T:System.MarshalByRefObject" />. A surrogate is a helper that knows how to serialize and deserialize objects of a particular type. The proxy, invisible to the user in most cases, will be of type <see cref="T:System.Runtime.Remoting.ObjRef" />.</para><para>As a general design pattern, it would be unusual for a class to be both marked with the serializable attribute and extend <see cref="T:System.MarshalByRefObject" />. Developers should think carefully about the possible serialization and remoting scenarios when combining these two characteristics. One example where this might be applicable is with a <see cref="T:System.IO.MemoryStream" />. While the base class of <see cref="T:System.IO.MemoryStream" /> (<see cref="T:System.IO.Stream" />) extends from <see cref="T:System.MarshalByRefObject" />, it is possible to capture the state of a <see cref="T:System.IO.MemoryStream" /> and restore it at will. It might, therefore, be meaningful to serialize the state of this stream into a database and restore it at some later point in time. However, when used through remoting, an object of this type would be proxied.</para><para>For more information about serialization of classes that extend <see cref="T:System.MarshalByRefObject" />, see <see cref="T:System.Runtime.Remoting.Messaging.RemotingSurrogateSelector" />. For more information about implementing <see cref="T:System.Runtime.Serialization.ISerializable" />, see <format type="text/html"><a href="12ED422D-5280-49B8-9B71-A2ED129C0384">[&lt;topic://cpconCustomSerialization&gt;]</a></format>.</para></remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Allows an object to control its own serialization and deserialization.</para></summary></Docs><Members><Member MemberName="GetObjectData"><MemberSignature Language="C#" Value="public void GetObjectData (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);" /><MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void GetObjectData(class System.Runtime.Serialization.SerializationInfo info, valuetype System.Runtime.Serialization.StreamingContext context) cil managed" /><MemberType>Method</MemberType><AssemblyInfo><AssemblyVersion>1.0.5000.0</AssemblyVersion><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.Void</ReturnType></ReturnValue><Parameters><Parameter Name="info" Type="System.Runtime.Serialization.SerializationInfo" /><Parameter Name="context" Type="System.Runtime.Serialization.StreamingContext" /></Parameters><Docs><remarks><attribution license="cc4" from="Microsoft" modified="false" /><para>Any objects that are included in the <see cref="T:System.Runtime.Serialization.SerializationInfo" /> are automatically tracked and serialized by the formatter.</para><para>Code that calls <see cref="M:System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)" /> requires the <see cref="T:System.Security.Permissions.SecurityPermission" /> for providing serialization services. Associated enumeration: <see cref="F:System.Security.Permissions.SecurityPermissionFlag.SerializationFormatter" />.</para><block subset="none" type="note"><para>It is not guaranteed that this method will be called only once per object instance during serialization. Therefore, the method should be implemented in such a way that its behavior will be the same regardless of the number of times it is called.</para></block></remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Populates a <see cref="T:System.Runtime.Serialization.SerializationInfo" /> with the data needed to serialize the target object.</para></summary><param name="info"><attribution license="cc4" from="Microsoft" modified="false" />The <see cref="T:System.Runtime.Serialization.SerializationInfo" /> to populate with data. </param><param name="context"><attribution license="cc4" from="Microsoft" modified="false" />The destination (see <see cref="T:System.Runtime.Serialization.StreamingContext" />) for this serialization. </param></Docs></Member></Members></Type>