Skip to content

Commit 5075857

Browse files
committed
Move SerializableAttribute usages into FEATURE_SERIALIZATION
1 parent c84f541 commit 5075857

File tree

56 files changed

+184
-109
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+184
-109
lines changed

src/Castle.Core.Tests/BugsReported/DynProxy159.cs

+7-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
#if !SILVERLIGHT
16+
1517
namespace CastleTests.BugsReported
1618
{
17-
#if !SILVERLIGHT
1819
using System;
1920
using System.IO;
2021
using System.Reflection;
@@ -74,12 +75,15 @@ public void ShouldSerializedMixofProxiedAndUnproxiedInstances()
7475
}
7576
}
7677

78+
#if FEATURE_SERIALIZATION
7779
[Serializable]
80+
#endif
7881
public class MySerialClass
7982
{
8083
public string xxx { get; set; }
8184
public double? yyy { get; set; }
8285
public int? zzz { get; set; }
8386
}
84-
#endif
85-
}
87+
}
88+
89+
#endif

src/Castle.Core.Tests/CrossAppDomainCaller.cs

+5-1
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,14 @@
1313
// limitations under the License.
1414

1515
#if !SILVERLIGHT
16+
1617
namespace Castle.DynamicProxy.Tests
1718
{
1819
using System;
1920

21+
#if FEATURE_SERIALIZATION
2022
[Serializable]
23+
#endif
2124
public class CrossAppDomainCaller
2225
{
2326
public static void RunInOtherAppDomain(Action<object[]> callback, params object[] args)
@@ -50,4 +53,5 @@ private void Run()
5053
}
5154
}
5255
}
53-
#endif
56+
57+
#endif

src/Castle.Core.Tests/DynamicProxy.Tests/Classes/ClassOverridingEqualsAndGetHashCode.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ namespace Castle.DynamicProxy.Tests.Classes
1616
{
1717
using System;
1818

19-
#if !SILVERLIGHT
19+
#if FEATURE_SERIALIZATION
2020
[Serializable]
2121
#endif
2222
public class ClassOverridingEqualsAndGetHashCode
@@ -72,4 +72,4 @@ public override int GetHashCode()
7272
return hash;
7373
}
7474
}
75-
}
75+
}

src/Castle.Core.Tests/DynamicProxy.Tests/Classes/ClassWithExplicitInterface.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ namespace Castle.DynamicProxy.Tests.Classes
1616
{
1717
using System;
1818

19-
#if !SILVERLIGHT
19+
#if FEATURE_SERIALIZATION
2020
[Serializable]
2121
#endif
2222
public class ClassWithExplicitInterface : ISimpleInterface
@@ -31,4 +31,4 @@ public virtual int DoVirtual()
3131
return 7;
3232
}
3333
}
34-
}
34+
}

src/Castle.Core.Tests/DynamicProxy.Tests/Classes/ClassWithInterface.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ namespace Castle.DynamicProxy.Tests.Classes
1616
{
1717
using System;
1818

19-
#if !SILVERLIGHT
19+
#if FEATURE_SERIALIZATION
2020
[Serializable]
2121
#endif
2222
public class ClassWithInterface : ISimpleInterface

src/Castle.Core.Tests/DynamicProxy.Tests/Classes/HasNonInheritableAttribute.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public virtual void Do2()
6060
}
6161
}
6262

63-
#if !SILVERLIGHT
63+
#if FEATURE_SERIALIZATION
6464
[Serializable]
6565
#endif
6666
[AttributeUsage(AttributeTargets.All, Inherited = false)]

src/Castle.Core.Tests/DynamicProxy.Tests/Classes/MySerializableClass.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ namespace Castle.DynamicProxy.Tests.Classes
2020
/// <summary>
2121
/// Summary description for MySerializableClass.
2222
/// </summary>
23-
#if !SILVERLIGHT
23+
#if FEATURE_SERIALIZATION
2424
[Serializable]
2525
#endif
2626
public class MySerializableClass
@@ -43,7 +43,7 @@ public virtual double CalculateSumDistanceNow()
4343
}
4444
}
4545

