示例#1
0
        public async Task <StatsDto> GetStatsAsync(CancellationToken token)
        {
            var query      = new StatsQuery();
            var retValTask = await _queryBus.QueryAsync(query, token);

            return(retValTask);
        }
        public DataTable GetCountryDetails([FromUri] root json)
        {
            //json = "{\"query\": [{\"SELECT\": [\"geo\",\"geo.name\",\"time\",\"pop\"], \"WHERE\": {\"geo\": [\"swe\",\"nor\"],\"time\": \"2000-2015\",\"ind\":\"1\"},\"FROM\": \"humnum\"}],\"lang\": \"en\"}";
            //var json = "{\"query\": [{\"SELECT\": [\"geo\",\"geo.name\",\"time\",\"pop\"],\"FROM\": \"humnum\"}],\"lang\": \"en\"}";
            //var a = JsonConvert.DeserializeObject<root>(json);
            StatsQuery sQ  = new StatsQuery(json);
            var        str = sQ.getData();

            return(str);

            //SELECT s = new SELECT();
            //s.select = new List<string> { "geo" };
            //FROM f = new FROM();
            //f.from = "dimTable";
            //WHERE w = new WHERE();
            //w.geo = new List<string> { "swe", "nor" };
            //w.time = "2001-2010";
            //query q = new query
            //{
            //    SELECT = new List<string> { "geo", "geo.name" },
            //    WHERE =  w ,
            //    FROM = "directtable"
            //};

            //var r = new root { query = new[] { q }, lang = "en" };
            //var j = JsonConvert.SerializeObject(r);
            return(null);
        }
示例#3
0
    public int RequestStats(StatsQuery statsQuery)
    {
        switch (statsQuery)
        {
        case StatsQuery.None:
            break;

        case StatsQuery.CurrentProgrammingTap:
            return(currentProgrammingTap);

        case StatsQuery.CurrentArtisticTap:
            return(currentArtisticTap);

        case StatsQuery.CurrentSoundTap:
            return(currentSoundTap);

        case StatsQuery.CurrentGameDesignTap:
            return(currentGameDesignTap);

        case StatsQuery.CurrentProgrammingDPS:
            return(currentProgrammingDPS);

        case StatsQuery.CurrentArtisticDPS:
            return(currentArtisticDPS);

        case StatsQuery.CurrentSoundDPS:
            return(currentSoundDPS);

        case StatsQuery.CurrentGameDesignDPS:
            return(currentGameDesignDPS);

        default:
            throw new ArgumentOutOfRangeException(nameof(statsQuery), statsQuery, null);
        }

        return(0);
    }
示例#4
0
    public string RequestStatsString(StatsQuery statsQuery)
    {
        switch (statsQuery)
        {
        case StatsQuery.None:
            break;

        case StatsQuery.CurrentProgrammingTap:
            return($"{programmingColorTag}Programming Pts per Tap : {currentProgrammingTap}");

        case StatsQuery.CurrentArtisticTap:
            return($"{artisticColorTag}Artistic Pts per Tap : {currentArtisticTap}");

        case StatsQuery.CurrentSoundTap:
            return($"{soundColorTag}Sound Design Pts per Tap : {currentSoundTap}");

        case StatsQuery.CurrentGameDesignTap:
            return($"{gameDesignColorTag}Game Design Pts per Tap : {currentGameDesignTap}");

        case StatsQuery.CurrentProgrammingDPS:
            return($"{programmingColorTag}Programming Pts per Seconds : {currentProgrammingDPS}");

        case StatsQuery.CurrentArtisticDPS:
            return($"{artisticColorTag}Artistic Pts per Seconds : {currentArtisticDPS}");

        case StatsQuery.CurrentSoundDPS:
            return($"{soundColorTag}Sound Pts per Seconds : {currentSoundDPS}");

        case StatsQuery.CurrentGameDesignDPS:
            return($"{gameDesignColorTag}Game Design Pts per Seconds : {currentGameDesignDPS}");

        default:
            throw new ArgumentOutOfRangeException(nameof(statsQuery), statsQuery, null);
        }

        return("");
    }
