當前位置: 首頁>>代碼示例>>C#>>正文


C# SerializationInfo.GetSingle方法代碼示例

本文整理匯總了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");
 }
開發者ID:hxzpily,項目名稱:projectanarchy,代碼行數:7,代碼來源:Cursor3DProperties.cs

示例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");
 }
開發者ID:dogmahtagram,項目名稱:Finale,代碼行數:12,代碼來源:FloatRectangle.cs

示例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");
 }
開發者ID:gwinsky,項目名稱:rhinocommon,代碼行數:7,代碼來源:rdk_color.cs

示例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));
 }
開發者ID:elemen,項目名稱:projectanarchy,代碼行數:12,代碼來源:DepthFogConfig.cs

示例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;
                }
            }
        }
開發者ID:anand-ajmera,項目名稱:cornell-urban-challenge,代碼行數:29,代碼來源:PlanningGrid.cs

示例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;
        }
開發者ID:osmanzeki,項目名稱:bmachine,代碼行數:30,代碼來源:AnimationCurveSurrogate.cs

示例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");
		}
開發者ID:savagemat,項目名稱:arcgis-diagrammer,代碼行數:8,代碼來源:Margin.cs

示例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);
		}
開發者ID:fuboss,項目名稱:aiProject,代碼行數:8,代碼來源:ColorSurrogate.cs

示例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);
        }
開發者ID:Boxxxx,項目名稱:clicker,代碼行數:8,代碼來源:ColorSurrogate.cs

示例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");
 }
開發者ID:jpneill,項目名稱:SPHSim,代碼行數:9,代碼來源:N_Particle.cs

示例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
            };
        }
開發者ID:Boxxxx,項目名稱:clicker,代碼行數:9,代碼來源:GradientSurrogate.cs

示例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));
 }
開發者ID:BCProgramming,項目名稱:BASeBlock,代碼行數:9,代碼來源:BackgroundDrawer.cs

示例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;
        }
開發者ID:pi11e,項目名稱:KinectHTML5,代碼行數:9,代碼來源:Extensions.cs

示例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);
        }
開發者ID:IDGASoft,項目名稱:Molydeux,代碼行數:14,代碼來源:WaypointComponent.cs

示例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;
 }
開發者ID:fuboss,項目名稱:aiProject,代碼行數:11,代碼來源:KeyframeSurrogate.cs


注:本文中的System.Runtime.Serialization.SerializationInfo.GetSingle方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。