/src/SampleLibrary/Proxy/SerializableInterceptor.cs

http://github.com/philiplaureano/LinFu · C# · 33 lines · 26 code · 7 blank · 0 comment · 0 complexity · 41debd5d667556f12b5fbdafe4bd45ca MD5 · raw file

  1. using System;
  2. using System.Runtime.Serialization;
  3. using LinFu.AOP.Interfaces;
  4. namespace SampleLibrary.Proxy
  5. {
  6. [Serializable]
  7. public class SerializableInterceptor : MarshalByRefObject, IInterceptor, ISerializable
  8. {
  9. public SerializableInterceptor()
  10. {
  11. }
  12. public SerializableInterceptor(SerializationInfo info, StreamingContext context)
  13. {
  14. Identifier = (Guid) info.GetValue("identifier", typeof(Guid));
  15. }
  16. public Guid Identifier { get; set; }
  17. public object Intercept(IInvocationInfo info)
  18. {
  19. return null;
  20. }
  21. public void GetObjectData(SerializationInfo info, StreamingContext context)
  22. {
  23. info.AddValue("identifier", Identifier);
  24. }
  25. }
  26. }