Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/291.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# Serialize type System.Drawing.Rectangle从.NET到C++的使用 如果在C中用OrthBufff序列化一个矩形System.Drawing.Rectangle,那么在Objy-C或C++中可以将它反序列化,因为Studio.Dr.In矩形不是普通的INT.< /P>类型。 < P> St.Dig.Labang.矩形类型在ToFBUF NET中不直接支持。因为自动属性元组代码没有额外的属性触发,所以我假设您在适当的位置有代理。或者您正在手动配置模型-例如: RuntimeTypeModel.Default.Add(typeof(Rectangle),false) .Add("X","Y","Width","Height");_C#_C++_Objective C_Protobuf Net - Fatal编程技术网

C# Serialize type System.Drawing.Rectangle从.NET到C++的使用 如果在C中用OrthBufff序列化一个矩形System.Drawing.Rectangle,那么在Objy-C或C++中可以将它反序列化,因为Studio.Dr.In矩形不是普通的INT.< /P>类型。 < P> St.Dig.Labang.矩形类型在ToFBUF NET中不直接支持。因为自动属性元组代码没有额外的属性触发,所以我假设您在适当的位置有代理。或者您正在手动配置模型-例如: RuntimeTypeModel.Default.Add(typeof(Rectangle),false) .Add("X","Y","Width","Height");

C# Serialize type System.Drawing.Rectangle从.NET到C++的使用 如果在C中用OrthBufff序列化一个矩形System.Drawing.Rectangle,那么在Objy-C或C++中可以将它反序列化,因为Studio.Dr.In矩形不是普通的INT.< /P>类型。 < P> St.Dig.Labang.矩形类型在ToFBUF NET中不直接支持。因为自动属性元组代码没有额外的属性触发,所以我假设您在适当的位置有代理。或者您正在手动配置模型-例如: RuntimeTypeModel.Default.Add(typeof(Rectangle),false) .Add("X","Y","Width","Height");,c#,c++,objective-c,protobuf-net,C#,C++,Objective C,Protobuf Net,在这种情况下,您需要做的是创建一个与之匹配的.proto模式。protobuf net实际上可以帮助您: var proto = RuntimeTypeModel.Default.GetSchema(typeof(Rectangle)); 对于我来说,即对于我使用的配置,生成: message Rectangle { optional int32 X = 1; optional int32 Y = 2; optional int32 Width = 3; optiona

在这种情况下,您需要做的是创建一个与之匹配的.proto模式。protobuf net实际上可以帮助您:

var proto = RuntimeTypeModel.Default.GetSchema(typeof(Rectangle));
对于我来说,即对于我使用的配置,生成:

message Rectangle {
   optional int32 X = 1;
   optional int32 Y = 2;
   optional int32 Width = 3;
   optional int32 Height = 4;
}
这应该可以从任何protobuf实现中使用。

protobuf net中不直接支持System.Drawing.Rectangle类型自动元组代码不会触发,因为有一些额外的属性,所以我假设您要么有一个代理,要么手动配置模型-例如:

RuntimeTypeModel.Default.Add(typeof(Rectangle),false)
                .Add("X","Y","Width","Height");
在这种情况下,您需要做的是创建一个与之匹配的.proto模式。protobuf net实际上可以帮助您:

var proto = RuntimeTypeModel.Default.GetSchema(typeof(Rectangle));
对于我来说,即对于我使用的配置,生成:

message Rectangle {
   optional int32 X = 1;
   optional int32 Y = 2;
   optional int32 Width = 3;
   optional int32 Height = 4;
}

这应该可以从任何protobuf实现中使用。

我通过使用自己的类类型来修复它,我的意思是将System.Drawing.Rectangle替换为我自己的类,而不是包含相同的属性


我的意思是,如果要序列化和反序列化,必须使用公共类型。

我通过使用自己的类类型来修复它,我的意思是将System.Drawing.Rectangle替换为我自己的类,而不是包含相同属性


我的意思是,如果要序列化和反序列化,必须使用公共类型。

我已经有一个包含System.Drawing.Rectangle类型的bin文件!“这个矩形”到底是什么?请显示您的代码。bin文件已经存在并包含矩形,是否可以在C++中获得相同的矩形?我已经有一个包含Studio .Drutug。矩形类型的bin文件!“这个矩形”到底是什么?请显示您的代码。bin文件已经存在并包含矩形,是否可以在C++中获得相同的矩形?