本文整理汇总了C#中System.Runtime.Serialization.SerializationInfo.GetSingle方法的典型用法代码示例。如果您正苦于以下问题:C# SerializationInfo.GetSingle方法的具体用法?C# SerializationInfo.GetSingle怎么用?C# SerializationInfo.GetSingle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Runtime.Serialization.SerializationInfo
的用法示例。
在下文中一共展示了SerializationInfo.GetSingle方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Cursor3DProperties
protected Cursor3DProperties(SerializationInfo info, StreamingContext context)
{
_enabled = info.GetBoolean("_enabled");
_radius = info.GetSingle("_radius");
_intensity = info.GetSingle("_intensity");
_rotationAngle = info.GetSingle("_rotationAngle");
}
示例2: FloatRectangle
/// <summary>
/// Constructor for deserialization.
/// </summary>
/// <param name="info">info is the serialization info to deserialize with</param>
/// <param name="context">context is the context in which to deserialize...?</param>
public FloatRectangle(SerializationInfo info, StreamingContext context)
{
mU = info.GetSingle("U");
mV = info.GetSingle("V");
mWidth = info.GetSingle("Width");
mHeight = info.GetSingle("Height");
}
示例3: Color4f
private Color4f(SerializationInfo info, StreamingContext context)
{
m_r = info.GetSingle("R");
m_g = info.GetSingle("G");
m_b = info.GetSingle("B");
m_a = info.GetSingle("A");
}
示例4: DepthFogConfig
/// <summary>
/// Called when deserializing
/// </summary>
/// <param name="info"></param>
/// <param name="context"></param>
protected DepthFogConfig(SerializationInfo info, StreamingContext context)
{
_bEnabled = info.GetBoolean("_bEnabled");
_fStartDist = info.GetSingle("_fStartDist");
_fStartEnd = info.GetSingle("_fStartEnd");
_color = (Color)info.GetValue("_color", typeof(Color));
}
示例5: PlanningGrid
protected PlanningGrid(SerializationInfo info, StreamingContext context)
{
sizeX = info.GetInt32("sizeX");
sizeY = info.GetInt32("sizeY");
spacing = info.GetSingle("spacing");
offsetX = info.GetSingle("offsetX");
offsetY = info.GetSingle("offsetY");
byte[] compData = (byte[])info.GetValue("data", typeof(byte[]));
MemoryStream ms = new MemoryStream(compData, false);
DeflateStream compStream = new DeflateStream(ms, CompressionMode.Decompress);
BinaryReader reader = new BinaryReader(compStream);
min = float.MaxValue;
max = float.MinValue;
data = new float[sizeX][];
for (int x = 0; x < sizeX; x++) {
data[x] = new float[sizeY];
for (int y = 0; y < sizeY; y++) {
float value = reader.ReadSingle();
data[x][y] = value;
if (value < min) min = value;
if (value > max) max = value;
}
}
}
示例6: SetObjectData
public object SetObjectData(object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)
{
Keyframe[] keyframes;
AnimationCurve curve=new AnimationCurve();
// curve.preWrapMode=(WrapMode)info.GetValue("preWrapMode",typeof(WrapMode));
// curve.postWrapMode=(WrapMode)info.GetValue("postWrapMode",typeof(WrapMode));
int numKeys=info.GetInt32("keysn");
keyframes=new Keyframe[numKeys];
Keyframe keyframeCurrent;
for (int i=0; i<numKeys; i++) {
keyframeCurrent=keyframes[i]=new Keyframe(info.GetSingle("keyt"+i),
info.GetSingle("keyv"+i));
keyframeCurrent.tangentMode=info.GetInt32("keymod"+i);
keyframeCurrent.inTangent=info.GetSingle("keyin"+i);
keyframeCurrent.outTangent=info.GetSingle("keyout"+i);
}
curve.keys = keyframes;
// don't know how to make connection between AnimaitonCurver and Keyframes surrogate
// AnimationCurve surrogate keys are constructed before thoose in Keyframe surrogate resulting in 0,0 Keyframes
//return new AnimationCurve((Keyframe[])info.GetValue ("keys", typeof(Keyframe[])));
return curve;
}
示例7: Margin
//Creates a new element from the supplied XML.
protected Margin(SerializationInfo info, StreamingContext context)
{
Left = info.GetSingle("Left");
Top = info.GetSingle("Top");
Right = info.GetSingle("Right");
Bottom = info.GetSingle("Bottom");
}
示例8: SetObjectData
public object SetObjectData(object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)
{
float single = info.GetSingle("r");
float single2 = info.GetSingle("g");
float single3 = info.GetSingle("b");
float single4 = info.GetSingle("a");
return new Color(single, single2, single3, single4);
}
示例9: SetObjectData
public object SetObjectData(object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector) {
float r = info.GetSingle("r");
float g = info.GetSingle("g");
float b = info.GetSingle("b");
float a = info.GetSingle("a");
return new Color(r, g, b, a);
}
示例10: N_Particle
public N_Particle(SerializationInfo sinfo, StreamingContext scon)
{
particleindex = sinfo.GetInt32("particleindex");
ismovingboundary = sinfo.GetBoolean("ismovingboundary");
isstationaryboundary = sinfo.GetBoolean("isstationaryboundary");
distance = sinfo.GetSingle("distance");
smoothingkernel = sinfo.GetSingle("smoothingkernel");
smoothingkernelsquared = sinfo.GetSingle("smoothingkernelsquared");
}
示例11: SetObjectData
public object SetObjectData(object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector) {
var alpha = info.GetSingle("alpha");
var time = info.GetSingle("time");
return new GradientAlphaKey {
alpha = alpha,
time = time
};
}
示例12: BackgroundColourImageDrawer
public BackgroundColourImageDrawer(SerializationInfo info, StreamingContext context)
{
_moveVelocity = (PointF)info.GetValue("MoveVelocity", typeof(PointF));
_backgroundFrameKeys = (String[])info.GetValue("Backgroundframekeys", typeof(String[]));
_rotateSpeed = info.GetSingle("rotatespeed");
_currentRotation = info.GetSingle("currentrotation");
_currentOffset = (PointF)info.GetValue("CurrentOffset",typeof(PointF));
_rotateOrigin = (PointF)info.GetValue("RotateOrigin", typeof(PointF));
}
示例13: SetObjectData
public object SetObjectData(object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)
{
NUIVector v = (NUIVector)obj;
v.X = info.GetSingle("X");
v.Y = info.GetSingle("Y");
v.Z = info.GetSingle("Z");
return v;
}
示例14: WaypointComponent_cl
/// <summary>
/// Constructor for deserialization.
/// </summary>
/// <param name="info">info is the serialization info to deserialize with</param>
/// <param name="context">context is the context in which to deserialize...?</param>
protected WaypointComponent_cl(SerializationInfo info, StreamingContext context)
: base(info, context)
{
//mPosition = new Vector3(info.GetSingle("X"), info.GetSingle("Y"), info.GetSingle("Z"));
mOffsetVector = new Vector3(info.GetSingle("OffsetX"), info.GetSingle("OffsetY"), info.GetSingle("OffsetZ"));
mRotation = info.GetSingle("Rotation");
WaypointManager_cl.AddWaypoint(this);
}
示例15: SetObjectData
public object SetObjectData(object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)
{
float single = info.GetSingle("time");
float single2 = info.GetSingle("value");
int @int = info.GetInt32("tangentMode");
float single3 = info.GetSingle("inTangent");
float single4 = info.GetSingle("outTangent");
Keyframe keyframe = new Keyframe(single, single2, single3, single4);
keyframe.tangentMode = @int;
return keyframe;
}