Skip to content

Commit

Permalink
Create Profile259 projects
Browse files Browse the repository at this point in the history
  • Loading branch information
lewischeng-ms committed May 9, 2015
1 parent 6636bc2 commit b7edcf8
Show file tree
Hide file tree
Showing 16 changed files with 1,655 additions and 9 deletions.
60 changes: 60 additions & 0 deletions sln/Microsoft.OData.Full.sln
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Spatial.Net45", "
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.OData.Core.Net45", "..\src\Microsoft.OData.Core\Microsoft.OData.Core.Net45.csproj", "{26E0562A-B1FA-4FE1-8862-CF195B23ABCB}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Spatial.Portable45", "..\src\Microsoft.Spatial\Microsoft.Spatial.Portable45.csproj", "{BE8B8A4C-F717-419A-BB33-1F7B4F92D22A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.OData.Edm.Portable45", "..\src\Microsoft.OData.Edm\Microsoft.OData.Edm.Portable45.csproj", "{8087F595-537B-4D35-9093-C9A79A4D93C4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.OData.Core.Portable45", "..\src\Microsoft.OData.Core\Microsoft.OData.Core.Portable45.csproj", "{3A553748-BFCD-4D2C-BA62-18BE5983AB45}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Cover|Any CPU = Cover|Any CPU
Expand Down Expand Up @@ -1232,6 +1238,60 @@ Global
{26E0562A-B1FA-4FE1-8862-CF195B23ABCB}.Release|x64.Build.0 = Release|x64
{26E0562A-B1FA-4FE1-8862-CF195B23ABCB}.Release|x86.ActiveCfg = Release|x86
{26E0562A-B1FA-4FE1-8862-CF195B23ABCB}.Release|x86.Build.0 = Release|x86
{BE8B8A4C-F717-419A-BB33-1F7B4F92D22A}.Cover|Any CPU.ActiveCfg = Cover|Any CPU
{BE8B8A4C-F717-419A-BB33-1F7B4F92D22A}.Cover|Any CPU.Build.0 = Cover|Any CPU
{BE8B8A4C-F717-419A-BB33-1F7B4F92D22A}.Cover|x64.ActiveCfg = Cover|x64
{BE8B8A4C-F717-419A-BB33-1F7B4F92D22A}.Cover|x64.Build.0 = Cover|x64
{BE8B8A4C-F717-419A-BB33-1F7B4F92D22A}.Cover|x86.ActiveCfg = Cover|x86
{BE8B8A4C-F717-419A-BB33-1F7B4F92D22A}.Cover|x86.Build.0 = Cover|x86
{BE8B8A4C-F717-419A-BB33-1F7B4F92D22A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BE8B8A4C-F717-419A-BB33-1F7B4F92D22A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BE8B8A4C-F717-419A-BB33-1F7B4F92D22A}.Debug|x64.ActiveCfg = Debug|x64
{BE8B8A4C-F717-419A-BB33-1F7B4F92D22A}.Debug|x64.Build.0 = Debug|x64
{BE8B8A4C-F717-419A-BB33-1F7B4F92D22A}.Debug|x86.ActiveCfg = Debug|x86
{BE8B8A4C-F717-419A-BB33-1F7B4F92D22A}.Debug|x86.Build.0 = Debug|x86
{BE8B8A4C-F717-419A-BB33-1F7B4F92D22A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BE8B8A4C-F717-419A-BB33-1F7B4F92D22A}.Release|Any CPU.Build.0 = Release|Any CPU
{BE8B8A4C-F717-419A-BB33-1F7B4F92D22A}.Release|x64.ActiveCfg = Release|x64
{BE8B8A4C-F717-419A-BB33-1F7B4F92D22A}.Release|x64.Build.0 = Release|x64
{BE8B8A4C-F717-419A-BB33-1F7B4F92D22A}.Release|x86.ActiveCfg = Release|x86
{BE8B8A4C-F717-419A-BB33-1F7B4F92D22A}.Release|x86.Build.0 = Release|x86
{8087F595-537B-4D35-9093-C9A79A4D93C4}.Cover|Any CPU.ActiveCfg = Cover|Any CPU
{8087F595-537B-4D35-9093-C9A79A4D93C4}.Cover|Any CPU.Build.0 = Cover|Any CPU
{8087F595-537B-4D35-9093-C9A79A4D93C4}.Cover|x64.ActiveCfg = Cover|x64
{8087F595-537B-4D35-9093-C9A79A4D93C4}.Cover|x64.Build.0 = Cover|x64
{8087F595-537B-4D35-9093-C9A79A4D93C4}.Cover|x86.ActiveCfg = Cover|x86
{8087F595-537B-4D35-9093-C9A79A4D93C4}.Cover|x86.Build.0 = Cover|x86
{8087F595-537B-4D35-9093-C9A79A4D93C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8087F595-537B-4D35-9093-C9A79A4D93C4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8087F595-537B-4D35-9093-C9A79A4D93C4}.Debug|x64.ActiveCfg = Debug|x64
{8087F595-537B-4D35-9093-C9A79A4D93C4}.Debug|x64.Build.0 = Debug|x64
{8087F595-537B-4D35-9093-C9A79A4D93C4}.Debug|x86.ActiveCfg = Debug|x86
{8087F595-537B-4D35-9093-C9A79A4D93C4}.Debug|x86.Build.0 = Debug|x86
{8087F595-537B-4D35-9093-C9A79A4D93C4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8087F595-537B-4D35-9093-C9A79A4D93C4}.Release|Any CPU.Build.0 = Release|Any CPU
{8087F595-537B-4D35-9093-C9A79A4D93C4}.Release|x64.ActiveCfg = Release|x64
{8087F595-537B-4D35-9093-C9A79A4D93C4}.Release|x64.Build.0 = Release|x64
{8087F595-537B-4D35-9093-C9A79A4D93C4}.Release|x86.ActiveCfg = Release|x86
{8087F595-537B-4D35-9093-C9A79A4D93C4}.Release|x86.Build.0 = Release|x86
{3A553748-BFCD-4D2C-BA62-18BE5983AB45}.Cover|Any CPU.ActiveCfg = Cover|Any CPU
{3A553748-BFCD-4D2C-BA62-18BE5983AB45}.Cover|Any CPU.Build.0 = Cover|Any CPU
{3A553748-BFCD-4D2C-BA62-18BE5983AB45}.Cover|x64.ActiveCfg = Cover|x64
{3A553748-BFCD-4D2C-BA62-18BE5983AB45}.Cover|x64.Build.0 = Cover|x64
{3A553748-BFCD-4D2C-BA62-18BE5983AB45}.Cover|x86.ActiveCfg = Cover|x86
{3A553748-BFCD-4D2C-BA62-18BE5983AB45}.Cover|x86.Build.0 = Cover|x86
{3A553748-BFCD-4D2C-BA62-18BE5983AB45}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3A553748-BFCD-4D2C-BA62-18BE5983AB45}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3A553748-BFCD-4D2C-BA62-18BE5983AB45}.Debug|x64.ActiveCfg = Debug|x64
{3A553748-BFCD-4D2C-BA62-18BE5983AB45}.Debug|x64.Build.0 = Debug|x64
{3A553748-BFCD-4D2C-BA62-18BE5983AB45}.Debug|x86.ActiveCfg = Debug|x86
{3A553748-BFCD-4D2C-BA62-18BE5983AB45}.Debug|x86.Build.0 = Debug|x86
{3A553748-BFCD-4D2C-BA62-18BE5983AB45}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3A553748-BFCD-4D2C-BA62-18BE5983AB45}.Release|Any CPU.Build.0 = Release|Any CPU
{3A553748-BFCD-4D2C-BA62-18BE5983AB45}.Release|x64.ActiveCfg = Release|x64
{3A553748-BFCD-4D2C-BA62-18BE5983AB45}.Release|x64.Build.0 = Release|x64
{3A553748-BFCD-4D2C-BA62-18BE5983AB45}.Release|x86.ActiveCfg = Release|x86
{3A553748-BFCD-4D2C-BA62-18BE5983AB45}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
4 changes: 4 additions & 0 deletions src/Microsoft.OData.Core/AsyncBufferedStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -374,10 +374,14 @@ public void WriteToStream(Stream stream)
public Task WriteToStreamAsync(Stream stream)
{
Debug.Assert(stream != null, "stream != null");
#if DNXCORE50
return stream.WriteAsync(this.buffer, 0, this.storedCount);
#else
return Task.Factory.FromAsync(
(callback, state) => stream.BeginWrite(this.buffer, 0, this.storedCount, callback, state),
stream.EndWrite,
null);
#endif
}
#endif
}
Expand Down
30 changes: 30 additions & 0 deletions src/Microsoft.OData.Core/BufferedReadStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,35 @@ private IEnumerable<Task> BufferInputStream()
currentBuffer = this.AddNewBuffer();
}

