Hardly.Library.Twitch.SqlTwitchChannelPointScale.ForChannel C# (CSharp) Method

ForChannel() public static method

public static ForChannel ( TwitchChannel channel ) : TwitchChannelPointScale[]
channel TwitchChannel
return TwitchChannelPointScale[]
        public static TwitchChannelPointScale[] ForChannel(TwitchChannel channel)
        {
            List<object[]> results = _table.Select(null, null, "ChannelUserId=?a", new object[] { channel.user.id }, "UnitValue", 0);

            if(results != null && results.Count > 0) {
                TwitchChannelPointScale[] points = new TwitchChannelPointScale[results.Count];
                for(int i = 0; i < results.Count; i++) {
                    points[i] = new SqlTwitchChannelPointScale(channel, results[i][1].FromSql<ulong>(), results[i][2].FromSql<string>(), results[i][3].FromSql<string>());
                }

                return points;
            }

            return null;
        }

Usage Example

コード例 #1
0
 public TwitchChannelPointScale[] GetChannelPointScale(TwitchChannel channel)
 {
     return(SqlTwitchChannelPointScale.ForChannel(channel));
 }