Quasar/Server/Core/Networking/UserState.cs

83 lines
3.1 KiB
C#
Raw Normal View History

using System;
using System.Windows.Forms;
using xServer.Core.ReverseProxy;
using xServer.Core.Utilities;
2015-01-13 10:29:11 -08:00
using xServer.Forms;
2014-07-08 05:58:53 -07:00
namespace xServer.Core.Networking
2014-07-08 05:58:53 -07:00
{
public class UserState : IDisposable
2014-07-08 05:58:53 -07:00
{
public string Version { get; set; }
public string OperatingSystem { get; set; }
public string AccountType { get; set; }
public string Country { get; set; }
public string CountryCode { get; set; }
public string Region { get; set; }
public string City { get; set; }
public string Id { get; set; }
public string Username { get; set; }
public string PCName { get; set; }
2015-08-03 08:33:50 -07:00
public string Tag { get; set; }
public string DownloadDirectory { get; set; }
2014-07-08 05:58:53 -07:00
2015-01-27 14:47:13 -08:00
public FrmRemoteDesktop FrmRdp { get; set; }
public FrmTaskManager FrmTm { get; set; }
public FrmFileManager FrmFm { get; set; }
public FrmSystemInformation FrmSi { get; set; }
public FrmRemoteShell FrmRs { get; set; }
public FrmStartupManager FrmStm { get; set; }
public FrmKeylogger FrmKl { get; set; }
public FrmReverseProxy FrmProxy { get; set; }
2015-08-02 11:04:58 -07:00
public FrmPasswordRecovery FrmPass { get; set; }
2015-01-27 14:47:13 -08:00
public bool IsAuthenticated { get; set; }
public bool LastDirectorySeen { get; set; }
public UnsafeStreamCodec StreamCodec { get; set; }
public ReverseProxyServer ProxyServer { get; set; }
2014-07-08 05:58:53 -07:00
public UserState()
{
2015-01-27 14:47:13 -08:00
IsAuthenticated = false;
LastDirectorySeen = true;
2014-07-08 05:58:53 -07:00
}
public void Dispose()
{
Dispose(true);
}
protected virtual void Dispose(bool disposing)
{
if (disposing)
{
try
{
if (FrmRdp != null)
FrmRdp.Invoke((MethodInvoker)delegate { FrmRdp.Close(); });
if (FrmTm != null)
FrmTm.Invoke((MethodInvoker)delegate { FrmTm.Close(); });
if (FrmFm != null)
FrmFm.Invoke((MethodInvoker)delegate { FrmFm.Close(); });
if (FrmSi != null)
FrmSi.Invoke((MethodInvoker)delegate { FrmSi.Close(); });
if (FrmRs != null)
FrmRs.Invoke((MethodInvoker)delegate { FrmRs.Close(); });
if (FrmStm != null)
FrmStm.Invoke((MethodInvoker)delegate { FrmStm.Close(); });
if (FrmKl != null)
FrmKl.Invoke((MethodInvoker)delegate { FrmKl.Close(); });
if (FrmProxy != null)
FrmProxy.Invoke((MethodInvoker)delegate { FrmProxy.Close(); });
2015-08-02 11:04:58 -07:00
if (FrmPass != null)
FrmPass.Invoke((MethodInvoker)delegate { FrmPass.Close(); });
if (StreamCodec != null)
StreamCodec.Dispose();
}
catch (InvalidOperationException)
{
}
}
}
2014-07-08 05:58:53 -07:00
}
}