本文整理汇总了C#中UltravioletContext类的典型用法代码示例。如果您正苦于以下问题:C# UltravioletContext类的具体用法?C# UltravioletContext怎么用?C# UltravioletContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UltravioletContext类属于命名空间,在下文中一共展示了UltravioletContext类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: CreateCullNone
/// <summary>
/// Creates the CullNone rasterizer state.
/// </summary>
/// <param name="uv">The Ultraviolet context.</param>
/// <returns>The rasterizer state that was created.</returns>
public static OpenGLRasterizerState CreateCullNone(UltravioletContext uv)
{
var state = new OpenGLRasterizerState(uv);
state.CullMode = CullMode.None;
state.MakeImmutable();
return state;
}
开发者ID:RUSshy,项目名称:ultraviolet,代码行数:12,代码来源:OpenGLRasterizerState.cs
示例2: AdornerLayer
/// <summary>
/// Initializes a new instance of the <see cref="AdornerLayer"/> class.
/// </summary>
/// <param name="uv">The Ultraviolet context.</param>
/// <param name="name">The element's identifying name within its namescope.</param>
public AdornerLayer(UltravioletContext uv, String name)
: base(uv, name)
{
adorners = new VisualCollection(this);
adornersStates = new List<AdornerState>();
adornersTemp = new List<Adorner>();
}
开发者ID:prshreshtha,项目名称:ultraviolet,代码行数:12,代码来源:AdornerLayer.cs
示例3: Apply
/// <summary>
/// Applies the specified settings.
/// </summary>
/// <param name="uv">The Ultraviolet context.</param>
public void Apply(UltravioletContext uv)
{
if (Window != null)
{
Window.Apply(uv);
}
}
开发者ID:prshreshtha,项目名称:ultraviolet,代码行数:11,代码来源:UltravioletApplicationSettings.cs
示例4: OpenGLUltravioletPlatform
/// <summary>
/// Initializes a new instance of the OpenGLUltravioletPlatform class.
/// </summary>
/// <param name="uv">The Ultraviolet context.</param>
/// <param name="configuration">The Ultraviolet Framework configuration settings for the current context.</param>
public OpenGLUltravioletPlatform(UltravioletContext uv, OpenGLUltravioletConfiguration configuration)
: base(uv)
{
this.clipboard = new OpenGLUltravioletClipboardInfo();
this.windows = new OpenGLUltravioletWindowInfo(uv, configuration);
this.displays = new OpenGLUltravioletDisplayInfo();
}
开发者ID:RUSshy,项目名称:ultraviolet,代码行数:12,代码来源:OpenGLUltravioletPlatform.cs
示例5: Initialize
/// <inheritdoc/>
public override void Initialize(UltravioletContext uv, Object configuration)
{
var config = (PresentationFoundationConfiguration)configuration ?? new PresentationFoundationConfiguration();
var upf = uv.GetUI().GetPresentationFoundation();
upf.BindingExpressionCompilerAssemblyName = config.BindingExpressionCompilerAssembly;
}
开发者ID:RUSshy,项目名称:ultraviolet,代码行数:8,代码来源:PresentationFoundationInitializer.cs
示例6: CompileSingleView
/// <inheritdoc/>
public BindingExpressionCompilationResult CompileSingleView(UltravioletContext uv, BindingExpressionCompilerOptions options)
{
Contract.Require(options, "options");
if (String.IsNullOrEmpty(options.Input))
throw new ArgumentException(PresentationStrings.InvalidCompilerOptions);
var definition = CreateDataSourceDefinitionFromXml(options.RequestedViewModelNamespace, options.RequestedViewModelName, options.Input);
if (definition == null)
return BindingExpressionCompilationResult.CreateSucceeded();
var state = CreateCompilerState(uv, options);
var dataSourceWrapperInfo = GetDataSourceWrapperInfo(state, definition.Value);
var dataSourceWrapperInfos = new[] { dataSourceWrapperInfo };
var result = CompileViewModels(state, dataSourceWrapperInfos, null);
if (result.Succeeded)
{
options.Output = dataSourceWrapperInfos[0].DataSourceWrapperSourceCode;
}
else
{
DeleteWorkingDirectory(state);
}
return result;
}
开发者ID:prshreshtha,项目名称:ultraviolet,代码行数:28,代码来源:ExpressionCompiler.cs
示例7: OpenGLCursor
/// <summary>
/// Initializes a new instance of the OpenGLCursor class.
/// </summary>
/// <param name="uv">The UltravioletContext class.</param>
/// <param name="surface">The surface that contains the cursor image.</param>
/// <param name="hx">The x-coordinate of the cursor's hotspot.</param>
/// <param name="hy">The y-coordinate of the cursor's hotspot.</param>
public OpenGLCursor(UltravioletContext uv, Surface2D surface, Int32 hx, Int32 hy)
: base(uv)
{
Contract.Require(surface, "surface");
uv.ValidateResource(surface);
if (AreCursorsSupported(uv))
{
this.cursor = SDL.CreateColorCursor(((OpenGLSurface2D)surface).Native, hx, hy);
this.width = surface.Width;
this.height = surface.Height;
if (this.cursor == null)
{
this.width = 0;
this.height = 0;
}
}
else
{
this.cursor = null;
this.width = 0;
this.height = 0;
}
}
开发者ID:prshreshtha,项目名称:ultraviolet,代码行数:33,代码来源:OpenGLCursor.cs
示例8: InitWindows8_1
/// <summary>
/// Retrieves DPI information when running on Windows 8.1 and higher.
/// </summary>
private Boolean InitWindows8_1(UltravioletContext uv, IUltravioletDisplay display)
{
if (uv.Platform != UltravioletPlatform.Windows || Environment.OSVersion.Version < new Version(6, 3))
return false;
var rect = new Win32.RECT
{
left = display.Bounds.Left,
top = display.Bounds.Top,
right = display.Bounds.Right,
bottom = display.Bounds.Bottom
};
var hmonitor = IntPtr.Zero;
Win32.EnumDisplayMonitors(IntPtr.Zero, &rect, (hdc, lprcClip, lprcMonitor, dwData) =>
{
hmonitor = hdc;
return false;
}, IntPtr.Zero);
if (hmonitor == IntPtr.Zero)
return false;
UInt32 x, y;
Win32.GetDpiForMonitor(hmonitor, 0, out x, out y);
this.densityX = x;
this.densityY = y;
this.densityScale = x / 96f;
this.densityBucket = GuessBucketFromDensityScale(densityScale);
return true;
}
开发者ID:prshreshtha,项目名称:ultraviolet,代码行数:37,代码来源:DesktopScreenDensityService.cs
示例9: Deactivate
/// <inheritdoc/>
public override void Deactivate(UltravioletContext uv, DependencyObject dobj)
{
var element = dobj as UIElement;
if (element == null || element.View == null)
return;
if (selector == null)
{
var storyboard = element.View.FindStoryboard(storyboardName);
if (storyboard == null)
return;
storyboard.Stop(element);
}
else
{
var rooted = selector.PartCount == 0 ? false :
String.Equals(selector[0].PseudoClass, "trigger-root", StringComparison.InvariantCultureIgnoreCase);
var target = rooted ? dobj as UIElement : null;
element.View.Select(target, selector, this, (e, s) =>
{
var action = (PlayStoryboardTriggerAction)s;
var storyboard = e.View.FindStoryboard(action.storyboardName);
if (storyboard != null)
{
storyboard.Stop(e);
}
});
}
base.Deactivate(uv, dobj);
}
开发者ID:RUSshy,项目名称:ultraviolet,代码行数:34,代码来源:PlayStoryboardTriggerAction.cs
示例10: CustomCompositor
/// <summary>
/// Initializes a new instance of the <see cref="CustomCompositor"/> class.
/// </summary>
/// <param name="uv">The Ultraviolet context.</param>
/// <param name="window">The window with which this compositor is associated.</param>
public CustomCompositor(UltravioletContext uv, IUltravioletWindow window)
: base(uv, window)
{
rtScene = RenderTarget2D.Create(BufferWidth, BufferHeight);
rtSceneColor = RenderBuffer2D.Create(RenderBufferFormat.Color, BufferWidth, BufferHeight);
rtScene.Attach(rtSceneColor);
rtSceneDepthStencil = RenderBuffer2D.Create(RenderBufferFormat.Depth24Stencil8, BufferWidth, BufferHeight);
rtScene.Attach(rtSceneDepthStencil);
rtInterface = RenderTarget2D.Create(BufferWidth, BufferHeight);
rtInterfaceColor = RenderBuffer2D.Create(RenderBufferFormat.Color, BufferWidth, BufferHeight);
rtInterface.Attach(rtInterfaceColor);
rtInterfaceDepthStencil = RenderBuffer2D.Create(RenderBufferFormat.Depth24Stencil8, BufferWidth, BufferHeight);
rtInterface.Attach(rtInterfaceDepthStencil);
rtComposition = RenderTarget2D.Create(BufferWidth, BufferHeight, RenderTargetUsage.PreserveContents);
rtCompositionColor = RenderBuffer2D.Create(RenderBufferFormat.Color, BufferWidth, BufferHeight);
rtComposition.Attach(rtCompositionColor);
rtCompositionDepthStencil = RenderBuffer2D.Create(RenderBufferFormat.Depth24Stencil8, BufferWidth, BufferHeight);
rtComposition.Attach(rtCompositionDepthStencil);
spriteBatch = SpriteBatch.Create();
}
开发者ID:RUSshy,项目名称:ultraviolet,代码行数:34,代码来源:CustomCompositor.cs
示例11: Compositor
/// <summary>
/// Initializes a new instance of the <see cref="Compositor"/> class.
/// </summary>
/// <param name="uv">The Ultraviolet context.</param>
/// <param name="window">The window with which this compositor is associated.</param>
public Compositor(UltravioletContext uv, IUltravioletWindow window)
: base(uv)
{
Contract.Require(window, nameof(window));
this.window = window;
}
开发者ID:RUSshy,项目名称:ultraviolet,代码行数:12,代码来源:Compositor.cs
示例12: Activate
/// <summary>
/// Activates the actions in the collection, with the specified dependency object as their implicit target.
/// </summary>
/// <param name="uv">The Ultraviolet context.</param>
/// <param name="dobj">The dependency object which is the implicit target of the activated actions.</param>
internal void Activate(UltravioletContext uv, DependencyObject dobj)
{
foreach (var action in actions)
{
action.Activate(uv, dobj);
}
}
开发者ID:RUSshy,项目名称:ultraviolet,代码行数:12,代码来源:TriggerActionCollection.cs
示例13: DummyUltravioletPlatform
/// <summary>
/// Initializes a new instance of the <see cref="DummyUltravioletPlatform"/> class.
/// </summary>
/// <param name="uv">The Ultraviolet context.</param>
public DummyUltravioletPlatform(UltravioletContext uv)
: base(uv)
{
this.clipboard = new DummyUltravioletClipboardInfo();
this.windows = new DummyUltravioletWindowInfo();
this.displays = new DummyUltravioletDisplayInfo();
}
开发者ID:prshreshtha,项目名称:ultraviolet,代码行数:11,代码来源:DummyUltravioletPlatform.cs
示例14: Compile
/// <inheritdoc/>
public BindingExpressionCompilationResult Compile(UltravioletContext uv, BindingExpressionCompilerOptions options)
{
Contract.Require(uv, "uv");
Contract.Require(options, "options");
if (String.IsNullOrEmpty(options.Input) || String.IsNullOrEmpty(options.Output))
throw new ArgumentException(PresentationStrings.InvalidCompilerOptions);
var state = CreateCompilerState(uv, options);
var dataSourceWrapperInfos = GetDataSourceWrapperInfos(state, uv, options.Input);
var cacheFile = Path.ChangeExtension(options.Output, "cache");
var cacheNew = CompilerCache.FromDataSourceWrappers(dataSourceWrapperInfos);
if (File.Exists(options.Output))
{
var cacheOld = CompilerCache.TryFromFile(cacheFile);
if (cacheOld != null && !options.IgnoreCache && !cacheOld.IsDifferentFrom(cacheNew))
return BindingExpressionCompilationResult.CreateSucceeded();
}
var result = CompileViewModels(state, dataSourceWrapperInfos, options.Output);
if (result.Succeeded)
{
cacheNew.Save(cacheFile);
if (!options.WriteCompiledFilesToWorkingDirectory && !options.WorkInTemporaryDirectory)
DeleteWorkingDirectory(state);
}
if (options.WriteCompiledFilesToWorkingDirectory && !options.WorkInTemporaryDirectory)
WriteCompiledFilesToWorkingDirectory(state, dataSourceWrapperInfos);
return result;
}
开发者ID:prshreshtha,项目名称:ultraviolet,代码行数:35,代码来源:ExpressionCompiler.cs
示例15: OpenGLRenderTarget2D
/// <summary>
/// Initializes a new instance of the OpenGLRenderTarget2D class.
/// </summary>
/// <param name="uv">The Ultraviolet context.</param>
/// <param name="width">The render target's width in pixels.</param>
/// <param name="height">The render target's height in pixels.</param>
/// <param name="usage">A <see cref="RenderTargetUsage"/> value specifying whether the
/// render target's data is discarded or preserved when it is bound to the graphics device.</param>
/// <param name="buffers">The collection of render buffers to attach to the target.</param>
public OpenGLRenderTarget2D(UltravioletContext uv, Int32 width, Int32 height, RenderTargetUsage usage, IEnumerable<RenderBuffer2D> buffers = null)
: base(uv)
{
Contract.EnsureRange(width > 0, nameof(width));
Contract.EnsureRange(height > 0, nameof(height));
// NOTE: If we're in an older version of GLES, we need to use glFramebufferTexture2D()
glFramebufferTextureIsSupported = !gl.IsGLES || gl.IsVersionAtLeast(3, 2);
glDrawBuffersIsSupported = !gl.IsGLES2 || gl.IsExtensionSupported("GL_ARB_draw_buffers");
glDrawBufferIsSupported = !gl.IsGLES;
var framebuffer = 0u;
uv.QueueWorkItemAndWait(() =>
{
using (OpenGLState.ScopedCreateFramebuffer(out framebuffer))
{
if (buffers != null)
{
foreach (OpenGLRenderBuffer2D buffer in buffers)
{
AttachRenderBuffer(buffer);
}
}
}
});
this.width = width;
this.height = height;
this.framebuffer = framebuffer;
this.renderTargetUsage = usage;
}
开发者ID:RUSshy,项目名称:ultraviolet,代码行数:42,代码来源:OpenGLRenderTarget2D.cs
示例16: OutOfBandRenderer
/// <summary>
/// Initializes a new instance of the <see cref="OutOfBandRenderer"/> class.
/// </summary>
/// <param name="uv">The Ultraviolet context.</param>
public OutOfBandRenderer(UltravioletContext uv)
: base(uv)
{
this.spriteBatch = SpriteBatch.Create();
this.drawingContext = new DrawingContext();
this.drawingContext.SpriteBatch = spriteBatch;
}
开发者ID:RUSshy,项目名称:ultraviolet,代码行数:12,代码来源:OutOfBandRenderer.cs
示例17: OpenGLEffectPass
/// <summary>
/// Initializes a new instance of the OpenGLEffectPass class.
/// </summary>
/// <param name="uv">The Ultraviolet context.</param>
/// <param name="name">The effect pass' name.</param>
/// <param name="programs">The effect pass' collection of shader programs.</param>
public OpenGLEffectPass(UltravioletContext uv, String name, ICollection<OpenGLShaderProgram> programs)
: base(uv)
{
Contract.RequireNotEmpty(programs, "programs");
this.name = name ?? String.Empty;
this.programs = new OpenGLShaderProgramCollection(programs);
}
开发者ID:prshreshtha,项目名称:ultraviolet,代码行数:14,代码来源:OpenGLEffectPass.cs
示例18: FrameworkElement
/// <summary>
/// Initializes a new instance of the <see cref="FrameworkElement"/> class.
/// </summary>
/// <param name="uv">The Ultraviolet context.</param>
/// <param name="name">The identifying name of this element within its layout.</param>
public FrameworkElement(UltravioletContext uv, String name)
: base(uv)
{
this.name = name;
this.visualStateGroups = new VisualStateGroupCollection(this);
this.visualStateGroups.Create("focus", VSGFocus);
}
开发者ID:RUSshy,项目名称:ultraviolet,代码行数:13,代码来源:FrameworkElement.cs
示例19: RegisterProfiler
/// <summary>
/// Registers <see cref="dotTraceProfiler"/> as the profiler for the current Ultraviolet context.
/// </summary>
/// <param name="owner">The Ultraviolet context with which to register the profiler.</param>
/// <param name="factory">The Ultraviolet factory for the Ultraviolet context.</param>
/// <remarks>This method must be called during the application's initialization phase, before any
/// of the static methods on <see cref="UltravioletProfiler"/> have been invoked.</remarks>
public static void RegisterProfiler(UltravioletContext owner, UltravioletFactory factory)
{
Contract.Require(owner, "owner");
Contract.Require(factory, "factory");
factory.RemoveFactoryMethod<UltravioletProfilerFactory>();
factory.SetFactoryMethod<UltravioletProfilerFactory>(uv => new dotTraceProfiler(uv));
}
开发者ID:prshreshtha,项目名称:ultraviolet,代码行数:15,代码来源:dotTraceProfiler.cs
示例20: OpenGLSurface2D
/// <summary>
/// Initializes a new instance of the OpenGLSurface2D class.
/// </summary>
/// <param name="uv">The Ultraviolet context.</param>
/// <param name="width">The width of the surface in pixels.</param>
/// <param name="height">The height of the surface in pixels.</param>
public OpenGLSurface2D(UltravioletContext uv, Int32 width, Int32 height)
: base(uv)
{
Contract.EnsureRange(width > 0, "width");
Contract.EnsureRange(height > 0, "height");
this.nativesurf = new SDL_Surface(width, height);
}
开发者ID:prshreshtha,项目名称:ultraviolet,代码行数:14,代码来源:OpenGLSurface2D.cs
注:本文中的UltravioletContext类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论