public AddEditEquipmentPropertyViewModel(CommonUtils.EquipmentPropertyType equipmentPropertyType, string descriptionRowHeight) { DescriptionRowHeight = descriptionRowHeight; mEquipmentPropertyType = equipmentPropertyType; CreateComponentPropertyInstance(); Types = GetPropertyTypes(); Type = Types[0]; IsEditable = true; IsVisible = true; LoadAllPropertyLists(); LoadExistingProperties(); InitialiseCommandButtons(); }
public AddEditEquipmentPropertyViewModel(int propertyId, CommonUtils.EquipmentPropertyType equipmentPropertyType, string descriptionRowHeight) { DescriptionRowHeight = descriptionRowHeight; mEquipmentPropertyType = equipmentPropertyType; LoadExistingProperties(); CmsWebServiceClient cmsWebServiceClient = new CmsWebServiceClient(Utils.WcfBinding, Utils.WcfEndPoint); switch (equipmentPropertyType) { case CommonUtils.EquipmentPropertyType.ControlEngineeringProperty: cmsWebServiceClient.GetControlSystemPropertyCompleted += (s, e) => { mComponentProperty = e.Result; Types = GetPropertyTypes(); LoadAllPropertyLists(); }; cmsWebServiceClient.GetControlSystemPropertyAsync(propertyId); break; case CommonUtils.EquipmentPropertyType.ControlTuningProperty: cmsWebServiceClient.GetControlSystemTuningPropertyCompleted += (s, e) => { mComponentProperty = e.Result; Types = GetPropertyTypes(); LoadAllPropertyLists(); }; cmsWebServiceClient.GetControlSystemTuningPropertyAsync(propertyId); break; case CommonUtils.EquipmentPropertyType.ControlInterlockProperty: cmsWebServiceClient.GetInterlockPropertyCompleted += (s, e) => { mComponentProperty = e.Result; Types = GetPropertyTypes(); LoadAllPropertyLists(); }; cmsWebServiceClient.GetInterlockPropertyAsync(propertyId); break; case CommonUtils.EquipmentPropertyType.ElectricalProperty: cmsWebServiceClient.GetElectricalEquipmentPropertyCompleted += (s, e) => { mComponentProperty = e.Result; Types = GetPropertyTypes(); LoadAllPropertyLists(); }; cmsWebServiceClient.GetElectricalEquipmentPropertyAsync(propertyId); break; case CommonUtils.EquipmentPropertyType.InstrumentProperty: cmsWebServiceClient.GetInstrumentPropertyCompleted += (s, e) => { mComponentProperty = e.Result; Types = GetPropertyTypes(); LoadAllPropertyLists(); }; cmsWebServiceClient.GetInstrumentPropertyAsync(propertyId); break; case CommonUtils.EquipmentPropertyType.MechanicalProperty: cmsWebServiceClient.GetMechanicalEquipmentPropertyCompleted += (s, e) => { mComponentProperty = e.Result; Types = GetPropertyTypes(); LoadAllPropertyLists(); }; cmsWebServiceClient.GetMechanicalEquipmentPropertyAsync(propertyId); break; case CommonUtils.EquipmentPropertyType.MobilePlantProperty: cmsWebServiceClient.GetMobilePlantPropertyCompleted += (s, e) => { mComponentProperty = e.Result; Types = GetPropertyTypes(); LoadAllPropertyLists(); }; cmsWebServiceClient.GetMobilePlantPropertyAsync(propertyId); break; case CommonUtils.EquipmentPropertyType.PipeProperty: cmsWebServiceClient.GetPipePropertyCompleted += (s, e) => { mComponentProperty = e.Result; Types = GetPropertyTypes(); LoadAllPropertyLists(); }; cmsWebServiceClient.GetPipePropertyAsync(propertyId); break; case CommonUtils.EquipmentPropertyType.SystemTestingProperty: cmsWebServiceClient.GetControlSystemTestingPropertyCompleted += (s, e) => { mComponentProperty = e.Result; Types = GetPropertyTypes(); LoadAllPropertyLists(); }; cmsWebServiceClient.GetControlSystemTestingPropertyAsync(propertyId); break; case CommonUtils.EquipmentPropertyType.ComponentTestingProperty: cmsWebServiceClient.GetControlSystemComponentTestingPropertyCompleted += (s, e) => { mComponentProperty = e.Result; Types = GetPropertyTypes(); LoadAllPropertyLists(); }; cmsWebServiceClient.GetControlSystemComponentTestingPropertyAsync(propertyId); break; } InitialiseCommandButtons(); }