Example #1
0
        public Boat(SerializationInfo info, StreamingContext ctxt)
        {
            date = info.GetDateTime("date");
            boatName = (boatType)info.GetValue("boatName",typeof(boatType));
            sailTime = info.GetString("sailTime");
            bankOut = info.GetDecimal("bankOut");

            pkgsOut = info.GetInt32("pkgsOut");
            pkgsNotViewed = info.GetInt32("pkgsNotViewed");
            pkgsViewedNS = info.GetInt32("pkgsViewedNS");

            clicker = info.GetInt32("clicker");
            headcount = info.GetInt32("headcount");
            paxCount = info.GetInt32("paxCount");

            AllInVal = info.GetDecimal("AllInVal");
            BaseVal = info.GetDecimal("BaseVal");
            AcrylOnlyVal = info.GetDecimal("AcrylOnlyVal");

            sold_allIn = info.GetInt32("sold_allIn");
            sold_baseOnly = info.GetInt32("sold_baseOnly");
            sold_acrylicOnly = info.GetInt32("sold_acrylicOnly");
            sold_reprint_allIn = info.GetInt32("sold_reprint_allIn");
            sold_reprint_Base = info.GetInt32("sold_reprint_Base");
            sold_acrylicAddOn = info.GetInt32("sold_acrylicAddOn");
            missingPackages = info.GetInt32("missingPackages");

            pkgsSold = info.GetInt32("pkgsSold");
            pkgsNotSold = info.GetInt32("pkgsNotSold");

            otherPrints = info.GetInt32("otherPrints");
            otherValue = info.GetDecimal("otherValue");

            override_AllInCount = info.GetBoolean("override_AllInCount");
            override_CashAmt = info.GetBoolean("override_AllInCount");

            inBank = (Bank)info.GetValue("inBank",typeof(Bank));
            depositBank = (Bank)info.GetValue("depositBank", typeof(Bank));

            expectedTotal = info.GetDecimal("expectedTotal");
            actualTotal = info.GetDecimal("actualTotal");
            grossTotal = info.GetDecimal("grossTotal");
            netProfit = info.GetDecimal("netProfit");
            perCap = info.GetDecimal("perCap");

            amEx = (NonCashAsset)info.GetValue("amEx",typeof(NonCashAsset));
            visa = (NonCashAsset)info.GetValue("visa", typeof(NonCashAsset));
            mastercard = (NonCashAsset)info.GetValue("mastercard", typeof(NonCashAsset));
            discover = (NonCashAsset)info.GetValue("discover", typeof(NonCashAsset));
            directBill = (NonCashAsset)info.GetValue("directBill", typeof(NonCashAsset));
            personalCheck = (NonCashAsset)info.GetValue("personalCheck", typeof(NonCashAsset));

            notes = info.GetString("notes");
            employeeInitials = info.GetString("employeeInitials");

            isLocked = info.GetBoolean("isLocked");
        }
Example #2
0
 public QLearned(SerializationInfo info, StreamingContext context)
 {
     algo = info.GetString("algo");
     state = info.GetString("state");
     learn = info.GetDecimal("learn");
     discount = info.GetDecimal("discount");
     explore = info.GetDecimal("explore");
     trials = info.GetInt32("trials");
     contents = info.GetValue("contents", typeof(object));
 }
Example #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DefaultType"/> class.
 /// </summary>
 /// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo"/> from which to create a new instance.</param>
 /// <param name="context">The source (see <see cref="T:System.Runtime.Serialization.StreamingContext"/>) for this serialization.</param>
 public DefaultType(SerializationInfo info, StreamingContext context)
 {
     Name = info.GetString("Name");
     Format = (Format) info.GetValue("Format", typeof(Format));
     Manufacturer = info.GetString("Manufacturer");
     Volume = info.GetDecimal("Volume");
 }
Example #4
0
 protected EmployeeDayTimeResult(SerializationInfo info, StreamingContext context)
 {
     _contractBegin = info.GetDateTime("cb");
     _contractEnd = info.GetDateTime("ce");
     _coefficient = info.GetDecimal("dt");
     _employeeID = info.GetInt64("em");
 }
Example #5
0
 protected Output(SerializationInfo info, StreamingContext context)
 {
     Name = info.GetString("Name");
     Target = info.GetString("Target");
     Input = info.GetString("Input");
     Parameter = info.GetString("Parameter");
     Delay = info.GetDecimal("Delay");
     OnceOnly = info.GetBoolean("OnceOnly");
 }
Example #6
0
File: Map.cs Project: silky/sledge
 protected Map(SerializationInfo info, StreamingContext context)
 {
     Version = info.GetDecimal("Version");
     Visgroups = ((Visgroup[]) info.GetValue("Visgroups", typeof (Visgroup[]))).ToList();
     Cameras = ((Camera[]) info.GetValue("Cameras", typeof (Camera[]))).ToList();
     var activeCamera = info.GetInt32("ActiveCameraID");
     ActiveCamera = activeCamera >= 0 ? Cameras[activeCamera] : null;
     WorldSpawn = (World) info.GetValue("WorldSpawn", typeof (World));
     IDGenerator = (IDGenerator) info.GetValue("IDGenerator", typeof (IDGenerator));
 }
Example #7
0
 protected DisplacementPoint(SerializationInfo info, StreamingContext context)
 {
     XIndex = info.GetInt32("XIndex");
     YIndex = info.GetInt32("YIndex");
     CurrentPosition = (Vertex) info.GetValue("CurrentPosition", typeof (Vertex));
     InitialPosition = (Coordinate) info.GetValue("InitialPosition", typeof (Coordinate));
     Displacement = (Vector) info.GetValue("Displacement", typeof (Vector));
     OffsetDisplacement = (Vector) info.GetValue("OffsetDisplacement", typeof (Vector));
     Alpha = info.GetDecimal("Alpha");
 }
Example #8
0
 protected Displacement(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     Power = info.GetInt32("Power");
     StartPosition = (Coordinate) info.GetValue("StartPosition", typeof (Coordinate));
     Elevation = info.GetDecimal("Elevation");
     SubDiv = info.GetBoolean("SubDiv");
     Points = (DisplacementPoint[,]) info.GetValue("Points", typeof (DisplacementPoint[,]));
     Points.OfType<DisplacementPoint>().ToList().ForEach(x => x.Parent = this);
 }
 public object SetObjectData(object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)
 {
     var orderDetail = (OrderDetail)obj;
     orderDetail.OrderID = info.GetInt32("OrderID");
     orderDetail.ProductID = info.GetInt32("ProductID");
     orderDetail.UnitPrice = info.GetDecimal("UnitPrice");
     orderDetail.Quantity = info.GetInt16("Quantity");
     orderDetail.Discount = info.GetSingle("Discount");
     orderDetail.Order = (Order)info.GetValue("Order", typeof(Order));
     orderDetail.Product = (Product)info.GetValue("Product", typeof(Product));
     return orderDetail;
 }
Example #10
0
 public Invoice(SerializationInfo info, StreamingContext context)
 {
     m_sInvoiceID = info.GetString("InvoiceID");
     m_iIAJobID = info.GetInt32("IAJobID");
     m_sCustomerID = info.GetString("CustomerID");
     m_sInvoiceNumber = info.GetString("InvoiceNumber");
     m_oDueDateTime = info.GetDateTime("DueDateTime");
     m_fAmount = info.GetDecimal("Amount");
     m_sFilename = info.GetString("Filename");
     m_bIsEmail = info.GetBoolean("IsEmail");
     m_sEmailSubject = info.GetString("EmailSubject");
     m_sEmailBody = info.GetString("EmailBody");
 }
        public object SetObjectData(object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)
        {
            var orderDetail = (Order_Detail) obj;

            orderDetail.OrderID = info.GetInt32(MemberNameHelper.GetPropertyName<Order_Detail, int>(p => p.OrderID));
            orderDetail.ProductID = info.GetInt32(MemberNameHelper.GetPropertyName<Order_Detail, int>(p => p.ProductID));
            orderDetail.UnitPrice = info.GetDecimal(MemberNameHelper.GetPropertyName<Order_Detail, decimal>(p => p.UnitPrice));
            orderDetail.Quantity = info.GetInt16(MemberNameHelper.GetPropertyName<Order_Detail, short>(p => p.Quantity));
            orderDetail.Discount = info.GetSingle(MemberNameHelper.GetPropertyName<Order_Detail, float>(p => p.Discount));
            orderDetail.Product = (Product) info.GetValue(MemberNameHelper.GetPropertyName<Order_Detail, Product>(p => p.Product), typeof(Product));
            orderDetail.Order = (Order) info.GetValue(MemberNameHelper.GetPropertyName<Order_Detail, Order>(p => p.Order), typeof (Order));

            return orderDetail;
        }
 /// <summary>
 /// 
 /// </summary>
 public OrderExecutionSourceClientStub(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     ChangeOperationalState(OperationalStateEnum.Constructed);
     StatusSynchronizationEnabled = true;
     _sourceId = (ComponentId)info.GetValue("sourceId", typeof(ComponentId));
     try
     {
         _slippageMultiplicator = info.GetDecimal("slippageMultiplicator");
     }
     catch (SerializationException)
     {
         _slippageMultiplicator = 1;
     }
 }