示例#5
0
文件: Sender.cs 项目: nebez/TwitchBot
		/// <summary>
		/// Request certain kinds of statistics about the current server.
		/// </summary>
		/// <remarks>
		/// Possible Errors
		/// 		<list type="bullet">
		/// 			<item><description>ERR_NOSUCHSERVER</description></item>
		/// 		</list>
		/// </remarks>
		/// <param name="query">The type of query to send. See <see cref="StatsQuery"/> for choice.</param>
		/// <param name="targetServer">Specifies the server that should process the request. Can include wildcards.</param>
		/// <example><code>
		/// //Request list of Operators from the server 'irc.gnome.org'
		/// connection.Sender.Stats( StatsQuery.Operators, "irc.gnome.org" );
		/// </code></example>
		/// <exception cref="ArgumentException">If the target server name is too long.</exception>
		/// <seealso cref="Listener.OnStats"/>
		public void Stats( StatsQuery query, string targetServer ) 
		{
			lock( this )
			{
				Buffer.Append("STATS");
				Buffer.Append( SPACE );
				Buffer.Append( Rfc2812Util.StatsQueryToChar( query ) );
				if( targetServer != null ) 
				{
					Buffer.Append( SPACE );
					Buffer.Append( targetServer );	
				}
				if( TooLong( Buffer ) ) 
				{
					ClearBuffer();
					throw new ArgumentException("Target server name is too long.");
				}
				Connection.SendCommand( Buffer );				
			}
		}
示例#6
0
文件: Sender.cs 项目: nebez/TwitchBot
		/// <summary>
		/// Request certain kinds of statistics about the current server.
		/// </summary>
		/// <remarks>
		/// Possible Errors
		/// 		<list type="bullet">
		/// 			<item><description>ERR_NOSUCHSERVER</description></item>
		/// 		</list>
		/// </remarks>
		/// <param name="query">The type of query to send. See <see cref="StatsQuery"/> for choice.</param>
		/// <example><code>
		/// //Request server link stats
		/// connection.Sender.Stats( StatsQuery.Connections );
		/// </code></example>
		/// <seealso cref="Listener.OnStats"/>
		public void Stats( StatsQuery query ) 
		{
			Stats( query, null );
		}
示例#7
0
 /// <summary>
 /// Converts a StatQuery enum value to its RFC2812 character.
 /// </summary>
 /// <param name="query">The query enum.</param>
 /// <returns>The corresponding char.</returns>
 public static char StatsQueryToChar(StatsQuery query)
 {
     return(Convert.ToChar((byte)query, CultureInfo.InvariantCulture));
 }
		/// <summary>
		/// Converts a StatQuery enum value to its RFC2812 character.
		/// </summary>
		/// <param name="query">The query enum.</param>
		/// <returns>The corresponding char.</returns>
		public static char StatsQueryToChar( StatsQuery query ) 
		{
			return Convert.ToChar( (byte) query, CultureInfo.InvariantCulture ) ;
		}
示例#9
0
 public void OnStats( StatsQuery queryType, string message, bool done )
 {
     Assertion.AssertEquals("OnStats: queryType", StatsQuery.Uptime, queryType);
     Assertion.AssertEquals("OnStats: message", "Server Up 46 days, 8:47:20", message);
     Assertion.Assert("OnStats: done", !done);
     Console.WriteLine("OnStats");
 }
示例#10
0
 public static string Stats(StatsQuery query, string target)
 {
     return($"STATS {(char) query} {target}");
 }
示例#11
0
 public static string Stats(StatsQuery query)
 {
     return($"STATS {(char) query}");
 }
示例#12
0
 /// <summary>
 /// Converts a StatQuery enum value to its RFC2812 character.
 /// </summary>
 /// <param name="query">The query enum.</param>
 /// <returns>The corresponding char.</returns>
 public static char StatsQueryToChar(StatsQuery query)
 {
     return ((byte)query).ToChar(CultureInfo.InvariantCulture);
 }
示例#13
0
 public async Task StatsQuery_Ok()
 {
     var query = new StatsQuery();
     var _     = await fixture.QueryBus.QueryAsync(query, default);
 }
示例#14
0
 /// <summary>
 /// Converts a StatQuery enum value to its RFC2812 character.
 /// </summary>
 /// <param name="query">The query enum.</param>
 /// <returns>The corresponding char.</returns>
 public static char StatsQueryToChar(StatsQuery query)
 {
     return(((byte)query).ToChar(CultureInfo.InvariantCulture));
 }
示例#15
0
 /// <summary> Converts a StatQuery enum value to its RFC2812 character. </summary>
 /// <param name="query">The query enum.</param>
 /// <returns>The corresponding char.</returns>
 public static char StatsQueryToChar(StatsQuery query)
 {
     return((char)((byte)query));
 }
示例#16
0
 public IEnumerable <Statistic> GetStatsByDateRange(StatsQuery query)
 {
     throw new NotImplementedException();
 }