예제 #1
0
 private void ConnectLiveInfoAsync(String liveId, Action<XmlDocument> method)
 {
     using (var webClient = new CookieAwareWebClient(this.cookieContainer)) {
         try {
             webClient.Encoding = Encoding.UTF8;
             webClient.QueryString.Add("v", liveId);
             webClient.OpenReadCompleted += (sender, e) => {
                 var xmlDoc = new XmlDocument();
                 xmlDoc.Load(e.Result);
                 method(xmlDoc);
             };
             webClient.OpenReadAsync(new Uri(NicoLivePlayerInfoUri));
         } catch (WebException e) {
             Debug.Write(e.Message);
         }
     }
 }