├── .gitattributes
├── .gitignore
├── AlertClient.lnk
├── AlertClient
├── AlertClient.csproj
├── App.config
├── Controls
│ ├── Grouper.cs
│ ├── HeaderPanel.Designer.cs
│ ├── HeaderPanel.cs
│ ├── HeaderPanel.resx
│ └── NumericTextBox.cs
├── Forms
│ ├── AboutForm.cs
│ ├── AboutForm.designer.cs
│ ├── AboutForm.resx
│ ├── MainForm.Designer.cs
│ ├── MainForm.cs
│ └── MainForm.resx
├── Helpers
│ ├── EventProcessor.cs
│ ├── EventProcessorFactory.cs
│ ├── EventProcessorFactoryConfiguration.cs
│ ├── PropertyComparer.cs
│ └── SortableBindingList.cs
├── Icons
│ ├── AzureLogo.ico
│ ├── Tool.ico
│ └── WindowsAzureLogo.ico
├── Images
│ ├── AzureLogo.png
│ ├── SmallDocument.png
│ ├── SmallWorld.png
│ ├── Warning.png
│ └── WhiteLogo.png
├── Program.cs
├── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ ├── Settings.Designer.cs
│ └── Settings.settings
└── packages.config
├── DeviceActorService.Interfaces
├── DeviceActorService.Interfaces.csproj
├── IDeviceActor.cs
├── Properties
│ └── AssemblyInfo.cs
└── packages.config
├── DeviceActorService
├── ActorEventSource.cs
├── App.config
├── ApplicationInsights.config
├── DeviceActor.cs
├── DeviceActorService.cs
├── DeviceActorService.csproj
├── PackageRoot
│ ├── Config
│ │ └── Settings.xml
│ └── ServiceManifest.xml
├── Program.cs
├── Properties
│ └── AssemblyInfo.cs
├── Service References
│ └── Application Insights
│ │ └── ConnectedService.json
└── packages.config
├── DeviceManagementWebService
├── App.config
├── App_Start
│ └── BrowserJsonFormatter.cs
├── Controllers
│ └── DeviceController.cs
├── DeviceManagementWebService.cs
├── DeviceManagementWebService.csproj
├── IOwinAppBuilder.cs
├── OwinCommunicationListener.cs
├── PackageRoot
│ ├── Config
│ │ └── Settings.xml
│ └── ServiceManifest.xml
├── Program.cs
├── Properties
│ └── AssemblyInfo.cs
├── ServiceEventSource.cs
├── Startup.cs
└── packages.config
├── DeviceSimulator.lnk
├── DeviceSimulator
├── App.config
├── Controls
│ ├── Grouper.cs
│ ├── HeaderPanel.Designer.cs
│ ├── HeaderPanel.cs
│ ├── HeaderPanel.resx
│ ├── NumericTextBox.cs
│ ├── TrackBar.cs
│ ├── TrackBar.resx
│ └── TrackBarDesigner.cs
├── DeviceSimulator.csproj
├── Forms
│ ├── AboutForm.cs
│ ├── AboutForm.designer.cs
│ ├── AboutForm.resx
│ ├── MainForm.Designer.cs
│ ├── MainForm.cs
│ └── MainForm.resx
├── Helpers
│ ├── CustomColorHelper.cs
│ └── CustomStyleHelper.cs
├── Icons
│ ├── AzureLogo.ico
│ ├── Tool.ico
│ └── WindowsAzureLogo.ico
├── Images
│ ├── AzureLogo.png
│ ├── SmallDocument.png
│ ├── SmallWorld.png
│ ├── Warning.png
│ └── WhiteLogo.png
├── Program.cs
├── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ ├── Settings.Designer.cs
│ └── Settings.settings
└── packages.config
├── Entities
├── Alert.cs
├── Device.cs
├── Payload.cs
├── PayloadEntities.csproj
├── Properties
│ └── AssemblyInfo.cs
├── app.config
└── packages.config
├── EventProcessorHostService
├── App.config
├── EventProcessor.cs
├── EventProcessorFactory.cs
├── EventProcessorHostListener.cs
├── EventProcessorHostService.cs
├── EventProcessorHostService.csproj
├── PackageRoot
│ ├── Config
│ │ └── Settings.xml
│ └── ServiceManifest.xml
├── Program.cs
├── Properties
│ └── AssemblyInfo.cs
├── ServiceEventSource.cs
└── packages.config
├── Images
├── AlertClient.png
├── DeviceSimulator.png
└── VerticalArchitectureDesign.png
├── IoTDemo.sln
├── IoTDemo
├── ApplicationPackageRoot
│ └── ApplicationManifest.xml
├── ApplicationParameters
│ ├── Cloud.xml
│ └── Local.xml
├── IoTDemo.sfproj
├── PublishProfiles
│ ├── Cloud.xml
│ └── Local.xml
└── Scripts
│ └── Deploy-FabricApplication.ps1
├── README.md
└── _config.yml
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 |
4 | # User-specific files
5 | *.suo
6 | *.user
7 | *.userosscache
8 | *.sln.docstates
9 |
10 | # User-specific files (MonoDevelop/Xamarin Studio)
11 | *.userprefs
12 |
13 | # Build results
14 | [Dd]ebug/
15 | [Dd]ebugPublic/
16 | [Rr]elease/
17 | [Rr]eleases/
18 | x64/
19 | x86/
20 | build/
21 | bld/
22 | [Bb]in/
23 | [Oo]bj/
24 |
25 | # Visual Studio 2015 cache/options directory
26 | .vs/
27 |
28 | # MSTest test Results
29 | [Tt]est[Rr]esult*/
30 | [Bb]uild[Ll]og.*
31 |
32 | # NUNIT
33 | *.VisualState.xml
34 | TestResult.xml
35 |
36 | # Build Results of an ATL Project
37 | [Dd]ebugPS/
38 | [Rr]eleasePS/
39 | dlldata.c
40 |
41 | # DNX
42 | project.lock.json
43 | artifacts/
44 |
45 | *_i.c
46 | *_p.c
47 | *_i.h
48 | *.ilk
49 | *.meta
50 | *.obj
51 | *.pch
52 | *.pdb
53 | *.pgc
54 | *.pgd
55 | *.rsp
56 | *.sbr
57 | *.tlb
58 | *.tli
59 | *.tlh
60 | *.tmp
61 | *.tmp_proj
62 | *.log
63 | *.vspscc
64 | *.vssscc
65 | .builds
66 | *.pidb
67 | *.svclog
68 | *.scc
69 |
70 | # Chutzpah Test files
71 | _Chutzpah*
72 |
73 | # Visual C++ cache files
74 | ipch/
75 | *.aps
76 | *.ncb
77 | *.opensdf
78 | *.sdf
79 | *.cachefile
80 |
81 | # Visual Studio profiler
82 | *.psess
83 | *.vsp
84 | *.vspx
85 |
86 | # TFS 2012 Local Workspace
87 | $tf/
88 |
89 | # Guidance Automation Toolkit
90 | *.gpState
91 |
92 | # ReSharper is a .NET coding add-in
93 | _ReSharper*/
94 | *.[Rr]e[Ss]harper
95 | *.DotSettings.user
96 |
97 | # JustCode is a .NET coding add-in
98 | .JustCode
99 |
100 | # TeamCity is a build add-in
101 | _TeamCity*
102 |
103 | # DotCover is a Code Coverage Tool
104 | *.dotCover
105 |
106 | # NCrunch
107 | _NCrunch_*
108 | .*crunch*.local.xml
109 |
110 | # MightyMoose
111 | *.mm.*
112 | AutoTest.Net/
113 |
114 | # Web workbench (sass)
115 | .sass-cache/
116 |
117 | # Installshield output folder
118 | [Ee]xpress/
119 |
120 | # DocProject is a documentation generator add-in
121 | DocProject/buildhelp/
122 | DocProject/Help/*.HxT
123 | DocProject/Help/*.HxC
124 | DocProject/Help/*.hhc
125 | DocProject/Help/*.hhk
126 | DocProject/Help/*.hhp
127 | DocProject/Help/Html2
128 | DocProject/Help/html
129 |
130 | # Click-Once directory
131 | publish/
132 |
133 | # Publish Web Output
134 | *.[Pp]ublish.xml
135 | *.azurePubxml
136 | ## TODO: Comment the next line if you want to checkin your
137 | ## web deploy settings but do note that will include unencrypted
138 | ## passwords
139 | #*.pubxml
140 |
141 | *.publishproj
142 |
143 | # NuGet Packages
144 | *.nupkg
145 | # The packages folder can be ignored because of Package Restore
146 | **/packages/*
147 | # except build/, which is used as an MSBuild target.
148 | !**/packages/build/
149 | # Uncomment if necessary however generally it will be regenerated when needed
150 | #!**/packages/repositories.config
151 |
152 | # Windows Azure Build Output
153 | csx/
154 | *.build.csdef
155 |
156 | # Windows Store app package directory
157 | AppPackages/
158 |
159 | # Visual Studio cache files
160 | # files ending in .cache can be ignored
161 | *.[Cc]ache
162 | # but keep track of directories ending in .cache
163 | !*.[Cc]ache/
164 |
165 | # Others
166 | ClientBin/
167 | [Ss]tyle[Cc]op.*
168 | ~$*
169 | *~
170 | *.dbmdl
171 | *.dbproj.schemaview
172 | *.pfx
173 | *.publishsettings
174 | node_modules/
175 | orleans.codegen.cs
176 |
177 | # RIA/Silverlight projects
178 | Generated_Code/
179 |
180 | # Backup & report files from converting an old project file
181 | # to a newer Visual Studio version. Backup files are not needed,
182 | # because we have git ;-)
183 | _UpgradeReport_Files/
184 | Backup*/
185 | UpgradeLog*.XML
186 | UpgradeLog*.htm
187 |
188 | # SQL Server files
189 | *.mdf
190 | *.ldf
191 |
192 | # Business Intelligence projects
193 | *.rdl.data
194 | *.bim.layout
195 | *.bim_*.settings
196 |
197 | # Microsoft Fakes
198 | FakesAssemblies/
199 |
200 | # Node.js Tools for Visual Studio
201 | .ntvs_analysis.dat
202 |
203 | # Visual Studio 6 build log
204 | *.plg
205 |
206 | # Visual Studio 6 workspace options file
207 | *.opt
208 |
209 | # LightSwitch generated files
210 | GeneratedArtifacts/
211 | _Pvt_Extensions/
212 | ModelManifest.xml
213 |
--------------------------------------------------------------------------------
/AlertClient.lnk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/paolosalvatori/servicefabriceventhubdemo/9ff4e611508eb1f0a1a43c7c34118cfbb22edb70/AlertClient.lnk
--------------------------------------------------------------------------------
/AlertClient/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
--------------------------------------------------------------------------------
/AlertClient/Controls/HeaderPanel.Designer.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel;
2 |
3 | namespace Microsoft.AzureCat.Samples.AlertClient
4 | {
5 | partial class HeaderPanel
6 | {
7 | ///
8 | /// Required designer variable.
9 | ///
10 | private IContainer components = null;
11 |
12 | ///
13 | /// Clean up any resources being used.
14 | ///
15 | /// true if managed resources should be disposed; otherwise, false.
16 | protected override void Dispose(bool disposing)
17 | {
18 | if (disposing && (components != null))
19 | {
20 | components.Dispose();
21 | }
22 | base.Dispose(disposing);
23 | }
24 |
25 | #region Component Designer generated code
26 |
27 | ///
28 | /// Required method for Designer support - do not modify
29 | /// the contents of this method with the code editor.
30 | ///
31 | private void InitializeComponent()
32 | {
33 | this.SuspendLayout();
34 | //
35 | // OutlookPanelEx
36 | //
37 | this.BackColor = System.Drawing.SystemColors.ControlLightLight;
38 | this.Margin = new System.Windows.Forms.Padding(5, 4, 5, 4);
39 | this.Name = "OutlookPanelEx";
40 | this.Size = new System.Drawing.Size(224, 172);
41 | this.Paint += new System.Windows.Forms.PaintEventHandler(this.OutlookPanelEx_Paint);
42 | this.ResumeLayout(false);
43 |
44 | }
45 |
46 | #endregion
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/AlertClient/Controls/HeaderPanel.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/paolosalvatori/servicefabriceventhubdemo/9ff4e611508eb1f0a1a43c7c34118cfbb22edb70/AlertClient/Controls/HeaderPanel.cs
--------------------------------------------------------------------------------
/AlertClient/Controls/HeaderPanel.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/AlertClient/Controls/NumericTextBox.cs:
--------------------------------------------------------------------------------
1 | #region Copyright
2 | //=======================================================================================
3 | // Microsoft Business Platform Division Customer Advisory Team
4 | //
5 | // This sample is supplemental to the technical guidance published on my personal
6 | // blog at http://blogs.msdn.com/b/paolos/.
7 | //
8 | // Author: Paolo Salvatori
9 | //=======================================================================================
10 | // Copyright © 2011 Microsoft Corporation. All rights reserved.
11 | //
12 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
13 | // EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
14 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. YOU BEAR THE RISK OF USING IT.
15 | //=======================================================================================
16 | #endregion
17 |
18 | #region Using Directives
19 |
20 | using System;
21 | using System.Globalization;
22 | using System.Windows.Forms;
23 |
24 | #endregion
25 |
26 | namespace Microsoft.AzureCat.Samples.AlertClient
27 | {
28 | public class NumericTextBox : TextBox
29 | {
30 | #region Private Fields
31 | private bool allowSpace;
32 | #endregion
33 |
34 | #region Protected Methods
35 | // Restricts the entry of characters to digits (including hex), the negative sign,
36 | // the decimal point, and editing keystrokes (backspace).
37 | protected override void OnKeyPress(KeyPressEventArgs e)
38 | {
39 | base.OnKeyPress(e);
40 |
41 | var numberFormatInfo = CultureInfo.CurrentCulture.NumberFormat;
42 | var decimalSeparator = numberFormatInfo.NumberDecimalSeparator;
43 | var groupSeparator = numberFormatInfo.NumberGroupSeparator;
44 | var negativeSign = numberFormatInfo.NegativeSign;
45 |
46 | var keyInput = e.KeyChar.ToString(CultureInfo.InvariantCulture);
47 |
48 | if (Char.IsDigit(e.KeyChar))
49 | {
50 | // Digits are OK
51 | }
52 | else if (keyInput.Equals(decimalSeparator) || keyInput.Equals(groupSeparator) ||
53 | keyInput.Equals(negativeSign))
54 | {
55 | // Decimal separator is OK
56 | }
57 | else if (e.KeyChar == '\b')
58 | {
59 | // Backspace key is OK
60 | }
61 | // else if ((ModifierKeys & (Keys.Control | Keys.Alt)) != 0)
62 | // {
63 | // // Let the edit control handle control and alt key combinations
64 | // }
65 | else if (allowSpace && e.KeyChar == ' ')
66 | {
67 |
68 | }
69 | else
70 | {
71 | // Swallow this invalid key and beep
72 | e.Handled = true;
73 | }
74 | }
75 | #endregion
76 |
77 | #region Public Properties
78 | public int IntegerValue
79 | {
80 | get { return Int32.Parse(Text); }
81 | }
82 |
83 | public decimal DecimalValue
84 | {
85 | get { return Decimal.Parse(Text); }
86 | }
87 |
88 | public bool AllowSpace
89 | {
90 | set { allowSpace = value; }
91 |
92 | get { return allowSpace; }
93 | }
94 | #endregion
95 | }
96 | }
--------------------------------------------------------------------------------
/AlertClient/Helpers/EventProcessor.cs:
--------------------------------------------------------------------------------
1 | #region Copyright
2 | //=======================================================================================
3 | // Microsoft Azure Customer Advisory Team
4 | //
5 | // This sample is supplemental to the technical guidance published on the community
6 | // blog at http://blogs.msdn.com/b/paolos/.
7 | //
8 | // Author: Paolo Salvatori
9 | //=======================================================================================
10 | // Copyright © 2015 Microsoft Corporation. All rights reserved.
11 | //
12 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
13 | // EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
14 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. YOU BEAR THE RISK OF USING IT.
15 | //=======================================================================================
16 | #endregion
17 |
18 | #region Using Directives
19 |
20 | using System;
21 | using System.Collections.Generic;
22 | using System.Linq;
23 | using System.Text;
24 | using System.Threading.Tasks;
25 | using Microsoft.AzureCat.Samples.PayloadEntities;
26 | using Microsoft.ServiceBus.Messaging;
27 | using Newtonsoft.Json;
28 |
29 | #endregion
30 |
31 | namespace Microsoft.AzureCat.Samples.AlertClient
32 | {
33 | public class EventProcessor : IEventProcessor
34 | {
35 | #region Private Fields
36 |
37 | private EventProcessorFactoryConfiguration configuration;
38 | #endregion
39 |
40 | #region Public Constructors
41 | public EventProcessor(EventProcessorFactoryConfiguration configuration)
42 | {
43 | if (configuration == null)
44 | {
45 | throw new ArgumentNullException(nameof(configuration));
46 | }
47 | this.configuration = configuration;
48 | }
49 | #endregion
50 |
51 | #region IEventProcessor Methods
52 | public Task OpenAsync(PartitionContext context)
53 | {
54 | try
55 | {
56 | // Trace Open Partition
57 | configuration.WriteToLog($"[EventProcessor].[OpenAsync]:: EventHub=[{context.EventHubPath}] ConsumerGroup=[{context.ConsumerGroupName}] PartitionId=[{context.Lease.PartitionId}]");
58 | }
59 | catch (Exception ex)
60 | {
61 | // Trace Exception
62 | configuration.WriteToLog($"[EventProcessor].[OpenAsync]:: Exception=[{ex.Message}]");
63 | }
64 | return Task.FromResult