Example #13
0
        public Settings(SerializationInfo info, StreamingContext context)
        {
            saintAllInVal = info.GetDecimal("saintAllInVal");
            saintBaseVal = info.GetDecimal("saintBaseVal");
            saintAcrylOnlyVal = info.GetDecimal("saintAcrylOnlyVal");

            minmoAllInVal = info.GetDecimal("minmoAllInVal");
            minmoBaseVal = info.GetDecimal("minmoBaseVal");
            minmoAcrylOnlyVal = info.GetDecimal("minmoAcrylOnlyVal");

            addOnAcrylVal = info.GetDecimal("addOnAcrylVal");

            lastSaveLoc = info.GetString("lastSaveLoc");

            defaultSaveLoc = info.GetString("defaultSaveLoc");
        }
Example #14
0
        public Bank(SerializationInfo info, StreamingContext ctxt)
        {
            numQuarters = info.GetInt32("numQuarters");
            numQuarterRolls = info.GetInt32("numQuarterRolls");
            numNickels = info.GetInt32("numNickels");
            numNickelRolls = info.GetInt32("numNickelRolls");
            numDimes = info.GetInt32("numDimes");
            numDimeRolls = info.GetInt32("numDimeRolls");
            numPennies = info.GetInt32("numPennies");
            numPennyRolls = info.GetInt32("numPennyRolls");

            numOnes = info.GetInt32("numOnes");
            numFives = info.GetInt32("numFives");
            numTens = info.GetInt32("numTens");
            numTwenties = info.GetInt32("numTwenties");
            numFifties = info.GetInt32("numFifties");
            numHundreds = info.GetInt32("numHundreds");
            totalBank = info.GetDecimal("totalBank");
        }
Example #15
0
        private void SetObjectData(SerializationInfo info)
        {
            this.ProductID = info.GetInt32(nameof(this.ProductID));
            this.ProductName = info.GetString(nameof(this.ProductName));
            this.SupplierID = (int?)info.GetValue(nameof(this.SupplierID), typeof(int?));
            this.CategoryID = (int?)info.GetValue(nameof(this.CategoryID), typeof(int?));
            this.QuantityPerUnit = info.GetString(nameof(this.QuantityPerUnit));
            this.UnitPrice = (decimal?)info.GetValue(nameof(this.UnitPrice), typeof(decimal?));
            this.UnitsInStock = (short?)info.GetValue(nameof(this.UnitsInStock), typeof(short?));
            this.ReorderLevel = (short?)info.GetValue(nameof(this.UnitsOnOrder), typeof(short?));
            this.Discontinued = info.GetBoolean(nameof(this.Discontinued));

            if (!info.GetBoolean(nameof(this.Category) + "IsNull"))
            {
                this.Category = new Category
                {
                    CategoryID = info.GetInt32(nameof(this.Category) + nameof(this.Category.CategoryID)),
                    CategoryName = info.GetString(nameof(this.Category) + nameof(this.Category.CategoryName)),
                    Description = info.GetString(nameof(this.Category) + nameof(this.Category.Description)),
                    Picture = (byte[])info.GetValue(nameof(this.Category) + nameof(this.Category.Picture), typeof(byte[]))
                };
            }

            var orderDetailsList = new List<OrderDetail>();

            for (var index = 0; index < info.GetInt32("orderDetailsCount"); index++)
            {
                var orderDetail = new OrderDetail
                {
                    OrderID = info.GetInt32($"{nameof(this.OrderDetails)}-{index}-{nameof(OrderDetail.OrderID)}"),
                    ProductID = info.GetInt32($"{nameof(this.OrderDetails)}-{index}-{nameof(OrderDetail.ProductID)}"),
                    UnitPrice = info.GetDecimal($"{nameof(this.OrderDetails)}-{index}-{nameof(OrderDetail.UnitPrice)}"),
                    Quantity = info.GetInt16($"{nameof(this.OrderDetails)}-{index}-{nameof(OrderDetail.Quantity)}"),
                    Discount = (float)info.GetValue($"{nameof(this.OrderDetails)}-{index}-{nameof(OrderDetail.Discount)}", typeof(float))
                };
                orderDetailsList.Add(orderDetail);
            }

            this.OrderDetails = orderDetailsList;

            if (!info.GetBoolean(nameof(this.Supplier) + "IsNull"))
            {
                this.Supplier = new Supplier
                {
                    SupplierID = info.GetInt32(nameof(this.Supplier) + nameof(this.Supplier.SupplierID)),
                    CompanyName = info.GetString(nameof(this.Supplier) + nameof(this.Supplier.CompanyName)),
                    ContactName = info.GetString(nameof(this.Supplier) + nameof(this.Supplier.ContactName)),
                    Address = info.GetString(nameof(this.Supplier) + nameof(this.Supplier.Address)),
                    City = info.GetString(nameof(this.Supplier) + nameof(this.Supplier.City)),
                    Region = info.GetString(nameof(this.Supplier) + nameof(this.Supplier.Region)),
                    PostalCode = info.GetString(nameof(this.Supplier) + nameof(this.Supplier.PostalCode)),
                    Country = info.GetString(nameof(this.Supplier) + nameof(this.Supplier.Country)),
                    Phone = info.GetString(nameof(this.Supplier) + nameof(this.Supplier.Phone)),
                    Fax = info.GetString(nameof(this.Supplier) + nameof(this.Supplier.Fax)),
                    HomePage = info.GetString(nameof(this.Supplier) + nameof(this.Supplier.HomePage))
                };
            }
        }
Example #16
0
 protected Vertex(SerializationInfo info, StreamingContext context)
 {
     TextureU = info.GetDecimal("TextureU");
     TextureV = info.GetDecimal("TextureV");
     Location = (Coordinate) info.GetValue("Location", typeof (Coordinate));
 }
 /// <summary>
 /// Deserialization constructor.
 /// </summary>
 /// <param name="si">Serialization information.</param>
 /// <param name="context">Streaming context.</param>
 protected WorkIndicationMessage(SerializationInfo si, StreamingContext context)
 {
     jobId = si.GetDecimal("JobId");
     segmentId = si.GetInt32("OperationDivisionID");
 }
Example #18
0
 // The following constructor is for deserialization
 public ShoppingCartItem(SerializationInfo info, StreamingContext context)
 {
     this.productId = info.GetInt32("Product ID");
     this.price = info.GetDecimal("Price");
     this.quantity = info.GetInt32("Quantity");
 }
Example #19
0
 protected Coordinate(SerializationInfo info, StreamingContext context)
 {
     X = info.GetDecimal("X");
     Y = info.GetDecimal("Y");
     Z = info.GetDecimal("Z");
 }
 protected LayerSelected(SerializationInfo info, StreamingContext context)
 {
     name = info.GetString("name");
     enabled = info.GetBoolean("enabled");
     activeIcon = info.GetBoolean("activeIcon");
     color.r = (float)info.GetDecimal("colorR");
     color.g = (float)info.GetDecimal("colorG");
     color.b = (float)info.GetDecimal("colorB");
     color.a = (float)info.GetDecimal("colorA");
 }
