bool _strictBinding = false;
IDictionary _properties;
-#if NET_1_1
- TypeFilterLevel _filterLevel = TypeFilterLevel.Low;
-#endif
-
- public static BinaryCore DefaultInstance = new BinaryCore ();
+ TypeFilterLevel _filterLevel;
+ public static BinaryCore DefaultInstance = new BinaryCore (TypeFilterLevel.Low);
+ public static readonly BinaryCore DefaultClientInstance = new BinaryCore (TypeFilterLevel.Full);
+
public BinaryCore (object owner, IDictionary properties, string[] allowedProperties)
{
_properties = properties;
+ if (_properties == null)
+ {
+ _properties = new Hashtable(10);
+ }
+
foreach(DictionaryEntry property in properties)
{
string key = (string) property.Key;
_strictBinding = Convert.ToBoolean (property.Value);
break;
-#if NET_1_1
case "typeFilterLevel":
if (property.Value is TypeFilterLevel)
_filterLevel = (TypeFilterLevel) property.Value;
_filterLevel = (TypeFilterLevel) Enum.Parse (typeof(TypeFilterLevel), s);
}
break;
-#endif
}
}
Init ();
}
- public BinaryCore ()
+ public BinaryCore (TypeFilterLevel filterLevel)
{
+ _filterLevel = filterLevel;
_properties = new Hashtable ();
Init ();
}
_serializationFormatter = new BinaryFormatter (surrogateSelector, context);
_deserializationFormatter = new BinaryFormatter (null, context);
-#if NET_1_1
_serializationFormatter.FilterLevel = _filterLevel;
_deserializationFormatter.FilterLevel = _filterLevel;
-#endif
if (!_includeVersions)
{
get { return _properties; }
}
-#if NET_1_1
public TypeFilterLevel TypeFilterLevel
{
get { return _filterLevel; }
}
-#endif
}
}