private OpenDotaApi(string apiKey, WebProxy proxy) { _request = new Request(apiKey, proxy); Matches = new MatchEndpoint(_request); Player = new PlayerEndpoint(_request); ProPlayers = new ProPlayerEndpoint(_request); ProMatches = new ProMatchesEndpoint(_request); PublicMatches = new PublicMatchEndpoint(_request); Metadata = new MetadataEndpoint(_request); MmrDistribution = new MmrDistributionEndpoint(_request); Search = new SearchEndpoint(_request); Ranking = new RankingEndpoint(_request); Benchmarks = new BenchmarksEndpoint(_request); Status = new StatusEndpoint(_request); Health = new HealthEndpoint(_request); Request = new RequestEndpoint(_request); FindMatch = new FindMatchEndpoint(_request); Hero = new HeroEndpoint(_request); HeroStats = new HeroStatsEndpoint(_request); League = new LeagueEndpoint(_request); Team = new TeamEndpoint(_request); Replay = new ReplayEndpoint(_request); Record = new RecordEndpoint(_request); Live = new LiveEndpoint(_request); Scenarios = new ScenariosEndpoint(_request); Schema = new SchemaEndpoint(_request); }
public void Setup() { var rule = Substitute.For <IValidationRule>(); rule.GetConfiguration().Returns(new Dictionary <string, string> { { "ClassName", "GoodTestClassName" }, { "PullRequestTitle", "GoodTestTitle" }, { "ReadMeTemplateFileLocation", "GoodTestLocation.md" }, { "MainBranch", "GoodTestBranch" } }); var rule2 = Substitute.For <IValidationRule>(); rule2.GetConfiguration().Returns(new Dictionary <string, string> { { "ClassName", "BadTestClassName" }, { "PullRequestTitle", "BadTestTitle" }, { "ReadMeTemplateFileLocation", "BadTestLocation.md" }, { "MainBranch", "BadTestBranch" } }); var rules = new[] { rule, rule2 }; _validator = Substitute.For <IRepositoryValidator>(); _validator.Rules.Returns(rules); _statusEndpoint = new StatusEndpoint(Substitute.For <ILogger <StatusEndpoint> >(), _validator); }
public void UpdateStatusIndicator(string color) { AddConnection(OperationContext.Current); lock (_AddressLock) { for (int index = _AvailableConnections.Count - 1; index >= 0; index--) { EndpointAddress address = _AvailableConnections[index]; Action <Task[]> action = new Action <Task[]>(delegate(Task[] t) { try { using (StatusEndpoint endpoint = new StatusEndpoint(new UpdateTcpBinding(), address)) { endpoint.Open(); endpoint.UpdateIndicator(color); } } catch { } }); Task[] lastTasks = new Task[] { _LastTask }; _LastTask = _TaskFactory.ContinueWhenAll(lastTasks, action); } } }
public OpenDota(string apiKey = null, IWebProxy proxy = null) { _request = new RequestHandler(apiKey, proxy); _jsonFormatter = new JsonFormatter(_request); Matches = new MatchesEndpoint(_jsonFormatter); PlayersByRank = new PlayersByRankEndpoint(_jsonFormatter); Players = new PlayersEndpoint(_jsonFormatter, _request); ProPlayers = new ProPlayersEndpoint(_jsonFormatter); ProMatches = new ProMatchesEndpoint(_jsonFormatter); PublicMatches = new PublicMatchesEndpoint(_jsonFormatter); ParsedMatches = new ParsedMatchesEndpoint(_jsonFormatter); Metadata = new MetadataEndpoint(_jsonFormatter); Distributions = new DistributionsEndpoint(_jsonFormatter); Search = new SearchEndpoint(_jsonFormatter); Rankings = new RankingsEndpoint(_jsonFormatter); Benchmarks = new BenchmarksEndpoint(_jsonFormatter); Status = new StatusEndpoint(_jsonFormatter); Health = new HealthEndpoint(_jsonFormatter); Request = new RequestEndpoint(_jsonFormatter, _request); FindMatches = new FindMatchesEndpoint(_jsonFormatter); Heroes = new HeroesEndpoint(_jsonFormatter); HeroStats = new HeroStatsEndpoint(_jsonFormatter); Leagues = new LeaguesEndpoint(_jsonFormatter); Teams = new TeamsEndpoint(_jsonFormatter); Replays = new ReplaysEndpoint(_jsonFormatter); Records = new RecordsEndpoint(_jsonFormatter); Live = new LiveEndpoint(_jsonFormatter); Scenarios = new ScenariosEndpoint(_jsonFormatter); Schema = new SchemaEndpoint(_jsonFormatter); Constants = new ConstantsEndpoint(_request); }
public void UpdateStatusIndicator (string color) { AddConnection(OperationContext.Current); lock (_AddressLock) { for (int index = _AvailableConnections.Count - 1; index >= 0; index--) { EndpointAddress address = _AvailableConnections[index]; Action<Task[]> action = new Action<Task[]>(delegate(Task[] t) { try { using (StatusEndpoint endpoint = new StatusEndpoint(new UpdateTcpBinding(), address)) { endpoint.Open(); endpoint.UpdateIndicator(color); } } catch { } }); Task[] lastTasks = new Task[] { _LastTask }; _LastTask = _TaskFactory.ContinueWhenAll(lastTasks, action); } } }