예제 #1
0
        private static void UninstallContext()
        {
            var menu = new WindowsContextMenu();

            menu.RemoveEntry("*", "SubMiner.1");
            menu.RemoveEntry("*", "SubMiner.2");
        }
예제 #2
0
        private static void InstallContext()
        {
            var menu    = new WindowsContextMenu();
            var exePath = Assembly.GetEntryAssembly().Location;

            menu.AddEntry("*", "SubMiner.1", "SubMiner: Search Subtitles", exePath);
            menu.AddEntry("*", "SubMiner.2", "SubMiner: Download First", exePath, new string[] { "true" });
        }
        protected override void OnStart(string[] args)
        {
            //System.Diagnostics.Debugger.Launch();
            base.OnStart(args);
            if (args.Length > 0)
            {
                string _configPath = args[0];
                ft = new FileTransfer(true, _configPath);

                WindowsContextMenu.Add("Send To My Client");
            }
        }
        private void ExecuteRightMouse(EventTranscriptionParameter <MouseButtonEventArgs> parameter)
        {
            if (ActiveView.FileSystem.IsWindowsFileSystem && ActiveView.IsAtLeastOneItemSelected)
            {
                var menu       = new WindowsContextMenu();
                var files      = ActiveView.SelectedItems.OfType <WindowsFile>().Select(x => (FileSystemInfo)x).ToArray();
                var mousePoint = Mouse.PrimaryDevice.GetPosition(Application.Current.MainWindow);
                mousePoint.Offset(Application.Current.MainWindow.Left, Application.Current.MainWindow.Top);
                menu.ShowContextMenu(files, Utility.ConvertPoint(mousePoint), ActiveView.FullPath);
            }

            parameter.EventArgs.Handled = true;
        }
예제 #5
0
        static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            // test if this is the first instance and register receiver, if so.
            if (SingletonController.IamFirst(new SingletonController.ReceiveDelegate(SecondRun)))
            {
                WindowsContextMenu.Add("Send To Server");
                Application.Run(new frmMain(args, new FileTransfer(true)));
            }
            else
            {
                // send command line args to running app, then terminate
                SingletonController.Send(args);
            }
            SingletonController.Cleanup();
        }
        protected override void OnStop()
        {
            base.OnStop();
            try
            {
                WindowsContextMenu.Remove("Send To My Client");
                ft.Stop();
            }
            catch (Exception ex)
            {
#if DEBUG
                using (EventLog eventLog = new EventLog("Application"))
                {
                    eventLog.Source = "EFTService";
                    eventLog.WriteEntry("Error in Stop Listening " + ex.Message, EventLogEntryType.Information, 101, 1);
                }
#endif
            }
        }
예제 #7
0
 private void frmMain_FormClosed(object sender, FormClosedEventArgs e)
 {
     WindowsContextMenu.Remove("Send To Server");
     _fileTransfer.Stop();
 }