using System;
using System.Collections;
using System.ComponentModel;
using FastReport.Utils;
namespace FastReport
{
///
/// Base class for report pages and dialog forms.
///
public abstract partial class PageBase : ComponentBase
{
#region Fields
private string pageName;
private bool needRefresh;
private bool needModify;
#endregion
#region Properties
internal string PageName
{
get
{
if (!String.IsNullOrEmpty(pageName))
return pageName;
return Name;
//string pageName = Name;
//if (pageName.StartsWith(BaseName))
// pageName = pageName.Replace(BaseName, Res.Get("Objects," + ClassName));
//return pageName;
}
set { pageName = value; }
}
internal bool NeedRefresh
{
get { return needRefresh; }
set { needRefresh = value; }
}
internal bool NeedModify
{
get { return needModify; }
set { needModify = value; }
}
#endregion
#region Public Methods
///
/// Causes the page to refresh in the preview window.
///
///
/// Call this method when you handle object's MouseMove, MouseDown, MouseUp, MouseEnter, MouseLeave events
/// and want to refresh the preview window.
///
/// If you have changed some objects on a page, the Refresh method will not save the changes.
/// This means when you print or export the page, you will see original (unmodified) page content.
/// If you want to save the changes, you have to use the method instead.
///
///
public void Refresh()
{
needRefresh = true;
}
///
/// Modifies the page content and refresh it in the preview window.
///
///
/// Call this method when you handle object's Click, MouseDown or MouseUp events
/// and want to modify an object and refresh the preview window.
///
public void Modify()
{
needModify = true;
needRefresh = true;
}
#endregion
///
/// Initializes a new instance of the class with default settings.
///
public PageBase()
{
SetFlags(Flags.CanMove | Flags.CanResize | Flags.CanDelete | Flags.CanChangeOrder |
Flags.CanChangeParent | Flags.CanCopy, false);
}
}
}