SND\AstrorEnales_cp 5505f7dcbf - Added PlatformSystem Plugins layer
- Started Windows, Metro and Linux Platform-Plugins
- Moved the RecordingSample to the Samples folder
- Started two samples for using the graphics device in a WinForms and Wpf Editor
- Refactorings in the AddIn-System
- Moved the Window initialization-code to the Platform modules
- Changed the License text in all code files which is now way smaller
- Started ProjectConverter tool which converts all the projects and solution to the target configuration
- Changed the SupportedPlatform names in the Resource files
- Changed the WIN8 define to WINDOWSMETRO which is actually meant
- Removed NLog and started our own Logger class
- Many more stuff...
2012-08-09 09:45:04 +00:00

162 lines
3.1 KiB
C#

using System;
// This file is part of the ANX.Framework created by the
// "ANX.Framework developer group" and released under the Ms-PL license.
// For details see: http://anxframework.codeplex.com/license
namespace ANX.Framework
{
public abstract class GameWindow
{
#region Private
private string title;
#endregion
#region Events
public event EventHandler<EventArgs> Activated;
public event EventHandler<EventArgs> ClientSizeChanged;
public event EventHandler<EventArgs> Deactivated;
public event EventHandler<EventArgs> OrientationChanged;
public event EventHandler<EventArgs> Paint;
public event EventHandler<EventArgs> ScreenDeviceNameChanged;
#endregion
#region Public
#region Title
public string Title
{
get
{
return this.title;
}
set
{
if (String.IsNullOrEmpty(value))
{
throw new ArgumentNullException();
}
if (value != this.title)
{
this.title = value;
SetTitle(value);
}
}
}
#endregion
public abstract bool AllowUserResizing
{
get;
set;
}
public abstract Rectangle ClientBounds
{
get;
}
public abstract string ScreenDeviceName
{
get;
}
public abstract DisplayOrientation CurrentOrientation
{
get;
}
public abstract IntPtr Handle
{
get;
}
public abstract bool IsMinimized
{
get;
}
#endregion
#region BeginScreenDeviceChange (abstract)
public abstract void BeginScreenDeviceChange(bool willBeFullScreen);
#endregion
#region EndScreenDeviceChange
public void EndScreenDeviceChange(string screenDeviceName)
{
EndScreenDeviceChange(screenDeviceName, ClientBounds.Width,
ClientBounds.Height);
}
#endregion
#region EndScreenDeviceChange (abstract)
public abstract void EndScreenDeviceChange(string screenDeviceName,
int clientWidth, int clientHeight);
#endregion
#region SetTitle (abstract)
protected abstract void SetTitle(string title);
#endregion
#region OnActivated
protected void OnActivated()
{
if (Activated != null)
{
Activated(this, EventArgs.Empty);
}
}
#endregion
#region OnDeactivated
protected void OnDeactivated()
{
if (Deactivated != null)
{
Deactivated(this, EventArgs.Empty);
}
}
#endregion
#region OnOrientationChanged
protected void OnOrientationChanged()
{
if (OrientationChanged != null)
{
OrientationChanged(this, EventArgs.Empty);
}
}
#endregion
#region OnPaint
protected void OnPaint()
{
if (Paint != null)
{
Paint(this, EventArgs.Empty);
}
}
#endregion
#region OnScreenDeviceNameChanged
protected void OnScreenDeviceNameChanged()
{
if (ScreenDeviceNameChanged != null)
{
ScreenDeviceNameChanged(this, EventArgs.Empty);
}
}
#endregion
#region OnClientSizeChanged
protected void OnClientSizeChanged()
{
if (ClientSizeChanged != null)
{
ClientSizeChanged(this, EventArgs.Empty);
}
}
#endregion
}
}