public AboutBox() { InitializeComponent(); Text = String.Format("About {0}", AssemblyTitle); logoPictureBox.Image = ApplicationIcon(); labelProductName.Text = AssemblyProduct; labelVersion.Text = String.Format("Version {0} ({1})", PreferencesFactory.get().getProperty("application.version"), PreferencesFactory.get().getProperty("application.revision")); labelCopyright.Text = Copyright(); Font bigBoldFont = new Font(Font.FontFamily, Font.Size + 4, FontStyle.Bold); labelProductName.Font = bigBoldFont; labelRegistered.Text = RegisteredText(); creditsRichTextBox.Rtf = Credits(); creditsRichTextBox.SelectAll(); creditsRichTextBox.SelectionFont = new Font(Font.FontFamily, 9); creditsRichTextBox.DeselectAll(); creditsRichTextBox.LinkClicked += (sender, e) => BrowserLauncherFactory.get().open(e.LinkText); ackButton.Click += delegate { ApplicationLauncherFactory.get().open(LocalFactory.get("Acknowledgments.rtf")); }; PeriodicUpdateChecker updater = PeriodicUpdateCheckerFactory.get(); updateButton.Enabled = updater.hasUpdatePrivileges(); updateButton.Click += delegate { updater.check(false); }; }
public bool reveal(ch.cyberduck.core.Local l) { if (l.exists()) { string path = l.getAbsolute(); DirectoryInfo d = new DirectoryInfo(path); string parameter = ""; if (d.Parent != null) { parameter = "/select,"; } return(ApplicationLauncherFactory.get() .open(new Application("explorer.exe", null), parameter + path)); } return(false); }
private void View_OpenEvent() { IList <IProgressView> selected = View.SelectedTransfers; if (selected.Count == 1) { Transfer transfer = GetTransferFromView(selected[0]); for (int i = 0; i < transfer.getRoots().size(); i++) { TransferItem item = (TransferItem)transfer.getRoots().get(i); Local l = item.local; if (ApplicationLauncherFactory.get().open(l)) { break; } } } }
private bool TryStartPuTTy(Host host, string workdir) { if (!File.Exists(PreferencesFactory.get().getProperty("terminal.command.ssh"))) { OpenFileDialog selectDialog = new OpenFileDialog(); selectDialog.Filter = "PuTTY executable (.exe)|*.exe"; selectDialog.FilterIndex = 1; DialogResult result = DialogResult.None; Thread thread = new Thread(() => result = selectDialog.ShowDialog()); thread.SetApartmentState(ApartmentState.STA); thread.Start(); thread.Join(); if (result == DialogResult.OK) { PreferencesFactory.get().setProperty("terminal.command.ssh", selectDialog.FileName); } else { return(false); } } string tempFile = Path.GetTempFileName(); bool identity = host.getCredentials().isPublicKeyAuthentication(); TextWriter tw = new StreamWriter(tempFile); tw.WriteLine("cd {0} && exec $SHELL", workdir); tw.Close(); String ssh = String.Format(PreferencesFactory.get().getProperty("terminal.command.ssh.args"), identity ? string.Format("-i \"{0}\"", host.getCredentials().getIdentity().getAbsolute()) : String.Empty, host.getCredentials().getUsername(), host.getHostname(), Convert.ToString(host.getPort()), tempFile); return(ApplicationLauncherFactory.get() .open( new Application(PreferencesFactory.get().getProperty("terminal.command.ssh"), null), ssh)); }
private void View_OpenDownloadFolderEvent() { Local folder = new DownloadDirectoryFinder().find(_host); ApplicationLauncherFactory.get().open(LocalFactory.get(folder.getAbsolute())); }