예제 #1
0
        public virtual void AddFiles()
        {
            // dataGridView1.DataSource = null;
            var ofd = new OpenFileDialog();

            ofd.Multiselect = true;
            if (ofd.ShowDialog(this) == DialogResult.OK)
            {
                using (Suspender.ShowSandTimerAndSuspend(this))
                {
                    Project.AddFiles(ofd.FileNames);
                    FillList();
                }
            }
        }
예제 #2
0
        /// <summary>
        /// Called when a file is dropped in the project window
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Windows.Forms.DragEventArgs"/> instance containing the event data.</param>
        protected virtual void ProjectWindow_DragDrop(object sender, DragEventArgs e)
        {
            string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);
            try
            {
                using (Suspender.ShowSandTimerAndSuspend(this))
                {
                    Project.AddFiles(files);
                }
            }
            catch (Exception ex)
            {
                MainWindow.Instance.ShowError(ex);
            }

            FillList();
        }