├── .gitattributes ├── .gitignore ├── MLNotification.ConsoleClient ├── App.config ├── MLNotification.ConsoleClient.csproj ├── Processor.cs ├── Program.cs ├── Properties │ └── AssemblyInfo.cs └── packages.config ├── MLNotification.Domain ├── Enums.cs ├── INotificationMessage.cs ├── IUserInfo.cs ├── MLNotification.Domain.csproj ├── NotificationMessage.cs ├── Properties │ └── AssemblyInfo.cs └── UserInfo.cs ├── MLNotification.MVCClient ├── App_Start │ ├── BundleConfig.cs │ ├── FilterConfig.cs │ └── RouteConfig.cs ├── ApplicationInsights.config ├── Content │ ├── Site.css │ ├── bootstrap.css │ └── bootstrap.min.css ├── Controllers │ ├── HomeController.cs │ └── NotificationsController.cs ├── Global.asax ├── Global.asax.cs ├── MLNotification.MVCClient.csproj ├── Properties │ └── AssemblyInfo.cs ├── Scripts │ ├── bootstrap.js │ ├── bootstrap.min.js │ ├── jquery-1.10.2.intellisense.js │ ├── jquery-1.10.2.js │ ├── jquery-1.10.2.min.js │ ├── jquery-1.10.2.min.map │ ├── jquery.signalR-2.2.2.js │ ├── jquery.signalR-2.2.2.min.js │ ├── jquery.validate-vsdoc.js │ ├── jquery.validate.js │ ├── jquery.validate.min.js │ ├── jquery.validate.unobtrusive.js │ ├── jquery.validate.unobtrusive.min.js │ ├── modernizr-2.6.2.js │ ├── respond.js │ └── respond.min.js ├── Views │ ├── Home │ │ ├── About.cshtml │ │ ├── Contact.cshtml │ │ └── Index.cshtml │ ├── Notifications │ │ ├── Index.cshtml │ │ └── Index2.cshtml │ ├── Shared │ │ ├── Error.cshtml │ │ └── _Layout.cshtml │ ├── Web.config │ └── _ViewStart.cshtml ├── Web.Debug.config ├── Web.Release.config ├── Web.config ├── favicon.ico ├── fonts │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.svg │ ├── glyphicons-halflings-regular.ttf │ └── glyphicons-halflings-regular.woff └── packages.config ├── MLNotification.Service ├── App.config ├── MLMessageHub.cs ├── MLNotification.Service.csproj ├── Program.cs ├── Properties │ └── AssemblyInfo.cs ├── Startup.cs └── packages.config ├── MLNotification.ServiceConnection ├── BuilderMLMessageHub.cs ├── EventArgs │ └── MLMessageEventArgs.cs ├── IMLMessageHubConect.cs ├── MLMessageHubConect.cs ├── MLNotification.ServiceClientConnect.csproj ├── Properties │ └── AssemblyInfo.cs └── packages.config ├── MLNotification.WPClient2 ├── App.config ├── App.xaml ├── App.xaml.cs ├── MLNotification.WPClient2.csproj ├── MainWindow.xaml ├── MainWindow.xaml.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings ├── Window2.xaml ├── Window2.xaml.cs └── packages.config ├── MLNotification.WPClient3 ├── App.config ├── App.xaml ├── App.xaml.cs ├── MLNotification.WPClient3.csproj ├── MainWindow.xaml ├── MainWindow.xaml.cs ├── MainWindow2.xaml ├── MainWindow2.xaml.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings ├── Simple Styles.xaml ├── Windows_Homepage_Icon_OS_1920.png └── packages.config ├── MLNotification.WPFClient.Tests ├── MLNotification.WPFClient.Tests.csproj ├── Properties │ └── AssemblyInfo.cs ├── Settings │ ├── IsolateFileManagerTests.cs │ └── SettingsManagerTests.cs ├── ViewModels │ └── NotificationViewModelTests.cs └── packages.config ├── MLNotification.WPFClient ├── App.config ├── App.xaml ├── App.xaml.cs ├── Converters │ ├── BallonStateBrushConverter.cs │ ├── BitmapToBitmapImageConverter.cs │ ├── MessageTypeImageConverter.cs │ ├── NotConectedBrushConverter.cs │ ├── NotConectedTextConverter.cs │ └── StateBrushConverter.cs ├── Images │ ├── 12-512.png │ ├── MLNotificationLogo.png │ ├── btClose1.png │ ├── btClose2.png │ ├── btClose3.png │ ├── clearall1.png │ ├── clearall2.png │ ├── clearall3.png │ ├── download.jpg │ ├── error.png │ ├── information.png │ ├── notification.ico │ ├── principal.ico │ ├── principal.png │ ├── save1.png │ ├── save2.png │ ├── save3.png │ ├── settings1.png │ ├── settings2.png │ ├── settings3.png │ ├── settingsImage.png │ ├── veryimportant.png │ └── warining.png ├── MLDarkStyle.xaml ├── MLNotification.WPFClient.csproj ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings ├── Settings │ ├── IFileSettingsManager.cs │ ├── ISettingsManager.cs │ ├── IsolateFileManager.cs │ ├── SettingsBuilder.cs │ ├── SettingsGlobalData.cs │ ├── SettingsInfo.cs │ └── SettingsManager.cs ├── Simple Styles.xaml ├── ViewModel │ ├── LinkBlogViewModel.cs │ ├── MainViewModel.cs │ ├── NotificationViewModel.cs │ ├── SettingsViewModel.cs │ └── ViewModelLocator.cs ├── Views │ ├── MLBallon.xaml │ ├── MLBallon.xaml.cs │ ├── MainView.xaml │ ├── MainView.xaml.cs │ ├── NotificationItemView.xaml │ ├── NotificationItemView.xaml.cs │ ├── NotificationView.xaml │ ├── NotificationView.xaml.cs │ ├── SettingsView.xaml │ └── SettingsView.xaml.cs └── packages.config └── MLNotification.sln /.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 | * linguist-vendored 14 | *.cs linguist-vendored=false 15 | 16 | ############################################################################### 17 | # Set the merge driver for project and solution files 18 | # 19 | # Merging from the command prompt will add diff markers to the files if there 20 | # are conflicts (Merging from VS is not affected by the settings below, in VS 21 | # the diff markers are never inserted). Diff markers may cause the following 22 | # file extensions to fail to load in VS. An alternative would be to treat 23 | # these files as binary and thus will always conflict and require user 24 | # intervention with every merge. To do so, just uncomment the entries below 25 | ############################################################################### 26 | #*.sln merge=binary 27 | #*.csproj merge=binary 28 | #*.vbproj merge=binary 29 | #*.vcxproj merge=binary 30 | #*.vcproj merge=binary 31 | #*.dbproj merge=binary 32 | #*.fsproj merge=binary 33 | #*.lsproj merge=binary 34 | #*.wixproj merge=binary 35 | #*.modelproj merge=binary 36 | #*.sqlproj merge=binary 37 | #*.wwaproj merge=binary 38 | 39 | ############################################################################### 40 | # behavior for image files 41 | # 42 | # image files are treated as binary by default. 43 | ############################################################################### 44 | #*.jpg binary 45 | #*.png binary 46 | #*.gif binary 47 | 48 | ############################################################################### 49 | # diff behavior for common document formats 50 | # 51 | # Convert binary document formats to text before diffing them. This feature 52 | # is only available from the command line. Turn it on by uncommenting the 53 | # entries below. 54 | ############################################################################### 55 | #*.doc diff=astextplain 56 | #*.DOC diff=astextplain 57 | #*.docx diff=astextplain 58 | #*.DOCX diff=astextplain 59 | #*.dot diff=astextplain 60 | #*.DOT diff=astextplain 61 | #*.pdf diff=astextplain 62 | #*.PDF diff=astextplain 63 | #*.rtf diff=astextplain 64 | #*.RTF diff=astextplain 65 | -------------------------------------------------------------------------------- /.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 | bld/ 21 | [Bb]in/ 22 | [Oo]bj/ 23 | [Ll]og/ 24 | 25 | # Visual Studio 2015 cache/options directory 26 | .vs/ 27 | # Uncomment if you have tasks that create the project's static files in wwwroot 28 | #wwwroot/ 29 | 30 | # MSTest test Results 31 | [Tt]est[Rr]esult*/ 32 | [Bb]uild[Ll]og.* 33 | 34 | # NUNIT 35 | *.VisualState.xml 36 | TestResult.xml 37 | 38 | # Build Results of an ATL Project 39 | [Dd]ebugPS/ 40 | [Rr]eleasePS/ 41 | dlldata.c 42 | 43 | # DNX 44 | project.lock.json 45 | project.fragment.lock.json 46 | artifacts/ 47 | 48 | *_i.c 49 | *_p.c 50 | *_i.h 51 | *.ilk 52 | *.meta 53 | *.obj 54 | *.pch 55 | *.pdb 56 | *.pgc 57 | *.pgd 58 | *.rsp 59 | *.sbr 60 | *.tlb 61 | *.tli 62 | *.tlh 63 | *.tmp 64 | *.tmp_proj 65 | *.log 66 | *.vspscc 67 | *.vssscc 68 | .builds 69 | *.pidb 70 | *.svclog 71 | *.scc 72 | 73 | # Chutzpah Test files 74 | _Chutzpah* 75 | 76 | # Visual C++ cache files 77 | ipch/ 78 | *.aps 79 | *.ncb 80 | *.opendb 81 | *.opensdf 82 | *.sdf 83 | *.cachefile 84 | *.VC.db 85 | *.VC.VC.opendb 86 | 87 | # Visual Studio profiler 88 | *.psess 89 | *.vsp 90 | *.vspx 91 | *.sap 92 | 93 | # TFS 2012 Local Workspace 94 | $tf/ 95 | 96 | # Guidance Automation Toolkit 97 | *.gpState 98 | 99 | # ReSharper is a .NET coding add-in 100 | _ReSharper*/ 101 | *.[Rr]e[Ss]harper 102 | *.DotSettings.user 103 | 104 | # JustCode is a .NET coding add-in 105 | .JustCode 106 | 107 | # TeamCity is a build add-in 108 | _TeamCity* 109 | 110 | # DotCover is a Code Coverage Tool 111 | *.dotCover 112 | 113 | # NCrunch 114 | _NCrunch_* 115 | .*crunch*.local.xml 116 | nCrunchTemp_* 117 | 118 | # MightyMoose 119 | *.mm.* 120 | AutoTest.Net/ 121 | 122 | # Web workbench (sass) 123 | .sass-cache/ 124 | 125 | # Installshield output folder 126 | [Ee]xpress/ 127 | 128 | # DocProject is a documentation generator add-in 129 | DocProject/buildhelp/ 130 | DocProject/Help/*.HxT 131 | DocProject/Help/*.HxC 132 | DocProject/Help/*.hhc 133 | DocProject/Help/*.hhk 134 | DocProject/Help/*.hhp 135 | DocProject/Help/Html2 136 | DocProject/Help/html 137 | 138 | # Click-Once directory 139 | publish/ 140 | 141 | # Publish Web Output 142 | *.[Pp]ublish.xml 143 | *.azurePubxml 144 | # TODO: Comment the next line if you want to checkin your web deploy settings 145 | # but database connection strings (with potential passwords) will be unencrypted 146 | #*.pubxml 147 | *.publishproj 148 | 149 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 150 | # checkin your Azure Web App publish settings, but sensitive information contained 151 | # in these scripts will be unencrypted 152 | PublishScripts/ 153 | 154 | # NuGet Packages 155 | *.nupkg 156 | # The packages folder can be ignored because of Package Restore 157 | **/packages/* 158 | # except build/, which is used as an MSBuild target. 159 | !**/packages/build/ 160 | # Uncomment if necessary however generally it will be regenerated when needed 161 | #!**/packages/repositories.config 162 | # NuGet v3's project.json files produces more ignoreable files 163 | *.nuget.props 164 | *.nuget.targets 165 | 166 | # Microsoft Azure Build Output 167 | csx/ 168 | *.build.csdef 169 | 170 | # Microsoft Azure Emulator 171 | ecf/ 172 | rcf/ 173 | 174 | # Windows Store app package directories and files 175 | AppPackages/ 176 | BundleArtifacts/ 177 | Package.StoreAssociation.xml 178 | _pkginfo.txt 179 | 180 | # Visual Studio cache files 181 | # files ending in .cache can be ignored 182 | *.[Cc]ache 183 | # but keep track of directories ending in .cache 184 | !*.[Cc]ache/ 185 | 186 | # Others 187 | ClientBin/ 188 | ~$* 189 | *~ 190 | *.dbmdl 191 | *.dbproj.schemaview 192 | *.jfm 193 | *.pfx 194 | *.publishsettings 195 | node_modules/ 196 | orleans.codegen.cs 197 | 198 | # Since there are multiple workflows, uncomment next line to ignore bower_components 199 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 200 | #bower_components/ 201 | 202 | # RIA/Silverlight projects 203 | Generated_Code/ 204 | 205 | # Backup & report files from converting an old project file 206 | # to a newer Visual Studio version. Backup files are not needed, 207 | # because we have git ;-) 208 | _UpgradeReport_Files/ 209 | Backup*/ 210 | UpgradeLog*.XML 211 | UpgradeLog*.htm 212 | 213 | # SQL Server files 214 | *.mdf 215 | *.ldf 216 | 217 | # Business Intelligence projects 218 | *.rdl.data 219 | *.bim.layout 220 | *.bim_*.settings 221 | 222 | # Microsoft Fakes 223 | FakesAssemblies/ 224 | 225 | # GhostDoc plugin setting file 226 | *.GhostDoc.xml 227 | 228 | # Node.js Tools for Visual Studio 229 | .ntvs_analysis.dat 230 | 231 | # Visual Studio 6 build log 232 | *.plg 233 | 234 | # Visual Studio 6 workspace options file 235 | *.opt 236 | 237 | # Visual Studio LightSwitch build output 238 | **/*.HTMLClient/GeneratedArtifacts 239 | **/*.DesktopClient/GeneratedArtifacts 240 | **/*.DesktopClient/ModelManifest.xml 241 | **/*.Server/GeneratedArtifacts 242 | **/*.Server/ModelManifest.xml 243 | _Pvt_Extensions 244 | 245 | # Paket dependency manager 246 | .paket/paket.exe 247 | paket-files/ 248 | 249 | # FAKE - F# Make 250 | .fake/ 251 | 252 | # JetBrains Rider 253 | .idea/ 254 | *.sln.iml 255 | 256 | # CodeRush 257 | .cr/ 258 | 259 | # Python Tools for Visual Studio (PTVS) 260 | __pycache__/ 261 | *.pyc -------------------------------------------------------------------------------- /MLNotification.ConsoleClient/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /MLNotification.ConsoleClient/MLNotification.ConsoleClient.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {671F005D-FA47-43CE-983E-284EE2DD30DB} 8 | Exe 9 | MLNotification.ConsoleClient 10 | MLNotification.ConsoleClient 11 | v4.5.2 12 | 512 13 | true 14 | SAK 15 | SAK 16 | SAK 17 | SAK 18 | 19 | 20 | AnyCPU 21 | true 22 | full 23 | false 24 | bin\Debug\ 25 | DEBUG;TRACE 26 | prompt 27 | 4 28 | 29 | 30 | AnyCPU 31 | pdbonly 32 | true 33 | bin\Release\ 34 | TRACE 35 | prompt 36 | 4 37 | 38 | 39 | 40 | ..\packages\Microsoft.AspNet.SignalR.Client.2.2.2\lib\net45\Microsoft.AspNet.SignalR.Client.dll 41 | 42 | 43 | ..\packages\Newtonsoft.Json.6.0.4\lib\net45\Newtonsoft.Json.dll 44 | True 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | {5c076819-f8cd-41d1-9ad8-e09852b844e8} 67 | MLNotification.Domain 68 | 69 | 70 | {0cf7f418-4732-4be9-9fa6-746ca351a6e7} 71 | MLNotification.ServiceClientConnect 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /MLNotification.ConsoleClient/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace MLNotification.ConsoleClient 8 | { 9 | class Program 10 | { 11 | static void Main(string[] args) 12 | { 13 | new Processor().Start(); 14 | 15 | 16 | 17 | 18 | 19 | 20 | } 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /MLNotification.ConsoleClient/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("MLNotification.ConsoleClient")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("MLNotification.ConsoleClient")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("671f005d-fa47-43ce-983e-284ee2dd30db")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /MLNotification.ConsoleClient/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /MLNotification.Domain/Enums.cs: -------------------------------------------------------------------------------- 1 | namespace MLNotification.Domain 2 | { 3 | public enum MessageType 4 | { 5 | Information, 6 | Warnnig, 7 | Error, 8 | VeryImportant, 9 | Information_urgent, 10 | Warnnig_urgent, 11 | Error_urgent, 12 | VeryImportant_urgent 13 | } 14 | } -------------------------------------------------------------------------------- /MLNotification.Domain/INotificationMessage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | 4 | namespace MLNotification.Domain 5 | { 6 | public interface INotificationMessage : IUserInfo 7 | { 8 | string Body { get; set; } 9 | string UriImage { get; set; } 10 | DateTime MessageDate { get; set; } 11 | MessageType MessageType { get; set; } 12 | string Subject { get; set; } 13 | 14 | } 15 | } -------------------------------------------------------------------------------- /MLNotification.Domain/IUserInfo.cs: -------------------------------------------------------------------------------- 1 | namespace MLNotification.Domain 2 | { 3 | public interface IUserInfo 4 | { 5 | string Group { get; set; } 6 | string User { get; set; } 7 | string Server { get; set; } 8 | } 9 | } -------------------------------------------------------------------------------- /MLNotification.Domain/MLNotification.Domain.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {5C076819-F8CD-41D1-9AD8-E09852B844E8} 8 | Library 9 | Properties 10 | MLNotification.Domain 11 | MLNotification.Domain 12 | v4.5.2 13 | 512 14 | SAK 15 | SAK 16 | SAK 17 | SAK 18 | 19 | 20 | true 21 | full 22 | false 23 | bin\Debug\ 24 | DEBUG;TRACE 25 | prompt 26 | 4 27 | 28 | 29 | pdbonly 30 | true 31 | bin\Release\ 32 | TRACE 33 | prompt 34 | 4 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /MLNotification.Domain/NotificationMessage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel.DataAnnotations; 3 | 4 | namespace MLNotification.Domain 5 | { 6 | [Serializable] 7 | public class NotificationMessage : INotificationMessage 8 | { 9 | [Required] 10 | [MaxLength(100)] 11 | public string Subject { get; set; } 12 | [Required] 13 | [MaxLength(2000)] 14 | public string Body { get; set; } 15 | public MessageType MessageType { get; set; } 16 | [MaxLength(50)] 17 | public string Group { get; set; } 18 | [MaxLength(50)] 19 | public string User { get; set; } 20 | [MaxLength(50)] 21 | public string Server { get; set; } 22 | public DateTime MessageDate { get; set; } 23 | public string UriImage { get; set; } 24 | } 25 | 26 | } 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /MLNotification.Domain/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("MLNotification.Domain")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("MLNotification.Domain")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("5c076819-f8cd-41d1-9ad8-e09852b844e8")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /MLNotification.Domain/UserInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel.DataAnnotations; 3 | 4 | namespace MLNotification.Domain 5 | { 6 | [Serializable] 7 | public class UserInfo : IUserInfo 8 | { 9 | [MaxLength(50)] 10 | public string Group { get; set; } 11 | [MaxLength(50)] 12 | public string User { get; set; } 13 | [MaxLength(50)] 14 | public string Server { get; set; } 15 | 16 | } 17 | 18 | 19 | 20 | } 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /MLNotification.MVCClient/App_Start/BundleConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web; 2 | using System.Web.Optimization; 3 | 4 | namespace MLNotification.MVCClient 5 | { 6 | public class BundleConfig 7 | { 8 | // For more information on bundling, visit https://go.microsoft.com/fwlink/?LinkId=301862 9 | public static void RegisterBundles(BundleCollection bundles) 10 | { 11 | bundles.Add(new ScriptBundle("~/bundles/jquery").Include( 12 | "~/Scripts/jquery-{version}.js")); 13 | 14 | bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include( 15 | "~/Scripts/jquery.validate*")); 16 | 17 | // Use the development version of Modernizr to develop with and learn from. Then, when you're 18 | // ready for production, use the build tool at https://modernizr.com to pick only the tests you need. 19 | bundles.Add(new ScriptBundle("~/bundles/modernizr").Include( 20 | "~/Scripts/modernizr-*")); 21 | 22 | bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include( 23 | "~/Scripts/bootstrap.js", 24 | "~/Scripts/respond.js")); 25 | 26 | bundles.Add(new StyleBundle("~/Content/css").Include( 27 | "~/Content/bootstrap.css", 28 | "~/Content/site.css")); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /MLNotification.MVCClient/App_Start/FilterConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web; 2 | using System.Web.Mvc; 3 | 4 | namespace MLNotification.MVCClient 5 | { 6 | public class FilterConfig 7 | { 8 | public static void RegisterGlobalFilters(GlobalFilterCollection filters) 9 | { 10 | filters.Add(new HandleErrorAttribute()); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /MLNotification.MVCClient/App_Start/RouteConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using System.Web.Routing; 7 | 8 | namespace MLNotification.MVCClient 9 | { 10 | public class RouteConfig 11 | { 12 | public static void RegisterRoutes(RouteCollection routes) 13 | { 14 | routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); 15 | 16 | routes.MapRoute( 17 | name: "Default", 18 | url: "{controller}/{action}/{id}", 19 | defaults: new { controller = "Notifications", action = "Index", id = UrlParameter.Optional } 20 | ); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /MLNotification.MVCClient/Content/Site.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 50px; 3 | padding-bottom: 20px; 4 | } 5 | 6 | /* Set padding to keep content from hitting the edges */ 7 | .body-content { 8 | padding-left: 15px; 9 | padding-right: 15px; 10 | } 11 | 12 | /* Override the default bootstrap behavior where horizontal description lists 13 | will truncate terms that are too long to fit in the left column 14 | */ 15 | .dl-horizontal dt { 16 | white-space: normal; 17 | } 18 | 19 | /* Set width on the form input elements since they're 100% wide by default */ 20 | input, 21 | select, 22 | textarea { 23 | max-width: 280px; 24 | } 25 | -------------------------------------------------------------------------------- /MLNotification.MVCClient/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | 7 | namespace MLNotification.MVCClient.Controllers 8 | { 9 | public class HomeController : Controller 10 | { 11 | public ActionResult Index() 12 | { 13 | return View(); 14 | } 15 | 16 | public ActionResult About() 17 | { 18 | ViewBag.Message = "Your application description page."; 19 | 20 | return View(); 21 | } 22 | 23 | public ActionResult Contact() 24 | { 25 | ViewBag.Message = "Your contact page."; 26 | 27 | return View(); 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /MLNotification.MVCClient/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="MLNotification.MVCClient.MvcApplication" Language="C#" %> 2 | -------------------------------------------------------------------------------- /MLNotification.MVCClient/Global.asax.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using System.Web.Optimization; 7 | using System.Web.Routing; 8 | 9 | namespace MLNotification.MVCClient 10 | { 11 | public class MvcApplication : System.Web.HttpApplication 12 | { 13 | protected void Application_Start() 14 | { 15 | AreaRegistration.RegisterAllAreas(); 16 | FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); 17 | RouteConfig.RegisterRoutes(RouteTable.Routes); 18 | BundleConfig.RegisterBundles(BundleTable.Bundles); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /MLNotification.MVCClient/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("MLNotification.MVCClient")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("MLNotification.MVCClient")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("e7958468-ad58-4c9e-a7f5-2a5851055388")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Revision and Build Numbers 33 | // by using the '*' as shown below: 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /MLNotification.MVCClient/Scripts/respond.min.js: -------------------------------------------------------------------------------- 1 | /* NUGET: BEGIN LICENSE TEXT 2 | * 3 | * Microsoft grants you the right to use these script files for the sole 4 | * purpose of either: (i) interacting through your browser with the Microsoft 5 | * website or online service, subject to the applicable licensing or use 6 | * terms; or (ii) using the files as included with a Microsoft product subject 7 | * to that product's license terms. Microsoft reserves all other rights to the 8 | * files not expressly granted by Microsoft, whether by implication, estoppel 9 | * or otherwise. Insofar as a script file is dual licensed under GPL, 10 | * Microsoft neither took the code under GPL nor distributes it thereunder but 11 | * under the terms set out in this paragraph. All notices and licenses 12 | * below are for informational purposes only. 13 | * 14 | * NUGET: END LICENSE TEXT */ 15 | /*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas. Dual MIT/BSD license */ 16 | /*! NOTE: If you're already including a window.matchMedia polyfill via Modernizr or otherwise, you don't need this part */ 17 | window.matchMedia=window.matchMedia||(function(e,f){var c,a=e.documentElement,b=a.firstElementChild||a.firstChild,d=e.createElement("body"),g=e.createElement("div");g.id="mq-test-1";g.style.cssText="position:absolute;top:-100em";d.style.background="none";d.appendChild(g);return function(h){g.innerHTML='­';a.insertBefore(d,b);c=g.offsetWidth==42;a.removeChild(d);return{matches:c,media:h}}})(document); 18 | 19 | /*! Respond.js v1.2.0: min/max-width media query polyfill. (c) Scott Jehl. MIT/GPLv2 Lic. j.mp/respondjs */ 20 | (function(e){e.respond={};respond.update=function(){};respond.mediaQueriesSupported=e.matchMedia&&e.matchMedia("only all").matches;if(respond.mediaQueriesSupported){return}var w=e.document,s=w.documentElement,i=[],k=[],q=[],o={},h=30,f=w.getElementsByTagName("head")[0]||s,g=w.getElementsByTagName("base")[0],b=f.getElementsByTagName("link"),d=[],a=function(){var D=b,y=D.length,B=0,A,z,C,x;for(;B-1,minw:F.match(/\(min\-width:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:F.match(/\(max\-width:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}}j()},l,r,v=function(){var z,A=w.createElement("div"),x=w.body,y=false;A.style.cssText="position:absolute;font-size:1em;width:1em";if(!x){x=y=w.createElement("body");x.style.background="none"}x.appendChild(A);s.insertBefore(x,s.firstChild);z=A.offsetWidth;if(y){s.removeChild(x)}else{x.removeChild(A)}z=p=parseFloat(z);return z},p,j=function(I){var x="clientWidth",B=s[x],H=w.compatMode==="CSS1Compat"&&B||w.body[x]||B,D={},G=b[b.length-1],z=(new Date()).getTime();if(I&&l&&z-l-1?(p||v()):1)}if(!!J){J=parseFloat(J)*(J.indexOf(y)>-1?(p||v()):1)}if(!K.hasquery||(!A||!L)&&(A||H>=C)&&(L||H<=J)){if(!D[K.media]){D[K.media]=[]}D[K.media].push(k[K.rules])}}for(var E in q){if(q[E]&&q[E].parentNode===f){f.removeChild(q[E])}}for(var E in D){var M=w.createElement("style"),F=D[E].join("\n");M.type="text/css";M.media=E;f.insertBefore(M,G.nextSibling);if(M.styleSheet){M.styleSheet.cssText=F}else{M.appendChild(w.createTextNode(F))}q.push(M)}},n=function(x,z){var y=c();if(!y){return}y.open("GET",x,true);y.onreadystatechange=function(){if(y.readyState!=4||y.status!=200&&y.status!=304){return}z(y.responseText)};if(y.readyState==4){return}y.send(null)},c=(function(){var x=false;try{x=new XMLHttpRequest()}catch(y){x=new ActiveXObject("Microsoft.XMLHTTP")}return function(){return x}})();a();respond.update=a;function t(){j(true)}if(e.addEventListener){e.addEventListener("resize",t,false)}else{if(e.attachEvent){e.attachEvent("onresize",t)}}})(this); -------------------------------------------------------------------------------- /MLNotification.MVCClient/Views/Home/About.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewBag.Title = "About"; 3 | } 4 |

