Commits

Michal Kutil  committed 4063d9d

Variable data client example add.

  • Participants
  • Parent commits f7d2c53

Comments (0)

Files changed (6)

File Examples/App.config

+<?xml version="1.0" encoding="utf-8" ?>
+<configuration>
+    <startup> 
+        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
+    </startup>
+</configuration>

File Examples/Examples.csproj

+<?xml version="1.0" encoding="utf-8"?>
+<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>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{32500D66-FCAE-4F25-8428-75557A5F95C2}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>Plantyst.Client.Example</RootNamespace>
+    <AssemblyName>Plantyst.Client.Example</AssemblyName>
+    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <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' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Program.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="App.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\Client\Client.csproj">
+      <Project>{7f8a3f48-7746-4c65-a022-b81dee622fbd}</Project>
+      <Name>Client</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.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">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>

File Examples/Program.cs

+namespace Example
+{
+    using System;
+    using System.IO;
+    using Plantyst.Client;
+    using Plantyst.Client.Security;
+
+    class Program
+    {
+        static void Main(string[] args)
+        {
+            // Setup
+            var userAccessToken = new UserAccessToken
+            {
+                Application = "",
+                Key = @"",
+                Secret = @""
+            };
+            var variableIdSet = new int[] { };
+            var from = new DateTime(2013, 07, 25, 14, 48, 00);
+            var to = new DateTime(2013, 07, 26, 08, 17, 00);
+
+            // Call api
+            var variableDataClient = new VariableDataClient(userAccessToken);
+            var task = variableDataClient.Get(variableIdSet, from, to, "minute");
+            task.Wait();
+
+            // Process result
+            var stream = task.Result;
+            var result = new StreamReader(stream).ReadToEnd();
+            Console.WriteLine(result);
+            Console.ReadKey();
+        }
+    }
+}

File Examples/Properties/AssemblyInfo.cs

+using System.Reflection;
+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("Plantyst client examples")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Plantyst")]
+[assembly: AssemblyProduct("Plantyst")]
+[assembly: AssemblyCopyright("Copyright © Plantyst 2013")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components.  If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("f3ffa558-ffb2-4e18-9703-2f643497902f")]
+
+// 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.*")]

File Examples/Settings.StyleCop

+<StyleCopSettings Version="105">
+  <Analyzers>
+    <Analyzer AnalyzerId="Community.StyleCop.CSharp.LayoutRules">
+      <Rules>
+        <Rule Name="LinesMustNotBeLongerThanNumCharacters">
+          <RuleSettings>
+            <BooleanProperty Name="Enabled">False</BooleanProperty>
+          </RuleSettings>
+        </Rule>
+      </Rules>
+      <AnalyzerSettings />
+    </Analyzer>
+    <Analyzer AnalyzerId="StyleCop.CSharp.DocumentationRules">
+      <Rules>
+        <Rule Name="FileMustHaveHeader">
+          <RuleSettings>
+            <BooleanProperty Name="Enabled">False</BooleanProperty>
+          </RuleSettings>
+        </Rule>
+      </Rules>
+      <AnalyzerSettings>
+        <StringProperty Name="CompanyName">Plantyst</StringProperty>
+        <StringProperty Name="Copyright">Copyright Plantyst</StringProperty>
+      </AnalyzerSettings>
+    </Analyzer>
+  </Analyzers>
+</StyleCopSettings>

File Plantyst SDK for Net.sln

 # Visual Studio 2012
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Client", "Client\Client.csproj", "{7F8A3F48-7746-4C65-A022-B81DEE622FBD}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Examples", "Examples\Examples.csproj", "{32500D66-FCAE-4F25-8428-75557A5F95C2}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
 		{7F8A3F48-7746-4C65-A022-B81DEE622FBD}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{7F8A3F48-7746-4C65-A022-B81DEE622FBD}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{7F8A3F48-7746-4C65-A022-B81DEE622FBD}.Release|Any CPU.Build.0 = Release|Any CPU
+		{32500D66-FCAE-4F25-8428-75557A5F95C2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{32500D66-FCAE-4F25-8428-75557A5F95C2}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{32500D66-FCAE-4F25-8428-75557A5F95C2}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{32500D66-FCAE-4F25-8428-75557A5F95C2}.Release|Any CPU.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE