示例#1
0
        public ILiveStreamInfo getLiveStreamUser(string un)
        {
            ILiveStreamInfo lsi        = null;
            string          requrl     = genGURL(APIResources.LiveSteamsUser, un);
            string          jsonReturn = engine.getWebEngine().getReturnJSON(requrl);

            if (jsonSchemaIsValid(Schema.ILiveStreamInfo, jsonReturn))
            {
                try {
                    lsi = JsonConvert.DeserializeObject <ILiveStreamInfo>(jsonReturn);
                } catch {
                    System.Diagnostics.Debugger.Log(0, "Deserializing", "Could not deserialize a valid json schema for ILiveStreamInfo.");
                    lsi = null;
                }
            }
            return(lsi);
        }
示例#2
0
        private void button1_Click(object sender, EventArgs e)
        {
            string          user = Username.Text;
            ILiveStreamInfo lsi  = Program.livecodingAPI.getAPIEngine().getLiveStreamUser(user);

            richTextBox1.AppendText("url: " + lsi.url + "\n");
            richTextBox1.AppendText("user: "******"\n");

            richTextBox1.AppendText("user__slug: " + lsi.user__slug + "\n");
            richTextBox1.AppendText("title: " + lsi.title + "\n");

            richTextBox1.AppendText("description: " + lsi.description + "\n");
            richTextBox1.AppendText("difficulty: " + lsi.difficulty + "\n");

            richTextBox1.AppendText("langauge: " + lsi.langauge + "\n");
            richTextBox1.AppendText("tags: " + lsi.tags + "\n");

            richTextBox1.AppendText("is_live: " + lsi.is_live + "\n");
            richTextBox1.AppendText("viewers_live: " + lsi.viewers_live + "\n");

            richTextBox1.AppendText("viewing_urls: " + lsi.viewing_urls + "\n");
        }