Added support to the SessionChangedEventArgs to allow providing which session changed

This commit is contained in:
David Sparer
2016-09-20 10:35:20 -06:00
parent d7c339ccea
commit 28fa043b32
2 changed files with 14 additions and 11 deletions

View File

@@ -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<PuttySessionInfo> GetSessions()
{
foreach (var sessionName in GetSessionNames(true))
@@ -26,22 +26,18 @@ namespace mRemoteNG.Config.Putty
}
return RootInfo.Children.OfType<PuttySessionInfo>();
}
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
}
}

View File

@@ -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;
}
}
}