Esempio n. 1
0
        public void OpenHinge()
        {
            if (_isOpen)
            {
                return;
            }
            _isOpen = true;
            //-----------------------------------
            if (LandPart == null)
            {
                return;
            }
            if (FloatPart == null)
            {
                return;                   //may be null
            }
            switch (FloatPartStyle)
            {
            default:
            case HingeFloatPartStyle.Popup:
            {
                RenderElement renderE = LandPart.CurrentPrimaryRenderElement;
                if (renderE != null)
                {
                    IContainerRenderElement topRenderBox = renderE.GetTopWindowRenderBox();
                    if (topRenderBox != null)
                    {
                        Point globalLocation = LandPart.GetGlobalLocation();
                        FloatPart.SetLocation(globalLocation.X, globalLocation.Y + LandPart.Height);
                        _floatPartRenderElement = FloatPart.GetPrimaryRenderElement();
                        topRenderBox.AddChild(_floatPartRenderElement);
                    }
                }
            }
            break;

            case HingeFloatPartStyle.Embeded:
            {
            }
            break;
            }
        }
Esempio n. 2
0
        public void CloseHinge()
        {
            if (!_isOpen)
            {
                return;
            }
            _isOpen = false;
            if (LandPart == null)
            {
                return;
            }
            if (FloatPart == null)
            {
                return;
            }
            switch (FloatPartStyle)
            {
            default:
            {
            }
            break;

            case HingeFloatPartStyle.Popup:
            {
                if (_floatPartRenderElement != null)
                {
                    var topRenderBox = _floatPartRenderElement.GetTopWindowRenderBox();
                    if (topRenderBox != null)
                    {
                        topRenderBox.RemoveChild(_floatPartRenderElement);
                    }
                }
            }
            break;

            case HingeFloatPartStyle.Embeded:
            {
            }
            break;
            }
        }