本文整理汇总了C#中SerializationInfo.GetInt32方法的典型用法代码示例。如果您正苦于以下问题:C# SerializationInfo.GetInt32方法的具体用法?C# SerializationInfo.GetInt32怎么用?C# SerializationInfo.GetInt32使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SerializationInfo
的用法示例。
在下文中一共展示了SerializationInfo.GetInt32方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CChair_SALContainer
//Serializatoin counstructor. call when Deserialize function called.
private CChair_SALContainer(SerializationInfo info, StreamingContext context)
: base(info,context)
{
var1 = info.GetInt32("var1");
var2 = info.GetInt32("var2");
str1 = (string[])info.GetValue("str1",typeof(string[]));
}
示例2: Message
public Message(SerializationInfo info, StreamingContext context)
{
SourceID = info.GetInt32 ("SourceID");
DestID = info.GetInt32 ("DestID");
Type = (MessageType)info.GetByte ("MessageType");
SerializedContent = (byte[])info.GetValue ("SerializedContent", typeof(byte[]));
}
示例3: CUBEGridInfo
public CUBEGridInfo(SerializationInfo info, StreamingContext context)
{
position = (sVector3)info.GetValue("position", typeof(sVector3));
rotation = (sVector3)info.GetValue("rotation", typeof(sVector3));
weaponMap = info.GetInt32("weaponMap");
augmentationMap = info.GetInt32("augmentationMap");
colors = (int[])info.GetValue("colors", typeof(int[]));
}
示例4: GameplayMessage
public GameplayMessage(SerializationInfo info, StreamingContext context)
{
Message = (MessageValue)info.GetByte ("Message");
PlayerID = info.GetInt32 ("PlayerID");
MoveDelta = new Vector2((float)info.GetValue("x",typeof(float)),(float)info.GetValue("y",typeof(float)));
OldPosition = new Vector3((float)info.GetValue("xloc", typeof(float)), (float)info.GetValue("yloc", typeof(float)), (float)info.GetValue("zloc", typeof(float)));
}
示例5: SampledStroke
public SampledStroke(SerializationInfo info, StreamingContext ctxt)
{
beginning = info.GetInt32("beginning");
str = (List<Dot>)info.GetValue("str", typeof(List<Dot>));
positionX = 0;
positionY = 0;
}
示例6: RuntimeException
/// <summary>
/// Initializes a new instance of the RuntimeException class
/// using data serialized via
/// <see cref="ISerializable"/>
/// </summary>
/// <param name="info"> serialization information </param>
/// <param name="context"> streaming context </param>
/// <returns> constructed object </returns>
protected RuntimeException(SerializationInfo info,
StreamingContext context)
: base(info, context)
{
_errorId = info.GetString("ErrorId");
_errorCategory = (ErrorCategory)info.GetInt32("ErrorCategory");
}
示例7: ConfigurationException
protected ConfigurationException(SerializationInfo info,
StreamingContext context)
: base(info, context)
{
HResult = unchecked((int)0x80131902);
this.filename = info.GetString("filename");
this.line = info.GetInt32("line");
}
示例8: GetHResult
// Extract the HResult from an exception object. We have to
// do it this way because HResult is "protected".
public static int GetHResult(Exception e)
{
SerializationInfo info =
new SerializationInfo(typeof(Exception),
new FormatterConverter());
StreamingContext context = new StreamingContext();
e.GetObjectData(info, context);
return info.GetInt32("HResult");
}
示例9: ConfigurationErrorsException
protected ConfigurationErrorsException(SerializationInfo info, StreamingContext context) : base(info, context)
{
string filename = info.GetString("firstFilename");
int line = info.GetInt32("firstLine");
this.Init(filename, line);
int num2 = info.GetInt32("count");
if (num2 != 0)
{
this._errors = new ConfigurationException[num2];
for (int i = 0; i < num2; i++)
{
string str2 = i.ToString(CultureInfo.InvariantCulture);
Type type = Type.GetType(info.GetString(str2 + "_errors_type"), true);
if ((type != typeof(ConfigurationException)) && (type != typeof(ConfigurationErrorsException)))
{
throw ExceptionUtil.UnexpectedError("ConfigurationErrorsException");
}
this._errors[i] = (ConfigurationException) info.GetValue(str2 + "_errors", type);
}
}
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:21,代码来源:ConfigurationErrorsException.cs
示例10: DeserializeDataSetSchema
private void DeserializeDataSetSchema(SerializationInfo info, StreamingContext context, SerializationFormat remotingFormat, System.Data.SchemaSerializationMode schemaSerializationMode)
{
if (remotingFormat != SerializationFormat.Xml)
{
if (schemaSerializationMode == System.Data.SchemaSerializationMode.IncludeSchema)
{
this.DeserializeDataSetProperties(info, context);
int num4 = info.GetInt32("DataSet.Tables.Count");
for (int i = 0; i < num4; i++)
{
byte[] buffer = (byte[]) info.GetValue(string.Format(CultureInfo.InvariantCulture, "DataSet.Tables_{0}", new object[] { i }), typeof(byte[]));
MemoryStream serializationStream = new MemoryStream(buffer) {
Position = 0L
};
BinaryFormatter formatter = new BinaryFormatter(null, new StreamingContext(context.State, false));
DataTable table = (DataTable) formatter.Deserialize(serializationStream);
this.Tables.Add(table);
}
for (int j = 0; j < num4; j++)
{
this.Tables[j].DeserializeConstraints(info, context, j, true);
}
this.DeserializeRelations(info, context);
for (int k = 0; k < num4; k++)
{
this.Tables[k].DeserializeExpressionColumns(info, context, k);
}
}
else
{
this.DeserializeDataSetProperties(info, context);
}
}
else
{
string s = (string) info.GetValue("XmlSchema", typeof(string));
if (s != null)
{
this.ReadXmlSchema(new XmlTextReader(new StringReader(s)), true);
}
}
}
示例11: PhpException
/// <summary>
/// Initializes a new instance of the PhpException class with serialized data. This constructor is used
/// when an exception is thrown in a remotely called method. Such an exceptions needs to be serialized,
/// transferred back to the caller and then rethrown using this constructor.
/// </summary>
/// <param name="info">The SerializationInfo that holds the serialized object data about the exception
/// being thrown.</param>
/// <param name="context">The StreamingContext that contains contextual information about the source or
/// destination.</param>
protected PhpException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
this.error = (PhpError)info.GetValue("error", typeof(PhpError));
this.info = new ErrorStackInfo(
(string)info.GetString("file"),
(string)info.GetString("caller"),
(int)info.GetInt32("line"),
(int)info.GetInt32("column"),
(bool)info.GetBoolean("libraryCaller"));
}
示例12: HttpException
/// <devdoc>
/// <para> Contructor used for derialization.</para>
/// </devdoc>
protected HttpException(SerializationInfo info, StreamingContext context)
:base(info, context) {
_httpCode = info.GetInt32("_httpCode");
}
示例13: HttpParseException
private HttpParseException(SerializationInfo info, StreamingContext context)
:base(info, context) {
_virtualPath = (VirtualPath)info.GetValue("_virtualPath", typeof(VirtualPath));
_line = info.GetInt32("_line");
_parserErrors = (ParserErrorCollection)info.GetValue("_parserErrors", typeof(ParserErrorCollection));
}
示例14: V_I
private V_I(SerializationInfo info, StreamingContext context){
i = info.GetInt32("IntValue");
}
示例15: DeserializeDataSetSchema
// Deserialize schema.
private void DeserializeDataSetSchema(SerializationInfo info, StreamingContext context, SerializationFormat remotingFormat, SchemaSerializationMode schemaSerializationMode) {
if (remotingFormat != SerializationFormat.Xml) {
if (schemaSerializationMode == SchemaSerializationMode.IncludeSchema) {
//DataSet public state properties
DeserializeDataSetProperties(info, context);
//Tables Count
int tableCount = info.GetInt32("DataSet.Tables.Count");
//Tables, Columns, Rows
for (int i = 0; i < tableCount; i++) {
Byte[] buffer = (Byte[])info.GetValue(String.Format(CultureInfo.InvariantCulture, "DataSet.Tables_{0}", i), typeof(Byte[]));
MemoryStream memStream = new MemoryStream(buffer);
memStream.Position = 0;
BinaryFormatter bf = new BinaryFormatter(null, new StreamingContext(context.State, false));
DataTable dt = (DataTable)bf.Deserialize(memStream);
Tables.Add(dt);
}
//Constraints
for (int i = 0; i < tableCount; i++) {
Tables[i].DeserializeConstraints(info, context, /* table index */i, /* serialize all constraints */ true); //
}
//Relations
DeserializeRelations(info, context);
//Expression Columns
for (int i = 0; i < tableCount; i++) {
Tables[i].DeserializeExpressionColumns(info, context, i);
}
} else {
//DeSerialize DataSet public properties.[Locale, CaseSensitive and EnforceConstraints]
DeserializeDataSetProperties(info, context);
}
} else {
string strSchema = (String)info.GetValue(KEY_XMLSCHEMA, typeof(System.String));
if (strSchema != null) {
this.ReadXmlSchema(new XmlTextReader(new StringReader(strSchema)), true);
}
}
}