Beispiel #1
0
		//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");
		}
Beispiel #2
0
 /// <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");
 }
        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;
                }
            }
        }
 protected Cursor3DProperties(SerializationInfo info, StreamingContext context)
 {
     _enabled = info.GetBoolean("_enabled");
       _radius = info.GetSingle("_radius");
       _intensity = info.GetSingle("_intensity");
       _rotationAngle = info.GetSingle("_rotationAngle");
 }
Beispiel #5
0
 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");
 }
 /// <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));
 }
        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;
        }
Beispiel #8
0
		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);
		}
Beispiel #9
0
        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);
        }
Beispiel #10
0
 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");
 }
Beispiel #11
0
        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
            };
        }
 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));
 }
Beispiel #13
0
        /// <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);
        }
Beispiel #14
0
        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;
        }
Beispiel #15
0
 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;
 }
Beispiel #16
0
        public ObjectInstance(SerializationInfo info, StreamingContext context)
        {
            _uid = (Guid)info.GetValue("Uid", typeof(Guid));
            _classId = (Guid)info.GetValue("ClassID", typeof(Guid));
            _posX = info.GetInt32("PosX");
            _posY = info.GetInt32("PosY");
            _rotation = info.GetSingle("Rotation");
            _scaleX = info.GetSingle("ScaleX");
            _scaleY = info.GetSingle("ScaleY");

            _predefinedProperties = new ObjectInstanceProperties(this);
            _properties = info.GetValue("Properties", typeof(PropertyCollection)) as PropertyCollection;
        }
		//Deserializes info into a new solid element
		protected MarkerBase(SerializationInfo info, StreamingContext context): base(info,context)
		{
			SuspendEvents = true;
			
			Width = info.GetSingle("Width");
			Height = info.GetSingle("Height");
			BackColor = Color.FromArgb(Convert.ToInt32(info.GetString("BackColor")));
			DrawBackground = info.GetBoolean("DrawBackground");
			Centered = info.GetBoolean("Centered");

			Label = (TextLabel) info.GetValue("Label",typeof(TextLabel));
			Image = (Image) info.GetValue("Image",typeof(Image));

			SuspendEvents = false;	
		}
        protected HavokNavMeshTestPathShape(SerializationInfo info, StreamingContext context)
            : base(info, context)
        {
            AddHint(HintFlags_e.NoScale | HintFlags_e.NoRotation);

            _vStartPoint = (Vector3F)info.GetValue("_vStartPoint", typeof(Vector3F));
            _vEndPoint = (Vector3F)info.GetValue("_vEndPoint", typeof(Vector3F));
            _fCharacterRadius = info.GetSingle("_fCharacterRadius");
            if (SerializationHelper.HasElement(info, "_fCharacterHeight"))
                _fCharacterHeight = info.GetSingle("_fCharacterHeight");
            if (SerializationHelper.HasElement(info, "_pathColor"))
                _pathColor = (Color)info.GetValue("_pathColor", typeof(Color));
            if (SerializationHelper.HasElement(info, "_fpathDisplayOffset"))
                _fpathDisplayOffset = info.GetSingle("_fpathDisplayOffset");
        }
Beispiel #19
0
        public ObjectInstance(SerializationInfo info, StreamingContext context)
        {
            _uid = (Guid)info.GetValue("Uid", typeof(Guid));
            _classId = (Guid)info.GetValue("ClassID", typeof(Guid));
            _posX = info.GetInt32("PosX");
            _posY = info.GetInt32("PosY");
            _rotation = info.GetSingle("Rotation");
            _scaleX = info.GetSingle("ScaleX");
            _scaleY = info.GetSingle("ScaleY");

            _propertyManager = new Framework.PropertyManager(_propertyClassManager, this);

            PropertyCollection props = info.GetValue("Properties", typeof(PropertyCollection)) as PropertyCollection;
            foreach (Property p in props)
                _propertyManager.CustomProperties.Add(p.Clone() as Property);
        }
