本文整理汇总了C#中BackgroundType类的典型用法代码示例。如果您正苦于以下问题:C# BackgroundType类的具体用法?C# BackgroundType怎么用?C# BackgroundType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BackgroundType类属于命名空间,在下文中一共展示了BackgroundType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetImage
public static ImageSource GetImage(string name, BackgroundType bgType)
{
try {
return ImageCache.Instance.GetImageUsingUri("pack://application:,,,/ILSpy.Debugger.Plugin;component/Images/" + name + ".png", bgType);
}
catch {
// resource not found
return null;
}
}
示例2: Background
public Background(BackgroundType type)
{
_type = type;
_textures = new Texture[MAX_LAYERS];
_movementFactors = new Vector2f[MAX_LAYERS];
_shapes = new RectangleShape[MAX_LAYERS];
for (int i = 0; i < MAX_LAYERS; i++)
{
_shapes[i] = new RectangleShape();
}
}
示例3: InitializeMenuItem
public static void InitializeMenuItem(IList<BreakpointBookmark> bpms, MenuItem menuItem, BackgroundType bgType)
{
menuItem.IsEnabled = bpms.Count > 0;
if (bpms.IsEnabled()) {
menuItem.Header = bpms.Count <= 1 ? "_Disable Breakpoint" : "_Disable Breakpoints";
menuItem.Icon = ImageService.LoadImage(ImageService.GetImage("DisableEnableBreakpoint", bgType), 16, 16);
}
else {
menuItem.Header = bpms.Count <= 1 ? "Enab_le Breakpoint" : "Enab_le Breakpoints";
menuItem.Icon = ImageService.LoadImage(ImageService.GetImage("DisableEnableBreakpoint", bgType), 16, 16);
}
}
示例4: GetBackgroundTypeString
private string GetBackgroundTypeString(BackgroundType type)
{
switch (type)
{
case BackgroundType.HorizontalGradient:
return "Horizontal Gradient";
case BackgroundType.VerticalGradient:
return "Vertical Gradient";
case BackgroundType.Image:
return "Image";
default:
return "Solid Color";
}
}
示例5: ScreenshotTask
public ScreenshotTask(IntPtr window, bool clipboard, string file,
bool resize, int resizeX, int resizeY,
BackgroundType backType, Color backColour,
int checkerSize, bool mouse) {
WindowHandle = window;
ClipboardNotDisk = clipboard;
DiskSaveDirectory = file;
DoResize = resize;
ResizeX = resizeX;
ResizeY = resizeY;
Background = backType;
BackgroundColour = backColour;
CheckerboardSize = checkerSize;
CaptureMouse = mouse;
}
示例6: Background
public Background(Game game, BackgroundType backgroundType)
: base(game)
{
string textureName = "";
switch (backgroundType)
{
case BackgroundType.Grass:
default:
textureName = "grass";
break;
}
var texturePath = "Resources/Battlesystem/background" + textureName;
LoadContent(texturePath);
}
示例7: ResetToDefaultConfiguration
public virtual void ResetToDefaultConfiguration()
{
horizontalContentAlignment = AlignmentHorizontal.Left;
verticalContentAlignment = AlignmentVertical.Top;
horizontalContentOffset = 0;
verticalContentOffset = 0;
depth = 1;
constrainToBounds = false;
backgroundType = BackgroundType.SolidColor;
backgroundColor = Color.white;
backgroundImage = null;
backgroundImageStyle = "RoundedBackground";
extendedBackgroundWidth = 0;
extendedBackgroundHeight = 0;
}
示例8: ColourConfiguration
public ColourConfiguration(ColourConfiguration config)
{
this.cycleColour = config.getCycleColour ();
//this.currentColour
this.cycle = config.getCycle ();
this.pulseCount = config.getPulseCount ();
//this.pulseLength
this.pulse = config.getPulse ();
this.pulseSpeed = config.getPulseSpeed ();
//this.pulseSpeedCount
this.fadeColour = config.getFadeColour ();
this.baseRed = config.getBaseRed ();
this.baseGreen = config.getBaseGreen ();
this.baseBlue = config.getBaseBlue ();
this.backgroundType = config.getBackgroundType ();
}
示例9: NewImageDialog
public NewImageDialog (int initialWidth, int initialHeight, BackgroundType initial_bg_type, bool isClipboardSize)
: base (string.Empty, PintaCore.Chrome.MainWindow, DialogFlags.Modal, Gtk.Stock.Cancel, Gtk.ResponseType.Cancel, Gtk.Stock.Ok, Gtk.ResponseType.Ok)
{
Title = Catalog.GetString ("New Image");
WindowPosition = Gtk.WindowPosition.CenterOnParent;
// We don't show the background color option if it's the same as "White"
allow_background_color = PintaCore.Palette.SecondaryColor.ToColorBgra () != ColorBgra.White;
BorderWidth = 4;
VBox.Spacing = 4;
Resizable = false;
DefaultResponse = ResponseType.Ok;
Icon = PintaCore.Resources.GetIcon (Stock.New, 16);
AlternativeButtonOrder = new int[] { (int)ResponseType.Ok, (int)ResponseType.Cancel };
has_clipboard = isClipboardSize;
clipboard_size = new Gdk.Size (initialWidth, initialHeight);
InitializePresets ();
BuildDialog ();
if (initial_bg_type == BackgroundType.SecondaryColor && allow_background_color)
secondary_bg_radio.Active = true;
else if (initial_bg_type == BackgroundType.Transparent)
trans_bg_radio.Active = true;
else
white_bg_radio.Active = true;
width_entry.Text = initialWidth.ToString ();
height_entry.Text = initialHeight.ToString ();
width_entry.GrabFocus ();
width_entry.SelectRegion (0, width_entry.Text.Length);
WireUpEvents ();
UpdateOrientation ();
UpdatePresetSelection ();
preview.Update (NewImageSize, NewImageBackground);
}
示例10: ScreenshotTask
public ScreenshotTask(IntPtr window, bool clipboard, string file,
bool resize, int resizeX, int resizeY,
BackgroundType backType, Color backColor,
int checkerSize, bool customGlass, Color aeroColor,
bool mouse, bool clearType, bool shadow)
{
WindowHandle = window;
ClipboardNotDisk = clipboard;
DiskSaveDirectory = file;
DoResize = resize;
ResizeX = resizeX;
ResizeY = resizeY;
Background = backType;
BackgroundColor = backColor;
CheckerboardSize = checkerSize;
CustomGlass = customGlass;
AeroColor = aeroColor;
CaptureMouse = mouse;
DisableClearType = clearType;
DisableShadow = shadow;
}
示例11: GetColor
public static Color GetColor(BackgroundType bgType) {
switch (bgType) {
case BackgroundType.Button: return GetColorBackground(dntheme.ColorType.CommonControlsButtonIconBackground);
case BackgroundType.TextEditor: return GetColorBackground(dntheme.ColorType.DefaultText);
case BackgroundType.DialogWindow: return GetColorBackground(dntheme.ColorType.DialogWindow);
case BackgroundType.TextBox: return GetColorBackground(dntheme.ColorType.CommonControlsTextBox);
case BackgroundType.TreeNode: return GetColorBackground(dntheme.ColorType.TreeView);
case BackgroundType.Search: return GetColorBackground(dntheme.ColorType.ListBoxBackground);
case BackgroundType.ComboBox: return GetColorBackground(dntheme.ColorType.CommonControlsComboBoxBackground);
case BackgroundType.Toolbar: return GetColorBackground(dntheme.ColorType.ToolBarIconBackground);
case BackgroundType.ToolBarButtonChecked: return GetColorBackground(dntheme.ColorType.ToolBarButtonChecked);
case BackgroundType.MainMenuMenuItem: return GetColorBackground(dntheme.ColorType.ToolBarIconVerticalBackground);
case BackgroundType.ContextMenuItem: return GetColorBackground(dntheme.ColorType.ContextMenuRectangleFill);
case BackgroundType.GridViewItem: return GetColorBackground(dntheme.ColorType.GridViewBackground);
case BackgroundType.CodeToolTip: return GetColorBackground(dntheme.ColorType.CodeToolTip);
case BackgroundType.TitleAreaActive: return GetColorBackground(dntheme.ColorType.EnvironmentMainWindowActiveCaption);
case BackgroundType.TitleAreaInactive: return GetColorBackground(dntheme.ColorType.EnvironmentMainWindowInactiveCaption);
default:
Debug.Fail("Invalid bg type");
return GetColorBackground(dntheme.ColorType.SystemColorsWindow);
}
}
示例12: GetBackgroundAndType
protected static string GetBackgroundAndType(IDictionary<string, string> attributes, out BackgroundType type)
{
type = BackgroundType.None;
string result = null;
foreach (KeyValuePair<string, string> attribute in attributes)
{
if (type != BackgroundType.None)
throw new ArgumentException("Background builder: Only one of the attributes 'StaticScreen', 'RemoveBackground' and 'BackgroundManagerClassName' must be set");
if (attribute.Key == "StaticScreen")
{
type = BackgroundType.Static;
result = attribute.Value;
}
else if (attribute.Key == "BackgroundManagerClassName")
{
type = BackgroundType.Manager;
result = attribute.Value;
}
}
if (type == BackgroundType.None)
throw new ArgumentException("Background builder needs one of the attributes 'StaticScreen', 'RemoveBackground' or 'BackgroundManagerClassName'");
return result;
}
示例13: GetImageInfo
internal static ImageInfo GetImageInfo(TypeIcon typeIcon, BackgroundType bgType)
{
switch (typeIcon) {
case TypeIcon.StaticClass: return new ImageInfo("StaticClass", bgType);
case TypeIcon.Class: return new ImageInfo("Class", bgType);
case TypeIcon.ClassPrivate: return new ImageInfo("ClassPrivate", bgType);
case TypeIcon.ClassProtected: return new ImageInfo("ClassProtected", bgType);
case TypeIcon.ClassInternal: return new ImageInfo("ClassInternal", bgType);
case TypeIcon.ClassProtectedInternal: return new ImageInfo("ClassProtectedInternal", bgType);
case TypeIcon.Enum: return new ImageInfo("Enum", bgType);
case TypeIcon.EnumPrivate: return new ImageInfo("EnumPrivate", bgType);
case TypeIcon.EnumProtected: return new ImageInfo("EnumProtected", bgType);
case TypeIcon.EnumInternal: return new ImageInfo("EnumInternal", bgType);
case TypeIcon.EnumProtectedInternal: return new ImageInfo("EnumProtectedInternal", bgType);
case TypeIcon.Struct: return new ImageInfo("Struct", bgType);
case TypeIcon.StructPrivate: return new ImageInfo("StructPrivate", bgType);
case TypeIcon.StructProtected: return new ImageInfo("StructProtected", bgType);
case TypeIcon.StructInternal: return new ImageInfo("StructInternal", bgType);
case TypeIcon.StructProtectedInternal: return new ImageInfo("StructProtectedInternal", bgType);
case TypeIcon.Interface: return new ImageInfo("Interface", bgType);
case TypeIcon.InterfacePrivate: return new ImageInfo("InterfacePrivate", bgType);
case TypeIcon.InterfaceProtected: return new ImageInfo("InterfaceProtected", bgType);
case TypeIcon.InterfaceInternal: return new ImageInfo("InterfaceInternal", bgType);
case TypeIcon.InterfaceProtectedInternal:return new ImageInfo("InterfaceProtectedInternal", bgType);
case TypeIcon.Delegate: return new ImageInfo("Delegate", bgType);
case TypeIcon.DelegatePrivate: return new ImageInfo("DelegatePrivate", bgType);
case TypeIcon.DelegateProtected: return new ImageInfo("DelegateProtected", bgType);
case TypeIcon.DelegateInternal: return new ImageInfo("DelegateInternal", bgType);
case TypeIcon.DelegateProtectedInternal:return new ImageInfo("DelegateProtectedInternal", bgType);
case TypeIcon.Exception: return new ImageInfo("Exception", bgType);
case TypeIcon.ExceptionPrivate: return new ImageInfo("ExceptionPrivate", bgType);
case TypeIcon.ExceptionProtected: return new ImageInfo("ExceptionProtected", bgType);
case TypeIcon.ExceptionInternal: return new ImageInfo("ExceptionInternal", bgType);
case TypeIcon.ExceptionProtectedInternal:return new ImageInfo("ExceptionProtectedInternal", bgType);
case TypeIcon.Generic: return new ImageInfo("Generic", bgType);
case TypeIcon.GenericPrivate: return new ImageInfo("GenericPrivate", bgType);
case TypeIcon.GenericProtected: return new ImageInfo("GenericProtected", bgType);
case TypeIcon.GenericInternal: return new ImageInfo("GenericInternal", bgType);
case TypeIcon.GenericProtectedInternal: return new ImageInfo("GenericProtectedInternal", bgType);
default:
Debug.Fail("Unknown type");
goto case TypeIcon.Class;
}
}
示例14: GetIcon
internal static ImageSource GetIcon(TypeIcon typeIcon, BackgroundType bgType)
{
return ImageCache.Instance.GetImage(GetImageInfo(typeIcon, bgType));
}
示例15: MonitorPage
//.........这里部分代码省略.........
if (pageHandlerMethod == null)
{
if (node.HasValue("text"))
{
text = JUtil.LoadPageDefinition(node.GetValue("text"));
isMutable |= text.IndexOf("$&$", StringComparison.Ordinal) != -1;
}
}
if (node.HasValue("textOverlay"))
{
textOverlayBuffer = JUtil.LoadPageDefinition(node.GetValue("textOverlay")).Split(JUtil.LineSeparator, StringSplitOptions.None);
}
foreach (ConfigNode handlerNode in node.GetNodes("BACKGROUNDHANDLER"))
{
MonoBehaviour handlerModule;
HandlerSupportMethods supportMethods;
MethodInfo handlerMethod = InstantiateHandler(handlerNode, ourMonitor, out handlerModule, out supportMethods);
if (handlerMethod != null && handlerModule != null)
{
try
{
backgroundHandlerMethod = (Func<RenderTexture, float, bool>)Delegate.CreateDelegate(typeof(Func<RenderTexture, float, bool>), handlerModule, handlerMethod);
}
catch
{
JUtil.LogErrorMessage(ourMonitor, "Incorrect signature for the background handler method {0}", handlerModule.name);
break;
}
backgroundHandlerS = supportMethods;
isMutable = true;
showNoSignal = node.HasValue("showNoSignal");
background = BackgroundType.Handler;
backgroundHandlerModule = handlerModule;
break;
}
}
if (background == BackgroundType.None)
{
if (node.HasValue("cameraTransform"))
{
isMutable = true;
background = BackgroundType.Camera;
camera = node.GetValue("cameraTransform");
cameraFOV = defaultFOV;
cameraFlickerChance = node.GetFloat("flickerChance") ?? 0;
cameraFlickerRange = node.GetInt("flickerRange") ?? 0;
if (node.HasValue("fov"))
{
float fov;
cameraFOV = float.TryParse(node.GetValue("fov"), out fov) ? fov : defaultFOV;
}
else if (node.HasValue("zoomFov") && node.HasValue("zoomButtons"))
{
Vector3 zoomFov = ConfigNode.ParseVector3(node.GetValue("zoomFov"));
Vector2 zoomButtons = ConfigNode.ParseVector2(node.GetValue("zoomButtons"));
if ((int)zoomFov.z != 0 && ((int)zoomButtons.x != (int)zoomButtons.y))
{
maxFOV = Math.Max(zoomFov.x, zoomFov.y);
minFOV = Math.Min(zoomFov.x, zoomFov.y);
zoomSteps = (int)zoomFov.z;
zoomUpButton = (int)zoomButtons.x;