- 12 12月, 2014 1 次提交
-
-
由 tanghai 提交于
-
- 17 11月, 2014 1 次提交
-
-
由 tanghai 提交于
2.整理一下代码
-
- 14 11月, 2014 3 次提交
- 12 11月, 2014 1 次提交
-
-
由 tanghai 提交于
2.回调不能使用delegate,delegate会导致无法reload.使用事件分发同的回调事件,比如BuffTimeout了会分发到BuffTimeoutCallback类中进行回调处理
-
- 10 11月, 2014 3 次提交
- 31 10月, 2014 2 次提交
- 30 10月, 2014 3 次提交
-
-
由 tanghai 提交于
-
由 tanghai 提交于
-
由 tanghai 提交于
2.本来想让Object支持集合初始化形式,例如 Object obj = new Object {{"a", 1}}. 这样需要继承IEnumerable,并且需要添加一个Add(string key, object value)方法,但是一旦实现IEnumerable接口,Mongdb会使用EnumerableSerializer序列化该类,导致异常. google到如下说明: https://jira.mongodb.org/browse/CSHARP-460 Here is a summary of the current situation: 1. Any class that subclasses a .NET collection class ends up being serialized using BsonClassMapSerializer, which doesn't work because the .NET collection class isn't designed the way BsonClassMapSerializer expects 2. As a result, the serialized document contains any public properties added by the derived class but does not contain the collection itself Item 2 is particularly surprising to people... The plan is to change the serialization of classes that implement collection interfaces to work better in more cases (but unfortunately not all). The new approach is essentially identical to that taken by the XmlSerializer in .NET. The new approach will be: 1. Any class that implements IDictionary<TKey, TValue> will be serialized using DictionarySerializer<TKey, TValue> 2. Any class that implements IDictionary will be serialized using DictionarySerializer 2. Any class that implements IEnumerable<T> will be serialized using EnumerableSerializer<T> 3. Any class that implements IEnumerable will be serialized using EnumerableSerializer Classes that implement IEnumerable<T> will also have to implement ICollection<T> if deserialization is desired (the Add method in ICollection<T> is needed for deserialization). Classes that implement IEnumerable will also have to implement IList if deserialization is desired (the Add method in IList is needed for deserialization). NOTE: just like with XmlSerializer, if your custom class implements either IEnumerable or IDictionary (legacy or generic) then ONLY the collection values will be serialized. If your custom class added additional public properties they will NOT be serialized. This is the opposite behavior as before, but is wrong less often (not serializing the collection values is always wrong, but custom collections that don't have additional properties are now serialized correctly). If you want to serialize your additional properties along with the collection values you will have to encapsulate and delegate to the collection class instead of subclassing it. Alex's suggestion to add a KeyValuePairSerializer<TKey, TValue> is a good one also. Work is in progress on this change.
-
- 29 10月, 2014 2 次提交
- 28 10月, 2014 1 次提交
-
-
由 tanghai 提交于
-
- 27 10月, 2014 2 次提交
- 21 10月, 2014 3 次提交
- 16 10月, 2014 3 次提交
- 15 10月, 2014 2 次提交
- 14 10月, 2014 2 次提交
- 09 10月, 2014 1 次提交
-
-
由 tanghai 提交于
-
- 08 10月, 2014 1 次提交
-
-
由 tanghai 提交于
-
- 19 9月, 2014 1 次提交
-
-
由 tanghai 提交于
-
- 16 9月, 2014 1 次提交
-
-
由 tanghai 提交于
-
- 15 9月, 2014 1 次提交
-
-
由 tanghai 提交于
-
- 09 9月, 2014 1 次提交
-
-
由 tanghai 提交于
-
- 04 9月, 2014 1 次提交
-
-
由 tanghai 提交于
-
- 25 8月, 2014 1 次提交
-
-
由 tanghai 提交于
-
- 22 8月, 2014 1 次提交
-
-
由 tanghai 提交于
-
- 19 8月, 2014 1 次提交
-
-
由 tanghai 提交于
-
- 18 8月, 2014 1 次提交
-
-
由 tanghai 提交于
2.Event相关放入Common.Event里面
-