public SICategory(PackageCategory category, SIStorageServiceClient siService, string restriction) { _category = category; _restriction = restriction; _siService = siService; }
public void Open() { _siService = new SIStorageServiceClient(); IsLoading = true; LoadPublishersAsync(); }
public StorageContextViewModel(SIStorageServiceClient siStorageService) { _siStorageService = siStorageService; }
private async Task Enter_Executed(object arg) { lock (_loginLock) { if (IsProgress) { return; } IsProgress = true; } Error = ""; FullError = null; Enter.CanBeExecuted = false; try { NewServerInfo[] uris; try { var siService = new SIStorageServiceClient(); uris = await siService.GetGameServersUrisAsync(_cancellationTokenSource.Token); } catch { uris = null; } var uri = uris?.FirstOrDefault() ?? new NewServerInfo { Uri = GameServerClientNew.GameServerPredefinedUri, ProtocolVersion = ClientProtocolVersion }; if (uri == null) { Error = Resources.CannotGetServerAddress; return; } if (uri.ProtocolVersion > ClientProtocolVersion) { IsProgress = false; Enter.CanBeExecuted = true; Error = Resources.ObsoleClient; return; } IGameServerClient client = new GameServerClientNew(uri.Uri); await client.OpenAsync(_login, _cancellationTokenSource.Token); Entered?.Invoke(_login, client); } catch (HttpRequestException exc) { var message = new StringBuilder(); var innerExc = exc.InnerException ?? exc; while (innerExc != null) { if (message.Length > 0) { message.AppendLine(); } message.Append(innerExc.Message); innerExc = innerExc.InnerException; } Error = message.ToString(); } catch (Exception exc) { Error = exc.Message; FullError = exc.ToString(); } finally { lock (_loginLock) { IsProgress = false; } Enter.CanBeExecuted = true; } }
public void Open() { _siService = new SIStorageServiceClient(); }