Exemple #1
0
        private void InsideOfTargetCals(ref double left, ref double top, ElementRects mainElementInfo, ElementRects hideDivElementInfo)
        {
            switch (Placement)
            {
            case PlacementType.Top:
            case PlacementType.TopLeft:
            case PlacementType.TopRight:
                left = 0 - Math.Abs(mainElementInfo.Width - hideDivElementInfo.Width) / 2;
                top  = mainElementInfo.Top - mainElementInfo.Height - _toolTopArrowFixSize;
                break;

            case PlacementType.Left:
            case PlacementType.LeftTop:
            case PlacementType.LeftBottom:
                left = 0 - hideDivElementInfo.Width;
                top  = mainElementInfo.OffsetTop - Math.Abs(mainElementInfo.Height - hideDivElementInfo.Height) / 2;
                break;

            case PlacementType.Right:
            case PlacementType.RightTop:
            case PlacementType.RightBottom:
                left = 0 + Math.Abs(mainElementInfo.Width - hideDivElementInfo.Width) / 2;
                top  = mainElementInfo.OffsetTop - Math.Abs(mainElementInfo.Height - hideDivElementInfo.Height) / 2;
                break;

            case PlacementType.Bottom:
            case PlacementType.BottomLeft:
            case PlacementType.BottomRight:
                left = 0 - Math.Abs(mainElementInfo.Width - hideDivElementInfo.Width) / 2;
                top  = 0 + mainElementInfo.Height;
                break;
            }
        }
Exemple #2
0
 private async Task ShowPicker(string targetElementID)
 {
     if (string.IsNullOrWhiteSpace(targetElementID))
     {
         return;
     }
     _elementRects = await ElementInfo.GetElementRectsByID(targetElementID);
 }
        public async void OnElementResize()
        {
            _elementRects = await ElementInfo.GetElementRectsByID($"maindiv_{IdentityKey}");

#if DEBUG
            Console.WriteLine(nameof(OnElementResize));
#endif
        }
 private async void HandleElementDefaultInfo()
 {
     _elementRects = await ElementInfo.GetElementRectsByID($"maindiv_{IdentityKey}");
 }
Exemple #5
0
        private void NormalCalc(ref double left, ref double top, ElementRects mainElementInfo, ElementRects hideDivElementInfo)
        {
            switch (Placement)
            {
            case PlacementType.Top:
                left = mainElementInfo.X - Math.Abs(mainElementInfo.Width - hideDivElementInfo.Width) / 4;
                top  = mainElementInfo.Top - mainElementInfo.Height - _toolTopArrowFixSize;
                break;

            case PlacementType.TopLeft:
                left = mainElementInfo.X;
                top  = mainElementInfo.Top - mainElementInfo.Height - _toolTopArrowFixSize;
                break;

            case PlacementType.TopRight:
                left = mainElementInfo.Right - hideDivElementInfo.Width;
                top  = mainElementInfo.Top - mainElementInfo.Height - _toolTopArrowFixSize;
                break;

            case PlacementType.Left:
                left = mainElementInfo.Left - hideDivElementInfo.Width;
                top  = mainElementInfo.Top;
                break;

            case PlacementType.LeftTop:
                left = mainElementInfo.Left - hideDivElementInfo.Width;
                top  = mainElementInfo.Top;
                break;

            case PlacementType.LeftBottom:
                left = mainElementInfo.Left - hideDivElementInfo.Width;
                top  = mainElementInfo.Top;
                break;

            case PlacementType.Right:
                left = mainElementInfo.Right;
                top  = mainElementInfo.Top;
                break;

            case PlacementType.RightTop:
                left = mainElementInfo.Right;
                top  = mainElementInfo.Top;
                break;

            case PlacementType.RightBottom:
                left = mainElementInfo.Right;
                top  = mainElementInfo.Top;
                break;

            case PlacementType.Bottom:
                left = mainElementInfo.X - Math.Abs(mainElementInfo.Width - hideDivElementInfo.Width) / 2;
                top  = mainElementInfo.Top + mainElementInfo.Height;
                break;

            case PlacementType.BottomLeft:
                left = mainElementInfo.X;
                top  = mainElementInfo.Top + mainElementInfo.Height;
                break;

            case PlacementType.BottomRight:
                left = mainElementInfo.Right - hideDivElementInfo.Width;
                top  = mainElementInfo.Top + mainElementInfo.Height;
                break;
            }
        }