/// <summary> /// Deserialization constructor /// </summary> /// <param name="info"></param> /// <param name="context"></param> protected BinaryAmbiance(SerializationInfo info, StreamingContext context) { #region Incremental serialization fix; delete try-catch when properly saved with all members try { mLocked = info.GetBoolean("mLocked"); } catch { this.mLocked = false; } try { mEnableTooltip = info.GetBoolean("mEnableTooltip"); } catch { mEnableTooltip = true; } try { mShowAutomataController = info.GetBoolean("mShowAutomataController"); } catch { mShowAutomataController = false; } #endregion mShowGrid = info.GetBoolean("mShowGrid"); mGradientBottom = (Color)info.GetValue("mGradientBottom", typeof(Color)); mGradientTop = (Color)info.GetValue("mGradientTop", typeof(Color)); mAllowAddConnection = info.GetBoolean("mAllowAddConnection"); mAllowAddShape = info.GetBoolean("mAllowAddShape"); mAllowDeleteShape = info.GetBoolean("mAllowDeleteShape"); mAllowMoveShape = info.GetBoolean("mAllowMoveShape"); mAutomataPulse = info.GetInt32("mAutomataPulse"); mBackgroundColor = (Color)info.GetValue("mBackgroundColor", typeof(Color)); mBackgroundImagePath = info.GetString("mBackgroundImagePath"); mBackgroundType = (CanvasBackgroundType)info.GetValue("mBackgroundType", typeof(CanvasBackgroundType)); mDefaultConnectionPath = info.GetString("mDefaultConnectionPath"); mGradientMode = (LinearGradientMode)info.GetValue("mGradientMode", typeof(LinearGradientMode)); mEnableContextMenu = info.GetBoolean("mEnableContextMenu"); mGridSize = info.GetInt32("mGridSize"); mRestrictToCanvas = info.GetBoolean("mRestrictToCanvas"); mSnap = info.GetBoolean("mSnap"); mDefaultConnectionEnd = (ConnectionEnd)info.GetValue("mDefaultConnectionEnd", typeof(ConnectionEnd)); mEnableLayout = info.GetBoolean("mEnableLayout"); mGraphLayoutAlgorithm = (GraphLayoutAlgorithms)info.GetValue("mGraphLayoutAlgorithm", typeof(GraphLayoutAlgorithms)); }
/// <summary> /// Deserialization constructor /// </summary> /// <param name="info"></param> /// <param name="context"></param> protected BinaryAmbiance(SerializationInfo info, StreamingContext context) { #region Incremental serialization fix; delete try-catch when properly saved with all members try { mLocked = info.GetBoolean("mLocked"); } catch { this.mLocked = false; } try { mEnableTooltip = info.GetBoolean("mEnableTooltip"); } catch { mEnableTooltip = true; } try { mShowAutomataController = info.GetBoolean("mShowAutomataController"); } catch { mShowAutomataController = false; } #endregion mShowGrid = info.GetBoolean("mShowGrid"); mGradientBottom = (Color) info.GetValue("mGradientBottom", typeof(Color)); mGradientTop = (Color) info.GetValue("mGradientTop", typeof(Color)); mAllowAddConnection = info.GetBoolean("mAllowAddConnection"); mAllowAddShape = info.GetBoolean("mAllowAddShape"); mAllowDeleteShape = info.GetBoolean("mAllowDeleteShape"); mAllowMoveShape = info.GetBoolean("mAllowMoveShape"); mAutomataPulse = info.GetInt32("mAutomataPulse"); mBackgroundColor = (Color) info.GetValue("mBackgroundColor", typeof(Color)); mBackgroundImagePath = info.GetString("mBackgroundImagePath"); mBackgroundType = (CanvasBackgroundType) info.GetValue("mBackgroundType", typeof(CanvasBackgroundType)); mDefaultConnectionPath = info.GetString("mDefaultConnectionPath"); mGradientMode =(LinearGradientMode) info.GetValue("mGradientMode", typeof(LinearGradientMode)); mEnableContextMenu = info.GetBoolean("mEnableContextMenu"); mGridSize = info.GetInt32("mGridSize"); mRestrictToCanvas = info.GetBoolean("mRestrictToCanvas"); mSnap = info.GetBoolean("mSnap"); mDefaultConnectionEnd = (ConnectionEnd) info.GetValue("mDefaultConnectionEnd", typeof(ConnectionEnd)); mEnableLayout = info.GetBoolean("mEnableLayout"); mGraphLayoutAlgorithm = (GraphLayoutAlgorithms) info.GetValue("mGraphLayoutAlgorithm", typeof(GraphLayoutAlgorithms)); }