/// <summary> /// Получить экземпляр системы по наименованию /// </summary> public ScadaInstance GetScadaInstance(string name) { if (settings.Instances.TryGetValue(name, out ScadaInstanceSettings instanceSettings)) { object syncRoot = locks.GetOrAdd(name, (key) => { return(new object()); }); ScadaInstance scadaInstance = new ScadaInstance(instanceSettings, syncRoot, log); return(scadaInstance); } else { return(null); } }
/// <summary> /// Установить данные авторизованного пользователя /// </summary> public void SetUser(string username, ScadaInstance scadaInstance) { LoggedOn = true; Username = username; ScadaInstance = scadaInstance; }