@ViewBag.Title.

5 |

@ViewBag.Message

6 | 7 |

Use this area to provide additional information.

8 | -------------------------------------------------------------------------------- /MLNotification.MVCClient/Views/Home/Contact.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewBag.Title = "Contact"; 3 | } 4 |

@ViewBag.Title.

5 |

@ViewBag.Message

6 | 7 |
8 | One Microsoft Way
9 | Redmond, WA 98052-6399
10 | P: 11 | 425.555.0100 12 |
13 | 14 |
15 | Support: Support@example.com
16 | Marketing: Marketing@example.com 17 |
-------------------------------------------------------------------------------- /MLNotification.MVCClient/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewBag.Title = "Home Page"; 3 | } 4 | 5 |
6 |

ASP.NET

7 |

ASP.NET is a free web framework for building great Web sites and Web applications using HTML, CSS and JavaScript.

8 |

Learn more »

9 |
10 | 11 |
12 |
13 |

Getting started

14 |

15 | ASP.NET MVC gives you a powerful, patterns-based way to build dynamic websites that 16 | enables a clean separation of concerns and gives you full control over markup 17 | for enjoyable, agile development. 18 |

19 |

Learn more »

20 |
21 |
22 |

Get more libraries

23 |

NuGet is a free Visual Studio extension that makes it easy to add, remove, and update libraries and tools in Visual Studio projects.

