/*
* Copyright (c) 2009 Craig Sutherland
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*/
namespace FastForward.Monitor
{
using System.Collections.Generic;
using System.Xml.Serialization;
using FastForward.WinCore.Configuration;
///
/// The configuration for the UI side of the application.
///
public class MonitorDisplayConfig
: WindowConfig
{
#region Constructors
///
/// Initialise a new .
///
public MonitorDisplayConfig()
{
ShowExplorer = true;
GroupByServer = true;
ListViews = new List();
Tabs = new List();
ShowInTaskBar = true;
}
#endregion
#region Public properties
#region ShowExplorer
///
/// Should the monitor explorer be displayed on start-up.
///
[XmlAttribute]
public bool ShowExplorer { get; set; }
#endregion
#region GroupByServer
///
/// Should the lists be grouped by server.
///
[XmlAttribute]
public bool GroupByServer { get; set; }
#endregion
#region ShowInTaskBar
///
/// Should the monitor be visible in the taskbar.
///
[XmlAttribute]
public bool ShowInTaskBar { get; set; }
#endregion
#region AlwaysOnTop
///
/// Should the monitor be always on top.
///
[XmlAttribute]
public bool AlwaysOnTop { get; set; }
#endregion
#region ListViews
///
/// The configuration for the list views.
///
[XmlElement("ListView")]
public List ListViews { get; set; }
#endregion
#region Tabs
///
/// Gets or sets the tabs for the display.
///
[XmlElement("Tab")]
public List Tabs { get; set; }
#endregion
#region AllProjectsDoubleClickAction
///
/// Gets or sets the action to perform on a double-click in the all projects view.
///
[XmlAttribute]
public string AllProjectsDoubleClickAction { get; set; }
#endregion
#endregion
#region Public methods
#region FindListView()
///
/// Find the configuration for a list view.
///
/// The key of the view.
///
public ListViewDisplayConfig FindListView(string key)
{
ListViewDisplayConfig value = null;
foreach (var view in ListViews)
{
if (view.Key == key)
{
value = view;
break;
}
}
return value;
}
#endregion
#region Clone()
///
/// Clones this configuration.
///
///
public new MonitorDisplayConfig Clone()
{
var clone = new MonitorDisplayConfig
{
AllProjectsDoubleClickAction = this.AllProjectsDoubleClickAction,
AlwaysOnTop = this.AlwaysOnTop,
GroupByServer = this.GroupByServer,
Height = this.Height,
Left = this.Left,
ShowExplorer = this.ShowExplorer,
ShowInTaskBar = this.ShowInTaskBar,
State = this.State,
Top = this.Top,
Width = this.Width
};
foreach (var listView in ListViews)
{
clone.ListViews.Add(listView.Clone());
}
foreach (var tab in Tabs)
{
clone.Tabs.Add(tab.Clone());
}
return clone;
}
#endregion
#endregion
}
}