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


C# UInt32.HasFlag方法代碼示例

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


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

示例1: if

		void nsIEmbeddingSiteWindow.GetDimensions(UInt32 flags, out Int32 x, out Int32 y, out Int32 cx, out Int32 cy)
		{
			Trace.TraceInformation("nsIEmbeddingSiteWindow.GetDimensions(flags = 0x{0:X8})", flags);

			x = y = cx = cy = 0;

			if (flags.HasFlag(nsIEmbeddingSiteWindowConstants.DIM_FLAGS_POSITION))
			{
				Point outerPosition = Container.GetOuterPosition();
				x = outerPosition.X;
				y = outerPosition.Y;
			}

			if (flags.HasFlag(nsIEmbeddingSiteWindowConstants.DIM_FLAGS_SIZE_INNER))
			{
				Size innerSize = Container.GetInnerSize();
				cx = innerSize.Width;
				cy = innerSize.Height;
			}
			else if (flags.HasFlag(nsIEmbeddingSiteWindowConstants.DIM_FLAGS_SIZE_OUTER))
			{
				Size outerSize = Container.GetOuterSize();
				cx = outerSize.Width;
				cy = outerSize.Height;
			}
		}
開發者ID:Happy-Ferret,項目名稱:dotgecko,代碼行數:26,代碼來源:WebBrowser.EmbeddingSiteWindow.cs

示例2: ConfirmEventArgs

		internal ConfirmEventArgs(String dialogTitle, String text,
			UInt32 buttonFlags, String button1Title, String button2Title, String button3Title,
			String checkMsg, Boolean checkState)
			: base(dialogTitle, text, checkMsg, checkState)
		{
			m_Buttons = new List<Button>(3);
			m_ReadOnlyButtons = new ReadOnlyCollection<Button>(m_Buttons);

			var title = new[] { button1Title, button2Title, button3Title };
			for (Int32 i = 0; i < 3; ++i)
			{
				UInt32 flags = (buttonFlags >> (i * 8)) & 0xFF;
				if (flags != 0)
				{
					m_Buttons.Add(new Button((ButtonKind)flags, title[i]));
				}
			}

			if (buttonFlags.HasFlag(nsIPromptServiceConstants.BUTTON_POS_2_DEFAULT))
			{
				m_DefaultButton = 2;
			}
			else if (buttonFlags.HasFlag(nsIPromptServiceConstants.BUTTON_POS_1_DEFAULT))
			{
				m_DefaultButton = 1;
			}
			else
			{
				m_DefaultButton = 0;
			}

			m_DelayEnable = buttonFlags.HasFlag(nsIPromptServiceConstants.BUTTON_DELAY_ENABLE);
		}
開發者ID:Happy-Ferret,項目名稱:dotgecko,代碼行數:33,代碼來源:PromptEventArgs.cs

示例3: Point

		void nsIEmbeddingSiteWindow.SetDimensions(UInt32 flags, Int32 x, Int32 y, Int32 cx, Int32 cy)
		{
			Trace.TraceInformation("nsIEmbeddingSiteWindow.SetDimensions(falgs = 0x{0:X8}, x = {1}, y = {2}, cx = {3}, cy = {4})", flags, x, y, cx, cy);

			if (flags.HasFlag(nsIEmbeddingSiteWindowConstants.DIM_FLAGS_POSITION))
			{
				Container.SetOuterPosition(new Point(x, y));
			}

			// The inner and outer flags are mutually exclusive and it is invalid to combine them.
			if (flags.HasFlag(nsIEmbeddingSiteWindowConstants.DIM_FLAGS_SIZE_INNER))
			{
				Container.SetInnerSize(new Size(cx, cy));
			}
			else if (flags.HasFlag(nsIEmbeddingSiteWindowConstants.DIM_FLAGS_SIZE_OUTER))
			{
				Container.SetOuterSize(new Size(cx, cy));
			}
		}
開發者ID:Happy-Ferret,項目名稱:dotgecko,代碼行數:19,代碼來源:WebBrowser.EmbeddingSiteWindow.cs


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