mirror of
https://github.com/StockSharp/StockSharp.git
synced 2026-12-06 17:42:13 +00:00
Source codes for Messages, BE, Algo, Xaml, Localization, Logging, Community and few connectors (SmartCOM, AlfaDirect, Transaq, BTCE, OpenECry, LMAX, MatLab, CQG, Sterling, RSS, Alor)
57 lines
1.3 KiB
C#
57 lines
1.3 KiB
C#
namespace StockSharp.Community
|
|
{
|
|
using System.Security;
|
|
|
|
using Ecng.Serialization;
|
|
|
|
/// <summary>
|
|
/// Êëàññ, õðàíÿùèõ â ñåáå ëîãèí è ïàðîëü äëÿ äîñòóïà ê ñåðâèñàì http://stocksharp.com
|
|
/// </summary>
|
|
public sealed class ServerCredentials : IPersistable
|
|
{
|
|
/// <summary>
|
|
/// Ñîçäàòü <see cref="ServerCredentials"/>.
|
|
/// </summary>
|
|
public ServerCredentials()
|
|
{
|
|
AutoLogon = true;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ëîãèí.
|
|
/// </summary>
|
|
public string Login { get; set; }
|
|
|
|
/// <summary>
|
|
/// Ïàðîëü.
|
|
/// </summary>
|
|
public SecureString Password { get; set; }
|
|
|
|
/// <summary>
|
|
/// Âõîäèòü àâòîìàòè÷åñêè.
|
|
/// </summary>
|
|
public bool AutoLogon { get; set; }
|
|
|
|
/// <summary>
|
|
/// Çàãðóçèòü íàñòðîéêè.
|
|
/// </summary>
|
|
/// <param name="storage">Õðàíèëèùå íàñòðîåê.</param>
|
|
public void Load(SettingsStorage storage)
|
|
{
|
|
Login = storage.GetValue<string>("Login");
|
|
Password = storage.GetValue<SecureString>("Password");
|
|
AutoLogon = storage.GetValue<bool>("AutoLogon");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ñîõðàíèòü íàñòðîéêè.
|
|
/// </summary>
|
|
/// <param name="storage">Õðàíèëèùå íàñòðîåê.</param>
|
|
public void Save(SettingsStorage storage)
|
|
{
|
|
storage.SetValue("Login", Login);
|
|
storage.SetValue("Password", Password);
|
|
storage.SetValue("AutoLogon", AutoLogon);
|
|
}
|
|
}
|
|
} |