46-
#if !SILVERLIGHT
46+
#if FEATURE_SERIALIZATION
4747
[Serializable]
4848
public class MySerializableClass2 : MySerializableClass, ISerializable
4949
{

src/Castle.Core.Tests/DynamicProxy.Tests/Classes/NonInheritableAttribute.cs

+2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ namespace Castle.DynamicProxy.Tests.Classes
1616
{
1717
using System;
1818

19+
#if FEATURE_SERIALIZATION
1920
[Serializable]
21+
#endif
2022
[AttributeUsage(AttributeTargets.All, Inherited = false)]
2123
public class NonInheritableAttribute : Attribute
2224
{

src/Castle.Core.Tests/DynamicProxy.Tests/Classes/NonInheritableWithArray2Attribute.cs

+2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ namespace CastleTests.DynamicProxy.Tests.Classes
1616
{
1717
using System;
1818

19+
#if FEATURE_SERIALIZATION
1920
[Serializable]
21+
#endif
2022
[AttributeUsage(AttributeTargets.All, Inherited = false)]
2123
public class NonInheritableWithArray2Attribute : Attribute
2224
{

src/Castle.Core.Tests/DynamicProxy.Tests/Classes/NonInheritableWithArrayAttribute.cs

+2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ namespace CastleTests.DynamicProxy.Tests.Classes
1616
{
1717
using System;
1818

19+
#if FEATURE_SERIALIZATION
1920
[Serializable]
21+
#endif
2022
[AttributeUsage(AttributeTargets.All, Inherited = false)]
2123
public class NonInheritableWithArrayAttribute : Attribute
2224
{

src/Castle.Core.Tests/DynamicProxy.Tests/Explicit/SimpleInterfaceExplicit.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ namespace Castle.DynamicProxy.Tests.Explicit
1616
{
1717
using System;
1818

19-
#if !SILVERLIGHT
19+
#if FEATURE_SERIALIZATION
2020
[Serializable]
2121
#endif
2222
public class SimpleInterfaceExplicit : ISimpleInterface

src/Castle.Core.Tests/DynamicProxy.Tests/ProxyTypeCachingWithDifferentHooksTestCase.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ namespace Castle.DynamicProxy.Tests
2424
[TestFixture]
2525
public class ProxyTypeCachingWithDifferentHooksTestCase : BasePEVerifyTestCase
2626
{
27-
#if !SILVERLIGHT
27+
#if FEATURE_SERIALIZATION
2828
[Serializable]
2929
#endif
3030
public class CustomHook : AllMethodsHook { }

src/Castle.Core.Tests/DynamicProxy.Tests/Serialization/C.cs

+5-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
#if FEATURE_SERIALIZATION
16+
1517
namespace Castle.DynamicProxy.Tests.Serialization
1618
{
17-
#if !SILVERLIGHT
1819
using System;
1920

2021
[Serializable]
@@ -29,5 +30,6 @@ public C(int i)
2930
This = this;
3031
}
3132
}
32-
#endif
33-
}
33+
}
34+
35+
#endif

src/Castle.Core.Tests/DynamicProxy.Tests/Serialization/ClassWithDirectAndIndirectSelfReference.cs

+5-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
#if FEATURE_SERIALIZATION
16+
1517
namespace Castle.DynamicProxy.Tests.Serialization
1618
{
17-
#if !SILVERLIGHT
1819
using System;
1920
using System.Collections;
2021

@@ -30,5 +31,6 @@ public ClassWithDirectAndIndirectSelfReference()
3031
List.Add(this);
3132
}
3233
}
33-
#endif
34-
}
34+
}
35+
36+
#endif

src/Castle.Core.Tests/DynamicProxy.Tests/Serialization/ClassWithIndirectSelfReference.cs

+5-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
#if FEATURE_SERIALIZATION
16+
1517
namespace Castle.DynamicProxy.Tests.Serialization
1618
{
17-
#if !SILVERLIGHT
1819
using System;
1920
using System.Collections;
2021

@@ -28,5 +29,6 @@ public ClassWithIndirectSelfReference()
2829
List.Add(this);
2930
}
3031
}
31-
#endif
32-
}
32+
}
33+
34+
#endif

