private void OnMenuTeamViewer(object sender, EventArgs e) { PwDatabase pd = m_host.Database; if ((pd == null) || !pd.IsOpen) { Debug.Assert(false); return; } PwEntry cureentSelectedItem = m_host.MainWindow.GetSelectedEntry(true); RemoteAppCredentials tw = new RemoteAppCredentials(); ProtectedString protectedStringRemoteID = cureentSelectedItem.Strings.Get("TeamViewerID"); ProtectedString protectedStringRemotePass = cureentSelectedItem.Strings.Get("TeamViewerPass"); tw.RemoteID = protectedStringRemoteID == null ? null: protectedStringRemoteID.ReadString(); tw.RemotePass = protectedStringRemotePass == null ? null : protectedStringRemotePass.ReadString(); if (tw.RemoteID != null && tw.RemotePass != null) { StartProcess(appPaths.TeamViewerFullPath, " --id " + tw.RemoteID + " --Password " + tw.RemotePass); } else { MessageBox.Show("No saved Team Viewer credentials for this entry!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void OnMenuAmmyy(object sender, EventArgs e) { PwDatabase pd = m_host.Database; if ((pd == null) || !pd.IsOpen) { Debug.Assert(false); return; } PwEntry cureentSelectedItem = m_host.MainWindow.GetSelectedEntry(true); RemoteAppCredentials ammyy = new RemoteAppCredentials(); ProtectedString protectedStringRemoteID = cureentSelectedItem.Strings.Get("AmmyyID"); ProtectedString protectedStringRemotePass = cureentSelectedItem.Strings.Get("AmmyyPass"); ammyy.RemoteID = protectedStringRemoteID == null ? null : protectedStringRemoteID.ReadString(); ammyy.RemotePass = protectedStringRemotePass == null ? null : protectedStringRemotePass.ReadString(); if (ammyy.RemoteID != null && ammyy.RemotePass != null) { Clipboard.SetText(ammyy.RemotePass); StartProcess(appPaths.AmmyyFullPath, " -connect " + ammyy.RemoteID); } else { MessageBox.Show("No saved Ammyy credentials for this entry!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }