public FieldSolveContext(SerializationInfo info, StreamingContext context) { RADeg = info.GetDouble("RADeg"); DEDeg = info.GetDouble("DEDeg"); ErrFoVs = info.GetDouble("ErrFoVs"); Method = (RecognitionMethod)info.GetInt32("Method"); DataBaseServer = info.GetString("DataBaseServer"); DataBaseName = info.GetString("DataBaseName"); CellX = info.GetDouble("CellX"); CellY = info.GetDouble("CellY"); FocalLength = info.GetDouble("FocalLength"); LimitMagn = info.GetDouble("LimitMagn"); PyramidMinMag = info.GetDouble("MinMag"); PyramidMaxMag = info.GetDouble("MaxMag"); UtcTime = info.GetDateTime("UtcTime"); FrameNoOfUtcTime = info.GetInt32("FrameNoOfUtcTime"); FrameNoOfUtcTime = info.GetInt32("FrameNoOfUtcTime"); ObsCode = info.GetString("ObsCode"); byte[] data = (byte[])info.GetValue("CatalogueStars", typeof(byte[])); BinaryFormatter fmt = new BinaryFormatter(); using (MemoryStream mem = new MemoryStream(data)) { CatalogueStars = new List<IStar>(); int count = (int)fmt.Deserialize(mem); for (int i = 0; i < count; i++) { IStar star = (Star)fmt.Deserialize(mem); CatalogueStars.Add(star); } } try { } catch(InvalidCastException) { } }
public FieldSolveContext(SerializationInfo info, StreamingContext context) { RADeg = info.GetDouble("RADeg"); DEDeg = info.GetDouble("DEDeg"); ErrFoVs = info.GetDouble("ErrFoVs"); Method = (RecognitionMethod)info.GetInt32("Method"); DataBaseServer = info.GetString("DataBaseServer"); DataBaseName = info.GetString("DataBaseName"); CellX = info.GetDouble("CellX"); CellY = info.GetDouble("CellY"); FocalLength = info.GetDouble("FocalLength"); LimitMagn = info.GetDouble("LimitMagn"); PyramidMinMag = info.GetDouble("MinMag"); PyramidMaxMag = info.GetDouble("MaxMag"); UtcTime = info.GetDateTime("UtcTime"); FrameNoOfUtcTime = info.GetInt32("FrameNoOfUtcTime"); FrameNoOfUtcTime = info.GetInt32("FrameNoOfUtcTime"); ObsCode = info.GetString("ObsCode"); byte[] data = (byte[])info.GetValue("CatalogueStars", typeof(byte[])); BinaryFormatter fmt = new BinaryFormatter(); using (MemoryStream mem = new MemoryStream(data)) { CatalogueStars = new List <IStar>(); int count = (int)fmt.Deserialize(mem); for (int i = 0; i < count; i++) { IStar star = (Star)fmt.Deserialize(mem); CatalogueStars.Add(star); } } try { } catch (InvalidCastException) { } }