using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using System.ComponentModel;
namespace OSGeo.MapGuide.Viewer
{
///
/// Base class for views show by their associated instances
///
[ToolboxItem(false)]
public class MgControlView : UserControl
{
///
/// Gets or set the title to show if this view is shown in a new window
///
public virtual string Title { get; set; }
protected MgControlView() { this.ModalWindow = false; }
protected override void Dispose(bool disposing)
{
if (disposing)
{
SubCleanup();
}
base.Dispose(disposing);
}
protected virtual void SubCleanup() { }
///
/// Gets whether to show as a modal window if parent component chooses to show this component
/// in a new window. Only applies if parent component shows this component in a new window
///
public virtual bool ModalWindow { get; set; }
public IContentCloser Closer { get; set; }
///
/// Raises the event
///
protected void Close()
{
if (this.Closer != null)
this.Closer.Close();
}
private void InitializeComponent()
{
this.SuspendLayout();
//
// MgControlView
//
this.Name = "MgControlView";
this.ResumeLayout(false);
}
}
public interface IContentCloser
{
void Close();
}
}