Skip to content

Commit e8e47d5

Browse files
committed
Updated code base
1 parent 45d3f7a commit e8e47d5

26 files changed

+640
-615
lines changed

AngleSharp.Samples.App/AngleSharp.Samples.App.csproj

Lines changed: 256 additions & 246 deletions
Large diffs are not rendered by default.

AngleSharp.Samples.App/App.config

Lines changed: 42 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,42 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<configuration>
3-
<configSections>
4-
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
5-
<section name="Samples.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
6-
</sectionGroup>
7-
</configSections>
8-
<startup>
9-
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
10-
</startup>
11-
<userSettings>
12-
<Samples.Properties.Settings>
13-
<setting name="SharedMode" serializeAs="String">
14-
<value>True</value>
15-
</setting>
16-
</Samples.Properties.Settings>
17-
</userSettings>
18-
<runtime>
19-
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
20-
<dependentAssembly>
21-
<assemblyIdentity name="OxyPlot" publicKeyToken="638079a8f0bd61e9" culture="neutral" />
22-
<bindingRedirect oldVersion="0.0.0.0-2014.1.546.0" newVersion="2014.1.546.0" />
23-
</dependentAssembly>
24-
<dependentAssembly>
25-
<assemblyIdentity name="Jint" publicKeyToken="2e92ba9c8d81157f" culture="neutral" />
26-
<bindingRedirect oldVersion="0.0.0.0-2.7.1.0" newVersion="2.7.1.0" />
27-
</dependentAssembly>
28-
<dependentAssembly>
29-
<assemblyIdentity name="AngleSharp" publicKeyToken="e83494dcdc6d31ea" culture="neutral" />
30-
<bindingRedirect oldVersion="0.0.0.0-0.9.9.0" newVersion="0.9.9.0" />
31-
</dependentAssembly>
32-
<dependentAssembly>
33-
<assemblyIdentity name="System.Windows.Interactivity" publicKeyToken="31bf3856ad364e35" culture="neutral" />
34-
<bindingRedirect oldVersion="0.0.0.0-4.5.0.0" newVersion="4.5.0.0" />
35-
</dependentAssembly>
36-
</assemblyBinding>
37-
</runtime>
38-
</configuration>
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<configSections>
4+
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
5+
<section name="Samples.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
6+
</sectionGroup>
7+
</configSections>
8+
<startup>
9+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
10+
</startup>
11+
<userSettings>
12+
<Samples.Properties.Settings>
13+
<setting name="SharedMode" serializeAs="String">
14+
<value>True</value>
15+
</setting>
16+
</Samples.Properties.Settings>
17+
</userSettings>
18+
<runtime>
19+
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
20+
<dependentAssembly>
21+
<assemblyIdentity name="OxyPlot" publicKeyToken="638079a8f0bd61e9" culture="neutral" />
22+
<bindingRedirect oldVersion="0.0.0.0-2014.1.546.0" newVersion="2014.1.546.0" />
23+
</dependentAssembly>
24+
<dependentAssembly>
25+
<assemblyIdentity name="Jint" publicKeyToken="2e92ba9c8d81157f" culture="neutral" />
26+
<bindingRedirect oldVersion="0.0.0.0-2.7.1.0" newVersion="2.7.1.0" />
27+
</dependentAssembly>
28+
<dependentAssembly>
29+
<assemblyIdentity name="AngleSharp" publicKeyToken="e83494dcdc6d31ea" culture="neutral" />
30+
<bindingRedirect oldVersion="0.0.0.0-0.9.9.0" newVersion="0.9.9.0" />
31+
</dependentAssembly>
32+
<dependentAssembly>
33+
<assemblyIdentity name="System.Windows.Interactivity" publicKeyToken="31bf3856ad364e35" culture="neutral" />
34+
<bindingRedirect oldVersion="0.0.0.0-4.5.0.0" newVersion="4.5.0.0" />
35+
</dependentAssembly>
36+
<dependentAssembly>
37+
<assemblyIdentity name="System.Text.Encoding.CodePages" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
38+
<bindingRedirect oldVersion="0.0.0.0-4.1.1.0" newVersion="4.1.1.0" />
39+
</dependentAssembly>
40+
</assemblyBinding>
41+
</runtime>
42+
</configuration>

AngleSharp.Samples.App/Properties/Resources.Designer.cs

Lines changed: 63 additions & 71 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

AngleSharp.Samples.App/Properties/Settings.Designer.cs

Lines changed: 49 additions & 49 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

AngleSharp.Samples.App/ViewModels/CssRuleViewModel.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace Samples.ViewModels
2-
{
3-
using AngleSharp.Dom.Css;
2+
{
3+
using AngleSharp.Css.Dom;
44
using System;
55
using System.Collections.ObjectModel;
66

AngleSharp.Samples.App/ViewModels/ErrorsViewModel.cs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
namespace Samples.ViewModels
22
{
3-
using AngleSharp;
4-
using AngleSharp.Dom.Events;
3+
using AngleSharp;
4+
using AngleSharp.Css.Dom.Events;
5+
using AngleSharp.Dom;
6+
using AngleSharp.Dom.Events;
7+
using AngleSharp.Html.Dom.Events;
58
using System;
69
using System.Collections.Generic;
710
using System.Collections.ObjectModel;
@@ -34,15 +37,13 @@ public IEnumerable<HtmlErrorEvent> Html
3437
private void Register<T>(Action<T> listener)
3538
where T : Event
3639
{
37-
_context.ParseError += (obj, ev) =>
40+
_context.AddEventListener(EventNames.Error, (obj, ev) =>
3841
{
39-
var data = ev as T;
40-
41-
if (data != null)
42+
if (ev is T data)
4243
{
4344
listener.Invoke(data);
4445
}
45-
};
46+
});
4647
}
4748

4849
public void Reset()

AngleSharp.Samples.App/ViewModels/MainViewModel.cs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
namespace Samples.ViewModels
22
{
3-
using AngleSharp;
3+
using AngleSharp;
4+
using AngleSharp.Io;
45
using System;
56
using System.Threading;
67
using System.Threading.Tasks;
@@ -38,11 +39,15 @@ sealed class MainViewModel : BaseViewModel
3839

3940
public MainViewModel()
4041
{
41-
var config = Configuration.Default.WithCss().WithRequesters(setup =>
42-
{
43-
setup.IsNavigationEnabled = true;
44-
setup.IsResourceLoadingEnabled = true;
45-
}).WithJavaScript();
42+
var config = Configuration.Default
43+
.WithCss()
44+
.WithCookies()
45+
.WithJs()
46+
.WithDefaultLoader(new LoaderOptions
47+
{
48+
IsNavigationDisabled = true,
49+
IsResourceLoadingEnabled = true,
50+
});
4651
_context = BrowsingContext.New(config);
4752
_profiler = new ProfilerViewModel(_context);
4853
_errors = new ErrorsViewModel(_context);

0 commit comments

Comments
 (0)