summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatthewsotoudeh <matthewsot@outlook.com>2014-06-06 22:47:26 -0700
committermatthewsotoudeh <matthewsot@outlook.com>2014-06-06 22:47:26 -0700
commit2a535e360372cd774efa198f53e26a0f4da8fb75 (patch)
treed78779a5492a69c3cbe9ab33e8308f50018d3990
parent6580fd946139cb3d23825532d41a5606a16db4ff (diff)
Added README
-rw-r--r--.gitattributes63
-rw-r--r--.gitignore1
-rw-r--r--README.md6
-rw-r--r--Universals/Universals.sln22
-rw-r--r--Universals/WebClient/C#/WebClient/Properties/AssemblyInfo.cs30
-rw-r--r--Universals/WebClient/C#/WebClient/WebClient.cs25
-rw-r--r--Universals/WebClient/C#/WebClient/WebClient.csproj78
-rw-r--r--Universals/WebClient/C#/WebClient/app.config15
-rw-r--r--Universals/WebClient/C#/WebClient/packages.config6
9 files changed, 245 insertions, 1 deletions
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000..1ff0c42
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,63 @@
+###############################################################################
+# Set default behavior to automatically normalize line endings.
+###############################################################################
+* text=auto
+
+###############################################################################
+# Set default behavior for command prompt diff.
+#
+# This is need for earlier builds of msysgit that does not have it on by
+# default for csharp files.
+# Note: This is only used by command line
+###############################################################################
+#*.cs diff=csharp
+
+###############################################################################
+# Set the merge driver for project and solution files
+#
+# Merging from the command prompt will add diff markers to the files if there
+# are conflicts (Merging from VS is not affected by the settings below, in VS
+# the diff markers are never inserted). Diff markers may cause the following
+# file extensions to fail to load in VS. An alternative would be to treat
+# these files as binary and thus will always conflict and require user
+# intervention with every merge. To do so, just uncomment the entries below
+###############################################################################
+#*.sln merge=binary
+#*.csproj merge=binary
+#*.vbproj merge=binary
+#*.vcxproj merge=binary
+#*.vcproj merge=binary
+#*.dbproj merge=binary
+#*.fsproj merge=binary
+#*.lsproj merge=binary
+#*.wixproj merge=binary
+#*.modelproj merge=binary
+#*.sqlproj merge=binary
+#*.wwaproj merge=binary
+
+###############################################################################
+# behavior for image files
+#
+# image files are treated as binary by default.
+###############################################################################
+#*.jpg binary
+#*.png binary
+#*.gif binary
+
+###############################################################################
+# diff behavior for common document formats
+#
+# Convert binary document formats to text before diffing them. This feature
+# is only available from the command line. Turn it on by uncommenting the
+# entries below.
+###############################################################################
+#*.doc diff=astextplain
+#*.DOC diff=astextplain
+#*.docx diff=astextplain
+#*.DOCX diff=astextplain
+#*.dot diff=astextplain
+#*.DOT diff=astextplain
+#*.pdf diff=astextplain
+#*.PDF diff=astextplain
+#*.rtf diff=astextplain
+#*.RTF diff=astextplain
diff --git a/.gitignore b/.gitignore
index 748683d..2ac1443 100644
--- a/.gitignore
+++ b/.gitignore
@@ -172,3 +172,4 @@ UpgradeLog*.htm
# Microsoft Fakes
FakesAssemblies/
+*.ide
diff --git a/README.md b/README.md
index c24437b..247174d 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,8 @@
Universals
==========
-
Language-specific implementations of universal libraries in .NET and Swift
+
+Until [SharpSwift](https://github.com/matthewsot/SharpSwift) can support far more complex parts of the .NET framework many common, but still complicated, things (like downloading a website's HTML code) will have to be written once in C# and once in Swift. Universals will make this easier by providing what is essentially the same interface/abstraction layer across C# and Swift to access different underlying code. You reference the C# version of a Universal in your C# code, then, after converting the syntax to Swift, you link the converted Swift file to the Swift version of the Universal and it should work without a hitch.
+
+
+Universals are located as separate folders within the /Universals folder. Each Universal is split into two sub-folders: C# and Swift. The C# folder holds a C# project for that Universal, while the Swift folder holds a Swift project for that Universal. \ No newline at end of file
diff --git a/Universals/Universals.sln b/Universals/Universals.sln
new file mode 100644
index 0000000..53ac118
--- /dev/null
+++ b/Universals/Universals.sln
@@ -0,0 +1,22 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2013
+VisualStudioVersion = 12.0.30516.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebClient", "WebClient\C#\WebClient\WebClient.csproj", "{6AFE831E-DE42-409A-AD4A-4FD7BA5CCA0C}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {6AFE831E-DE42-409A-AD4A-4FD7BA5CCA0C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {6AFE831E-DE42-409A-AD4A-4FD7BA5CCA0C}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {6AFE831E-DE42-409A-AD4A-4FD7BA5CCA0C}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {6AFE831E-DE42-409A-AD4A-4FD7BA5CCA0C}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/Universals/WebClient/C#/WebClient/Properties/AssemblyInfo.cs b/Universals/WebClient/C#/WebClient/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..021dcd9
--- /dev/null
+++ b/Universals/WebClient/C#/WebClient/Properties/AssemblyInfo.cs
@@ -0,0 +1,30 @@
+using System.Resources;
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("WebClient")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("WebClient")]
+[assembly: AssemblyCopyright("Copyright © 2014")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+[assembly: NeutralResourcesLanguage("en")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Universals/WebClient/C#/WebClient/WebClient.cs b/Universals/WebClient/C#/WebClient/WebClient.cs
new file mode 100644
index 0000000..7a4b3b3
--- /dev/null
+++ b/Universals/WebClient/C#/WebClient/WebClient.cs
@@ -0,0 +1,25 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net.Http;
+using System.Text;
+
+namespace WebClient
+{
+ /// <summary>
+ /// Provides a universal way to make HTTP requests
+ /// </summary>
+ public class WebClient
+ {
+ private HttpClient _client = new HttpClient();
+ public void GetAsyncString(string URL, Action<string> handler)
+ {
+ _client.GetStringAsync(URL).ContinueWith(resp => handler(resp.Result));
+ }
+
+ public void Dispose()
+ {
+ _client.Dispose();
+ }
+ }
+}
diff --git a/Universals/WebClient/C#/WebClient/WebClient.csproj b/Universals/WebClient/C#/WebClient/WebClient.csproj
new file mode 100644
index 0000000..3add9a5
--- /dev/null
+++ b/Universals/WebClient/C#/WebClient/WebClient.csproj
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+ <PropertyGroup>
+ <MinimumVisualStudioVersion>10.0</MinimumVisualStudioVersion>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProjectGuid>{6AFE831E-DE42-409A-AD4A-4FD7BA5CCA0C}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>WebClient</RootNamespace>
+ <AssemblyName>WebClient</AssemblyName>
+ <DefaultLanguage>en-US</DefaultLanguage>
+ <FileAlignment>512</FileAlignment>
+ <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <TargetFrameworkProfile>Profile328</TargetFrameworkProfile>
+ <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <!-- A reference to the entire .NET Framework is automatically included -->
+ <None Include="app.config" />
+ <None Include="packages.config" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="WebClient.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <Reference Include="System.IO">
+ <HintPath>..\..\..\packages\Microsoft.Bcl.1.1.9\lib\portable-net40+sl5+win8+wp8+wpa81\System.IO.dll</HintPath>
+ </Reference>
+ <Reference Include="System.Net.Http">
+ <HintPath>..\..\..\packages\Microsoft.Net.Http.2.2.22\lib\portable-net40+sl4+win8+wp71+wpa81\System.Net.Http.dll</HintPath>
+ </Reference>
+ <Reference Include="System.Net.Http.Extensions">
+ <HintPath>..\..\..\packages\Microsoft.Net.Http.2.2.22\lib\portable-net40+sl4+win8+wp71+wpa81\System.Net.Http.Extensions.dll</HintPath>
+ </Reference>
+ <Reference Include="System.Net.Http.Primitives">
+ <HintPath>..\..\..\packages\Microsoft.Net.Http.2.2.22\lib\portable-net40+sl4+win8+wp71+wpa81\System.Net.Http.Primitives.dll</HintPath>
+ </Reference>
+ <Reference Include="System.Runtime">
+ <HintPath>..\..\..\packages\Microsoft.Bcl.1.1.9\lib\portable-net40+sl5+win8+wp8+wpa81\System.Runtime.dll</HintPath>
+ </Reference>
+ <Reference Include="System.Threading.Tasks">
+ <HintPath>..\..\..\packages\Microsoft.Bcl.1.1.9\lib\portable-net40+sl5+win8+wp8+wpa81\System.Threading.Tasks.dll</HintPath>
+ </Reference>
+ </ItemGroup>
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
+ <Import Project="..\..\..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets" Condition="Exists('..\..\..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" />
+ <Target Name="EnsureBclBuildImported" BeforeTargets="BeforeBuild" Condition="'$(BclBuildImported)' == ''">
+ <Error Condition="!Exists('..\..\..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" Text="This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=317567." HelpKeyword="BCLBUILD2001" />
+ <Error Condition="Exists('..\..\..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" Text="The build restored NuGet packages. Build the project again to include these packages in the build. For more information, see http://go.microsoft.com/fwlink/?LinkID=317568." HelpKeyword="BCLBUILD2002" />
+ </Target>
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project> \ No newline at end of file
diff --git a/Universals/WebClient/C#/WebClient/app.config b/Universals/WebClient/C#/WebClient/app.config
new file mode 100644
index 0000000..108b695
--- /dev/null
+++ b/Universals/WebClient/C#/WebClient/app.config
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+ <runtime>
+ <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+ <dependentAssembly>
+ <assemblyIdentity name="System.Threading.Tasks" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-2.6.9.0" newVersion="2.6.9.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-2.6.9.0" newVersion="2.6.9.0" />
+ </dependentAssembly>
+ </assemblyBinding>
+ </runtime>
+</configuration> \ No newline at end of file
diff --git a/Universals/WebClient/C#/WebClient/packages.config b/Universals/WebClient/C#/WebClient/packages.config
new file mode 100644
index 0000000..c0e3bb1
--- /dev/null
+++ b/Universals/WebClient/C#/WebClient/packages.config
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+ <package id="Microsoft.Bcl" version="1.1.9" targetFramework="portable-net40+sl50+win+wpa81+wp80" />
+ <package id="Microsoft.Bcl.Build" version="1.0.14" targetFramework="portable-net40+sl50+win+wpa81+wp80" />
+ <package id="Microsoft.Net.Http" version="2.2.22" targetFramework="portable-net40+sl50+win+wpa81+wp80" />
+</packages> \ No newline at end of file
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback