using System;
using System.Drawing; // Color object
namespace Standard
{
///
/// Persistent is a Singleton object used only by the Model.
/// Persistent is the Model object's repository of persistent data. No
/// object except the Model should directly access this object.
/// The Model object will serialize and deserialize Persistent as
/// needed. The contents of this object are stored in a SOAP-encoded
/// XML settings file on disk.
///
[Serializable()] public sealed class Persistent
{
static readonly Persistent instance=new Persistent();
// explicit static constructor causes C# compiler
// not to mark type as beforefieldinit, which means
// use lazy instantiation (construct only if really used)
static Persistent()
{
}
private Persistent()
{
}
public static Persistent GetInstance()
{
return instance;
}
//----------------- persistent properties ------------------------
private int myMainFormLeft = 100;
///
/// MainFormLeft is the location of the left side of the main form
///
public int MainFormLeft
{
get { return myMainFormLeft; }
set { myMainFormLeft = value; }
}
private int myMainFormTop = 100;
///
/// MainFormTop is the location of the top edge of the main form
///
public int MainFormTop
{
get { return myMainFormTop; }
set { myMainFormTop = value; }
}
private int myMainFormWidth = 500;
///
/// MainFormWidth is width of the main form
///
public int MainFormWidth
{
get { return myMainFormWidth; }
set { myMainFormWidth = value; }
}
private int myMainFormHeight = 400;
///
/// MainFormHeight is height of the main form
///
public int MainFormHeight
{
get { return myMainFormHeight; }
set { myMainFormHeight = value; }
}
private bool myMainFormMaximized = false;
///
/// MainFormMaximized is true is the main form should open maximized
///
public bool MainFormMaximized
{
get { return myMainFormMaximized; }
set { myMainFormMaximized = value; }
}
private Model.BgType myBackground = Model.BgType.Gradient;
///
/// Background is assigned one of the values from the
/// Model.BgType enumeration to designate whether the
/// form Backgrounds will be solid, gradient or an image.
///
public Model.BgType Background
{
get { return myBackground; }
set { myBackground = value; }
}
} // end class
} // end namespace