PageRenderTime 22ms CodeModel.GetById 18ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

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