Beispiel #20
0
        public object SetObjectData(object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)
        {
            //Debug.Log ("Set Keyframe t:" +(float)info.GetValue("t",typeof(float))+ " v:" + (float)info.GetValue("v",typeof(float))
            //           +" obj:"+obj);

            Keyframe keyframe=(Keyframe)obj;
            keyframe.time=(float)info.GetValue("t",typeof(float));
            keyframe.value=(float)info.GetValue("v",typeof(float));
            keyframe.inTangent=info.GetSingle ("it");
            keyframe.outTangent=info.GetSingle ("ot");
            keyframe.tangentMode=info.GetInt32 ("mod");

            return keyframe;

            //return new Keyframe(,(float)info.GetValue("v",typeof(float)));
        }
Beispiel #21
0
 private GeoDisplayPolygonRegion(SerializationInfo info, StreamingContext context)
 {
     if (ProjectSingleton.Instance.OpenV3R5ProjectFile)
     {
         base.m_Comments = info.GetString("m_Remark");
         this.m_Region = new GeoPolygonRegion();
         this.m_Region.ID = info.GetInt32("m_ID");
         this.m_Region.Name = info.GetString("m_Name");
         this.m_Region.SelectedForPrint = info.GetBoolean("m_SelectedForPrint");
         this.m_Region.GeoPolygonList = info.GetValue("m_GeoPolygonList", typeof(List<GeoPolygon>)) as List<GeoPolygon>;
         GeoPolygonStyle style = GeoEntityStyleFactory.GenerateDefaultPolygonStyle();
         style.LineWidth = info.GetSingle("m_LineWidth");
         style.LineDashStyle = (DashStyle) info.GetValue("m_LineType", typeof(DashStyle));
         style.Color = (Color) info.GetValue("m_LineColor", typeof(Color));
         style.FillColor = (Color) info.GetValue("m_RegionColor", typeof(Color));
         style.Visible = info.GetBoolean("m_Visible");
         style.IsShowLabel = info.GetBoolean("m_IsShownPolygonName");
         base.m_Style = style;
     }
     else
     {
         base.BuildBaseClassFromV3R6(info, context);
         this.m_Region = info.GetValue("m_Region", typeof(GeoPolygonRegion)) as GeoPolygonRegion;
     }
 }
 public MyClass_(SerializationInfo info, StreamingContext context)
 {
     a  = info.GetInt32("a");
     b  = info.GetSingle("b");
     c  = info.GetString("c");
     abc = a + b + c;
 }
 /// <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 BaseLightComponent(SerializationInfo info, StreamingContext context)
 {
     Name = info.GetString("Name");
     UpdateType = (UpdateType)(info.GetValue("UpdateType", typeof(UpdateType)));
     LightEnabled = info.GetBoolean("LightEnabled");
     LightingType = (LightingType)(info.GetValue("LightingType", typeof(LightingType)));
     DiffuseColor = (Vector3)(info.GetValue("DiffuseColor", typeof(Vector3)));
     Intensity = info.GetSingle("Intensity");
     FillLight = info.GetBoolean("FillLight");
     FalloffStrength = info.GetSingle("FalloffStrength");
     ShadowType = (ShadowType)(info.GetValue("ShadowType", typeof(ShadowType)));
     ShadowQuality = info.GetSingle("ShadowQuality");
     ShadowPrimaryBias = info.GetSingle("ShadowPrimaryBias");
     ShadowSecondaryBias = info.GetSingle("ShadowSecondaryBias");
     ShadowPerSurfaceLOD = info.GetBoolean("ShadowPerSurfaceLOD");
 }
		public virtual object SetObjectData(object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)
		{
			Diagram diagram = (Diagram) obj;

			diagram.SuspendEvents = true;
			diagram.Suspend();
			
			mShapes = (Elements) info.GetValue("Shapes",typeof(Elements));
			mLines = (Elements) info.GetValue("Lines",typeof(Elements));
			mLayers = (Layers) info.GetValue("Layers",typeof(Layers));
			
			//Diagram is created without a constructor, so need to do some initialization
			diagram.SetRender(new Render());

			diagram.DiagramSize = Serialize.GetSize(info.GetString("DiagramSize"));
			diagram.Zoom = info.GetSingle("Zoom");
			diagram.ShowTooltips = info.GetBoolean("ShowTooltips");
			diagram.Paged = info.GetBoolean("Paged");
			diagram.CheckBounds = info.GetBoolean("CheckBounds");
			diagram.Margin = (Margin) info.GetValue("Margin",typeof(Margin));
			diagram.WorkspaceColor = Color.FromArgb(Convert.ToInt32(info.GetString("WorkspaceColor")));
			if (Serialize.Contains(info,"Animator", typeof(Animator))) diagram.Animator = (Animator) info.GetValue("Animator", typeof(Animator));

			diagram.Resume();
			diagram.SuspendEvents = false;
			return diagram;
		}
		private Font (SerializationInfo info, StreamingContext context)
			: this(
			info.GetString("Name"), 
			info.GetSingle("Size"), 
			(FontStyle)info.GetValue("Style", typeof(FontStyle)), 
			(GraphicsUnit)info.GetValue("Unit", typeof(GraphicsUnit)) ) {
		}