#if DNXCORE50
yield return inputStream.ReadAsync(currentBuffer.Buffer, currentBuffer.OffsetToWriteTo, currentBuffer.FreeBytes)
.ContinueWith(t =>
{
try
{
int bytesRead = t.Result;
if (bytesRead == 0)
{
this.inputStream = null;
}
else
{
currentBuffer.MarkBytesAsWritten(bytesRead);
}
}
catch (Exception exception)
{
if (!ExceptionUtils.IsCatchableExceptionType(exception))
{
throw;
}

this.inputStream = null;
throw;
}
});

#else
yield return Task.Factory.FromAsync(
(asyncCallback, asyncState) => this.inputStream.BeginRead(
currentBuffer.Buffer,
Expand Down Expand Up @@ -294,6 +323,7 @@ private IEnumerable<Task> BufferInputStream()
}
},
null);
#endif
}
}

Expand Down
26 changes: 26 additions & 0 deletions src/Microsoft.OData.Core/MessageStreamWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ namespace Microsoft.OData.Core
using System;
using System.Diagnostics;
using System.IO;
#if DNXCORE50
using System.Threading;
using System.Threading.Tasks;
#endif
#endregion Namespaces

/// <summary>
Expand Down Expand Up @@ -176,6 +180,19 @@ public override int Read(byte[] buffer, int offset, int count)
return bytesRead;
}

