2012-08-09 09:45:04 +00:00
|
|
|
#region Using Statements
|
2011-10-31 05:36:24 +00:00
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Collections;
|
2012-10-13 10:51:27 +00:00
|
|
|
using System.Linq;
|
2012-10-10 19:26:53 +00:00
|
|
|
using ANX.Framework.NonXNA.Development;
|
2011-10-31 05:36:24 +00:00
|
|
|
|
|
|
|
#endregion // Using Statements
|
|
|
|
|
2012-08-09 09:45:04 +00:00
|
|
|
// 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
|
2011-10-31 05:36:24 +00:00
|
|
|
|
|
|
|
namespace ANX.Framework.Graphics
|
|
|
|
{
|
2012-10-13 10:51:27 +00:00
|
|
|
[PercentageComplete(100)]
|
|
|
|
[Developer("AstrorEnales")]
|
2012-10-10 19:26:53 +00:00
|
|
|
[TestState(TestStateAttribute.TestState.Untested)]
|
2011-10-31 05:36:24 +00:00
|
|
|
public sealed class EffectAnnotationCollection : IEnumerable<EffectAnnotation>
|
|
|
|
{
|
2012-10-13 10:51:27 +00:00
|
|
|
private readonly List<EffectAnnotation> annotations;
|
|
|
|
|
|
|
|
public int Count
|
|
|
|
{
|
|
|
|
get { return annotations.Count; }
|
|
|
|
}
|
|
|
|
|
2011-10-31 05:36:24 +00:00
|
|
|
public EffectAnnotation this[int index]
|
|
|
|
{
|
2012-10-13 10:51:27 +00:00
|
|
|
get { return index >= 0 && index < annotations.Count ? annotations[index] : null; }
|
2011-10-31 05:36:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public EffectAnnotation this[string name]
|
|
|
|
{
|
2012-10-13 10:51:27 +00:00
|
|
|
get { return annotations.FirstOrDefault(annotation => annotation.Name == name); }
|
2011-10-31 05:36:24 +00:00
|
|
|
}
|
|
|
|
|
2012-10-13 13:12:07 +00:00
|
|
|
internal EffectAnnotationCollection(List<EffectAnnotation> setAnnotations)
|
2011-10-31 05:36:24 +00:00
|
|
|
{
|
2012-10-13 13:12:07 +00:00
|
|
|
annotations = setAnnotations ?? new List<EffectAnnotation>();
|
2011-10-31 05:36:24 +00:00
|
|
|
}
|
|
|
|
|
2012-10-13 10:51:27 +00:00
|
|
|
IEnumerator<EffectAnnotation> IEnumerable<EffectAnnotation>.GetEnumerator()
|
2011-10-31 05:36:24 +00:00
|
|
|
{
|
2012-10-13 10:51:27 +00:00
|
|
|
return annotations.GetEnumerator();
|
2011-10-31 05:36:24 +00:00
|
|
|
}
|
|
|
|
|
2012-10-13 10:51:27 +00:00
|
|
|
IEnumerator IEnumerable.GetEnumerator()
|
2011-10-31 05:36:24 +00:00
|
|
|
{
|
2012-10-13 10:51:27 +00:00
|
|
|
return annotations.GetEnumerator();
|
2011-10-31 05:36:24 +00:00
|
|
|
}
|
|
|
|
|
2012-10-13 10:51:27 +00:00
|
|
|
public List<EffectAnnotation>.Enumerator GetEnumerator()
|
2011-10-31 05:36:24 +00:00
|
|
|
{
|
2012-10-13 10:51:27 +00:00
|
|
|
return annotations.GetEnumerator();
|
2011-10-31 05:36:24 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|