/// <summary> /// Creates field consumer /// </summary> protected void CreateFieldConsumer() { if (consumer == null) { consumer = new Motion6D.FieldConsumer3D(this); ch = new IAssociatedObject[] { consumer }; } }
/// <summary> /// Deserialization constructor /// </summary> /// <param name="info">Serialization info</param> /// <param name="context">Streaming context</param> protected WpfShape(SerializationInfo info, StreamingContext context) { try { LoadTextures(info); } catch (Exception e) { e.ShowError(10); } try { Xaml = info.GetString("Xaml"); isColored = info.GetBoolean("IsColored"); consumer = info.Deserialize <Motion6D.FieldConsumer3D>("FieldConsumer"); ch = new IAssociatedObject[] { consumer }; try { scaled = info.GetBoolean("Scaled"); } catch (Exception) { } try { forecastTime = (TimeSpan)info.GetValue("ForecastTime", typeof(TimeSpan)); coordinateError = info.GetDouble("CoordinateError"); angleError = info.GetDouble("AngleError"); } catch (Exception) { } } catch (Exception) { CreateFieldConsumer(); } }