using System;
using DevExpress.XtraReports.UserDesigner;

namespace RibbonReportDesigner {
    public partial class MainForm : MainFormBase {
        public MainForm() {
            InitializeComponent();
        }
        public override XRDesignPanel ActiveXRDesignPanel {
            get { return reportDesigner1.ActiveDesignPanel; }
        }
        public override void OpenReport(DevExpress.XtraReports.UI.XtraReport newReport) {
            reportDesigner1.OpenReport(newReport);
        }

        public void CreateNewReport() {
            reportDesigner1.CreateNewReport();
        }

        public void HandleCommand(ReportCommand command, object[] args)
        {

        }

        public bool CanHandleCommand(ReportCommand command, ref bool useNextHandler)
        {
            switch (command)
            {
                case ReportCommand.SaveFile:
                    useNextHandler = false;
                    return true;
                default:
                    useNextHandler = true;
                    return false;
            }
        }
    }
}
