//-----------------------------------------------------------------------
//
// Copyright © 2005-2006 Erik Tigerholm, 2013 Nils Hammar
//
//-----------------------------------------------------------------------
/*
* Copyright (c) 2005-2006 Erik Tigerholm
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
namespace OpenTraffic.Model
{
using System;
using System.IO;
using System.Xml.Serialization;
///
/// Possible image states.
///
[XmlType("VISIBLE")]
public enum IMAGE_STATES
{
///
/// Show image.
///
SHOW,
///
/// Hide image.
///
HIDE,
}
///
/// Background image data record.
///
[Serializable]
public class BackgroundImage
{
#region XmlExport
///
/// Gets or sets file name for image.
///
public string XmlExportFileName
{
get
{
return this.File.FullName;
}
set
{
this.File = new FileInfo(value);
}
}
///
/// Gets or sets image state.
///
[XmlAttribute(AttributeName = "State")]
public IMAGE_STATES State { get; set; }
///
/// Gets or sets minimum X position.
///
[XmlAttribute(AttributeName = "MinX")]
public float MinX { get; set; }
///
/// Gets or sets maximum X position.
///
[XmlAttribute(AttributeName = "MaxX")]
public float MaxX { get; set; }
///
/// Gets or sets maximum Y position.
///
[XmlAttribute(AttributeName = "MaxY")]
public float MaxY { get; set; }
#endregion
///
/// Gets name of image file.
///
[XmlIgnore]
public FileInfo File { get; set; }
///
/// Initializes a new instance of the class.
///
public BackgroundImage()
{
}
///
/// Initializes a new instance of the class.
///
/// Name of image file.
/// Minimum X position.
/// Maximum X position.
/// Maximum Y position.
/// Image State (SHOW/HIDE)
public BackgroundImage(FileInfo file, float minX, float maxX, float maxY, IMAGE_STATES imageState)
{
this.File = file;
this.MinX = minX;
this.MaxX = maxX;
this.MaxY = maxY;
this.State = imageState;
}
}
}