Disposer.cs 351 B

12345678910111213141516171819202122
  1. using MongoDB.Bson.Serialization.Attributes;
  2. namespace Hotfix
  3. {
  4. public abstract class Disposer : Object, IDisposable2
  5. {
  6. [BsonIgnoreIfDefault]
  7. [BsonDefaultValue(1L)]
  8. [BsonElement]
  9. public long Id { get; set; }
  10. protected Disposer()
  11. {
  12. ObjectEvents.Instance.Add(this);
  13. }
  14. public virtual void Dispose()
  15. {
  16. this.Id = 0;
  17. }
  18. }
  19. }