本文整理汇总了C#中CellState.HasFlag方法的典型用法代码示例。如果您正苦于以下问题:C# CellState.HasFlag方法的具体用法?C# CellState.HasFlag怎么用?C# CellState.HasFlag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CellState
的用法示例。
在下文中一共展示了CellState.HasFlag方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RenderTimelineEventBase
static void RenderTimelineEventBase(Color color, Image ss, bool selected, string desc, IDrawingToolkit tk,
IContext context, Area backgroundArea, Area cellArea, CellState state,
out Point selectPoint, out Point textPoint, out Point imagePoint,
out Point circlePoint, out double textWidth)
{
selectPoint = new Point (backgroundArea.Start.X, backgroundArea.Start.Y);
textPoint = new Point (selectPoint.X + StyleConf.ListSelectedWidth + StyleConf.ListRowSeparator, selectPoint.Y);
imagePoint = new Point (textPoint.X + StyleConf.ListTextWidth + StyleConf.ListRowSeparator, selectPoint.Y);
textWidth = StyleConf.ListTextWidth;
circlePoint = new Point (selectPoint.X + StyleConf.ListSelectedWidth / 2, selectPoint.Y + backgroundArea.Height / 2);
tk.LineWidth = 0;
if (state.HasFlag (CellState.Prelit)) {
tk.FillColor = Config.Style.PaletteBackgroundDarkBright;
} else {
tk.FillColor = Config.Style.PaletteBackgroundDark;
}
tk.DrawRectangle (backgroundArea.Start, backgroundArea.Width, backgroundArea.Height);
/* Selection rectangle */
tk.LineWidth = 0;
tk.FillColor = color;
tk.DrawRectangle (selectPoint, StyleConf.ListSelectedWidth, backgroundArea.Height);
tk.FillColor = Config.Style.PaletteBackgroundDark;
tk.DrawCircle (circlePoint, (StyleConf.ListSelectedWidth / 2) - 1);
if (state.HasFlag (CellState.Selected)) {
tk.FillColor = Config.Style.PaletteBackground;
tk.FillColor = Config.Style.PaletteActive;
tk.DrawCircle (circlePoint, (StyleConf.ListSelectedWidth / 2) - 2);
}
if (desc != null) {
tk.FontSize = 10;
tk.FontWeight = FontWeight.Normal;
tk.StrokeColor = Config.Style.PaletteSelected;
tk.FontAlignment = FontAlignment.Left;
tk.DrawText (textPoint, textWidth, cellArea.Height, desc);
}
if (selected) {
if (EyeSurface == null) {
EyeSurface = Config.DrawingToolkit.CreateSurface (Path.Combine (Config.IconsDir, StyleConf.ListEyeIconPath));
}
tk.DrawSurface (EyeSurface, new Point (imagePoint.X - EyeSurface.Width - StyleConf.ListEyeIconOffset, imagePoint.Y + backgroundArea.Height / 2 - EyeSurface.Height / 2));
}
if (ss != null) {
tk.DrawImage (imagePoint, StyleConf.ListImageWidth, cellArea.Height, ss, true);
}
}