Beispiel #26
0
        /// <summary>
        /// </summary>
        /// <param name="info"> </param>
        /// <param name="context"> </param>
        public Version(SerializationInfo info, StreamingContext context)
            : this(null, info.GetString("Title"))
        {
            _cursorPosition = info.GetInt32("CursorPosition");
            _number = info.GetSingle("Number");
            int itemsCount = info.GetInt32("ItemsCount");
            int pagesCount = info.GetInt32("PageCount");
            for (int i = 0; i < itemsCount; i++)
            {
                try
                {
                    Option option = info.GetValue(string.Concat("Item", i), typeof (Option)) as Option;
                    option.Parent = this;
                    _items.Add(option);
                }
                catch (Exception)
                {
                    throw;
                }
            }

            for (int i = 0; i < pagesCount; i++)
            {
                Page page = info.GetValue(string.Concat("Page", i), typeof (Page)) as Page;
                if (page == null)
                    throw new NullReferenceException("page");

                page.Parent = this;
                _pages.Add(page);
            }
        }
Beispiel #27
0
        public Block(SerializationInfo info, StreamingContext context)
        {
            // built-in value
            _bits = info.GetUInt32("built-int");
            // cutom bits
            _customBits = new uint[info.GetUInt16("cBitCount")];
            int length = _customBits.Length;
            for (int i = 0; i < length; i++)
            {
                _customBits[i] = info.GetUInt32("cBit" + i);
            }

            // custom floats
            length = info.GetUInt16("cFloatCount");
            _customFloats = new ConcurrentDictionary<int, float>(3, length * 2);
            for (int i = 0; i < length; i++)
            {
                _customFloats[info.GetInt32("cFloatKey" + i)] = info.GetSingle("cFloatValue" + i);
            }

            // custom strings
            length = info.GetUInt16("cStringCount");
            _customStrings = new ConcurrentDictionary<int, string>(3, length * 2);
            for (int i = 0; i < length; i++)
            {
                _customStrings[info.GetInt32("cStringKey" + i)] = info.GetString("cStringValue" + i);
            }
        }
 /// <summary>
 /// Serialization constructor required for <see cref="ISerializable"/>; reads connection data from <paramref name="info"/>.
 /// </summary>
 /// <param name="info">Serialization store that we are going to read our data from.</param>
 /// <param name="context">Streaming context to use during the deserialization process.</param>
 public PowerShellConnection(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     BackgroundColor = Color.FromArgb(info.GetInt32("BackgroundColor"));
     TextColor = Color.FromArgb(info.GetInt32("TextColor"));
     FontFamily = info.GetString("FontFamily");
     FontSize = info.GetSingle("FontSize");
 }
		//Creates a new element from the supplied XML.
		protected internal Animation(SerializationInfo info, StreamingContext context)
		{
			mTotalFrames = info.GetInt32("TotalFrames");
			mCurrentFrame = info.GetInt32("CurrentFrame");
			mFramesPerSecond = info.GetSingle("FramesPerSecond");
			mNextTick = info.GetInt64("NextTick");
			mEnabled = info.GetBoolean("Enabled");
		}
 /// <summary>
 /// Deserialization constructor
 /// </summary>
 /// <param name="info">The info.</param>
 /// <param name="context">The context.</param>
 protected PenStyle(SerializationInfo info, StreamingContext context)
 {
     if(Tracing.BinaryDeserializationSwitch.Enabled)
         Trace.WriteLine("Deserializing the fields of 'PenStyle'.");
     mWidth = info.GetSingle("Width");
     mColor = (Color) info.GetValue("Color", typeof(Color));
     mDashStyle = (System.Drawing.Drawing2D.DashStyle)Enum.Parse(typeof(System.Drawing.Drawing2D.DashStyle), info.GetString("DashStyle"));
 }
