Skip to content

Commit b212b58

Browse files
committed
Update SS.Interfaces to support PCL's
1 parent 28e07ae commit b212b58

53 files changed

Lines changed: 872 additions & 141 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<MinimumVisualStudioVersion>11.0</MinimumVisualStudioVersion>
6+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
7+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
8+
<ProjectGuid>{42E1C8C0-A163-44CC-92B1-8F416F2C0B01}</ProjectGuid>
9+
<OutputType>Library</OutputType>
10+
<AppDesignerFolder>Properties</AppDesignerFolder>
11+
<RootNamespace>ServiceStack</RootNamespace>
12+
<AssemblyName>ServiceStack.Interfaces</AssemblyName>
13+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
14+
<TargetFrameworkProfile>Profile7</TargetFrameworkProfile>
15+
<FileAlignment>512</FileAlignment>
16+
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
17+
</PropertyGroup>
18+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
19+
<DebugSymbols>true</DebugSymbols>
20+
<DebugType>full</DebugType>
21+
<Optimize>false</Optimize>
22+
<OutputPath>bin\PclDebug\</OutputPath>
23+
<DefineConstants>PCL;DEBUG;TRACE</DefineConstants>
24+
<ErrorReport>prompt</ErrorReport>
25+
<WarningLevel>4</WarningLevel>
26+
</PropertyGroup>
27+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
28+
<DebugType>pdbonly</DebugType>
29+
<Optimize>true</Optimize>
30+
<OutputPath>bin\Pcl\</OutputPath>
31+
<DefineConstants>PCL;TRACE</DefineConstants>
32+
<ErrorReport>prompt</ErrorReport>
33+
<WarningLevel>4</WarningLevel>
34+
</PropertyGroup>
35+
<ItemGroup>
36+
<!-- A reference to the entire .NET Framework is automatically included -->
37+
</ItemGroup>
38+
<ItemGroup>
39+
<Compile Include="AsyncState.cs" />
40+
<Compile Include="AsyncServiceClient.cs" />
41+
<Compile Include="AsyncUtils.cs" />
42+
<Compile Include="AuthDtos.cs" />
43+
<Compile Include="ClientFactory.cs" />
44+
<Compile Include="ContentFormat.cs" />
45+
<Compile Include="Messaging\InMemoryMessageQueueClient.cs" />
46+
<Compile Include="MessageExtensions.cs" />
47+
<Compile Include="Messaging\MessageQueueClientFactory.cs" />
48+
<Compile Include="NameValueCollectionExtensions.cs" />
49+
<Compile Include="GenericProxy.cs" />
50+
<Compile Include="IDuplex.cs" />
51+
<Compile Include="IDuplexCallback.cs" />
52+
<Compile Include="IOneWay.cs" />
53+
<Compile Include="ISyncReply.cs" />
54+
<Compile Include="IWcfServiceClient.cs" />
55+
<Compile Include="JsonServiceClient.cs" />
56+
<Compile Include="JsvServiceClient.cs" />
57+
<Compile Include="Properties\AssemblyInfo.cs" />
58+
<Compile Include="Messaging\RedisMessageFactory.cs" />
59+
<Compile Include="Messaging\RedisMessageProducer.cs" />
60+
<Compile Include="Messaging\RedisMessageQueueClient.cs" />
61+
<Compile Include="Messaging\RedisMessageQueueClientFactory.cs" />
62+
<Compile Include="RequestContext.cs" />
63+
<Compile Include="ResponseStatusUtils.cs" />
64+
<Compile Include="RouteMember.cs" />
65+
<Compile Include="Serialization\DataContractSerializer.Deserialize.cs" />
66+
<Compile Include="Serialization\DataContractSerializer.cs" />
67+
<Compile Include="Serialization\IStringSerializer.cs" />
68+
<Compile Include="Serialization\IStringStreamSerializer.cs" />
69+
<Compile Include="Serialization\JsonDataContractSerializer.Deserialize.cs" />
70+
<Compile Include="Serialization\JsonDataContractSerializer.cs" />
71+
<Compile Include="Serialization\KeyValueDataContractDeserializer.cs" />
72+
<Compile Include="Serialization\StringMapTypeDeserializer.cs" />
73+
<Compile Include="Serialization\XmlSerializableSerializer.Deserialize.cs" />
74+
<Compile Include="Serialization\XmlSerializableSerializer.cs" />
75+
<Compile Include="Serialization\XmlSerializableWrapper.cs" />
76+
<Compile Include="ServiceClientBase.cs" />
77+
<Compile Include="Soap11ServiceClient.cs" />
78+
<Compile Include="Soap12ServiceClient.cs" />
79+
<Compile Include="StreamExtensions.cs" />
80+
<Compile Include="Support\NetDeflateProvider.cs" />
81+
<Compile Include="Support\NetGZipProvider.cs" />
82+
<Compile Include="UrlExtensions.cs" />
83+
<Compile Include="Validation\ValidationError.cs" />
84+
<Compile Include="Validation\ValidationErrorField.cs" />
85+
<Compile Include="Validation\ValidationErrorResult.cs" />
86+
<Compile Include="WcfServiceClient.cs" />
87+
<Compile Include="WebRequestUtils.cs" />
88+
<Compile Include="WebServiceException.cs" />
89+
<Compile Include="XmlServiceClient.cs" />
90+
</ItemGroup>
91+
<!--ItemGroup,Content-->
92+
<!--ItemGroup,None-->
93+
<ItemGroup>
94+
<ProjectReference Include="..\..\..\ServiceStack.Text\src\ServiceStack.Text\ServiceStack.Text.PCL.csproj">
95+
<Project>{579B3FDB-CDAD-44E1-8417-885C38E49A0E}</Project>
96+
<Name>ServiceStack.Text.PCL</Name>
97+
</ProjectReference>
98+
<ProjectReference Include="..\ServiceStack.Interfaces\ServiceStack.Interfaces.PCL.csproj">
99+
<Project>{42E1C8C0-A163-44CC-92B1-8F416F2C0B01}</Project>
100+
<Name>ServiceStack.Interfaces.PCL</Name>
101+
</ProjectReference>
102+
</ItemGroup>
103+
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
104+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
105+
Other similar extension points exist, see Microsoft.Common.targets.
106+
<Target Name="BeforeBuild">
107+
</Target>
108+
<Target Name="AfterBuild">
109+
</Target>
110+
-->
111+
</Project>