Example #21
0
		private MockableCall(SerializationInfo info, StreamingContext context) {
			// Retrieve serialization version:
			string assemblyVersion = info.GetString("assemblyVersion");
			decimal serializationVersion = info.GetDecimal("serializationVersion");
			// Retrieve callee:
			this.callee = new MockingProxy(Type.GetType(info.GetString("calleeType")), new PlayBackMocker(), info.GetString("calleeInstanceName"));
			// Retrieve isConstructorCall:
			this.isConstructorCall = info.GetBoolean("isConstructorCall");
			// Retrieve method:
			Type methodType = Type.GetType(info.GetString("methodType"));
			string[] methodSignatureStr = (string[])info.GetValue("methodSignature", typeof(string[]));
			Type[] methodSignature = new Type[methodSignatureStr.Length];
			for(int i=0; i<methodSignatureStr.Length; i++) methodSignature[i] = Type.GetType(methodSignatureStr[i]);
			if (this.isConstructorCall) {
				this.method = methodType.GetConstructor(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, methodSignature, null);
			} else {
				this.method = methodType.GetMethod(info.GetString("methodName"), BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, methodSignature, null);
			}
			// Retrieve inArgs:
			this.inArgs = (object[])info.GetValue("inArgs", typeof(object[]));
			object[] inArgsSubstitutions = (object[])info.GetValue("inArgsMockers", typeof(object[]));
			foreach(object[] subst in inArgsSubstitutions) {
				MockingProxy proxy = new MockingProxy(Type.GetType((string)subst[1]), new PlayBackMocker(), (string)subst[2]);
				this.inArgs[(int)subst[0]] = proxy.GetTransparentProxy();
			}
			// Retrieve outArgs:
			this.outArgs = (object[])info.GetValue("outArgs", typeof(object[]));
			object[] outArgsSubstitutions = (object[])info.GetValue("outArgsMockers", typeof(object[]));
			if (outArgs != null) {
				foreach(object[] subst in outArgsSubstitutions) {
					MockingProxy proxy = new MockingProxy(Type.GetType((string)subst[1]), new PlayBackMocker(), (string)subst[2]);
					this.outArgs[(int)subst[0]] = proxy.GetTransparentProxy();
				}
			}
			// Retrieve returnValue:
			bool returnValueMocked = info.GetBoolean("returnValueMocked");
			Type returnValueType = Type.GetType(info.GetString("returnValueType"));
			if (returnValueMocked) {
				MockingProxy proxy = new MockingProxy(Type.GetType(info.GetString("returnValueType")), new PlayBackMocker(), info.GetString("returnValueName"));
				this.returnValue = proxy.GetTransparentProxy();
			} else {
				this.returnValue = info.GetValue("returnValue", returnValueType);
			}
			// Retrieve exception:
			this.exception = (Exception)info.GetValue("exception", typeof(Exception));
			if (exception == null) {
				string exceptionType = info.GetString("exceptionType");
				if (exceptionType != null) {
					this.exception = (Exception)Type.GetType(exceptionType).GetConstructor(new Type[] {}).Invoke(new object[] {});
				}
			}
			// Retrieve iscompleted & duration:
			this.isCompleted = info.GetBoolean("isCompleted");
			this.callDuration = info.GetInt32("callDuration");
		}
Example #22
0
        public void GetObjectData_SerializationInfo_AreEqual()
        {
            ISerializable obj = TestStruct;
            var info = new SerializationInfo(typeof(Amount), new FormatterConverter());
            obj.GetObjectData(info, default(StreamingContext));

            Assert.AreEqual(42.17m, info.GetDecimal("Value"));
        }
Example #23
0
 public PaymentLineItem(SerializationInfo info, StreamingContext context)
 {
     m_sInvoiceID = info.GetString("InvoiceID");
     m_sQBInvoiceID = info.GetString("QBInvoiceID");
     m_fAmount = info.GetDecimal("Amount");
 }
