internal static DockStyle xGetDock(IArrangedElement element) { BitVector32 layoutState = GetLayoutState(element); DockStyle style = (DockStyle)layoutState[_dockAndAnchorSection]; DockAnchorMode mode = (DockAnchorMode)layoutState[_dockModeSection]; return((mode == DockAnchorMode.Dock) ? style : DockStyle.None); }
internal static AnchorStyles xGetAnchor(IArrangedElement element) { BitVector32 state = GetLayoutState(element); AnchorStyles value = (AnchorStyles)state[_dockAndAnchorSection]; DockAnchorMode mode = (DockAnchorMode)state[_dockModeSection]; // If we are docked, or if it the value is 0, we return DefaultAnchor value = mode == DockAnchorMode.Anchor ? xTranslateAnchorValue(value) : DefaultAnchor; Debug.Assert(mode == DockAnchorMode.Anchor || value == DefaultAnchor, "xGetAnchor needs to return DefaultAnchor when docked."); return(value); }
internal static DockStyle xGetDock(IArrangedElement element) { BitVector32 state = GetLayoutState(element); DockStyle value = (DockStyle)state[_dockAndAnchorSection]; DockAnchorMode mode = (DockAnchorMode)state[_dockModeSection]; // If we are anchored we return DefaultDock value = mode == DockAnchorMode.Dock ? value : DefaultDock; Debug.Assert(ClientUtils.IsEnumValid(value, (int)value, (int)DockStyle.None, (int)DockStyle.Fill), "Illegal value returned form xGetDock."); Debug.Assert(mode == DockAnchorMode.Dock || value == DefaultDock, "xGetDock needs to return the DefaultDock style when not docked."); return(value); }
internal static DockStyle xGetDock(IArrangedElement element) { BitVector32 state = GetLayoutState(element); DockStyle value = (DockStyle)state[_dockAndAnchorSection]; DockAnchorMode mode = (DockAnchorMode)state[_dockModeSection]; // If we are anchored we return DefaultDock value = mode == DockAnchorMode.Dock ? value : DefaultDock; SourceGenerated.EnumValidator.Validate(value); Debug.Assert(mode == DockAnchorMode.Dock || value == DefaultDock, "xGetDock needs to return the DefaultDock style when not docked."); return(value); }