Beispiel #1
0
 public static Task<ElectricalEquipment> GetElectricalEquipment(int equipmentId)
 {
     var task = new TaskCompletionSource<ElectricalEquipment>();
     var cee = new CmsWebServiceClient(Utils.WcfBinding, Utils.WcfEndPoint);
     cee.GetElectricalEquipmentCompleted += (s, e) => task.SetResult(e.Result);
     cee.GetElectricalEquipmentAsync(equipmentId);
     return task.Task;
 }
        public void ReloadElectricalEquipment(Action finished, int equipmentId)
        {
            CmsWebServiceClient cmsWebServiceClient = new CmsWebServiceClient(Utils.WcfBinding, Utils.WcfEndPoint);
            cmsWebServiceClient.GetElectricalEquipmentCompleted += (s, e) =>
            {
                Equipment = e.Result;
                OriginalName = Equipment.Name;

                if (finished != null)
                {
                    finished();
                }
            };

            cmsWebServiceClient.GetElectricalEquipmentAsync(equipmentId);
        }