src/Castle.Core.Tests/DynamicProxy.Tests/Serialization/ComplexHolder.cs

+5-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
#if FEATURE_SERIALIZATION
16+
1517
namespace Castle.DynamicProxy.Tests.Serialization
1618
{
17-
#if !SILVERLIGHT
1819
using System;
1920

2021
[Serializable]
@@ -23,5 +24,6 @@ public class ComplexHolder
2324
public object Element;
2425
public Type Type;
2526
}
26-
#endif
27-
}
27+
}
28+
29+
#endif

src/Castle.Core.Tests/DynamicProxy.Tests/Serialization/DelegateHolder.cs

+5-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
#if FEATURE_SERIALIZATION
16+
1517
namespace Castle.DynamicProxy.Tests.Serialization
1618
{
17-
#if !SILVERLIGHT
1819
using System;
1920
using System.Collections;
2021

@@ -28,5 +29,6 @@ public void TestHandler(object sender, EventArgs e)
2829
{
2930
}
3031
}
31-
#endif
32-
}
32+
}
33+
34+
#endif

src/Castle.Core.Tests/DynamicProxy.Tests/Serialization/EventHandlerClass.cs

+5-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
#if FEATURE_SERIALIZATION
16+
1517
namespace Castle.DynamicProxy.Tests.Serialization
1618
{
17-
#if !SILVERLIGHT
1819
using System;
1920

2021
[Serializable]
@@ -24,5 +25,6 @@ public void TestHandler(object sender, EventArgs e)
2425
{
2526
}
2627
}
27-
#endif
28-
}
28+
}
29+
30+
#endif

src/Castle.Core.Tests/DynamicProxy.Tests/Serialization/IndirectDelegateHolder.cs

+5-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
#if FEATURE_SERIALIZATION
16+
1517
namespace Castle.DynamicProxy.Tests.Serialization
1618
{
17-
#if !SILVERLIGHT
1819
using System;
1920

2021
[Serializable]
@@ -26,5 +27,6 @@ public void TestHandler(object sender, EventArgs e)
2627
{
2728
}
2829
}
29-
#endif
30-
}
30+
}
31+
32+
#endif

src/Castle.Core.Tests/DynamicProxy.Tests/Serialization/MethodFilterHook.cs

+5-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
#if FEATURE_SERIALIZATION
16+
1517
namespace Castle.DynamicProxy.Tests.Serialization
1618
{
17-
#if !SILVERLIGHT
1819
using System;
1920
using System.Reflection;
2021
using System.Text.RegularExpressions;
@@ -42,5 +43,6 @@ public bool ShouldInterceptMethod(Type type, MethodInfo memberInfo)
4243
return Regex.IsMatch(memberInfo.Name, nameFilter);
4344
}
4445
}
45-
#endif
46-
}
46+
}
47+
48+
#endif

src/Castle.Core.Tests/DynamicProxy.Tests/Serialization/SerializableExplicitImpl.cs

+5-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
#if FEATURE_SERIALIZATION
16+
1517
namespace Castle.DynamicProxy.Tests.Serialization
1618
{
17-
#if !SILVERLIGHT
1819
using System;
1920
using System.Runtime.Serialization;
2021

@@ -25,5 +26,6 @@ void ISerializable.GetObjectData(SerializationInfo info, StreamingContext contex
2526
{
2627
}
2728
}
28-
#endif
29-
}
29+
}
30+
31+
#endif

0 commit comments

Comments
 (0)