/// <summary> /// Updates from a particular setting state. /// </summary> /// <param name="state">The new state that will be set.</param> public static void UpdateFromState(ViewSettingsState state) { AlwaysPanParallelViews = state.AlwaysPanParallelViews; DefinedViewSetCPlane = state.DefinedViewSetCPlane; DefinedViewSetProjection = state.DefinedViewSetProjection; LinkedViewports = state.LinkedViewports; PanReverseKeyboardAction = state.PanReverseKeyboardAction; PanScreenFraction = state.PanScreenFraction; RotateCircleIncrement = state.RotateCircleIncrement; RotateReverseKeyboard = state.RotateReverseKeyboard; RotateToView = state.RotateToView; SingleClickMaximize = state.SingleClickMaximize; ZoomScale = state.ZoomScale; }
static ViewSettingsState CreateState(bool current) { IntPtr pViewSettings = UnsafeNativeMethods.CRhinoAppViewSettings_New(current); ViewSettingsState rc = new ViewSettingsState(); rc.AlwaysPanParallelViews = GetBool(idxAlwaysPanParallelViews, pViewSettings); rc.DefinedViewSetCPlane = GetBool(idxDefinedViewSetCPlane, pViewSettings); rc.DefinedViewSetProjection = GetBool(idxDefinedViewSetProjection, pViewSettings); rc.LinkedViewports = GetBool(idxLinkedViewports, pViewSettings); rc.PanReverseKeyboardAction = GetBool(idxPanReverseKeyboardAction, pViewSettings); rc.PanScreenFraction = GetDouble(idxPanScreenFraction, pViewSettings); rc.RotateCircleIncrement = UnsafeNativeMethods.CRhinoAppViewSettings_GetSetInt(idxRotateCircleIncrement, false, 0, pViewSettings); rc.RotateReverseKeyboard = GetBool(idxRotateReverseKeyboard, pViewSettings); rc.RotateToView = GetBool(idxRotateToView, pViewSettings); rc.SingleClickMaximize = GetBool(idxSingleClickMaximize, pViewSettings); rc.ZoomScale = GetDouble(idxZoomScale, pViewSettings); UnsafeNativeMethods.CRhinoAppViewSettings_Delete(pViewSettings); return rc; }