fixed compile issue in Metro/ModernUI build

This commit is contained in:
Glatzemann 2012-10-04 11:42:21 +00:00 committed by Konstantin Koch
parent 52b87d1459
commit 298aad1a1c
3 changed files with 27 additions and 10 deletions

View File

@ -47,30 +47,37 @@ namespace ANX.Framework.Content.Pipeline.Serialization.Compiler
{
throw new ArgumentNullException("output");
}
if (value == null)
{
throw new ArgumentNullException("value");
}
if (!Enum.IsDefined(typeof(TargetPlatform), targetPlatform))
{
throw new ArgumentOutOfRangeException("targetPlatform");
}
if (!Enum.IsDefined(typeof(GraphicsProfile), targetProfile))
{
throw new ArgumentOutOfRangeException("targetProfile");
}
if (string.IsNullOrEmpty(rootDirectory))
{
throw new ArgumentNullException("rootDirectory");
}
if (string.IsNullOrEmpty(referenceRelocationPath))
{
throw new ArgumentNullException("referenceRelocationPath");
}
if (compressContent)
{
compressContent = this.ShouldCompressContent(targetPlatform, value);
}
using (ContentWriter contentWriter = new ContentWriter(this, output, compressContent, rootDirectory, referenceRelocationPath) { TargetPlatform = targetPlatform, TargetProfile = targetProfile })
{
contentWriter.WriteObject<object>(value);
@ -83,6 +90,7 @@ namespace ANX.Framework.Content.Pipeline.Serialization.Compiler
{
throw new ArgumentNullException("type");
}
ContentTypeWriter typeWriterInternal = this.GetTypeWriterInternal(type);
//TODO: this.RecordDependency(typeWriterInternal.TargetType);
return typeWriterInternal;
@ -97,6 +105,7 @@ namespace ANX.Framework.Content.Pipeline.Serialization.Compiler
//this.AddTypeWriter(contentTypeWriter);
//this.InitializeTypeWriter(contentTypeWriter);
}
return contentTypeWriter;
}
@ -106,7 +115,9 @@ namespace ANX.Framework.Content.Pipeline.Serialization.Compiler
{
return false;
}
ContentTypeWriter typeWriterInternal = this.GetTypeWriterInternal(value.GetType());
return typeWriterInternal.ShouldCompressContent(targetPlatform, value);
}
}

View File

@ -470,21 +470,29 @@ namespace ANX.Framework.Content
referenceName = GetPathToReference(referenceName);
referenceName = Path.Combine(ContentManager.RootDirectory, referenceName);
Assembly assembly = Assembly.GetEntryAssembly();
Assembly assembly = null;
string titleLocationPath = null;
#if !WINDOWSMETRO
assembly = Assembly.GetEntryAssembly();
if (assembly == null)
{
assembly = Assembly.GetCallingAssembly();
string titleLocationPath = Path.GetDirectoryName(assembly.Location);
}
titleLocationPath = Path.GetDirectoryName(assembly.Location);
#else
throw new NotImplementedException();
//TODO: find solution for metro
#endif
referenceName = Path.Combine(titleLocationPath, referenceName);
return TitleContainer.GetCleanPath(referenceName);
}
private string GetPathToReference(string referenceName)
{
int num = AssetName.LastIndexOfAny(new[] { '\\', '/', Path.DirectorySeparatorChar });
string path = "";
if (num != -1)
path = AssetName.Substring(0, num);
return Path.Combine(path, referenceName);
return Path.Combine(Path.GetDirectoryName(AssetName), referenceName);
}
}
}

View File

@ -67,9 +67,7 @@
<Reference Include="System.Net" />
</ItemGroup>
<ItemGroup>
<Compile Include="AddInSelector.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="AddInSelector.cs" />
<Compile Include="AddInSelector.Designer.cs">
<DependentUpon>AddInSelector.cs</DependentUpon>
</Compile>