24 |

Learn more »

25 |
26 |
27 |

Web Hosting

28 |

You can easily find a web hosting company that offers the right mix of features and price for your applications.

29 |

Learn more »

30 |
31 |
-------------------------------------------------------------------------------- /MLNotification.MVCClient/Views/Notifications/Index.cshtml: -------------------------------------------------------------------------------- 1 |  2 | @{ 3 | ViewBag.Title = "View"; 4 | Layout = null; 5 | } 6 | 7 | 8 | 9 | 10 | 11 | Notifications MVC 12 | 13 | 14 | @Styles.Render("~/Content/css") 15 | @Scripts.Render("~/bundles/modernizr") 16 | @Scripts.Render("~/bundles/jquery") 17 | @Scripts.Render("~/bundles/bootstrap") 18 | @Scripts.Render("~/bundles/angular") 19 | @Scripts.Render("~/bundles/signalr") 20 | 21 | 22 | 23 | 24 | 25 |
26 |
27 |
28 |

Signalr Hubs - Cliente JS

29 |
30 |
31 |
32 | 33 | 34 |
35 |
36 | 37 |
38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 |
Mensaje
{{msgObj.Texto}}
50 |
51 |
52 |
53 | 54 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | -------------------------------------------------------------------------------- /MLNotification.MVCClient/Views/Notifications/Index2.cshtml: -------------------------------------------------------------------------------- 1 |  2 | @{ 3 | ViewBag.Title = "Index2"; 4 | Layout = null; 5 | } 6 | 7 |