Example #24
0
        protected GPSDataEntity(SerializationInfo info, StreamingContext context)
            : this()
        {
            if (info == null)
            {
                throw new ArgumentNullException("info", "serialization information can't be null");
            }

            try { ID = (Guid)info.GetValue("ID", typeof(Guid)); }
            catch { }

            GPSCode = info.GetString("GPSCode");
            Longitude = info.GetDecimal("Longitude");
            Latitude = info.GetDecimal("Latitude");
            Speed = info.GetDecimal("Speed");

            Direction = info.GetDecimal("Direction");
            ReportTime = info.GetDateTime("ReportTime");
            ReceiveTime = info.GetDateTime("ReceiveTime");
            OilState = info.GetInt32("OilState");
            ACCState = info.GetInt32("ACCState");

            Mileage = info.GetDecimal("Mileage");
            PowerState = info.GetInt32("PowerState");
            StarkMileage = info.GetDecimal("StarkMileage");
            AntennaState = info.GetInt32("AntennaState");
            PlunderState = info.GetInt32("PlunderState");

            OilBearing = info.GetDecimal("OilBearing");
            DoorStatus = info.GetInt32("DoorStatus");
            PhotoPath = info.GetString("PhotoPath");

            try { VehicleCode = (Guid)info.GetValue("VehicleCode", typeof(Guid)); }
            catch { }

            CameraId = info.GetInt32("CameraId");

            RealTimePhotoType = info.GetInt32("RealTimePhotoType");
            IsOverflowGPSData = info.GetBoolean("IsOverflowGPSData");
            IsLocatedData = info.GetBoolean("IsLocatedData");
            IsFetchData = info.GetBoolean("IsFetchData");
            IsPhotoData = info.GetBoolean("IsPhotoData");

            GPSDeviceMileage = info.GetDecimal("GPSDeviceMileage");

            StartStopCarTime = info.GetDateTime("StartStopCarTime");
            IsStartStopCarTime = info.GetBoolean("IsStartStopCarTime");
            IsSendLongIntervalMessage = info.GetBoolean("IsSendLongIntervalMessage");
            ControlTime = info.GetDateTime("ControlTime");


            try { Detector1 = info.GetSingle("Detector1"); }
            catch { }
            try { Detector2 = info.GetSingle("Detector2"); }
            catch { }
            try { Detector3 = info.GetSingle("Detector3"); }
            catch { }
            try { Detector4 = info.GetSingle("Detector4"); }
            catch { }

            CoolerStatus = info.GetInt32("CoolerStatus");
            IsOnCar = info.GetBoolean("IsOnCar");
            DataSource = info.GetString("DataSource");
        }
Example #25
0
        public void GetObjectData_SerializationInfo_AreEqual()
        {
            ISerializable obj = TestStruct;
            var info = new SerializationInfo(typeof(Percentage), new System.Runtime.Serialization.FormatterConverter());
            obj.GetObjectData(info, default(StreamingContext));

            Assert.AreEqual(0.1751m, info.GetDecimal("Value"));
        }
Example #26
0
 protected Vector(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     Normal = (Coordinate) info.GetValue("Normal", typeof (Coordinate));
     Distance = info.GetDecimal("Distance");
 }
Example #27
0
 protected Plane(SerializationInfo info, StreamingContext context)
     : this((Coordinate)info.GetValue("Normal", typeof(Coordinate)), info.GetDecimal("DistanceFromOrigin"))
 {
 }
        /// <summary>
        /// Deserialization constructor.
        /// </summary>
        public MBTradingAdapter(SerializationInfo info, StreamingContext context)
            : base(info, context)
        {
            try
            {
                _username = info.GetString("username");
                _password = info.GetString("password");

                _applyQuoteCommission = info.GetBoolean("applyQuoteCommission");
                _applyOrderCommission = info.GetBoolean("applyOrderCommission");

                _commissionValue = info.GetDecimal("commission");
                _commissionPrecisionDecimals = info.GetInt32("commissionPrecisionDecimals");
            }
            catch(Exception ex)
            {
                SystemMonitor.OperationError("Failed to deserialize adapter.", ex);
            }

            Construct();
        }