using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace RadFormWithCallout
{
    public partial class ucNote : UserControl
    {

        public DialogResult Result
        {
            get; set;
        }

        public ucNote()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (!this.ValidateData())
            {
                return;
            }

            this.Result = DialogResult.OK;
            Telerik.WinControls.UI.RadFlyoutManager.Close();
        }

        private bool ValidateData()
        {
            if (string.IsNullOrWhiteSpace(txtNote.Text))
            {
                return false;
            }

            return true;
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Result = DialogResult.Cancel;
            Telerik.WinControls.UI.RadFlyoutManager.Close();
        }
    }
}
