DeviceTests ToggleFullscreenModeWithSpaceKey Method Delta Engine Documentation

Namespace: DeltaEngine.Graphics.Tests
Assembly: DeltaEngine.Graphics.Tests (in DeltaEngine.Graphics.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public void ToggleFullscreenModeWithSpaceKey()
Examples

[Test]
public void ToggleFullscreenModeWithSpaceKey()
{
    var window = Resolve<Window>();
    window.BackgroundColor = Color.Red;
    bool fullscreen = false;
    var screenSize = GetScreenSize();
    //ncrunch: no coverage start 
    new Command(() =>
    {
        if (fullscreen)
            window.SetWindowed();
        else
            window.SetFullscreen(screenSize);
        fullscreen = !fullscreen;
    }).Add(new KeyTrigger(Key.Space));
    //ncrunch: no coverage end
}
See Also