updates for Universal Apps

This commit is contained in:
2014-04-06 23:03:34 +02:00
parent 5923e8ceaa
commit ba0a62b1f6
7 changed files with 85 additions and 128 deletions
@@ -78,6 +78,9 @@
<Name>UptimeSharp</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\Microsoft.Bcl.Build.1.0.13\tools\Microsoft.Bcl.Build.targets" Condition="Exists('..\packages\Microsoft.Bcl.Build.1.0.13\tools\Microsoft.Bcl.Build.targets')" />
<Target Name="EnsureBclBuildImported" BeforeTargets="BeforeBuild" Condition="'$(BclBuildImported)' == ''">
+3 -1
View File
@@ -1,6 +1,8 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
# Visual Studio 2013
VisualStudioVersion = 12.0.30324.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UptimeSharp.Tests", "UptimeSharp.Tests\UptimeSharp.Tests.csproj", "{7AB536B7-1A99-44A7-B5AA-E36E9C7F09F4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UptimeSharp", "UptimeSharp\UptimeSharp.csproj", "{EC1E656D-4966-499A-9EDD-9DB56137BF62}"
-86
View File
@@ -1,86 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Choose>
<When Condition="$(NCrunchOriginalSolutionDir) != '' And $(NCrunchOriginalSolutionDir) != '*Undefined*'">
<PropertyGroup>
<FodySolutionDir>$(NCrunchOriginalSolutionDir)</FodySolutionDir>
</PropertyGroup>
</When>
<When Condition="$(SolutionDir) != '' And $(SolutionDir) != '*Undefined*'">
<PropertyGroup>
<FodySolutionDir>$(SolutionDir)</FodySolutionDir>
</PropertyGroup>
</When>
<When Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">
<PropertyGroup>
<FodySolutionDir>$(MSBuildProjectDirectory)\..\</FodySolutionDir>
</PropertyGroup>
</When>
</Choose>
<Choose>
<When Condition="$(KeyOriginatorFile) != '' And $(KeyOriginatorFile) != '*Undefined*'">
<PropertyGroup>
<FodyKeyFilePath>$(KeyOriginatorFile)</FodyKeyFilePath>
</PropertyGroup>
</When>
<When Condition="$(AssemblyOriginatorKeyFile) != '' And $(AssemblyOriginatorKeyFile) != '*Undefined*'">
<PropertyGroup>
<FodyKeyFilePath>$(AssemblyOriginatorKeyFile)</FodyKeyFilePath>
</PropertyGroup>
</When>
<Otherwise >
<PropertyGroup>
<FodyKeyFilePath></FodyKeyFilePath>
</PropertyGroup>
</Otherwise>
</Choose>
<PropertyGroup>
<IntermediateDir>$(ProjectDir)$(IntermediateOutputPath)</IntermediateDir>
<FodySignAssembly Condition="$(FodySignAssembly) == '' Or $(FodySignAssembly) == '*Undefined*'">$(SignAssembly)</FodySignAssembly>
<FodyPath Condition="$(FodyPath) == '' Or $(FodyPath) == '*Undefined*'">$(MSBuildThisFileDirectory)</FodyPath>
</PropertyGroup>
<UsingTask
TaskName="Fody.WeavingTask"
AssemblyFile="$(FodyPath)\Fody.dll" />
<Target
AfterTargets="AfterCompile"
Name="WinFodyTarget"
Condition=" '$(OS)' == 'Windows_NT'">
<Fody.WeavingTask
AssemblyPath="@(IntermediateAssembly)"
IntermediateDir="$(IntermediateDir)"
KeyFilePath="$(FodyKeyFilePath)"
ProjectDirectory="$(ProjectDir)"
SolutionDir="$(FodySolutionDir)"
References="@(ReferencePath)"
SignAssembly="$(FodySignAssembly)"
ReferenceCopyLocalPaths="@(ReferenceCopyLocalPaths)"
DefineConstants="$(DefineConstants)"
/>
</Target>
<Target
AfterTargets="AfterBuild"
Name="NonWinFodyTarget"
Condition=" '$(OS)' != 'Windows_NT'">
<Fody.WeavingTask
AssemblyPath="$(TargetPath)"
IntermediateDir="$(IntermediateDir)"
KeyFilePath="$(FodyKeyFilePath)"
ProjectDirectory="$(ProjectDir)"
SolutionDir="$(FodySolutionDir)"
References="@(ReferencePath)"
SignAssembly="$(FodySignAssembly)"
ReferenceCopyLocalPaths="$(ReferenceCopyLocalPaths)"
DefineConstants="$(DefineConstants)"
/>
</Target>
<!--Support for ncrunch-->
<ItemGroup>
<None Include="$(FodyPath)\*.*" />
</ItemGroup>
</Project>
+17 -7
View File
@@ -22,16 +22,26 @@ namespace UptimeSharp.Models
Dictionary<string, string> parameterDict = new Dictionary<string, string>();
// get object properties
IEnumerable<PropertyInfo> properties = this.GetType()
.GetProperties(BindingFlags.Instance | BindingFlags.Public)
.Where(p => Attribute.IsDefined(p, typeof(DataMemberAttribute)));
IEnumerable<MemberInfo> properties = this.GetType()
.GetTypeInfo()
.DeclaredMembers
.Where(p => p.CustomAttributes.FirstOrDefault(a => a.AttributeType == typeof(DataMemberAttribute)) != null);
// gather attributes of object
foreach (PropertyInfo propertyInfo in properties)
foreach (MemberInfo memberInfo in properties)
{
DataMemberAttribute attribute = (DataMemberAttribute)propertyInfo.GetCustomAttributes(typeof(DataMemberAttribute), false).FirstOrDefault();
string name = attribute.Name ?? propertyInfo.Name.ToLower();
object value = propertyInfo.GetValue(this, null);
DataMemberAttribute attribute = (DataMemberAttribute)memberInfo.GetCustomAttributes(typeof(DataMemberAttribute), false).FirstOrDefault();
string name = attribute.Name ?? memberInfo.Name.ToLower();
object value = null;
if (memberInfo is FieldInfo)
{
value = ((FieldInfo)memberInfo).GetValue(this);
}
else
{
value = ((PropertyInfo)memberInfo).GetValue(this, null);
}
// invalid parameter
if (value == null)
+2 -2
View File
@@ -22,5 +22,5 @@
// 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("2.1.0.0")]
[assembly: AssemblyFileVersion("2.1.0.0")]
[assembly: AssemblyVersion("3.0.0.0")]
[assembly: AssemblyFileVersion("3.0.0.0")]
+53 -25
View File
@@ -2,7 +2,7 @@
<Project ToolsVersion="4.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>
<MinimumVisualStudioVersion>11.0</MinimumVisualStudioVersion>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{EC1E656D-4966-499A-9EDD-9DB56137BF62}</ProjectGuid>
@@ -10,11 +10,31 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>UptimeSharp</RootNamespace>
<AssemblyName>UptimeSharp</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile>Profile104</TargetFrameworkProfile>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkProfile>Profile259</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<FodyPath>..\packages\Fody.1.20.0.0</FodyPath>
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<OldToolsVersion>4.0</OldToolsVersion>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<NuGetPackageImportStamp>f5b16e91</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -35,7 +55,6 @@
</PropertyGroup>
<ItemGroup>
<!-- A reference to the entire .NET Framework is automatically included -->
<None Include="Fody.targets" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
@@ -65,47 +84,56 @@
</ItemGroup>
<ItemGroup>
<Reference Include="Microsoft.Threading.Tasks">
<HintPath>..\packages\Microsoft.Bcl.Async.1.0.165\lib\portable-net40+sl4+win8+wp71\Microsoft.Threading.Tasks.dll</HintPath>
<HintPath>..\packages\Microsoft.Bcl.Async.1.0.166\lib\portable-net45+win8+wp8+wpa81\Microsoft.Threading.Tasks.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Threading.Tasks.Extensions">
<HintPath>..\packages\Microsoft.Bcl.Async.1.0.165\lib\portable-net40+sl4+win8+wp71\Microsoft.Threading.Tasks.Extensions.dll</HintPath>
<HintPath>..\packages\Microsoft.Bcl.Async.1.0.166\lib\portable-net45+win8+wp8+wpa81\Microsoft.Threading.Tasks.Extensions.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json">
<HintPath>..\packages\Newtonsoft.Json.5.0.8\lib\portable-net40+sl4+wp7+win8\Newtonsoft.Json.dll</HintPath>
<HintPath>..\packages\Newtonsoft.Json.6.0.2\lib\portable-net45+wp80+win8+wpa81\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="PropertyChanged">
<HintPath>..\packages\PropertyChanged.Fody.1.45.0.0\Lib\portable-net4+sl4+wp7+win8+MonoAndroid16+MonoTouch40\PropertyChanged.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.IO">
<HintPath>..\packages\Microsoft.Bcl.1.1.6\lib\portable-net40+sl4+win8+wp71\System.IO.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http">
<HintPath>..\packages\Microsoft.Net.Http.2.2.18\lib\portable-net40+sl4+win8+wp71\System.Net.Http.dll</HintPath>
<HintPath>..\packages\Microsoft.Net.Http.2.2.19\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.18\lib\portable-net40+sl4+win8+wp71\System.Net.Http.Extensions.dll</HintPath>
<HintPath>..\packages\Microsoft.Net.Http.2.2.19\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.18\lib\portable-net40+sl4+win8+wp71\System.Net.Http.Primitives.dll</HintPath>
</Reference>
<Reference Include="System.Runtime">
<HintPath>..\packages\Microsoft.Bcl.1.1.6\lib\portable-net40+sl4+win8+wp71\System.Runtime.dll</HintPath>
</Reference>
<Reference Include="System.Threading.Tasks">
<HintPath>..\packages\Microsoft.Bcl.1.1.6\lib\portable-net40+sl4+win8+wp71\System.Threading.Tasks.dll</HintPath>
<HintPath>..\packages\Microsoft.Net.Http.2.2.19\lib\portable-net40+sl4+win8+wp71+wpa81\System.Net.Http.Primitives.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Content Include="FodyWeavers.xml" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
<Import Project="..\packages\Microsoft.Bcl.Build.1.0.13\tools\Microsoft.Bcl.Build.targets" Condition="Exists('..\packages\Microsoft.Bcl.Build.1.0.13\tools\Microsoft.Bcl.Build.targets')" />
<Target Name="EnsureBclBuildImported" BeforeTargets="BeforeBuild" Condition="'$(BclBuildImported)' == ''">
<Error Condition="!Exists('..\packages\Microsoft.Bcl.Build.1.0.13\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.13\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" />
<Import Project="..\packages\Fody.1.22.1\build\Fody.targets" Condition="Exists('..\packages\Fody.1.22.1\build\Fody.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>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=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Fody.1.22.1\build\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.1.22.1\build\Fody.targets'))" />
</Target>
<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>
<Import Project="Fody.targets" />
<!-- 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">
+7 -7
View File
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Fody" version="1.20.0.0" targetFramework="portable-win+net45+sl40+wp71" developmentDependency="true" />
<package id="Microsoft.Bcl" version="1.1.6" targetFramework="portable-win+net45+sl40+wp71" />
<package id="Microsoft.Bcl.Async" version="1.0.165" targetFramework="portable-win+net45+sl40+wp71" />
<package id="Microsoft.Bcl.Build" version="1.0.13" targetFramework="portable-win+net45+sl40+wp71" />
<package id="Microsoft.Net.Http" version="2.2.18" targetFramework="portable-win+net45+sl40+wp71" />
<package id="Newtonsoft.Json" version="5.0.8" targetFramework="portable-win+net45+sl40+wp71" />
<package id="PropertyChanged.Fody" version="1.45.0.0" targetFramework="portable-win+net45+sl40+wp71" developmentDependency="true" />
<package id="Fody" version="1.22.1" targetFramework="portable-net45+win+wpa81+wp80" developmentDependency="true" />
<package id="Microsoft.Bcl" version="1.1.7" targetFramework="portable-net45+win+wpa81+wp80" />
<package id="Microsoft.Bcl.Async" version="1.0.166" targetFramework="portable-net45+win+wpa81+wp80" />
<package id="Microsoft.Bcl.Build" version="1.0.14" targetFramework="portable-net45+win+wpa81+wp80" />
<package id="Microsoft.Net.Http" version="2.2.19" targetFramework="portable-net45+win+wpa81+wp80" />
<package id="Newtonsoft.Json" version="6.0.2" targetFramework="portable-net45+win+wpa81+wp80" />
<package id="PropertyChanged.Fody" version="1.45.0.0" targetFramework="portable-win+net45+sl40+wp71" developmentDependency="true" requireReinstallation="True" />
</packages>