src/ServiceStack.Interfaces/Data/DbConnectionFactory.cs renamed to src/ServiceStack.Common/Data/DbConnectionFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if !SILVERLIGHT
1+
#if !SL5
22
using System;
33
using System.Data;
44

src/ServiceStack.Interfaces/Data/IDbConnectionFactory.cs renamed to src/ServiceStack.Common/Data/IDbConnectionFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if !SILVERLIGHT
1+
#if !SL5
22
using System.Data;
33

44
namespace ServiceStack.Data

src/ServiceStack.Interfaces/Data/IHasDbConnection.cs renamed to src/ServiceStack.Common/Data/IHasDbConnection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//Copyright (c) Service Stack LLC. All Rights Reserved.
22
//License: https://raw.github.com/ServiceStack/ServiceStack/master/license.txt
33

4-
#if !SILVERLIGHT && !XBOX
4+
#if !SL5 && !XBOX
55
using System.Data;
66

77
namespace ServiceStack.Data

src/ServiceStack.Interfaces/Logging/ConsoleLogFactory.cs renamed to src/ServiceStack.Common/Logging/ConsoleLogFactory.cs

File renamed without changes.
File renamed without changes.
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
using System;
2+
using System.Collections;
3+
using System.Collections.Specialized;
4+
using ServiceStack.Web;
5+
6+
namespace ServiceStack
7+
{
8+
public class NameValueCollectionWrapper : INameValueCollection
9+
{
10+
private readonly NameValueCollection data;
11+
12+
public NameValueCollectionWrapper(NameValueCollection data)
13+
{
14+
this.data = data;
15+
}
16+
17+
public IEnumerator GetEnumerator()
18+
{
19+
return data.GetEnumerator();
20+
}
21+
22+
public object Original
23+
{
24+
get { return data; }
25+
}
26+
27+
public void Add(string name, string value)
28+
{
29+
data.Add(name, value);
30+
}
31+
32+
public void Clear()
33+
{
34+
data.Clear();
35+
}
36+
37+
public void CopyTo(Array dest, int index)
38+
{
39+
data.CopyTo(dest, index);
40+
}
41+
42+
public string Get(int index)
43+
{
44+
return data.Get(index);
45+
}
46+
47+
public string Get(string name)
48+
{
49+
return data.Get(name);
50+
}
51+
52+
public string GetKey(int index)
53+
{
54+
return data.GetKey(index);
55+
}
56+
57+
public string[] GetValues(string name)
58+
{
59+
return data.GetValues(name);
60+
}
61+
62+
public bool HasKeys()
63+
{
64+
return data.HasKeys();
65+
}
66+
67+
public void Remove(string name)
68+
{
69+
data.Remove(name);
70+
}
71+
72+
public void Set(string name, string value)
73+
{
74+
data.Set(name, value);
75+
}
76+
77+
public string this[int index]
78+
{
79+
get { return data[index]; }
80+
}
81+
82+
public string this[string name]
83+
{
84+
get { return data[name]; }
85+
set { data[name] = value; }
86+
}
87+
88+
public string[] AllKeys
89+
{
90+
get { return data.AllKeys; }
91+
}
92+
93+
public int Count
94+
{
95+
get { return data.Count; }
96+
}
97+
98+
private bool readOnly;
99+
public bool IsReadOnly
100+
{
101+
get { return readOnly; }
102+
set { readOnly = value; }
103+
}
104+
105+
public object SyncRoot
106+
{
107+
get { return data; }
108+
}
109+
110+
public bool IsSynchronized
111+
{
112+
get { return false; }
113+
}
114+
115+
public static NameValueCollectionWrapper New()
116+
{
117+
return new NameValueCollectionWrapper(new NameValueCollection());
118+
}
119+
}
120+
121+
public static class NameValueCollectionWrapperExtensions
122+
{
123+
public static NameValueCollectionWrapper InWrapper(this NameValueCollection nvc)
124+
{
125+
return new NameValueCollectionWrapper(nvc);
126+
}
127+
128+
public static NameValueCollection ToNameValueCollection(this INameValueCollection nvc)
129+
{
130+
return (NameValueCollection)nvc.Original;
131+
}
132+
}
133+
134+
}

