Esempio n. 1
0
        void OnDropFiles(IntPtr hDrop)
        {
            var filenames = new List <string>();
            int count     = Shell32.DragQueryFile(hDrop, 0xFFFFFFFF, null, 0);

            for (uint i = 0; i < count; i++)
            {
                var sb = new StringBuilder(256);
                if (Shell32.DragQueryFile(hDrop, i, sb, (uint)sb.Capacity) > 0)
                {
                    filenames.Add(sb.ToString());
                }
            }

            Shell32.DragFinish(hDrop);

            //
            var pt = this.PointToClient(Control.MousePosition);
            var de = new DropFilesEventArgs(filenames.ToArray(), pt);

            this.PostDropFiles(de);
            if (de.Handled)
            {
                return;
            }

            if (filenames.Count > 0)
            {
                OpenDocuments(filenames.ToArray());
            }
        }
Esempio n. 2
0
        public void OnFilesDrop(DropFilesEventArgs e)
        {
            if (ReadOnly)
            {
                return;
            }

            var topic = this.GetTopicAt(e.MousePosition.X, e.MousePosition.Y);

            if (topic != null)
            {
                if (MenuDropFiles == null)
                {
                    InitializeDropFilesMenu();
                }

                DropFilesTopic         = topic;
                DropFileNames          = e.FileNames;
                MenuDropFiles.Renderer = UITheme.Default.ToolStripRenderer;
                MenuDropFiles.Show(this, e.MousePosition, ToolStripDropDownDirection.BelowRight);
                e.Handled = true;
            }
        }
Esempio n. 3
0
 static void dlg_CBDropFiles(object sender, DropFilesEventArgs e)
 {
 }