added some more classes to our own ContentPipeline implementation

This commit is contained in:
Glatzemann 2012-08-16 07:30:59 +00:00
parent d17743ef3a
commit 91e6bff34c
16 changed files with 670 additions and 1 deletions

View File

@ -34,6 +34,21 @@
<Reference Include="System" />
</ItemGroup>
<ItemGroup>
<Compile Include="ChildCollection.cs" />
<Compile Include="ContentBuildLogger.cs" />
<Compile Include="ContentIdentity.cs" />
<Compile Include="ContentImporter.cs" />
<Compile Include="ContentImporterAttribute.cs" />
<Compile Include="ContentImporterContext.cs" />
<Compile Include="ContentItem.cs" />
<Compile Include="ContentProcessor.cs" />
<Compile Include="ContentProcessorAttribute.cs" />
<Compile Include="ContextProcessorContext.cs" />
<Compile Include="ExternalReference.cs" />
<Compile Include="IContentImporter.cs" />
<Compile Include="IContentProcessor.cs" />
<Compile Include="NamedValueDictionary.cs" />
<Compile Include="OpaqueDataDictionary.cs" />
<Compile Include="Serialization\Compiler\BuiltInTypeWriter.cs" />
<Compile Include="Serialization\Compiler\ContentCompiler.cs" />
<Compile Include="Serialization\Compiler\ContentTypeWriter.cs" />

View File

@ -0,0 +1,56 @@
#region Using Statements
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.ObjectModel;
#endregion
// This file is part of the ANX.Framework created by the
// "ANX.Framework developer group" and released under the Ms-PL license.
// For details see: http://anxframework.codeplex.com/license
namespace ANX.Framework.Content.Pipeline
{
public abstract class ChildCollection<TParent, TChild> : Collection<TChild> where TParent : class where TChild : class
{
protected ChildCollection(TParent parent)
{
throw new NotImplementedException();
}
protected override void ClearItems()
{
base.ClearItems();
throw new NotImplementedException();
}
protected abstract TParent GetParent(TChild child);
protected override void InsertItem(int index, TChild item)
{
base.InsertItem(index, item);
throw new NotImplementedException();
}
protected override void RemoveItem(int index)
{
base.RemoveItem(index);
throw new NotImplementedException();
}
protected override void SetItem(int index, TChild item)
{
base.SetItem(index, item);
throw new NotImplementedException();
}
protected abstract void SetParent(TChild child, TParent parent);
}
}

View File

@ -0,0 +1,41 @@
#region Using Statements
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
#endregion
// This file is part of the ANX.Framework created by the
// "ANX.Framework developer group" and released under the Ms-PL license.
// For details see: http://anxframework.codeplex.com/license
namespace ANX.Framework.Content.Pipeline
{
public abstract class ContentBuildLogger
{
protected ContentBuildLogger()
{
throw new NotImplementedException();
}
public abstract void LogImportantMessage(string message, params Object[] messageArgs);
public abstract void LogMessage(string message, params Object[] messageArgs);
public abstract void LogWarning(string helpLink, ContentIdentity contentIdentity, string message, params Object[] messageArgs);
public void PopFile()
{
throw new NotImplementedException();
}
public void PushFile(string filename)
{
throw new NotImplementedException();
}
protected string GetCurrentFilename(ContentIdentity contentIdentity)
{
throw new NotImplementedException();
}
}
}

View File

@ -0,0 +1,59 @@
#region Using Statements
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
#endregion
// This file is part of the ANX.Framework created by the
// "ANX.Framework developer group" and released under the Ms-PL license.
// For details see: http://anxframework.codeplex.com/license
namespace ANX.Framework.Content.Pipeline
{
[Serializable]
public class ContentIdentity
{
public ContentIdentity()
{
}
public ContentIdentity(string sourceFilename)
{
SourceFilename = sourceFilename;
}
public ContentIdentity(string sourceFilename, string sourceTool)
{
SourceFilename = sourceFilename;
SourceTool = sourceTool;
}
public ContentIdentity(string sourceFilename, string sourceTool, string fragmentIdentifier)
{
SourceFilename = sourceFilename;
SourceTool = sourceTool;
FragmentIdentifier = fragmentIdentifier;
}
public string FragmentIdentifier
{
get;
set;
}
public string SourceFilename
{
get;
set;
}
public string SourceTool
{
get;
set;
}
}
}

View File

@ -0,0 +1,28 @@
#region Using Statements
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
#endregion
// This file is part of the ANX.Framework created by the
// "ANX.Framework developer group" and released under the Ms-PL license.
// For details see: http://anxframework.codeplex.com/license
namespace ANX.Framework.Content.Pipeline
{
public abstract class ContentImporter<T> : IContentImporter
{
protected ContentImporter()
{
throw new NotImplementedException();
}
Object ANX.Framework.Content.Pipeline.IContentImporter.Import(string filename, ContentImporterContext context)
{
throw new NotImplementedException();
}
}
}

