日期:2014-05-18 浏览次数:21167 次
int flag=0;
private void BindBaseDatas()
  {
  string weburl = Application.Current.Host.Source.ToString();
  weburl = weburl.Substring(0, (weburl.Length - 23)) + "/ChartsService.svc";
  MyChartsService.ChartsServiceClient client = new MyChartsService.ChartsServiceClient("CustomBinding_ChartsService1", weburl);
  client.GetMonitoringDatasEntityAsync(monitortype, monitordate_type, monitordate_value, monitortype_type, monitortype_value, meterusetype, true);
  client.GetMonitoringDatasEntityCompleted += new EventHandler<GetMonitoringDatasEntityCompletedEventArgs>(client_GetMonitoringDatasEntityCompleted);
client.GetMonitoringDatasEntityTwoAsync(monitortype, monitordate_type, monitordate_value, monitortype_type, monitortype_value, meterusetype, false);
  client.GetMonitoringDatasEntityTwoCompleted += new EventHandler<GetMonitoringDatasEntityTwoCompletedEventArgs>(client_GetMonitoringDatasEntityTwoCompleted);
}
void client_GetMonitoringDatasEntityTwoCompleted(object sender, GetMonitoringDatasEntityTwoCompletedEventArgs e)
  {
  monitoringstwo = e.Result;
     if(flag==0)
     {
           flag=2;
     }
     else
     {
          BindChart(); 
          flag=0;
      }
  }
  void client_GetMonitoringDatasEntityCompleted(object sender, GetMonitoringDatasEntityCompletedEventArgs e)
  {
  monitoringsone = e.Result;
if(flag==0)
     {
           flag=3;
     }
     else
     {
          BindChart(); 
          flag=0;
      }
  }