當前位置: 首頁>>代碼示例>>C#>>正文


C# Rectangle.Contains方法代碼示例

本文整理匯總了C#中Xwt.Rectangle.Contains方法的典型用法代碼示例。如果您正苦於以下問題:C# Rectangle.Contains方法的具體用法?C# Rectangle.Contains怎麽用?C# Rectangle.Contains使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Xwt.Rectangle的用法示例。


在下文中一共展示了Rectangle.Contains方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: OnButtonReleased

		protected override void OnButtonReleased (ButtonEventArgs args)
		{
			base.OnButtonReleased (args);
			if (args.Button == PointerButton.Left) {
				if (Expanded) {
					var headerRect = new Rectangle (0, 0, Size.Width, header.Size.Height + header.MarginTop + header.MarginBottom);
					if (!headerRect.Contains (args.Position))
						return;
				}
				Expanded = !Expanded;
			}
		}
開發者ID:kdubau,項目名稱:monodevelop,代碼行數:12,代碼來源:ConfigurationSectionWidget.cs

示例2: DrawCaret

		public void DrawCaret (Context ctx, Rectangle area)
		{
			if (!caretBlink || HexEditorData.IsSomethingSelected) 
				return;
			long caretY = HexEditorData.Caret.Line * LineHeight - (long)HexEditorData.VAdjustment.Value;
			double caretX;
			char ch;
			if (HexEditorData.Caret.InTextEditor) {
				caretX = textEditorMargin.CalculateCaretXPos (out ch);
			} else {
				caretX = hexEditorMargin.CalculateCaretXPos (out ch);
			}

			if (!area.Contains (caretX, (int)caretY))
				return;
			
			if (HexEditorData.Caret.IsInsertMode) {
				ctx.Rectangle (caretX, (int)caretY, 2, LineHeight);
			} else {
				ctx.Rectangle (caretX, (int)caretY, textEditorMargin.charWidth, LineHeight);
			}

			ctx.SetColor (HexEditorStyle.HexDigit); 
			ctx.Fill ();

			if (!HexEditorData.Caret.IsInsertMode) {
				using (var layout = new TextLayout (this)) {
					layout.Font = Options.Font;
					layout.Text = ch.ToString ();
					ctx.SetColor (HexEditorStyle.HexDigitBg);
					ctx.DrawTextLayout (layout, caretX, caretY); 
				}
			}
		}
開發者ID:riverans,項目名稱:monodevelop,代碼行數:34,代碼來源:HexEditor.cs

示例3: OnButtonPressed

        protected override void OnButtonPressed(ButtonEventArgs args)
        {
            base.OnButtonPressed(args);

            switch (args.Button) {
            case PointerButton.Left:
                Rectangle closeRegion = new Rectangle(
                                            Size.Width - closeNormal.Width - (next == null ? padding.Right + Lean.Dx : 0),
                                            (Size.Height - closeNormal.Height) / 2,
                                            closeNormal.Width, closeNormal.Height
                                        );

                if (closeRegion.Contains(args.Position)) {
                    OnTabClosed(this, new CloseEventArgs());
                } else {
                    if (!Managed) {
                        Active = !Active;
                    }
                    if (toggleEvent != null) {
                        toggleEvent(this, EventArgs.Empty);
                    }
                }

                break;
            }
        }
開發者ID:jfreax,項目名稱:BAIMP,代碼行數:26,代碼來源:TabButton.cs


注:本文中的Xwt.Rectangle.Contains方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。