DarkRoomW.frmMain.txtPage_DragDrop C# (CSharp) Method

txtPage_DragDrop() private method

private txtPage_DragDrop ( object sender, System e ) : void
sender object
e System
return void
        private void txtPage_DragDrop(object sender, System.Windows.Forms.DragEventArgs e)
        {
            if (e.Data.GetDataPresent(DataFormats.FileDrop, false) == true)
            {
                string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);
                DialogResult UserResponse = new DialogResult();
                if (txtPage.Modified)
                {
                    UserResponse = ConfirmOverwrite();
                }
                if (txtPage.Modified & UserResponse == DialogResult.Cancel)
                {
                    return;
                }
                else if (txtPage.Modified & UserResponse == DialogResult.Yes)
                {
                    SaveFile();
                }

                OpenFile(files[0]);

                e.Data.SetData(null);
            }
        }