Beispiel #31
0
 public ValueColor(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
 {
     try
     {
         _LengthConnector = info.GetInt32("_LengthConnector");
     }
     catch
     {
         _LengthConnector = 0;
     }
     try
     {
         _Value = info.GetString("_Value");
     }
     catch
     {
         _Value = string.Empty;
     }
     try
     {
         _Color = (System.Drawing.Color)info.GetValue("_Color", typeof(System.Drawing.Color));
     }
     catch
     {
         _Color = Color.Empty;
     }
     try
     {
         _TextColor = (System.Drawing.Color)info.GetValue("_TextColor", typeof(System.Drawing.Color));
     }
     catch
     {
         _TextColor = Color.Empty;
     }
     try
     {
         _RectBorderColor = (System.Drawing.Color)info.GetValue("_RectBorderColor", typeof(System.Drawing.Color));
     }
     catch
     {
         _RectBorderColor = Color.Empty;
     }
     try
     {
         _Hidden = info.GetBoolean("_Hidden");
     }
     catch
     {
         _Hidden = false;
     }
     try
     {
         _GradientColor = (System.Drawing.Color)info.GetValue("_GradientColor", typeof(System.Drawing.Color));
     }
     catch
     {
         _GradientColor = Color.Empty;
     }
     try
     {
         _GradientAngle = info.GetSingle("_GradientAngle");
     }
     catch
     {
         _GradientAngle = 0f;
     }
 }
 public RepeatControlView(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : base(info, context)
 {
     try
     {
         _AfterLast = info.GetBoolean("_AfterLast");
     }
     catch
     {
         _AfterLast = false;
     }
     try
     {
         _RepeatSetting = (Webb.Reports.PageGroupInfo)info.GetValue("_RepeatSetting", typeof(Webb.Reports.PageGroupInfo));
     }
     catch
     {
         _RepeatSetting = new PageFieldInfo("");
     }
     try
     {
         _RepeatedWidth = info.GetSingle("_RepeatedWidth");
     }
     catch
     {
         _RepeatedWidth = 240f;
     }
     try
     {
         _RepeatedHeight = info.GetSingle("_RepeatedHeight");
     }
     catch
     {
         _RepeatedHeight = 240f;
     }
     try
     {
         _RepeatedCount = info.GetInt32("_RepeatedCount");
     }
     catch
     {
         _RepeatedCount = 3;
     }
     try
     {
         _RepeatedVerticalCount = info.GetInt32("_RepeatedVerticalCount");
     }
     catch
     {
         _RepeatedVerticalCount = 3;
     }
     try
     {
         _RepeatTopCount = info.GetInt32("_RepeatTopCount");
     }
     catch
     {
         _RepeatTopCount = 0;
     }
     try
     {
         _ChartColorWhenMax = (System.Drawing.Color)info.GetValue("_ChartColorWhenMax", typeof(System.Drawing.Color));
     }
     catch
     {
         _ChartColorWhenMax = Color.Empty;
     }
 }