Send Corrected !!!!

8 | 9 | -------------------------------------------------------------------------------- /MLNotification.MVCClient/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Error 6 | 7 | 8 |
9 |

Error.

10 |

An error occurred while processing your request.

11 |
12 | 13 | 14 | -------------------------------------------------------------------------------- /MLNotification.MVCClient/Views/Shared/_Layout.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | @ViewBag.Title - My ASP.NET Application 7 | @Styles.Render("~/Content/css") 8 | @Scripts.Render("~/bundles/modernizr") 9 | 10 | 11 | 30 |
31 | @RenderBody() 32 |
33 |
34 |

© @DateTime.Now.Year - My ASP.NET Application

35 |
36 |
37 | 38 | @Scripts.Render("~/bundles/jquery") 39 | @Scripts.Render("~/bundles/bootstrap") 40 | @RenderSection("scripts", required: false) 41 | 42 | 43 | -------------------------------------------------------------------------------- /MLNotification.MVCClient/Views/Web.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 | -------------------------------------------------------------------------------- /MLNotification.MVCClient/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "~/Views/Shared/_Layout.cshtml"; 3 | } 4 | -------------------------------------------------------------------------------- /MLNotification.MVCClient/Web.Debug.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /MLNotification.MVCClient/Web.Release.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 17 | 18 | 19 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /MLNotification.MVCClient/Web.config: -------------------------------------------------------------------------------- 1 |  2 | 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 | 54 | 55 | 56 | 57 | 58 | 61 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /MLNotification.MVCClient/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moraleslarios/MLNotifications/a2d2b9b03fd71d9e6977075a338dc3856d2945f2/MLNotification.MVCClient/favicon.ico -------------------------------------------------------------------------------- /MLNotification.MVCClient/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moraleslarios/MLNotifications/a2d2b9b03fd71d9e6977075a338dc3856d2945f2/MLNotification.MVCClient/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /MLNotification.MVCClient/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moraleslarios/MLNotifications/a2d2b9b03fd71d9e6977075a338dc3856d2945f2/MLNotification.MVCClient/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /MLNotification.MVCClient/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moraleslarios/MLNotifications/a2d2b9b03fd71d9e6977075a338dc3856d2945f2/MLNotification.MVCClient/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /MLNotification.MVCClient/packages.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 | -------------------------------------------------------------------------------- /MLNotification.Service/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /MLNotification.Service/MLMessageHub.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNet.SignalR; 2 | using MLNotification.Domain; 3 | using System; 4 | using System.Threading.Tasks; 5 | 6 | namespace MLNotification.Service 7 | { 8 | public class MLMessageHub : Hub 9 | { 10 | async public override Task OnConnected() 11 | { 12 | //Console.WriteLine("Nueva conexion con Id=" + Context.ConnectionId); 13 | 14 | //var message = new NotificationMessage 15 | //{ 16 | // Subject = "New service connection", 17 | // Body = $"There is a new connection from the UserId:{Context.ConnectionId}", 18 | // MessageDate = DateTime.Now, 19 | // MessageType = MessageType.Information 20 | //}; 21 | 22 | //await Clients.Caller.ProcessMessage(message); 23 | //await Clients.Others.ProcessMessage(message); 24 | } 25 | async public override Task OnDisconnected(bool stopCalled) 26 | { 27 | Console.WriteLine("Nueva conexion con Id=" + Context.ConnectionId); 28 | 29 | var message = new NotificationMessage 30 | { 31 | Subject = "New service desconnection", 32 | Body = $"There is a desconnection from the UserId:{Context.ConnectionId}", 33 | MessageDate = DateTime.Now, 34 | MessageType = MessageType.Information, 35 | UriImage = "http://www.tampabay.com/resources/images/dti/rendered/2015/04/wek_plug041615_15029753_8col.jpg" 36 | }; 37 | 38 | await Clients.Caller.ProcessMessage(message); 39 | await Clients.Others.ProcessMessage(message); 40 | } 41 | 42 | async public Task SendMessage(NotificationMessage message) 43 | { 44 | Console.WriteLine("[" + message.User + "]: " + message.Body); 45 | await Clients.All.ProcessMessage(message); 46 | } 47 | 48 | 49 | async public Task RegisterUser(UserInfo userInfo) 50 | { 51 | //if (userInfo == null) userInfo = new UserInfo { User = Context.ConnectionId, Group = string.Empty, Server = "Not Info Server" }; 52 | 53 | //this.userInfo = userInfo; 54 | 55 | //System.Threading.Thread.Sleep(2000); 56 | 57 | //Console.WriteLine($"[User {userInfo.User} register at {DateTime.Now}]: "); 58 | 59 | //var message = new NotificationMessage { Body = $"User {userInfo.User} conected at {DateTime.Now}", Subject = $"User {userInfo.User}", User = userInfo.User, 60 | // MessageType = MessageType.Information, MessageDate = DateTime.Now, Group = userInfo.Group, Server = userInfo.Server, 61 | // UriImage = "http://www.iconhot.com/icon/png/glossy/512/plug-5.png"}; 62 | 63 | //await Clients.All.ProcessMessage(message); 64 | } 65 | 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /MLNotification.Service/MLNotification.Service.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {8096A9FF-BE2A-42C8-9390-70E94C365B25} 8 | Exe 9 | MLNotification.Service 10 | MLNotification.Service 11 | v4.5.2 12 | 512 13 | true 14 | SAK 15 | SAK 16 | SAK 17 | SAK 18 | 19 | 20 | AnyCPU 21 | true 22 | full 23 | false 24 | bin\Debug\ 25 | DEBUG;TRACE 26 | prompt 27 | 4 28 | 29 | 30 | AnyCPU 31 | pdbonly 32 | true 33 | bin\Release\ 34 | TRACE 35 | prompt 36 | 4 37 | 38 | 39 | 40 | ..\packages\Microsoft.AspNet.SignalR.Core.2.2.2-preview1\lib\net45\Microsoft.AspNet.SignalR.Core.dll 41 | 42 | 43 | ..\packages\Microsoft.Owin.3.1.0\lib\net45\Microsoft.Owin.dll 44 | 45 | 46 | ..\packages\Microsoft.Owin.Cors.3.1.0\lib\net45\Microsoft.Owin.Cors.dll 47 | 48 | 49 | ..\packages\Microsoft.Owin.Diagnostics.2.1.0\lib\net40\Microsoft.Owin.Diagnostics.dll 50 | 51 | 52 | ..\packages\Microsoft.Owin.Host.HttpListener.2.1.0\lib\net45\Microsoft.Owin.Host.HttpListener.dll 53 | 54 | 55 | ..\packages\Microsoft.Owin.Hosting.2.1.0\lib\net45\Microsoft.Owin.Hosting.dll 56 | 57 | 58 | ..\packages\Microsoft.Owin.Security.2.1.0\lib\net45\Microsoft.Owin.Security.dll 59 | 60 | 61 | ..\packages\Newtonsoft.Json.6.0.4\lib\net45\Newtonsoft.Json.dll 62 | True 63 | 64 | 65 | ..\packages\Owin.1.0\lib\net40\Owin.dll 66 | 67 | 68 | 69 | 70 | ..\packages\Microsoft.AspNet.Cors.5.0.0\lib\net45\System.Web.Cors.dll 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | {5c076819-f8cd-41d1-9ad8-e09852b844e8} 92 | MLNotification.Domain 93 | 94 | 95 | 96 | -------------------------------------------------------------------------------- /MLNotification.Service/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Owin.Hosting; 2 | using System; 3 | 4 | namespace MLNotification.Service 5 | { 6 | class Program 7 | { 8 | static void Main(string[] args) 9 | { 10 | using (WebApp.Start("http://localhost:11111")) 11 | { 12 | Console.WriteLine("Hub on http://localhost:11111"); 13 | Console.ReadLine(); 14 | } 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /MLNotification.Service/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("MLNotification.Service")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("MLNotification.Service")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("8096a9ff-be2a-42c8-9390-70e94c365b25")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /MLNotification.Service/Startup.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Owin.Cors; 2 | using Owin; 3 | 4 | namespace MLNotification.Service 5 | { 6 | public class Startup 7 | { 8 | public static void Configuration(IAppBuilder app) 9 | { 10 | app.UseCors(CorsOptions.AllowAll); 11 | app.MapSignalR(); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /MLNotification.Service/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /MLNotification.ServiceConnection/BuilderMLMessageHub.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNet.SignalR.Client; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using MLNotification.Domain; 8 | 9 | namespace MLNotification.ServiceClientConnect 10 | { 11 | public class BuilderMLMessageHubConnect 12 | { 13 | public static MLMessageHubConect CreateMLMessageHub(string address, IUserInfo userInfo = null, bool isDefaultConnect = true) 14 | { 15 | HubConnection conexionHub = new HubConnection(address, isDefaultConnect); 16 | IHubProxy proxyHub = conexionHub.CreateHubProxy("MLMessageHub"); 17 | 18 | try 19 | { 20 | var result = new MLMessageHubConect(conexionHub, proxyHub, userInfo); 21 | return result; 22 | } 23 | catch (Exception ex) 24 | { 25 | throw ex; 26 | } 27 | 28 | return null; 29 | } 30 | 31 | 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /MLNotification.ServiceConnection/EventArgs/MLMessageEventArgs.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using MLNotification.Domain; 7 | 8 | namespace MLNotification.ServiceClientConnect.EventArgs 9 | { 10 | public class MLMessageEventArgs 11 | { 12 | public NotificationMessage NotificationMessage { get; private set; } 13 | 14 | public MLMessageEventArgs(NotificationMessage notificationMessage) 15 | { 16 | NotificationMessage = notificationMessage; 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /MLNotification.ServiceConnection/IMLMessageHubConect.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | using MLNotification.Domain; 4 | using MLNotification.ServiceClientConnect.EventArgs; 5 | 6 | namespace MLNotification.ServiceClientConnect 7 | { 8 | public interface IMLMessageHubConect 9 | { 10 | event EventHandler ProcessMessage; 11 | 12 | void Dispose(); 13 | Task SendMessage(NotificationMessage message); 14 | } 15 | } -------------------------------------------------------------------------------- /MLNotification.ServiceConnection/MLMessageHubConect.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNet.SignalR.Client; 2 | using MLNotification.Domain; 3 | using MLNotification.ServiceClientConnect.EventArgs; 4 | using System; 5 | using System.Threading.Tasks; 6 | 7 | namespace MLNotification.ServiceClientConnect 8 | { 9 | public class MLMessageHubConect : IDisposable, IMLMessageHubConect 10 | { 11 | public HubConnection conexionHub = null; 12 | private IHubProxy proxyHub = null; 13 | 14 | public IUserInfo userInfo; 15 | 16 | private const string NotificationMessageStr = "ProcessMessage"; 17 | private const string SendMessageStr = "SendMessage"; 18 | private const string RegisterUserStr = "RegisterUser"; 19 | 20 | private bool isConnect = false; 21 | 22 | public event EventHandler ProcessMessage; 23 | 24 | 25 | 26 | public MLMessageHubConect(HubConnection conexionHub, IHubProxy proxyHub, IUserInfo userInfo = null) 27 | { 28 | this.conexionHub = conexionHub; 29 | this.proxyHub = proxyHub; 30 | 31 | this.userInfo = userInfo; 32 | 33 | Connect(); 34 | 35 | RegisterUser(userInfo); 36 | } 37 | 38 | private void Connect() 39 | { 40 | try 41 | { 42 | 43 | proxyHub.On(NotificationMessageStr, (NotificationMessage message) => 44 | { 45 | if (message != null && conexionHub != null) 46 | { 47 | OnProcessMessage(message); 48 | } 49 | }); 50 | 51 | Task.WaitAll(conexionHub.Start()); 52 | 53 | RegisterUser(userInfo); 54 | } 55 | catch (Exception ex) 56 | { 57 | System.Diagnostics.Debug.WriteLine("Error " + ex.Message); 58 | 59 | throw new HubException($"Error to connect to Service. Check the service is online, and the ServiceAddress is correct. Error:{ex.Message}"); 60 | } 61 | } 62 | 63 | 64 | public Task SendMessage(NotificationMessage message) 65 | { 66 | //message.User = userInfo.User; 67 | 68 | return proxyHub.Invoke(SendMessageStr, message); 69 | } 70 | 71 | public void SendMessage2(NotificationMessage message) 72 | { 73 | proxyHub.Invoke(SendMessageStr, message).Wait(); 74 | } 75 | 76 | public Task RegisterUser(IUserInfo userInfo) 77 | { 78 | return proxyHub.Invoke(RegisterUserStr, userInfo); 79 | } 80 | 81 | protected internal virtual void OnProcessMessage(NotificationMessage message) => ProcessMessage?.Invoke(this, new MLMessageEventArgs(message)); 82 | 83 | 84 | public void Dispose() 85 | { 86 | isConnect = false; 87 | 88 | conexionHub.Dispose(); 89 | conexionHub = null; 90 | proxyHub = null; 91 | } 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /MLNotification.ServiceConnection/MLNotification.ServiceClientConnect.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {0CF7F418-4732-4BE9-9FA6-746CA351A6E7} 8 | Library 9 | Properties 10 | MLNotification.ServiceClientConnect 11 | MLNotification.ServiceClientConnect 12 | v4.5.2 13 | 512 14 | SAK 15 | SAK 16 | SAK 17 | SAK 18 | 19 | 20 | true 21 | full 22 | false 23 | bin\Debug\ 24 | DEBUG;TRACE 25 | prompt 26 | 4 27 | 28 | 29 | pdbonly 30 | true 31 | bin\Release\ 32 | TRACE 33 | prompt 34 | 4 35 | 36 | 37 | 38 | ..\packages\Microsoft.AspNet.SignalR.Client.2.2.2-preview1\lib\net45\Microsoft.AspNet.SignalR.Client.dll 39 | 40 | 41 | ..\packages\Newtonsoft.Json.6.0.4\lib\net45\Newtonsoft.Json.dll 42 | True 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | {5c076819-f8cd-41d1-9ad8-e09852b844e8} 66 | MLNotification.Domain 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /MLNotification.ServiceConnection/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("MLNotification.ServiceClientConnect")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("MLNotification.ServiceClientConnect")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("0cf7f418-4732-4be9-9fa6-746ca351a6e7")] 24 | 25 | [assembly: InternalsVisibleTo("MLNotification.WPFClient.Tests")] 26 | 27 | // Version information for an assembly consists of the following four values: 28 | // 29 | // Major Version 30 | // Minor Version 31 | // Build Number 32 | // Revision 33 | // 34 | // You can specify all the values or you can default the Build and Revision Numbers 35 | // by using the '*' as shown below: 36 | // [assembly: AssemblyVersion("1.0.*")] 37 | [assembly: AssemblyVersion("1.0.0.0")] 38 | [assembly: AssemblyFileVersion("1.0.0.0")] 39 | -------------------------------------------------------------------------------- /MLNotification.ServiceConnection/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /MLNotification.WPClient2/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /MLNotification.WPClient2/App.xaml: -------------------------------------------------------------------------------- 1 |  6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /MLNotification.WPClient2/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Configuration; 4 | using System.Data; 5 | using System.Linq; 6 | using System.Threading.Tasks; 7 | using System.Windows; 8 | 9 | namespace MLNotification.WPClient2 10 | { 11 | /// 12 | /// Interaction logic for App.xaml 13 | /// 14 | public partial class App : Application 15 | { 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /MLNotification.WPClient2/MainWindow.xaml: -------------------------------------------------------------------------------- 1 |  16 | 17 | 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 |