/// <summary> /// Restore the state of this drawer /// </summary> public void Load(object state) { if (state is DrawerState) { DrawerState ds = (DrawerState)state; currentTransform = ds.CurrentTransform; matrixStack = ds.MatrixStack; transformRequired = currentTransform != null; } else { IncompatibleTypeException.Publish(state, typeof(DrawerState)); } }
/// <summary> /// Save the current state of this drawer /// Typical implementation store transformation matrix, clipping, and other information to this state object /// </summary> public object Save() { DrawerState result = new DrawerState(); if (matrixStack != null) { result.MatrixStack = matrixStack.Clone(); } if (currentTransform != null) { result.CurrentTransform = currentTransform.Clone(); } return(result); }
/// <summary> /// Save the current state of this drawer /// Typical implementation store transformation matrix, clipping, and other information to this state object /// </summary> public object Save() { DrawerState result = new DrawerState(); if (matrixStack != null) result.MatrixStack = matrixStack.Clone(); if (currentTransform != null) result.CurrentTransform = currentTransform.Clone(); return result; }