This commit is contained in:
Florian Rappl 2015-06-16 23:10:11 +02:00
Родитель 166caf6554
Коммит 25029ce447
6 изменённых файлов: 22 добавлений и 47 удалений

Просмотреть файл

@ -41,13 +41,13 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="Accessibility" />
<Reference Include="AngleSharp, Version=0.8.4.40085, Culture=neutral, processorArchitecture=MSIL">
<Reference Include="AngleSharp, Version=0.8.5.38717, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\AngleSharp.0.8.4.1\lib\net45\AngleSharp.dll</HintPath>
<HintPath>..\packages\AngleSharp.0.8.5\lib\net45\AngleSharp.dll</HintPath>
</Reference>
<Reference Include="AngleSharp.Scripting.JavaScript, Version=0.1.5.17539, Culture=neutral, processorArchitecture=MSIL">
<Reference Include="AngleSharp.Scripting.JavaScript, Version=0.1.6.39665, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\AngleSharp.Scripting.JavaScript.0.1.5\lib\net45\AngleSharp.Scripting.JavaScript.dll</HintPath>
<HintPath>..\packages\AngleSharp.Scripting.JavaScript.0.1.6\lib\net45\AngleSharp.Scripting.JavaScript.dll</HintPath>
</Reference>
<Reference Include="Jint, Version=2.5.0.0, Culture=neutral, PublicKeyToken=2e92ba9c8d81157f, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>

Просмотреть файл

@ -10,31 +10,25 @@
readonly String typeName;
readonly String name;
private CssRuleViewModel(String typeName)
private CssRuleViewModel(Type type)
{
this.children = new ObservableCollection<CssRuleViewModel>();
this.typeName = typeName;
this.typeName = type.Name;
}
private CssRuleViewModel(Object o)
: this(o.GetType().Name)
: this(o.GetType())
{
}
private CssRuleViewModel(String name, String value)
: this(name, new PseudoValue(value))
{
}
private CssRuleViewModel(String name, ICssValue value)
: this("CSSProperty")
{
this.name = name;
this.children.Add(new CssRuleViewModel(value));
}
public CssRuleViewModel(ICssRule rule)
: this((Object)rule)
: this(rule.GetType())
{
switch (rule.Type)
{
@ -91,12 +85,14 @@
{
}
public CssRuleViewModel(ICssValue value)
: this("CSSValue")
public CssRuleViewModel(String value)
: this(typeof(CSSValue))
{
name = value.CssText;
name = value;
}
struct CSSValue { }
void Populate(ICssFontFaceRule font)
{
AddIfNotEmpty("Family", font.Family);
@ -141,24 +137,5 @@
{
get { return children; }
}
class PseudoValue : ICssValue
{
public PseudoValue(String value)
{
CssText = value;
}
public CssValueType Type
{
get { return CssValueType.Custom; }
}
public String CssText
{
get;
private set;
}
}
}
}

Просмотреть файл

@ -1,8 +1,8 @@
namespace Samples.ViewModels
{
using AngleSharp.Dom;
using AngleSharp.Scripting;
using AngleSharp.Scripting.JavaScript;
using AngleSharp.Services.Scripting;
using System;
using System.Collections.ObjectModel;
using System.Windows.Input;

Просмотреть файл

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="AngleSharp" version="0.8.4.1" targetFramework="net45" />
<package id="AngleSharp.Scripting.JavaScript" version="0.1.5" targetFramework="net45" />
<package id="AngleSharp" version="0.8.5" targetFramework="net45" />
<package id="AngleSharp.Scripting.JavaScript" version="0.1.6" targetFramework="net45" />
<package id="Jint" version="2.5.0" targetFramework="net45" />
<package id="MahApps.Metro" version="1.1.2.0" targetFramework="net45" />
<package id="OxyPlot.Core" version="2014.1.546" targetFramework="net45" />

Просмотреть файл

@ -33,13 +33,11 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="AngleSharp, Version=0.8.4.40085, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\AngleSharp.0.8.4.1\lib\net45\AngleSharp.dll</HintPath>
<Reference Include="AngleSharp">
<HintPath>..\packages\AngleSharp.0.8.5\lib\net45\AngleSharp.dll</HintPath>
</Reference>
<Reference Include="AngleSharp.Scripting.JavaScript, Version=0.1.5.17539, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\AngleSharp.Scripting.JavaScript.0.1.5\lib\net45\AngleSharp.Scripting.JavaScript.dll</HintPath>
<Reference Include="AngleSharp.Scripting.JavaScript">
<HintPath>..\packages\AngleSharp.Scripting.JavaScript.0.1.6\lib\net45\AngleSharp.Scripting.JavaScript.dll</HintPath>
</Reference>
<Reference Include="Jint, Version=2.5.0.0, Culture=neutral, PublicKeyToken=2e92ba9c8d81157f, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>

Просмотреть файл

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="AngleSharp" version="0.8.4.1" targetFramework="net45" />
<package id="AngleSharp.Scripting.JavaScript" version="0.1.5" targetFramework="net45" />
<package id="AngleSharp" version="0.8.5" targetFramework="net45" />
<package id="AngleSharp.Scripting.JavaScript" version="0.1.6" targetFramework="net45" />
<package id="Jint" version="2.5.0" targetFramework="net45" />
</packages>