private void ControlsToData()
 {
     if (HasValue())
     {
         if (_ACPower == null)
             _ACPower = new PowerSpecificationsAC();
         _ACPower.phaseSpecified = cmbPhase.SelectedIndex > 0;
         _ACPower.phase = cmbPhase.SelectedIndex;
         _ACPower.Description = edtDescription.GetValue<string>();
         _ACPower.Voltage = lmtVoltage.Limit;
         _ACPower.Frequency = lmtFrequency.Limit;
         _ACPower.Item = lmtAmpresPower.Limit;
         if (rbAmpres.Checked )
             _ACPower.ItemElementName = PowerSpecificationsACItemChoiceType2.Amperage;
         else if( rbPowerDraw.Checked )
             _ACPower.ItemElementName = PowerSpecificationsACItemChoiceType2.PowerDraw;
         _ACPower.ConnectorPins = connectorLocationPinListControl.ConnectorLocations;
     }
     else
     {
         _ACPower = null;
     }
 }
 public static bool LoadFromFile(string fileName, out PowerSpecificationsAC obj)
 {
     Exception exception;
     return LoadFromFile(fileName, out obj, out exception);
 }
 public static bool Deserialize(string input, out PowerSpecificationsAC obj)
 {
     Exception exception;
     return Deserialize(input, out obj, out exception);
 }
 /// <summary>
 /// Deserializes xml markup from file into an PowerSpecificationsAC object
 /// </summary>
 /// <param name="fileName">string xml file to load and deserialize</param>
 /// <param name="obj">Output PowerSpecificationsAC object</param>
 /// <param name="exception">output Exception value if deserialize failed</param>
 /// <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
 public static bool LoadFromFile(string fileName, out PowerSpecificationsAC obj, out Exception exception)
 {
     exception = null;
     obj = default(PowerSpecificationsAC);
     try
     {
         obj = LoadFromFile(fileName);
         return true;
     }
     catch (Exception ex)
     {
         exception = ex;
         return false;
     }
 }
 /// <summary>
 /// Deserializes workflow markup into an PowerSpecificationsAC object
 /// </summary>
 /// <param name="input">string workflow markup to deserialize</param>
 /// <param name="obj">Output PowerSpecificationsAC object</param>
 /// <param name="exception">output Exception value if deserialize failed</param>
 /// <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
 public static bool Deserialize(string input, out PowerSpecificationsAC obj, out Exception exception)
 {
     exception = null;
     obj = default(PowerSpecificationsAC);
     try
     {
         obj = Deserialize(input);
         return true;
     }
     catch (Exception ex)
     {
         exception = ex;
         return false;
     }
 }