From b7d695703d135081004a8ef9091ec72130036078 Mon Sep 17 00:00:00 2001 From: Florian Rappl Date: Mon, 14 Nov 2016 23:23:58 +0100 Subject: [PATCH] Inital commit of the demo --- .gitignore | 183 ++++++++++++++++++ AngleSharp.Demos.Indotnet.sln | 22 +++ .../AngleSharp.Demos.Indotnet.csproj | 120 ++++++++++++ AngleSharp.Demos.Indotnet/App.config | 6 + AngleSharp.Demos.Indotnet/App.xaml | 8 + AngleSharp.Demos.Indotnet/App.xaml.cs | 17 ++ AngleSharp.Demos.Indotnet/MainViewModel.cs | 58 ++++++ AngleSharp.Demos.Indotnet/MainWindow.xaml | 43 ++++ AngleSharp.Demos.Indotnet/MainWindow.xaml.cs | 15 ++ .../Properties/AssemblyInfo.cs | 21 ++ .../Properties/Resources.Designer.cs | 71 +++++++ .../Properties/Resources.resx | 117 +++++++++++ .../Properties/Settings.Designer.cs | 30 +++ .../Properties/Settings.settings | 7 + AngleSharp.Demos.Indotnet/RelayCommand.cs | 27 +++ AngleSharp.Demos.Indotnet/packages.config | 6 + LICENSE | 22 +++ README.md | 45 +++++ 18 files changed, 818 insertions(+) create mode 100644 .gitignore create mode 100644 AngleSharp.Demos.Indotnet.sln create mode 100644 AngleSharp.Demos.Indotnet/AngleSharp.Demos.Indotnet.csproj create mode 100644 AngleSharp.Demos.Indotnet/App.config create mode 100644 AngleSharp.Demos.Indotnet/App.xaml create mode 100644 AngleSharp.Demos.Indotnet/App.xaml.cs create mode 100644 AngleSharp.Demos.Indotnet/MainViewModel.cs create mode 100644 AngleSharp.Demos.Indotnet/MainWindow.xaml create mode 100644 AngleSharp.Demos.Indotnet/MainWindow.xaml.cs create mode 100644 AngleSharp.Demos.Indotnet/Properties/AssemblyInfo.cs create mode 100644 AngleSharp.Demos.Indotnet/Properties/Resources.Designer.cs create mode 100644 AngleSharp.Demos.Indotnet/Properties/Resources.resx create mode 100644 AngleSharp.Demos.Indotnet/Properties/Settings.Designer.cs create mode 100644 AngleSharp.Demos.Indotnet/Properties/Settings.settings create mode 100644 AngleSharp.Demos.Indotnet/RelayCommand.cs create mode 100644 AngleSharp.Demos.Indotnet/packages.config create mode 100644 LICENSE create mode 100644 README.md diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fd5204b --- /dev/null +++ b/.gitignore @@ -0,0 +1,183 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.sln.docstates + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +build/ +bld/ +[Bb]in/ +[Oo]bj/ + +# Roslyn cache directories +*.ide/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +#NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opensdf +*.sdf +*.cachefile + +# Visual Studio profiler +*.psess +*.vsp +*.vspx + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding addin-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +_NCrunch_* +.*crunch*.local.xml + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# TODO: Comment the next line if you want to checkin your web deploy settings +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# If using the old MSBuild-Integrated Package Restore, uncomment this: +#!**/packages/repositories.config + +# Windows Azure Build Output +csx/ +*.build.csdef + +# Windows Store app package directory +AppPackages/ + +# Others +sql/ +*.Cache +ClientBin/ +[Ss]tyle[Cc]op.* +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.pfx +*.publishsettings +node_modules/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ diff --git a/AngleSharp.Demos.Indotnet.sln b/AngleSharp.Demos.Indotnet.sln new file mode 100644 index 0000000..c72ddb6 --- /dev/null +++ b/AngleSharp.Demos.Indotnet.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.40629.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AngleSharp.Demos.Indotnet", "AngleSharp.Demos.Indotnet\AngleSharp.Demos.Indotnet.csproj", "{3301D7B2-3314-45A9-A1F3-9795F78E8C07}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {3301D7B2-3314-45A9-A1F3-9795F78E8C07}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3301D7B2-3314-45A9-A1F3-9795F78E8C07}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3301D7B2-3314-45A9-A1F3-9795F78E8C07}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3301D7B2-3314-45A9-A1F3-9795F78E8C07}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/AngleSharp.Demos.Indotnet/AngleSharp.Demos.Indotnet.csproj b/AngleSharp.Demos.Indotnet/AngleSharp.Demos.Indotnet.csproj new file mode 100644 index 0000000..ad2fa0d --- /dev/null +++ b/AngleSharp.Demos.Indotnet/AngleSharp.Demos.Indotnet.csproj @@ -0,0 +1,120 @@ + + + + + Debug + AnyCPU + {3301D7B2-3314-45A9-A1F3-9795F78E8C07} + WinExe + Properties + AngleSharp.Demos.Indotnet + AngleSharp.Demos.Indotnet + v4.6 + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\AngleSharp.0.9.2\lib\net45\AngleSharp.dll + True + + + ..\packages\AngleSharp.Scripting.JavaScript.0.3.1\lib\net45\AngleSharp.Scripting.JavaScript.dll + True + + + ..\packages\Jint.2.6.0\lib\portable-net40+sl50+win+WindowsPhoneApp81+wp80\Jint.dll + True + + + + + + + + + + 4.0 + + + + + + + + MSBuild:Compile + Designer + + + + MSBuild:Compile + Designer + + + App.xaml + Code + + + + MainWindow.xaml + Code + + + + + Code + + + True + True + Resources.resx + + + True + Settings.settings + True + + + ResXFileCodeGenerator + Resources.Designer.cs + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + + + + + \ No newline at end of file diff --git a/AngleSharp.Demos.Indotnet/App.config b/AngleSharp.Demos.Indotnet/App.config new file mode 100644 index 0000000..8324aa6 --- /dev/null +++ b/AngleSharp.Demos.Indotnet/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/AngleSharp.Demos.Indotnet/App.xaml b/AngleSharp.Demos.Indotnet/App.xaml new file mode 100644 index 0000000..d50a1a5 --- /dev/null +++ b/AngleSharp.Demos.Indotnet/App.xaml @@ -0,0 +1,8 @@ + + + + + diff --git a/AngleSharp.Demos.Indotnet/App.xaml.cs b/AngleSharp.Demos.Indotnet/App.xaml.cs new file mode 100644 index 0000000..135cbb2 --- /dev/null +++ b/AngleSharp.Demos.Indotnet/App.xaml.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Data; +using System.Linq; +using System.Threading.Tasks; +using System.Windows; + +namespace AngleSharp.Demos.Indotnet +{ + /// + /// Interaction logic for App.xaml + /// + public partial class App : Application + { + } +} diff --git a/AngleSharp.Demos.Indotnet/MainViewModel.cs b/AngleSharp.Demos.Indotnet/MainViewModel.cs new file mode 100644 index 0000000..135b5c9 --- /dev/null +++ b/AngleSharp.Demos.Indotnet/MainViewModel.cs @@ -0,0 +1,58 @@ +namespace AngleSharp.Demos.Indotnet +{ + using System; + using System.ComponentModel; + using System.Runtime.CompilerServices; + using System.Threading.Tasks; + + sealed class MainViewModel : INotifyPropertyChanged + { + private readonly IBrowsingContext _context; + private String _source; + private String _title; + private String _result; + private Task _current; + + public event PropertyChangedEventHandler PropertyChanged; + + public MainViewModel() + { + _context = BrowsingContext.New(Configuration.Default.WithJavaScript()); + _source = String.Empty; + _title = String.Empty; + _result = String.Empty; + _current = Task.FromResult(true); + } + + public String Title + { + get { return _title; } + set { _title = value; RaisePropertyChanged(); } + } + + public String Source + { + get { return _source; } + set { _source = value; RaisePropertyChanged(); _current.ContinueWith(_ => ParseAsync(value)); } + } + + public String Result + { + get { return _result; } + private set { _result = value; RaisePropertyChanged(); } + } + + private async Task ParseAsync(String source) + { + var document = await _context.OpenAsync(res => res.Content(source)); + + Result = document.ToHtml(); + Title = document.Title; + } + + private void RaisePropertyChanged([CallerMemberName] String propertyName = null) + { + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } + } +} diff --git a/AngleSharp.Demos.Indotnet/MainWindow.xaml b/AngleSharp.Demos.Indotnet/MainWindow.xaml new file mode 100644 index 0000000..f7e87f3 --- /dev/null +++ b/AngleSharp.Demos.Indotnet/MainWindow.xaml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + diff --git a/AngleSharp.Demos.Indotnet/MainWindow.xaml.cs b/AngleSharp.Demos.Indotnet/MainWindow.xaml.cs new file mode 100644 index 0000000..e0762ae --- /dev/null +++ b/AngleSharp.Demos.Indotnet/MainWindow.xaml.cs @@ -0,0 +1,15 @@ +namespace AngleSharp.Demos.Indotnet +{ + using System.Windows; + + /// + /// Interaction logic for MainWindow.xaml + /// + public partial class MainWindow : Window + { + public MainWindow() + { + InitializeComponent(); + } + } +} diff --git a/AngleSharp.Demos.Indotnet/Properties/AssemblyInfo.cs b/AngleSharp.Demos.Indotnet/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..38b1c59 --- /dev/null +++ b/AngleSharp.Demos.Indotnet/Properties/AssemblyInfo.cs @@ -0,0 +1,21 @@ +using System.Reflection; +using System.Resources; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Windows; + +[assembly: AssemblyTitle("AngleSharp.Demos.Indotnet")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("AngleSharp.Demos.Indotnet")] +[assembly: AssemblyCopyright("Copyright © AngleSharp 2016")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] +[assembly: ComVisible(false)] +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, + ResourceDictionaryLocation.SourceAssembly +)] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/AngleSharp.Demos.Indotnet/Properties/Resources.Designer.cs b/AngleSharp.Demos.Indotnet/Properties/Resources.Designer.cs new file mode 100644 index 0000000..f1fc3b5 --- /dev/null +++ b/AngleSharp.Demos.Indotnet/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace AngleSharp.Demos.Indotnet.Properties +{ + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("AngleSharp.Demos.MunichDotnet.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/AngleSharp.Demos.Indotnet/Properties/Resources.resx b/AngleSharp.Demos.Indotnet/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/AngleSharp.Demos.Indotnet/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/AngleSharp.Demos.Indotnet/Properties/Settings.Designer.cs b/AngleSharp.Demos.Indotnet/Properties/Settings.Designer.cs new file mode 100644 index 0000000..f72f44f --- /dev/null +++ b/AngleSharp.Demos.Indotnet/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace AngleSharp.Demos.Indotnet.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/AngleSharp.Demos.Indotnet/Properties/Settings.settings b/AngleSharp.Demos.Indotnet/Properties/Settings.settings new file mode 100644 index 0000000..033d7a5 --- /dev/null +++ b/AngleSharp.Demos.Indotnet/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/AngleSharp.Demos.Indotnet/RelayCommand.cs b/AngleSharp.Demos.Indotnet/RelayCommand.cs new file mode 100644 index 0000000..70b75a0 --- /dev/null +++ b/AngleSharp.Demos.Indotnet/RelayCommand.cs @@ -0,0 +1,27 @@ +namespace AngleSharp.Demos.Indotnet +{ + using System; + using System.Windows.Input; + + sealed class RelayCommand : ICommand + { + public event EventHandler CanExecuteChanged; + + readonly Action _run; + + public RelayCommand(Action run) + { + _run = run; + } + + public Boolean CanExecute(Object parameter) + { + return true; + } + + public void Execute(Object parameter) + { + _run(); + } + } +} diff --git a/AngleSharp.Demos.Indotnet/packages.config b/AngleSharp.Demos.Indotnet/packages.config new file mode 100644 index 0000000..0a176b0 --- /dev/null +++ b/AngleSharp.Demos.Indotnet/packages.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..8c72c2f --- /dev/null +++ b/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 AngleSharp + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/README.md b/README.md new file mode 100644 index 0000000..bf1078e --- /dev/null +++ b/README.md @@ -0,0 +1,45 @@ +# AngleSharp.Demos.Indotnet + +Simple and sweet demonstration playground for AngleSharp as shown in the Indotnet usergroup on November 2016. + +If you have anything to add to the demo, then feel free to do so. Push requests are always highly appreciated. + +## Running the Sample + +The demo is a Visual Studio 2015 solution that uses C# 6 together with the AngleSharp library. For demonstration purposes also the AngleSharp.Scripting.JavaScript library has been loaded. + +The application is a WPF UI that uses the MVVM pattern. The main viewmodel is the `MainViewModel`. Here the connection to the transformation is designed. The `ParseAsync` method is called when the source code (via the `Source` property) changes. + +Generally, the code is quite similar to the demo for the Munich.NET usergroup, however, this one does not include any CSS parts and focuses on a live preview. + +## Playing around with the Sample + +The thing that can be done is typing in elemental parts of any HTML document such as ``. Seeing it being interpreted in real time (e.g., first as a text, then a comment, finally the doctype) is wonderful - educational and working-wise. Also complex examples can be shown in no time; how HTML5 treats nested tables or complicated formatting. + +The scoping rules (applied to paragraphs `

` or list items `

  • ` for example) can also be demonstrated easily. Plus we get some immediate grasp on topics such as raw text (`title` element) or the `` tag (there is no way out!). + +Another thing is that a JavaScript engine has been integrated. Thus parsing the following chunk of HTML code actually does something: + +```html +<script>console.log('Hi Mum!')</script> +``` + +The debug output view of Visual Studio should display "Hi Mum!". This can be abused as such: + +```html +<script>document.write('<span>again</span>')</script> +``` + +Inserting this and pressing "Transform!" multiple types will repeat the *again* in the `span` element. This is a nice way to "grow" a document. Granted, a rather boring document. + +## License + +The MIT License (MIT) + +Copyright (c) 2016 AngleSharp + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.