Example #1
0
        private Control GetForm()
        {
            Control parent = Parent;

            while (parent != null)
            {
                if (parent is Form)
                {
                    break;
                }
                parent = parent.Parent;
            }
            try
            {
                if (parent != null)
                {
                    return(parent);
                }
            }
            catch (Exception ex)
            {
                OkMessageBox.ShowError(ex.ToString());
            }
            return(null);
        }
Example #2
0
 private void tsbDelete_Click_1(object sender, EventArgs e)
 {
     OkMessageBox.Ask("Are you sure want to delete?");
     if (!OkMessageBox.IsProcedd)
     {
         return;
     }
     if (OkDeleteButtonClicked != null)
     {
         OkDeleteButtonClicked(sender, e);
     }
 }
Example #3
0
        public static void Show(OkNewResult result)
        {
            OkMessageBox box;

            switch (result.OpType)
            {
            case OpType.Successful:
                box = new OkMessageBox(result.Message, BoxType.Success);
                box.ShowDialog();
                break;

            case OpType.UserError:
                box = new OkMessageBox(result.Message, BoxType.Warning);
                box.ShowDialog();
                break;

            case OpType.SystemError:
                box = new OkMessageBox(result.Message, BoxType.SystemError, result.Exception);
                box.ShowDialog();
                break;
            }
        }
Example #4
0
        public static void Ask(string message)
        {
            OkMessageBox box = new OkMessageBox(message, BoxType.Question);

            box.ShowDialog();
        }
Example #5
0
        public static void ShowError(string message)
        {
            OkMessageBox box = new OkMessageBox(message, BoxType.Warning);

            box.ShowDialog();
        }