本文整理匯總了C#中Xwt.Rectangle.ToCGRect方法的典型用法代碼示例。如果您正苦於以下問題:C# Rectangle.ToCGRect方法的具體用法?C# Rectangle.ToCGRect怎麽用?C# Rectangle.ToCGRect使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Xwt.Rectangle
的用法示例。
在下文中一共展示了Rectangle.ToCGRect方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Show
public void Show (Xwt.Popover.Position orientation, Xwt.Widget referenceWidget, Xwt.Rectangle positionRect, Xwt.Widget child)
{
popover = MakePopover (child, BackgroundColor);
popover.Delegate = new PopoverDelegate (sink);
ViewBackend backend = (ViewBackend)Toolkit.GetBackend (referenceWidget);
var reference = backend.Widget;
// If the position rect is empty, the coordinates of the rect will be ignored.
// Width and Height of the rect must be > Epsilon, for the positioning to function correctly.
if (Math.Abs (positionRect.Width) < double.Epsilon)
positionRect.Width = 1;
if (Math.Abs (positionRect.Height) < double.Epsilon)
positionRect.Height = 1;
positionRect = new Rectangle(positionRect.X, positionRect.Y, positionRect.Width * 2, positionRect.Height); //It appears to be necessary to multiply the width by a factor of 2
popover.Show (positionRect.ToCGRect (),
reference,
ToRectEdge (orientation));
}