src/ServiceStack.Interfaces/ApiAllowableValuesAttribute.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
//License: https://raw.github.com/ServiceStack/ServiceStack/master/license.txt
33

44
using System;
5+
using System.Reflection;
56

67
namespace ServiceStack
78
{
@@ -29,8 +30,12 @@ public ApiAllowableValuesAttribute(string name, params string[] values)
2930
public ApiAllowableValuesAttribute(string name, Type enumType)
3031
: this(name)
3132
{
32-
if (enumType.IsEnum)
33-
{
33+
#if (NETFX_CORE || PCL)
34+
if (enumType.GetTypeInfo().IsEnum)
35+
#else
36+
if (enumType.IsEnum())
37+
#endif
38+
{
3439
Type = "LIST";
3540
Values = System.Enum.GetNames(enumType);
3641
}

src/ServiceStack.Interfaces/AttributeBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace ServiceStack
88
{
99
public class AttributeBase : Attribute
1010
{
11-
#if !(NETFX_CORE || WINDOWS_PHONE || SILVERLIGHT || PCL)
11+
#if !(NETFX_CORE || WP || SL5 || PCL)
1212
/// <summary>
1313
/// Required when using a TypeDescriptor to make it unique
1414
/// </summary>

src/ServiceStack.Interfaces/Caching/ISessionFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if !SILVERLIGHT && !MONOTOUCH && !XBOX
1+
#if !SL5 && !IOS && !XBOX
22
using ServiceStack.Web;
33

44
namespace ServiceStack.Caching

0 commit comments

Comments
 (0)