diff --git a/mRemoteV1/Config/Putty/AbstractPuttySessionsProvider.cs b/mRemoteV1/Config/Putty/AbstractPuttySessionsProvider.cs index 416157092..d4cb19ea8 100644 --- a/mRemoteV1/Config/Putty/AbstractPuttySessionsProvider.cs +++ b/mRemoteV1/Config/Putty/AbstractPuttySessionsProvider.cs @@ -14,7 +14,7 @@ namespace mRemoteNG.Config.Putty #region Public Methods public abstract string[] GetSessionNames(bool raw = false); public abstract PuttySessionInfo GetSession(string sessionName); - + public virtual IEnumerable GetSessions() { foreach (var sessionName in GetSessionNames(true)) @@ -26,22 +26,18 @@ namespace mRemoteNG.Config.Putty } return RootInfo.Children.OfType(); } - + public virtual void StartWatcher() { } - + public virtual void StopWatcher() { } #endregion - - #region Public Events + public delegate void SessionChangedEventHandler(object sender, SessionChangedEventArgs e); public event SessionChangedEventHandler SessionChanged; - #endregion - - #region Protected Methods - protected virtual void RaiseSessionChangedEvent(SessionChangedEventArgs e) + + protected virtual void RaiseSessionChangedEvent(SessionChangedEventArgs args) { - SessionChanged?.Invoke(this, new SessionChangedEventArgs()); + SessionChanged?.Invoke(this, args); } - #endregion } } \ No newline at end of file diff --git a/mRemoteV1/Config/Putty/SessionChangedEventArgs.cs b/mRemoteV1/Config/Putty/SessionChangedEventArgs.cs index cbccee048..31270e3c6 100644 --- a/mRemoteV1/Config/Putty/SessionChangedEventArgs.cs +++ b/mRemoteV1/Config/Putty/SessionChangedEventArgs.cs @@ -1,9 +1,16 @@ using System; +using mRemoteNG.Connection; namespace mRemoteNG.Config.Putty { public class SessionChangedEventArgs : EventArgs { + public PuttySessionInfo Session { get; set; } + + public SessionChangedEventArgs(PuttySessionInfo sessionChanged = null) + { + Session = sessionChanged; + } } } \ No newline at end of file