Open GoogleCodeExporter opened 9 years ago
That's very good idea. I would probably use a different method name though to
distinguish it:
void IgnorePropertiesMatching(string pattern)
void IgnorePropertiesMatching(RegExp pattern)
Original comment by elliott....@gmail.com
on 6 Oct 2010 at 10:08
Glad to hear it. For anyone else viewing this ticket who wants to do something
like this prior to the future release, here's an example of how I've gone about
it:
var td = s.Config.GetTypeHandler(object_to_serialize.GetType());
Regex sampleRegex = new Regex(
"IgnoreThisPropertyRegularExpression",
RegexOptions.Multiline
| RegexOptions.CultureInvariant
| RegexOptions.Compiled
);
foreach (var prop in td.AllProperties)
{
if(sampleRegex.IsMatch(prop.Name))
{
prop.Ignored = true;
}
else
{
prop.Ignored = false;
}
}
Original comment by mustafa....@wearemammoth.com
on 6 Oct 2010 at 10:26
Original issue reported on code.google.com by
mustafa....@wearemammoth.com
on 6 Oct 2010 at 6:46