Skip to content

Commit 7bfc94c

Browse files
committed
Merge pull request #127 from Code-Sharp/develop
Making contracts serializable
2 parents 71396ff + d5e3437 commit 7bfc94c

33 files changed

+89
-30
lines changed

src/mono/WampSharp/WampSharp.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,9 @@
260260
<Compile Include="..\..\net45\WampSharp\Core\Utilities\Method.cs">
261261
<Link>Core\Utilities\Method.cs</Link>
262262
</Compile>
263+
<Compile Include="..\..\net45\WampSharp\Core\Utilities\SerializableAttribute.cs">
264+
<Link>Core\Utilities\SerializableAttribute.cs</Link>
265+
</Compile>
263266
<Compile Include="..\..\net45\WampSharp\Core\Utilities\ReadOnlyDictionary.cs">
264267
<Link>Core\Utilities\ReadOnlyDictionary.cs</Link>
265268
</Compile>

src/net40/WampSharp/WampSharp.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,9 @@
264264
<Compile Include="..\..\net45\WampSharp\Core\Utilities\Method.cs">
265265
<Link>Core\Utilities\Method.cs</Link>
266266
</Compile>
267+
<Compile Include="..\..\net45\WampSharp\Core\Utilities\SerializableAttribute.cs">
268+
<Link>Core\Utilities\SerializableAttribute.cs</Link>
269+
</Compile>
267270
<Compile Include="..\..\net45\WampSharp\Core\Utilities\ReadOnlyDictionary.cs">
268271
<Link>Core\Utilities\ReadOnlyDictionary.cs</Link>
269272
</Compile>

src/net45/WampSharp.WAMP1/WAMP1/V1/Api/Server/WampRequestContext.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55

66
namespace WampSharp.V1
77
{
8-
#if !PCL
98
[Serializable]
10-
#endif
119
public class WampRequestContext
1210
{
1311
#region Static Members
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#if PCL
2+
3+
namespace System
4+
{
5+
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
6+
internal sealed class SerializableAttribute : Attribute
7+
{
8+
}
9+
10+
[AttributeUsage(AttributeTargets.Field, Inherited = false, AllowMultiple = false)]
11+
internal sealed class NonSerializedAttribute : Attribute
12+
{
13+
}
14+
}
15+
16+
#endif

src/net45/WampSharp/WAMP2/V2/Api/WampEventContext.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ namespace WampSharp.V2
99
/// <summary>
1010
/// Includes information about the current event.
1111
/// </summary>
12-
#if !PCL
1312
[Serializable]
14-
#endif
1513
public class WampEventContext
1614
{
1715

src/net45/WampSharp/WAMP2/V2/Api/WampInvocationContext.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ namespace WampSharp.V2
1010
/// <summary>
1111
/// Includes information about the current invocation.
1212
/// </summary>
13-
#if !PCL
1413
[Serializable]
15-
#endif
1614
public class WampInvocationContext
1715
{
1816
#region Static Members

src/net45/WampSharp/WAMP2/V2/Authentication/WampAuthenticationException.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ namespace WampSharp.V2.Authentication
77
/// An exception that can be thrown if can't authenticate with router.
88
/// This sends an ABORT message to the router.
99
/// </summary>
10-
#if !PCL
1110
[Serializable]
12-
#endif
1311
public class WampAuthenticationException : Exception
1412
{
1513
protected const string DefaultMessage = "sorry, I cannot authenticate (onchallenge handler raised an exception)";

src/net45/WampSharp/WAMP2/V2/Client/Session/WampAuthenticationNotImplementedException.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ namespace WampSharp.V2.Client
88
/// Occurs when an CHALLENGE message has been received,
99
/// but no <see cref="IWampClientAuthenticator"/> has been provided.
1010
/// </summary>
11-
#if !PCL
1211
[Serializable]
13-
#endif
1412
public class WampAuthenticationNotImplementedException : WampAuthenticationException
1513
{
1614
/// <summary>

src/net45/WampSharp/WAMP2/V2/Client/WampSessionNotEstablishedException.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33

44
namespace WampSharp.V2.Client
55
{
6-
#if !PCL
76
[Serializable]
8-
#endif
97
public class WampSessionNotEstablishedException : Exception
108
{
119
public WampSessionNotEstablishedException() : this("No connection to router is currently available.")

src/net45/WampSharp/WAMP2/V2/Core/Contracts/PubSub/EventDetails.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using System;
12
using System.Runtime.Serialization;
23
using WampSharp.Core.Message;
34

@@ -7,6 +8,7 @@ namespace WampSharp.V2.Core.Contracts
78
/// Represents details for EVENT message.
89
/// </summary>
910
[DataContract]
11+
[Serializable]
1012
[WampDetailsOptions(WampMessageType.v2Event)]
1113
public class EventDetails : WampDetailsOptions
1214
{

0 commit comments

Comments
 (0)