View File

@ -0,0 +1,51 @@
#region Using Statements
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
#endregion
// This file is part of the ANX.Framework created by the
// "ANX.Framework developer group" and released under the Ms-PL license.
// For details see: http://anxframework.codeplex.com/license
namespace ANX.Framework.Content.Pipeline
{
public class ContentImporterAttribute : Attribute
{
public ContentImporterAttribute(string fileExtension)
{
FileExtensions = new string[] { fileExtension };
}
public ContentImporterAttribute(params string[] fileExtensions)
{
FileExtensions = fileExtensions;
}
public bool CacheImportedData
{
get;
set;
}
public string DefaultProcessor
{
get;
set;
}
public virtual string DisplayName
{
get;
set;
}
public IEnumerable<string> FileExtensions
{
get;
private set;
}
}
}

View File

@ -0,0 +1,27 @@
#region Using Statements
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
#endregion
// This file is part of the ANX.Framework created by the
// "ANX.Framework developer group" and released under the Ms-PL license.
// For details see: http://anxframework.codeplex.com/license
namespace ANX.Framework.Content.Pipeline
{
public abstract class ContentImporterContext
{
public ContentImporterContext()
{
throw new NotImplementedException();
}
public abstract string IntermediateDirectory { get; }
public abstract ContentBuildLogger Logger { get; }
public abstract string OutputDirectory { get; }
public abstract void AddDependency(string filename);
}
}

View File

@ -0,0 +1,42 @@
#region Using Statements
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
#endregion
// This file is part of the ANX.Framework created by the
// "ANX.Framework developer group" and released under the Ms-PL license.
// For details see: http://anxframework.codeplex.com/license
namespace ANX.Framework.Content.Pipeline
{
public class ContentItem
{
public ContentItem()
{
throw new NotImplementedException();
}
public ContentIdentity Identity
{
get;
set;
}
public string Name
{
get;
set;
}
public OpaqueDataDictionary OpaqueData
{
get;
private set;
}
}
}

View File

@ -0,0 +1,39 @@
#region Using Statements
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
#endregion
// This file is part of the ANX.Framework created by the
// "ANX.Framework developer group" and released under the Ms-PL license.
// For details see: http://anxframework.codeplex.com/license
namespace ANX.Framework.Content.Pipeline
{
public abstract class ContentProcessor<TInput, TOutput> : IContentProcessor
{
protected ContentProcessor()
{
throw new NotImplementedException();
}
public abstract TOutput Process(TInput input, ContextProcessorContext context);
Type IContentProcessor.InputType
{
get { throw new NotImplementedException(); }
}
Type IContentProcessor.OutputType
{
get { throw new NotImplementedException(); }
}
object IContentProcessor.Process(object input, ContextProcessorContext context)
{
throw new NotImplementedException();
}
}
}

View File

@ -0,0 +1,27 @@
#region Using Statements
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
#endregion
// This file is part of the ANX.Framework created by the
// "ANX.Framework developer group" and released under the Ms-PL license.
// For details see: http://anxframework.codeplex.com/license
namespace ANX.Framework.Content.Pipeline
{
public class ContentProcessorAttribute : Attribute
{
public ContentProcessorAttribute()
{
}
public virtual string DisplayName
{
get;
set;
}
}
}

View File

@ -0,0 +1,57 @@
#region Using Statements
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ANX.Framework.Graphics;
#endregion
// This file is part of the ANX.Framework created by the
// "ANX.Framework developer group" and released under the Ms-PL license.
// For details see: http://anxframework.codeplex.com/license
namespace ANX.Framework.Content.Pipeline
{
public abstract class ContextProcessorContext
{
public ContextProcessorContext()
{
throw new NotImplementedException();
}
public abstract string BuildConfiguration { get; }
public abstract string IntermediateDirectory { get; }
public abstract ContentBuildLogger Logger { get; }
public abstract string OutputDirectory { get; }
public abstract string OutputFilename { get; }
public abstract OpaqueDataDictionary Parameters { get; }
public abstract TargetPlatform TargetPlatform { get; }
public abstract GraphicsProfile TargetProfile { get; }
public abstract void AddDependency(string filename);
public abstract void AddOutputFile(string filename);
public TOutput BuildAndLoadAsset<TInput, TOutput>(ExternalReference<TInput> sourceAsset, string processorName)
{
throw new NotImplementedException();
}
public abstract TOutput BuildAndLoadAsset<TInput, TOutput>(ExternalReference<TInput> sourceAsset, string processorName, OpaqueDataDictionary processorParameters, string importerName);
public ExternalReference<TOutput> BuildAsset<TInput, TOutput>(ExternalReference<TInput> sourceAsset, string processorName)
{
throw new NotImplementedException();
}
public abstract ExternalReference<TOutput> BuildAsset<TInput, TOutput>(ExternalReference<TInput> sourceAsset, string processorName, OpaqueDataDictionary processorParameters, string importerName, string assetName);
public TOutput Convert<TInput, TOutput>(TInput input, string processorName)
{
throw new NotImplementedException();
}
public abstract TOutput Convert<TInput, TOutput>(TInput input, string processorName, OpaqueDataDictionary processorParameters);
}
}

