mirror of
https://github.com/mRemoteNG/mRemoteNG.git
synced 2026-02-17 22:11:48 +08:00
Added support to the SessionChangedEventArgs to allow providing which session changed
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user