Exemple #1
0
        /// <summary>
        /// Обработчик события, создаёт контекстное меню проводника для выделенных элементов
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void lvFileList_PreviewMouseRightButtonDown(object sender, MouseButtonEventArgs e)
        {
            ListView lstFiles = (ListView)sender;
            var      selItems = lstFiles.SelectedItems;

            //List<System.IO.FileSystemInfoEx> list = new List<FileSystemInfoEx>();
            List <FileSystemInfo> list = new List <FileSystemInfo>();


            // Point mousePoint = e.GetPosition(lstFiles);
            // lstFiles.


            foreach (var itm in selItems)
            {
                CustomFileSystemCover cc = (CustomFileSystemCover)itm;

                list.Add(cc.FileSystemElement);
            }

            System.Drawing.Point dPoint = new System.Drawing.Point();
            Point point = lstFiles.PointToScreen(new Point());


            dPoint.X = Convert.ToInt32(point.X);
            dPoint.Y = Convert.ToInt32(point.Y);
            //System.IO.Tools.ContextMenuWrapper cmw = new System.IO.Tools.ContextMenuWrapper();
            //cmw.Popup(list.ToArray(), dPoint);

            ExplorerNet.Tools.ShellContextMenu scm = new Tools.ShellContextMenu();
            scm.ShowContextMenu(list.ToArray(), dPoint);
        }
Exemple #2
0
        /// <summary>
        /// Для вызова контекстного меню проводника для кнопки диска
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnDrive_MouseRightButtonDown(Object sender, MouseButtonEventArgs e)
        {
            DriveButton btnDrive = (DriveButton)sender;
            DriveInfo   drive    = (DriveInfo)btnDrive.Tag;


            System.Drawing.Point dPoint = new System.Drawing.Point();

            Point point = btnDrive.PointToScreen(new Point());

            dPoint.X = Convert.ToInt32(point.X);
            dPoint.Y = Convert.ToInt32(point.Y);

            ExplorerNet.Tools.ShellContextMenu scm = new Tools.ShellContextMenu();
            scm.ShowContextMenu(drive, dPoint);
        }
Exemple #3
0
        /// <summary>
        /// Обработчик события, создаёт контекстное меню проводника для выделенных элементов
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void lvFileList_PreviewMouseRightButtonDown(object sender, MouseButtonEventArgs e)
        {
            ListView lstFiles = (ListView)sender;
            var selItems = lstFiles.SelectedItems;

            //List<System.IO.FileSystemInfoEx> list = new List<FileSystemInfoEx>();
            List<FileSystemInfo> list = new List<FileSystemInfo>();

               // Point mousePoint = e.GetPosition(lstFiles);
               // lstFiles.

            foreach (var itm in selItems)
            {
                CustomFileSystemCover cc = (CustomFileSystemCover)itm;

                list.Add(cc.FileSystemElement);

            }

            System.Drawing.Point dPoint = new System.Drawing.Point();
            Point point = lstFiles.PointToScreen(new Point());

            dPoint.X = Convert.ToInt32(point.X);
            dPoint.Y = Convert.ToInt32(point.Y);
            //System.IO.Tools.ContextMenuWrapper cmw = new System.IO.Tools.ContextMenuWrapper();
            //cmw.Popup(list.ToArray(), dPoint);

            ExplorerNet.Tools.ShellContextMenu scm = new Tools.ShellContextMenu();
            scm.ShowContextMenu(list.ToArray(), dPoint);
        }
Exemple #4
0
        /// <summary>
        /// Для вызова контекстного меню проводника для кнопки диска
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnDrive_MouseRightButtonDown(Object sender, MouseButtonEventArgs e)
        {
            DriveButton btnDrive = (DriveButton)sender;
            DriveInfo drive = (DriveInfo)btnDrive.Tag;

            System.Drawing.Point dPoint = new System.Drawing.Point();

            Point point = btnDrive.PointToScreen(new Point());

            dPoint.X = Convert.ToInt32(point.X);
            dPoint.Y = Convert.ToInt32(point.Y);

            ExplorerNet.Tools.ShellContextMenu scm = new Tools.ShellContextMenu();
            scm.ShowContextMenu(drive, dPoint);
        }