Skip to content

Commit

Permalink
Ignore indexers in ReflectiveSerializer.
Browse files Browse the repository at this point in the history
Fixes #3439.
  • Loading branch information
Tim Jones committed Feb 1, 2015
1 parent 0cdd2eb commit a0cf967
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
Expand Up @@ -65,6 +65,10 @@ private bool GetElementInfo(IntermediateSerializer serializer, MemberInfo member
if (prop.GetSetMethod() == null &&
prop.PropertyType.Namespace == "System")
return false;

// Don't serialize or deserialize indexers.
if (prop.GetIndexParameters().Any())
return false;
}
else if (field != null)
{
Expand Down
7 changes: 7 additions & 0 deletions Test/ContentPipeline/AssetTestClasses.cs
Expand Up @@ -135,6 +135,13 @@ public class Collections
public List<string> StringList;
public int[] IntArray;
public Color[] ColorArray;

// Indexer - should be ignored by intermediate serializer.
public Color this[int i]
{
get { return ColorArray[i]; }
set { ColorArray[i] = value; }
}
}
#endregion

Expand Down

2 comments on commit a0cf967

@mgbot
Copy link
Member

@mgbot mgbot commented on a0cf967 Feb 1, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TeamCity MonoGame :: Develop (Win) Build 3.3.0.1999 is now running

@mgbot
Copy link
Member

@mgbot mgbot commented on a0cf967 Feb 1, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TeamCity MonoGame :: Develop (Win) Build 3.3.0.1999 outcome was SUCCESS
Summary: Tests passed: 368, ignored: 6 Build time: 00:15:53

Please sign in to comment.