System.Yaml.Serialization.YamlRepresenter.TypeNameToYamlTag C# (CSharp) Méthode

TypeNameToYamlTag() private static méthode

private static TypeNameToYamlTag ( Type type ) : string
type Type
Résultat string
        private static string TypeNameToYamlTag(Type type)
        {
            /*
            if ( TypeUtils.GetType(type.FullName) == null ) {
                throw new ArgumentException(
                    "Can not serialize (non public?) type '{0}'.".DoFormat(type.FullName));
            }
            */
            if ( type == typeof(int) )
                return YamlNode.ExpandTag("!!int");
            if ( type == typeof(string) )
                return YamlNode.ExpandTag("!!str");
            if ( type == typeof(Double) )
                return YamlNode.ExpandTag("!!float");
            if ( type == typeof(bool) )
                return YamlNode.ExpandTag("!!bool");
            if ( type == typeof(object[]) )
                return YamlNode.ExpandTag("!!seq");
            return "!" + type.FullName;
        }