protected virtual void ControlsToData()
 {
     if (_versionIdentifier == null)
         _versionIdentifier = new VersionIdentifier();
     _versionIdentifier.version = edtVersion.GetValue<string>();
     _versionIdentifier.name = edtVersionName.GetValue<string>();
     _versionIdentifier.qualifier =
         (VersionIdentifierQualifier)
             Enum.Parse(typeof (VersionIdentifierQualifier), (string) cmbVersionIdentifierQualifier.SelectedItem);
 }
        private void ControlsToData()
        {
            if (_toolDependancy == null)
            {
                if (rbDriver.Checked)
                    _toolDependancy = new HardwareItemDescriptionControlToolDriver();
                else if (rbSoftware.Checked)
                    _toolDependancy = new HardwareItemDescriptionControlToolSoftware();
            }
            else
            {
                if( _toolDependancy is HardwareItemDescriptionControlToolDriver && rbSoftware.Checked )
                    _toolDependancy = new HardwareItemDescriptionControlToolSoftware();
                else if ( _toolDependancy is HardwareItemDescriptionControlToolSoftware && rbDriver.Checked )
                    _toolDependancy = new HardwareItemDescriptionControlToolDriver();
            }

            if (_toolDependancy != null)
            {
                _toolDependancy.name = controlToolDependancyControl1.VersionIdentifier.name;
                _toolDependancy.qualifier = controlToolDependancyControl1.VersionIdentifier.qualifier;
                _toolDependancy.version = controlToolDependancyControl1.VersionIdentifier.version;
            }
        }
 void VersionIdentifierControl_Validating(object sender, CancelEventArgs e)
 {
     string saved = null;
     if( _versionIdentifier != null )
         saved = XmlUtils.SerializeObject( _versionIdentifier );
     ControlsToData();
     ValidateToSchema(_versionIdentifier);
     if (saved == null)
         _versionIdentifier = null;
     else
         _versionIdentifier = (VersionIdentifier)XmlUtils.DeserializeObject(_versionIdentifier, saved);
 }
 public static bool LoadFromFile(string fileName, out VersionIdentifier obj)
 {
     Exception exception;
     return LoadFromFile(fileName, out obj, out exception);
 }
 /// <summary>
 /// Deserializes xml markup from file into an VersionIdentifier object
 /// </summary>
 /// <param name="fileName">string xml file to load and deserialize</param>
 /// <param name="obj">Output VersionIdentifier 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 VersionIdentifier obj, out Exception exception)
 {
     exception = null;
     obj = default(VersionIdentifier);
     try
     {
         obj = LoadFromFile(fileName);
         return true;
     }
     catch (Exception ex)
     {
         exception = ex;
         return false;
     }
 }
 public static bool Deserialize(string input, out VersionIdentifier obj)
 {
     Exception exception;
     return Deserialize(input, out obj, out exception);
 }
 /// <summary>
 /// Deserializes workflow markup into an VersionIdentifier object
 /// </summary>
 /// <param name="input">string workflow markup to deserialize</param>
 /// <param name="obj">Output VersionIdentifier 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 VersionIdentifier obj, out Exception exception)
 {
     exception = null;
     obj = default(VersionIdentifier);
     try
     {
         obj = Deserialize(input);
         return true;
     }
     catch (Exception ex)
     {
         exception = ex;
         return false;
     }
 }