Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static HashSet<Type> _classesConvertable = new HashSet<Type>();
- static HashSet<Type> _classesNonConvertable = new HashSet<Type>();
- public override bool CanConvert(Type objectType)
- {
- if (_classesConvertable.Contains(objectType)) return true;
- if(_classesNonConvertable.Contains(objectType)) return false;
- if (typeof(IContainSecretData).IsAssignableFrom(objectType))
- {
- _classesConvertable.Add(objectType);
- return true;
- }
- else
- {
- _classesNonConvertable.Add(objectType);
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement