using System;
using System.Drawing;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using DevExpress.XtraBars.Docking2010.Customization;
using DevExpress.XtraBars.Docking2010.Views.WindowsUI;
namespace TestProject
{
/// <summary>
/// 메인 폼
/// </summary>
public partial class MainForm : XtraForm
{
//////////////////////////////////////////////////////////////////////////////////////////////////// Constructor
////////////////////////////////////////////////////////////////////////////////////////// Public
#region 생성자 - MainForm()
/// <summary>
/// 생성자
/// </summary>
public MainForm()
{
InitializeComponent();
this.showFlyoutDialogButton.Click += showFlyoutDialogButton_Click;
}
#endregion
//////////////////////////////////////////////////////////////////////////////////////////////////// Method
////////////////////////////////////////////////////////////////////////////////////////// Private
//////////////////////////////////////////////////////////////////////////////// Event
#region 플라이아웃 대화 상자 표시 버튼 클릭시 처리하기 - showFlyoutDialogButton_Click(sender, e)
/// <summary>
/// 플라이아웃 대화 상자 표시 버튼 클릭시 처리하기
/// </summary>
/// <param name="sender">이벤트 발생자</param>
/// <param name="e">이벤트 인자</param>
private void showFlyoutDialogButton_Click(object sender, EventArgs e)
{
FlyoutAction flyoutAction = new FlyoutAction()
{
Caption = "CONFIRMATION",
Description = "작업을 중단하시겠습니까?"
};
Predicate<DialogResult> predicate = CheckStop;
FlyoutCommand stopCommand = new FlyoutCommand()
{
Text = "중단",
Result = DialogResult.Yes
};
FlyoutCommand cencelCommand = new FlyoutCommand()
{
Text = "취소",
Result = DialogResult.No
};
flyoutAction.Commands.Add(stopCommand );
flyoutAction.Commands.Add(cencelCommand);
FlyoutProperties flyoutProperties = new FlyoutProperties();
flyoutProperties.ButtonSize = new Size(100, 40);
flyoutProperties.Style = FlyoutStyle.MessageBox;
DialogResult result = FlyoutDialog.Show(this, flyoutAction, flyoutProperties, predicate);
if(result == DialogResult.Yes)
{
XtraMessageBox.Show(this, result.ToString(), "INFORMATION", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
#endregion
//////////////////////////////////////////////////////////////////////////////// Function
#region 중단 여부 체크하기 - CheckStop(result)
/// <summary>
/// 중단 여부 체크하기
/// </summary>
/// <param name="result">대화 상자 결과</param>
/// <returns>중단 여부</returns>
private static bool CheckStop(DialogResult result)
{
return result != DialogResult.Cancel;
}
#endregion
}
}