- Added some more types to the XmlImporter conversion list.
This commit is contained in:
parent
3a5b123c49
commit
e011a8fc1f
@ -58,7 +58,7 @@ namespace ANX.Framework.Content.Pipeline.Importer
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Type GetType(string typeString)
|
private static Type GetType(string typeString)
|
||||||
{
|
{
|
||||||
//TODO: Implement custom assembly path checking
|
//TODO: Implement custom assembly path checking
|
||||||
//Check every assembly in the current working dir for type
|
//Check every assembly in the current working dir for type
|
||||||
@ -151,7 +151,7 @@ namespace ANX.Framework.Content.Pipeline.Importer
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
private object XmlContentToObject(XElement item)
|
public static object XmlContentToObject(XElement item)
|
||||||
{
|
{
|
||||||
if (!item.HasAttributes && !item.HasElements) // String
|
if (!item.HasAttributes && !item.HasElements) // String
|
||||||
{
|
{
|
||||||
@ -164,7 +164,14 @@ namespace ANX.Framework.Content.Pipeline.Importer
|
|||||||
var type = GetType(typeString);
|
var type = GetType(typeString);
|
||||||
if (type == typeof(Single))
|
if (type == typeof(Single))
|
||||||
return Convert.ToSingle(item.Value);
|
return Convert.ToSingle(item.Value);
|
||||||
|
if (type == typeof(Int32))
|
||||||
|
return Convert.ToInt32(item.Value);
|
||||||
|
if (type == typeof(Int64))
|
||||||
|
return Convert.ToInt64(item.Value);
|
||||||
|
if (type == typeof(Double))
|
||||||
|
return Convert.ToDouble(item.Value);
|
||||||
|
if (type == typeof(Boolean))
|
||||||
|
return Convert.ToBoolean(item.Value);
|
||||||
throw new NotSupportedException("Sorry, conversion of type \"" + type + "\" is currently not supported.");
|
throw new NotSupportedException("Sorry, conversion of type \"" + type + "\" is currently not supported.");
|
||||||
}
|
}
|
||||||
throw new NotSupportedException("Conversion of nested stuff is not supported! If you have the time, go ahead and implement it! :P");
|
throw new NotSupportedException("Conversion of nested stuff is not supported! If you have the time, go ahead and implement it! :P");
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
@ -12,6 +12,7 @@
|
|||||||
<AssemblyName>AnxSampleBrowser</AssemblyName>
|
<AssemblyName>AnxSampleBrowser</AssemblyName>
|
||||||
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
|
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
|
||||||
<FileAlignment>512</FileAlignment>
|
<FileAlignment>512</FileAlignment>
|
||||||
|
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||||
<PublishUrl>veröffentlichen\</PublishUrl>
|
<PublishUrl>veröffentlichen\</PublishUrl>
|
||||||
<Install>true</Install>
|
<Install>true</Install>
|
||||||
<InstallFrom>Disk</InstallFrom>
|
<InstallFrom>Disk</InstallFrom>
|
||||||
@ -24,7 +25,6 @@
|
|||||||
<MapFileExtensions>true</MapFileExtensions>
|
<MapFileExtensions>true</MapFileExtensions>
|
||||||
<ApplicationRevision>0</ApplicationRevision>
|
<ApplicationRevision>0</ApplicationRevision>
|
||||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
|
||||||
<UseApplicationTrust>false</UseApplicationTrust>
|
<UseApplicationTrust>false</UseApplicationTrust>
|
||||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user