Example #1
0
        /// <summary>
        /// Return Full qualified class name of Controls
        /// </summary>
        /// <param name="enm"></param>
        /// <returns></returns>
        public static string CheckControlType(enmDataType enm)
        {
            string strReturn = "";

            switch (enm)
            {
            case enmDataType.TextBox:
                strReturn = "System.Windows.Forms.TextBox";
                break;

            case enmDataType.ComboBox:
                strReturn = "System.Windows.Forms.ComboBox";
                break;

            case enmDataType.CheckBox:
                strReturn = "System.Windows.Forms.CheckBox";
                break;

            case enmDataType.DateTimePicker:
                strReturn = "System.Windows.Forms.DateTimePicker";
                break;

            case enmDataType.Button:
                strReturn = "System.Windows.Forms.Button";
                break;

            case enmDataType.Label:
                strReturn = "System.Windows.Forms.Label";
                break;

            default:
                break;
            }
            return(strReturn);
        }
Example #2
0
        /// <summary>
        /// User dropped a file into a empty window
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Form_DragDrop(object sender, DragEventArgs e)
        {
            var s = (string[])e.Data.GetData(DataFormats.FileDrop, false);

            if (s.Length > 1)
            {
                MessageBox.Show("Only one file at a time!", "One file please...",
                                MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else
            {
                var fExt          = Path.GetExtension(s[0]);
                var fileTypeError = string.IsNullOrEmpty(fExt);

                if (!fileTypeError)
                {
                    if (fExt.Equals(".dnt", StringComparison.CurrentCultureIgnoreCase))
                    {
                        OpenSessionCheckExisting(s[0], USE_THREADED_LOAD);
                    }
                    else if (fExt.Equals(".csv", StringComparison.CurrentCultureIgnoreCase))
                    {
                        mDataSetType = enmDataType.ESET;

                        OpenExpressionFile(s[0]);
                    }
                    else
                    {
                        fileTypeError = true;
                    }
                }

                if (fileTypeError)
                {
                    MessageBox.Show("Only .dnt or .csv files can be opened via drag/drop here", "Unsupported file type",
                                    MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
        }
Example #3
0
        /// <summary>
        /// User dropped a file into a empty window
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Form_DragDrop(object sender, DragEventArgs e)
        {
            var s = (string[])e.Data.GetData(DataFormats.FileDrop, false);

            if (s.Length > 1)
                MessageBox.Show("Only one file at a time!", "One file please...",
                    MessageBoxButtons.OK, MessageBoxIcon.Warning);
            else
            {
                var fExt = Path.GetExtension(s[0]);
                var fileTypeError = string.IsNullOrEmpty(fExt);

                if (!fileTypeError)
                {
                    if (fExt.Equals(".dnt", StringComparison.CurrentCultureIgnoreCase))
                    {
                        OpenSessionCheckExisting(s[0], USE_THREADED_LOAD);
                    }
                    else if (fExt.Equals(".csv", StringComparison.CurrentCultureIgnoreCase))
                    {
                        mDataSetType = enmDataType.ESET;

                        OpenExpressionFile(s[0]);

                    }
                    else
                    {
                        fileTypeError = true;
                    }
                }

                if (fileTypeError)
                {
                    MessageBox.Show("Only .dnt or .csv files can be opened via drag/drop here", "Unsupported file type",
                                    MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
        }