/// <summary> /// Checks if specified UserID currently available. If not, /// returns first available value. /// </summary> /// <param name="SID">UserID to check.</param> /// <returns>Checked or default UserID.</returns> public string GetCurrentSteamID(string SID) { if (SteamIDs.Count < 1) { throw new ArgumentOutOfRangeException(DebugStrings.AppDbgExCoreStmManSidListEmpty); } return(SteamIDs.IndexOf(SID) != -1 ? SID : SteamIDs[0]); }
/// <summary> /// Проверяет доступен ли переданный в качестве параметра SteamID. Если нет, /// то возвращает первый элемент списка из SteamID. /// </summary> /// <param name="SID">SteamID для проверки</param> /// <returns>Возвращает значение SteamID</returns> public string GetCurrentSteamID(string SID) { if (SteamIDs.Count < 1) { throw new ArgumentOutOfRangeException("SteamID list is empty. Can not select one of them."); } return(SteamIDs.IndexOf(SID) != -1 ? SID : SteamIDs[0]); }
/// <summary> /// Gets list of available UserIDs. /// </summary> /// <returns>List of available UserIDs.</returns> private void GetUserIDs() { if (Directory.Exists(UserDataPath)) { DirectoryInfo DInfo = new DirectoryInfo(UserDataPath); foreach (DirectoryInfo SubDir in DInfo.GetDirectories()) { if (SteamConv.ValidateUserID(SubDir.Name)) { SteamIDs.Add(SubDir.Name); } } } }