#if DNXCORE50
/// <inheritdoc />
public async override Task<int> ReadAsync(
byte[] buffer,
int offset,
int count,
CancellationToken cancellationToken)
{
int bytesRead = await this.innerStream.ReadAsync(buffer, offset, count, cancellationToken);
this.IncreaseTotalBytesRead(bytesRead);
return bytesRead;
}
#else
/// <summary>
/// Begins a read operation from the stream.
/// </summary>
Expand All @@ -201,6 +218,7 @@ public override int EndRead(IAsyncResult asyncResult)
this.IncreaseTotalBytesRead(bytesRead);
return bytesRead;
}
#endif

/// <summary>
/// Seeks the stream.
Expand Down Expand Up @@ -233,6 +251,13 @@ public override void Write(byte[] buffer, int offset, int count)
this.innerStream.Write(buffer, offset, count);
}

#if DNXCORE50
/// <inheritdoc />
public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
{
return this.innerStream.WriteAsync(buffer, offset, count, cancellationToken);
}
#else
/// <summary>
/// Begins an asynchronous write operation to the stream.
/// </summary>
Expand All @@ -255,6 +280,7 @@ public override void EndWrite(IAsyncResult asyncResult)
{
this.innerStream.EndWrite(asyncResult);
}
#endif

/// <summary>
/// Dispose this wrapping stream and the underlying stream.
Expand Down
4 changes: 2 additions & 2 deletions src/Microsoft.OData.Core/Metadata/EdmLibraryExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ internal static bool IsPrimitiveType(Type clrType)
Debug.Assert(clrType != null, "clrType != null");

// PERF
switch (Type.GetTypeCode(clrType))
switch (PlatformHelper.GetTypeCode(clrType))
{
case TypeCode.Boolean:
case TypeCode.Byte:
Expand Down Expand Up @@ -1799,7 +1799,7 @@ internal static IEdmPrimitiveTypeReference GetPrimitiveTypeReference(Type clrTyp
{
Debug.Assert(clrType != null, "clrType != null");

TypeCode typeCode = Type.GetTypeCode(clrType);
TypeCode typeCode = PlatformHelper.GetTypeCode(clrType);
switch (typeCode)
{
case TypeCode.Boolean:
Expand Down
Loading

0 comments on commit b7edcf8

Please sign in to comment.