public static ReportStatus ( String status ) : void | ||
status | String | A string containing the message |
return | void |
TreeNode AddSessionNode(TreeNode parentNode, SessionData session, bool isInitializing) { TreeNode addedNode = null; if (parentNode.Nodes.ContainsKey(session.SessionName)) { SuperPuTTY.ReportStatus("Node with the same name exists. New node ({0}) NOT added", session.SessionName); } else { addedNode = parentNode.Nodes.Add(session.SessionName, session.SessionName, ImageKeySession, ImageKeySession); addedNode.Tag = session; addedNode.ContextMenuStrip = this.contextMenuStripAddTreeItem; addedNode.ToolTipText = session.ToString(); // Override with custom icon if valid if (IsValidImage(session.ImageKey)) { addedNode.ImageKey = session.ImageKey; addedNode.SelectedImageKey = session.ImageKey; } } return(addedNode); }
private void removeFolderToolStripMenuItem_Click(object sender, EventArgs e) { TreeNode node = this.treeView1.SelectedNode; if (node != null) { if (node.Nodes.Count > 0) { List <SessionData> sessions = new List <SessionData>(); GetAllSessions(node, sessions); if (DialogResult.Yes == MessageBox.Show( "Remove Folder [" + node.Text + "] and [" + sessions.Count + "] sessions?", "Remove Folder?", MessageBoxButtons.YesNo)) { foreach (SessionData session in sessions) { SuperPuTTY.RemoveSession(session.SessionId); } node.Remove(); SuperPuTTY.ReportStatus("Removed Folder, {0} and {1} sessions", node.Text, sessions.Count); SuperPuTTY.SaveSessions(); } } else { node.Remove(); SuperPuTTY.ReportStatus("Removed Folder, {0}", node.Text); } } }
/// <summary>Open a new putty scp window with its settings being passed in a <seealso cref="SessionData"/> object</summary> /// <param name="session">The <seealso cref="SessionData"/> object containing the settings</param> public static void OpenScpSession(SessionData session) { Log.InfoFormat("Opening scp session, id={0}", session == null ? "" : session.SessionId); if (!IsScpEnabled) { SuperPuTTY.ReportStatus("Could not open session, pscp not found: {0} [SCP]", session.SessionId); } else if (session != null) { PscpBrowserPanel panel = new PscpBrowserPanel( session, new PscpOptions { PscpLocation = Settings.PscpExe, PscpHomePrefix = Settings.PscpHomePrefix }, Environment.GetFolderPath(Environment.SpecialFolder.Desktop)); ApplyDockRestrictions(panel); ApplyIconForWindow(panel, session); panel.Show(MainForm.DockPanel, session.LastDockstate); SuperPuTTY.ReportStatus("Opened session: {0} [SCP]", session.SessionId); } else { Log.Warn("Could not open null session"); } }
/// <summary>Open a new putty scp window with its settings being passed in a <seealso cref="SessionData"/> object</summary> /// <param name="session">The <seealso cref="SessionData"/> object containing the settings</param> public static void OpenScpSession(SessionData session) { Log.InfoFormat("Opening scp session, id={0}", session == null ? "" : session.SessionId); if (!IsScpEnabled) { SuperPuTTY.ReportStatus("Could not open session, pscp not found: {0} [SCP]", session.SessionId); } else if (session != null) { var homePrefix = session.Username.ToLower().Equals("root") ? Settings.PscpRootHomePrefix : Settings.PscpHomePrefix; PscpBrowserPanel panel = new PscpBrowserPanel( session, new PscpOptions { PscpLocation = Settings.PscpExe, PscpHomePrefix = homePrefix }); ApplyDockRestrictions(panel); ApplyIconForWindow(panel, session); panel.Show(MainForm.DockPanel, session.LastDockstate); SuperPuTTY.ReportStatus("Opened session: {0} [SCP]", session.SessionId); } else { Log.Warn("Could not open null session"); } }
private void timerDelayedSave_Tick(object sender, EventArgs e) { // stop timer timerDelayedSave.Stop(); // do save SuperPuTTY.SaveSessions(); SuperPuTTY.ReportStatus("Saved Sessions after Drag-Drop @ {0}", DateTime.Now); }
/// <summary>Open a new putty window with its settings being passed in a <seealso cref="SessionData"/> object</summary> /// <param name="session">The <seealso cref="SessionData"/> object containing the settings</param> public static void OpenPuttySession(SessionData session) { Log.InfoFormat("Opening putty session, id={0}", session == null ? "" : session.SessionId); if (session != null) { ctlPuttyPanel sessionPanel = ctlPuttyPanel.NewPanel(session); ApplyDockRestrictions(sessionPanel); ApplyIconForWindow(sessionPanel, session); sessionPanel.Show(MainForm.DockPanel, session.LastDockstate); SuperPuTTY.ReportStatus("Opened session: {0} [{1}]", session.SessionId, session.Proto); } }
TreeNode AddFolderNode(TreeNode parentNode, String nodeName) { TreeNode nodeNew = null; if (parentNode.Nodes.ContainsKey(nodeName)) { SuperPuTTY.ReportStatus("Node with the same name exists. New node ({0}) NOT added", nodeName); } else { SuperPuTTY.ReportStatus("Adding new folder, {1}. parent={0}", parentNode.Text, nodeName); nodeNew = parentNode.Nodes.Add(nodeName, nodeName, ImageKeyFolder, ImageKeyFolder); nodeNew.ContextMenuStrip = this.contextMenuStripFolder; } return(nodeNew); }
static void OpenScpSessionOld(SessionData session) { Log.InfoFormat("Opening scp session, id={0}", session == null ? "" : session.SessionId); if (!IsScpEnabled) { SuperPuTTY.ReportStatus("Could not open session, pscp not found: {0} [SCP]", session.SessionId); } else if (session != null) { RemoteFileListPanel panel = null; bool cancelShow = false; if (session != null) { PuttyClosedCallback callback = delegate(bool error) { cancelShow = error; }; PscpTransfer xfer = new PscpTransfer(session); xfer.PuttyClosed = callback; panel = new RemoteFileListPanel(xfer, SuperPuTTY.MainForm.DockPanel, session); ApplyDockRestrictions(panel); ApplyIconForWindow(panel, session); if (!cancelShow) { panel.Show(MainForm.DockPanel, session.LastDockstate); } } SuperPuTTY.ReportStatus("Opened session: {0} [SCP]", session.SessionId); } else { Log.Warn("Could not open null session"); } }