Skip to content

Commit d38303b

Browse files
committed
Merge pull request #317 from sharwell/Examples
Examples projects
2 parents 9b4836f + ff621e5 commit d38303b

30 files changed

Lines changed: 1548 additions & 2 deletions

src/Documentation/Documentation.v3.5.shfbproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,9 @@
143143
<Folder Include="Content" />
144144
<Folder Include="Content\Authentication\" />
145145
</ItemGroup>
146+
<ItemGroup>
147+
<Tokens Include="SharedTokens.tokens" />
148+
</ItemGroup>
146149
<!-- Import the SHFB build targets -->
147150
<Import Project="$(SHFBROOT)\SandcastleHelpFileBuilder.targets" />
148151
</Project>

src/Documentation/Documentation.v4.0.shfbproj

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,20 @@
6262
<output includeNamespaces="false" namespacesFile="Namespaces" folder="{@OutputFolder}\..\..\Api\v4.0" />
6363
</component>
6464
</ComponentConfig>
65+
<ComponentConfig id="Code Block Component" enabled="True">
66+
<component id="Code Block Component" type="SandcastleBuilder.Components.CodeBlockComponent" assembly="{@SHFBFolder}SandcastleBuilder.Components.dll">
67+
<basePath value="{@HtmlEncProjectFolder}" />
68+
<outputPaths>{@HelpFormatOutputPaths}</outputPaths>
69+
<allowMissingSource value="false" />
70+
<removeRegionMarkers value="false" />
71+
<colorizer syntaxFile="{@SHFBFolder}Colorizer\highlight.xml" styleFile="{@SHFBFolder}Colorizer\highlight.xsl" stylesheet="{@SHFBFolder}Colorizer\highlight.css" scriptFile="{@SHFBFolder}Colorizer\highlight.js" language="cs" tabSize="0" numberLines="false" outlining="false" keepSeeTags="false" defaultTitle="true" />
72+
</component>
73+
</ComponentConfig>
74+
<ComponentConfig id="API Token Resolution" enabled="True">
75+
<component id="API Token Resolution" type="Microsoft.Ddue.Tools.SharedContentComponent" assembly="{@SandcastlePath}ProductionTools\BuildComponents.dll">
76+
{@TokenFiles}
77+
<replace elements="/*//token" item="string(.)" /></component>
78+
</ComponentConfig>
6579
</ComponentConfigurations>
6680
<CatalogName>VisualStudio11</CatalogName>
6781
<TocParentId>-1</TocParentId>
@@ -137,6 +151,9 @@
137151
<Folder Include="Content" />
138152
<Folder Include="Content\Authentication" />
139153
</ItemGroup>
154+
<ItemGroup>
155+
<Tokens Include="SharedTokens.tokens" />
156+
</ItemGroup>
140157
<!-- Import the SHFB build targets -->
141158
<Import Project="$(SHFBROOT)\SandcastleHelpFileBuilder.targets" />
142159
</Project>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<content
3+
xmlns:ddue="http://ddue.schemas.microsoft.com/authoring/2003/5"
4+
xmlns:xlink="http://www.w3.org/1999/xlink">
5+
6+
<!--
7+
The following items can only be used in <token> elements that appear in the XML documentation comments.
8+
-->
9+
10+
<item id="TaskParallelLibrary">
11+
<see href="http://msdn.microsoft.com/en-us/library/dd460717.aspx">Task Parallel Library</see>
12+
</item>
13+
14+
<item id="AsyncAwaitExample">
15+
<note>
16+
<para>
17+
The following code uses the <see langword="async/await"/> operators. For more information
18+
about using these operators in your code, see <conceptualLink target="32cc6156-3b31-4450-b209-b55fcfc0a210"/>.
19+
</para>
20+
</note>
21+
</item>
22+
23+
<item id="TplExample">
24+
<para>
25+
The following code shows demonstrates the same example using the <token>TaskParallelLibrary</token>
26+
instead of the <see langword="async/await"/> operators.
27+
</para>
28+
</item>
29+
</content>
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#include "stdafx.h"
2+
3+
using namespace System;
4+
using namespace System::Reflection;
5+
using namespace System::Runtime::CompilerServices;
6+
using namespace System::Runtime::InteropServices;
7+
using namespace System::Security::Permissions;
8+
9+
//
10+
// General Information about an assembly is controlled through the following
11+
// set of attributes. Change these attribute values to modify the information
12+
// associated with an assembly.
13+
//
14+
[assembly:AssemblyTitleAttribute(L"CPPCodeSamples")];
15+
[assembly:AssemblyDescriptionAttribute(L"")];
16+
[assembly:AssemblyConfigurationAttribute(L"")];
17+
[assembly:AssemblyCompanyAttribute(L"")];
18+
[assembly:AssemblyProductAttribute(L"CPPCodeSamples")];
19+
[assembly:AssemblyCopyrightAttribute(L"Copyright (c) 2013")];
20+
[assembly:AssemblyTrademarkAttribute(L"")];
21+
[assembly:AssemblyCultureAttribute(L"")];
22+
23+
//
24+
// Version information for an assembly consists of the following four values:
25+
//
26+
// Major Version
27+
// Minor Version
28+
// Build Number
29+
// Revision
30+
//
31+
// You can specify all the value or you can default the Revision and Build Numbers
32+
// by using the '*' as shown below:
33+
34+
[assembly:AssemblyVersionAttribute("1.0.*")];
35+
36+
[assembly:ComVisible(false)];
37+
38+
[assembly:CLSCompliantAttribute(true)];
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 DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup Label="ProjectConfigurations">
4+
<ProjectConfiguration Include="Debug|Win32">
5+
<Configuration>Debug</Configuration>
6+
<Platform>Win32</Platform>
7+
</ProjectConfiguration>
8+
<ProjectConfiguration Include="Release|Win32">
9+
<Configuration>Release</Configuration>
10+
<Platform>Win32</Platform>
11+
</ProjectConfiguration>
12+
</ItemGroup>
13+
<PropertyGroup Label="Globals">
14+
<ProjectGuid>{2B5E19B8-7169-4F4F-92DA-AE7D9F20DDC4}</ProjectGuid>
15+
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
16+
<Keyword>ManagedCProj</Keyword>
17+
<RootNamespace>CPPCodeSamples</RootNamespace>
18+
</PropertyGroup>
19+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
20+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
21+
<ConfigurationType>DynamicLibrary</ConfigurationType>
22+
<UseDebugLibraries>true</UseDebugLibraries>
23+
<PlatformToolset>v110</PlatformToolset>
24+
<CLRSupport>true</CLRSupport>
25+
<CharacterSet>Unicode</CharacterSet>
26+
</PropertyGroup>
27+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
28+
<ConfigurationType>DynamicLibrary</ConfigurationType>
29+
<UseDebugLibraries>false</UseDebugLibraries>
30+
<PlatformToolset>v110</PlatformToolset>
31+
<CLRSupport>true</CLRSupport>
32+
<CharacterSet>Unicode</CharacterSet>
33+
</PropertyGroup>
34+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
35+
<ImportGroup Label="ExtensionSettings">
36+
</ImportGroup>
37+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
38+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
39+
</ImportGroup>
40+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
41+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
42+
</ImportGroup>
43+
<PropertyGroup Label="UserMacros" />
44+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
45+
<LinkIncremental>true</LinkIncremental>
46+
</PropertyGroup>
47+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
48+
<LinkIncremental>false</LinkIncremental>
49+
</PropertyGroup>
50+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
51+
<ClCompile>
52+
<WarningLevel>Level3</WarningLevel>
53+
<Optimization>Disabled</Optimization>
54+
<PreprocessorDefinitions>WIN32;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
55+
<PrecompiledHeader>Use</PrecompiledHeader>
56+
</ClCompile>
57+
<Link>
58+
<GenerateDebugInformation>true</GenerateDebugInformation>
59+
<AdditionalDependencies />
60+
</Link>
61+
</ItemDefinitionGroup>
62+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
63+
<ClCompile>
64+
<WarningLevel>Level3</WarningLevel>
65+
<PreprocessorDefinitions>WIN32;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
66+
<PrecompiledHeader>Use</PrecompiledHeader>
67+
</ClCompile>
68+
<Link>
69+
<GenerateDebugInformation>true</GenerateDebugInformation>
70+
<AdditionalDependencies />
71+
</Link>
72+
</ItemDefinitionGroup>
73+
<ItemGroup>
74+
<Reference Include="Newtonsoft.Json">
75+
<HintPath>..\..\packages\Newtonsoft.Json.5.0.6\lib\net40\Newtonsoft.Json.dll</HintPath>
76+
</Reference>
77+
<Reference Include="System" />
78+
<Reference Include="System.Core" />
79+
<Reference Include="System.Data" />
80+
<Reference Include="System.Xml" />
81+
</ItemGroup>
82+
<ItemGroup>
83+
<ClInclude Include="resource.h" />
84+
<ClInclude Include="Stdafx.h" />
85+
</ItemGroup>
86+
<ItemGroup>
87+
<ClCompile Include="AssemblyInfo.cpp" />
88+
<ClCompile Include="QueueingServiceExamples.cpp" />
89+
<ClCompile Include="Stdafx.cpp">
90+
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
91+
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
92+
</ClCompile>
93+
</ItemGroup>
94+
<ItemGroup>
95+
<Text Include="ReadMe.txt" />
96+
</ItemGroup>
97+
<ItemGroup>
98+
<ResourceCompile Include="app.rc" />
99+
</ItemGroup>
100+
<ItemGroup>
101+
<Image Include="app.ico" />
102+
</ItemGroup>
103+
<ItemGroup>
104+
<ProjectReference Include="..\..\corelib\corelib.v4.0.csproj">
105+
<Project>{7dba11eb-dba7-4d3a-8d42-b5312e74b9c0}</Project>
106+
</ProjectReference>
107+
</ItemGroup>
108+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
109+
<ImportGroup Label="ExtensionTargets">
110+
</ImportGroup>
111+
</Project>
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup>
4+
<Filter Include="Source Files">
5+
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
6+
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
7+
</Filter>
8+
<Filter Include="Header Files">
9+
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
10+
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
11+
</Filter>
12+
<Filter Include="Resource Files">
13+
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
14+
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
15+
</Filter>
16+
</ItemGroup>
17+
<ItemGroup>
18+
<ClInclude Include="Stdafx.h">
19+
<Filter>Header Files</Filter>
20+
</ClInclude>
21+
<ClInclude Include="resource.h">
22+
<Filter>Header Files</Filter>
23+
</ClInclude>
24+
</ItemGroup>
25+
<ItemGroup>
26+
<ClCompile Include="AssemblyInfo.cpp">
27+
<Filter>Source Files</Filter>
28+
</ClCompile>
29+
<ClCompile Include="Stdafx.cpp">
30+
<Filter>Source Files</Filter>
31+
</ClCompile>
32+
<ClCompile Include="QueueingServiceExamples.cpp">
33+
<Filter>Source Files</Filter>
34+
</ClCompile>
35+
</ItemGroup>
36+
<ItemGroup>
37+
<Text Include="ReadMe.txt" />
38+
</ItemGroup>
39+
<ItemGroup>
40+
<ResourceCompile Include="app.rc">
41+
<Filter>Resource Files</Filter>
42+
</ResourceCompile>
43+
</ItemGroup>
44+
<ItemGroup>
45+
<Image Include="app.ico">
46+
<Filter>Resource Files</Filter>
47+
</Image>
48+
</ItemGroup>
49+
</Project>
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
#include "Stdafx.h"
2+
3+
using namespace net::openstack::Core;
4+
using namespace net::openstack::Core::Collections;
5+
using namespace net::openstack::Core::Domain;
6+
using namespace net::openstack::Core::Providers;
7+
using namespace net::openstack::Core::Domain::Queues;
8+
using namespace net::openstack::Providers::Rackspace;
9+
using namespace System;
10+
using namespace System::Collections::ObjectModel;
11+
using namespace System::Threading;
12+
using namespace System::Threading::Tasks;
13+
14+
ref class QueueingServiceExamples
15+
{
16+
private:
17+
static CloudIdentity^ identity = gcnew CloudIdentity();
18+
static String^ region = nullptr;
19+
static Guid clientId = Guid::NewGuid();
20+
static bool internalUrl = false;
21+
static IIdentityProvider^ identityProvider = nullptr;
22+
23+
public:
24+
void GetHome()
25+
{
26+
#pragma region GetHomeAsync (TPL)
27+
IQueueingService^ queueingService = gcnew CloudQueuesProvider(identity, region, clientId, internalUrl, identityProvider);
28+
Task<HomeDocument^>^ task = queueingService->GetHomeAsync(CancellationToken::None);
29+
#pragma endregion
30+
}
31+
32+
void GetNodeHealth()
33+
{
34+
#pragma region GetNodeHealthAsync (TPL)
35+
IQueueingService^ queueingService = gcnew CloudQueuesProvider(identity, region, clientId, internalUrl, identityProvider);
36+
Task^ task = queueingService->GetNodeHealthAsync(CancellationToken::None);
37+
#pragma endregion
38+
}
39+
40+
void CreateQueue()
41+
{
42+
#pragma region CreateQueueAsync (TPL)
43+
IQueueingService^ queueingService = gcnew CloudQueuesProvider(identity, region, clientId, internalUrl, identityProvider);
44+
QueueName^ queueName = gcnew QueueName("ExampleQueue");
45+
Task<bool>^ task = queueingService->CreateQueueAsync(queueName, CancellationToken::None);
46+
#pragma endregion
47+
}
48+
49+
void DeleteQueue()
50+
{
51+
#pragma region DeleteQueueAsync (TPL)
52+
IQueueingService^ queueingService = gcnew CloudQueuesProvider(identity, region, clientId, internalUrl, identityProvider);
53+
QueueName^ queueName = gcnew QueueName("ExampleQueue");
54+
Task^ task = queueingService->DeleteQueueAsync(queueName, CancellationToken::None);
55+
#pragma endregion
56+
}
57+
58+
#pragma region ListQueuesAsync (TPL)
59+
void ListQueues()
60+
{
61+
IQueueingService^ queueingService = gcnew CloudQueuesProvider(identity, region, clientId, internalUrl, identityProvider);
62+
Task<ReadOnlyCollectionPage<CloudQueue^>^>^ queuesPageTask = queueingService->ListQueuesAsync(nullptr, Nullable<int>(), true, CancellationToken::None);
63+
auto func = gcnew Func<Task<ReadOnlyCollectionPage<CloudQueue^>^>^, Task<ReadOnlyCollection<CloudQueue^>^>^>(GetAllPagesContinuationAsync<CloudQueue^>);
64+
Task<ReadOnlyCollection<CloudQueue^>^>^ queuesTask = TaskExtensions::Unwrap(queuesPageTask->ContinueWith(func));
65+
}
66+
67+
generic<class T>
68+
static Task<ReadOnlyCollection<T>^>^ GetAllPagesContinuationAsync(Task<ReadOnlyCollectionPage<T>^>^ pageTask)
69+
{
70+
return ReadOnlyCollectionPageExtensions::GetAllPagesAsync(pageTask->Result, CancellationToken::None, static_cast<IProgress<ReadOnlyCollectionPage<T>^>^>(nullptr));
71+
}
72+
#pragma endregion
73+
74+
void QueueExists()
75+
{
76+
#pragma region QueueExistsAsync (TPL)
77+
IQueueingService^ queueingService = gcnew CloudQueuesProvider(identity, region, clientId, internalUrl, identityProvider);
78+
QueueName^ queueName = gcnew QueueName("ExampleQueue");
79+
Task<bool>^ task = queueingService->QueueExistsAsync(queueName, CancellationToken::None);
80+
#pragma endregion
81+
}
82+
};
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
========================================================================
2+
DYNAMIC LINK LIBRARY : CPPCodeSamples Project Overview
3+
========================================================================
4+
5+
AppWizard has created this CPPCodeSamples DLL for you.
6+
7+
This file contains a summary of what you will find in each of the files that
8+
make up your CPPCodeSamples application.
9+
10+
CPPCodeSamples.vcxproj
11+
This is the main project file for VC++ projects generated using an Application Wizard.
12+
It contains information about the version of Visual C++ that generated the file, and
13+
information about the platforms, configurations, and project features selected with the
14+
Application Wizard.
15+
16+
CPPCodeSamples.vcxproj.filters
17+
This is the filters file for VC++ projects generated using an Application Wizard.
18+
It contains information about the association between the files in your project
19+
and the filters. This association is used in the IDE to show grouping of files with
20+
similar extensions under a specific node (for e.g. ".cpp" files are associated with the
21+
"Source Files" filter).
22+
23+
CPPCodeSamples.cpp
24+
This is the main DLL source file.
25+
26+
CPPCodeSamples.h
27+
This file contains a class declaration.
28+
29+
AssemblyInfo.cpp
30+
Contains custom attributes for modifying assembly metadata.
31+
32+
/////////////////////////////////////////////////////////////////////////////
33+
Other notes:
34+
35+
AppWizard uses "TODO:" to indicate parts of the source code you
36+
should add to or customize.
37+
38+
/////////////////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)