本文整理汇总了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;
}
}
示例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);
}
示例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));
}
}