System.Data.XmlTreeGen.SetMSDataAttribute C# (CSharp) Метод

SetMSDataAttribute() приватный Метод

resolve the name from the type for schema output and set the msdata:Data attribute
if multipleTargetConverter throws or returns an empty result
private SetMSDataAttribute ( XmlElement root, Type type ) : void
root XmlElement
type Type non-special type to resolve
Результат void
        private void SetMSDataAttribute(XmlElement root, Type type)
        {
            string result = DataStorage.GetQualifiedName(type);
            try
            {
                if (null != _targetConverter)
                {
                    result = _targetConverter(type);
                }

                if (!string.IsNullOrEmpty(result))
                {
                    // SetAttribute doesn't fail with invalid data, but the final XmlDocument.Save will fail later
                    // with the ArugmentException when calling the actual XmlWriter.SetAttribute
                    root.SetAttribute(Keywords.MSD_DATATYPE, Keywords.MSDNS, result);
                }
            }
            catch (Exception ex) when (ADP.IsCatchableExceptionType(ex))
            {
                ExceptionBuilder.ThrowMultipleTargetConverter(ex);
            }

            if (string.IsNullOrEmpty(result))
            {
                ExceptionBuilder.ThrowMultipleTargetConverter(null);
            }
        }
    }