View File

@ -0,0 +1,38 @@
#region Using Statements
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
#endregion
// This file is part of the ANX.Framework created by the
// "ANX.Framework developer group" and released under the Ms-PL license.
// For details see: http://anxframework.codeplex.com/license
namespace ANX.Framework.Content.Pipeline
{
public sealed class ExternalReference<T> : ContentItem
{
public ExternalReference()
{
}
public ExternalReference(string filename)
{
Filename = filename;
}
public ExternalReference(string filename, ContentIdentity relativeToContent)
{
Filename = filename;
Identity = relativeToContent;
}
public string Filename
{
get;
set;
}
}
}

View File

@ -0,0 +1,16 @@
#region Using Statements
using System;
#endregion
// This file is part of the ANX.Framework created by the
// "ANX.Framework developer group" and released under the Ms-PL license.
// For details see: http://anxframework.codeplex.com/license
namespace ANX.Framework.Content.Pipeline
{
public interface IContentImporter
{
Object Import(string filename, ContentImporterContext context);
}
}

View File

@ -0,0 +1,21 @@
#region Using Statements
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
#endregion
// This file is part of the ANX.Framework created by the
// "ANX.Framework developer group" and released under the Ms-PL license.
// For details see: http://anxframework.codeplex.com/license
namespace ANX.Framework.Content.Pipeline
{
public interface IContentProcessor
{
Type InputType { get; }
Type OutputType { get; }
Object Process(Object input, ContextProcessorContext context);
}
}

View File

@ -0,0 +1,145 @@
#region Using Statements
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
#endregion
// This file is part of the ANX.Framework created by the
// "ANX.Framework developer group" and released under the Ms-PL license.
// For details see: http://anxframework.codeplex.com/license
namespace ANX.Framework.Content.Pipeline
{
public class NamedValueDictionary<T> : IDictionary<string, T>, ICollection<KeyValuePair<string, T>>, IEnumerable<KeyValuePair<string, T>>, IEnumerable
{
public NamedValueDictionary()
{
throw new NotImplementedException();
}
public int Count
{
get;
private set;
}
public T this[string key]
{
get
{
throw new NotImplementedException();
}
set
{
throw new NotImplementedException();
}
}
public ICollection<string> Keys
{
get
{
throw new NotImplementedException();
}
}
public ICollection<T> Values
{
get
{
throw new NotImplementedException();
}
}
protected internal virtual Type DefaultSerializerType
{
get
{
throw new NotImplementedException();
}
}
public void Add(string key, T value)
{
throw new NotImplementedException();
}
public void Clear()
{
throw new NotImplementedException();
}
public bool ContainsKey(string key)
{
throw new NotImplementedException();
}
public IEnumerator<KeyValuePair<string, T>> GetEnumerator()
{
throw new NotImplementedException();
}
public bool Remove(string key)
{
throw new NotImplementedException();
}
public bool TryGetValue(string key, out T value)
{
throw new NotImplementedException();
}
protected virtual void AddItem(string key, T value)
{
throw new NotImplementedException();
}
protected virtual void ClearItems()
{
throw new NotImplementedException();
}
protected virtual bool RemoveItem(string key)
{
throw new NotImplementedException();
}
protected virtual void SetItem(string key, T value)
{
throw new NotImplementedException();
}
bool ICollection<KeyValuePair<string, T>>.IsReadOnly
{
get { throw new NotImplementedException(); }
}
void ICollection<KeyValuePair<string, T>>.Add(KeyValuePair<string, T> item)
{
throw new NotImplementedException();
}
bool ICollection<KeyValuePair<string, T>>.Contains(KeyValuePair<string, T> item)
{
throw new NotImplementedException();
}
void ICollection<KeyValuePair<string, T>>.CopyTo(KeyValuePair<string, T>[] array, int arrayIndex)
{
throw new NotImplementedException();
}
IEnumerator IEnumerable.GetEnumerator()
{
throw new NotImplementedException();
}
bool ICollection<KeyValuePair<string, T>>.Remove(KeyValuePair<string, T> item)
{
throw new NotImplementedException();
}
}
}

View File

@ -1,4 +1,11 @@
using System;
#region Using Statements
using System;
#endregion
// This file is part of the ANX.Framework created by the
// "ANX.Framework developer group" and released under the Ms-PL license.
// For details see: http://anxframework.codeplex.com/license
namespace ANX.Framework.Content.Pipeline.Serialization.Compiler
{