commit
cd2b7530f5
153 changed files with 346438 additions and 0 deletions
@ -0,0 +1,22 @@ |
|||
# Auto detect text files and perform LF normalization |
|||
* text=auto |
|||
|
|||
# Custom for Visual Studio |
|||
*.cs diff=csharp |
|||
*.sln merge=union |
|||
*.csproj merge=union |
|||
*.vbproj merge=union |
|||
*.fsproj merge=union |
|||
*.dbproj merge=union |
|||
|
|||
# Standard to msysgit |
|||
*.doc diff=astextplain |
|||
*.DOC diff=astextplain |
|||
*.docx diff=astextplain |
|||
*.DOCX diff=astextplain |
|||
*.dot diff=astextplain |
|||
*.DOT diff=astextplain |
|||
*.pdf diff=astextplain |
|||
*.PDF diff=astextplain |
|||
*.rtf diff=astextplain |
|||
*.RTF diff=astextplain |
|||
@ -0,0 +1,152 @@ |
|||
################# |
|||
## Visual Studio |
|||
################# |
|||
|
|||
## 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/ |
|||
[Rr]elease/ |
|||
x64/ |
|||
build/ |
|||
[Bb]in/ |
|||
[Oo]bj/ |
|||
|
|||
# MSTest test Results |
|||
[Tt]est[Rr]esult*/ |
|||
[Bb]uild[Ll]og.* |
|||
|
|||
*_i.c |
|||
*_p.c |
|||
*.ilk |
|||
*.meta |
|||
*.obj |
|||
*.pch |
|||
*.pdb |
|||
*.pgc |
|||
*.pgd |
|||
*.rsp |
|||
*.sbr |
|||
*.tlb |
|||
*.tli |
|||
*.tlh |
|||
*.tmp |
|||
*.tmp_proj |
|||
*.log |
|||
*.vspscc |
|||
*.vssscc |
|||
.builds |
|||
*.pidb |
|||
*.log |
|||
*.scc |
|||
|
|||
# Visual C++ cache files |
|||
ipch/ |
|||
*.aps |
|||
*.ncb |
|||
*.opensdf |
|||
*.sdf |
|||
*.cachefile |
|||
|
|||
# Visual Studio profiler |
|||
*.psess |
|||
*.vsp |
|||
*.vspx |
|||
|
|||
# Guidance Automation Toolkit |
|||
*.gpState |
|||
|
|||
# ReSharper is a .NET coding add-in |
|||
_ReSharper*/ |
|||
*.[Rr]e[Ss]harper |
|||
|
|||
# TeamCity is a build add-in |
|||
_TeamCity* |
|||
|
|||
# DotCover is a Code Coverage Tool |
|||
*.dotCover |
|||
|
|||
# NCrunch |
|||
*.ncrunch* |
|||
.*crunch*.local.xml |
|||
|
|||
# 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 |
|||
*.Publish.xml |
|||
*.pubxml |
|||
|
|||
# NuGet Packages Directory |
|||
## TODO: If you have NuGet Package Restore enabled, uncomment the next line |
|||
#packages/ |
|||
|
|||
# Windows Azure Build Output |
|||
csx |
|||
*.build.csdef |
|||
|
|||
# Windows Store app package directory |
|||
AppPackages/ |
|||
|
|||
# Others |
|||
sql/ |
|||
*.Cache |
|||
ClientBin/ |
|||
[Ss]tyle[Cc]op.* |
|||
~$* |
|||
*~ |
|||
*.dbmdl |
|||
*.[Pp]ublish.xml |
|||
*.pfx |
|||
*.publishsettings |
|||
|
|||
# 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 |
|||
App_Data/*.mdf |
|||
App_Data/*.ldf |
|||
|
|||
############# |
|||
## Windows detritus |
|||
############# |
|||
|
|||
# Windows image file caches |
|||
Thumbs.db |
|||
ehthumbs.db |
|||
|
|||
# Folder config file |
|||
Desktop.ini |
|||
|
|||
# Recycle Bin used on file shares |
|||
$RECYCLE.BIN/ |
|||
|
|||
# Mac crap |
|||
.DS_Store |
|||
@ -0,0 +1,105 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
|||
<PropertyGroup> |
|||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
|||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> |
|||
<ProjectGuid>{2905FF23-53FB-45E6-AA49-6AF47A172056}</ProjectGuid> |
|||
<OutputType>Library</OutputType> |
|||
<AppDesignerFolder>Properties</AppDesignerFolder> |
|||
<RootNamespace>Perspex.UnitTests</RootNamespace> |
|||
<AssemblyName>Perspex.UnitTests</AssemblyName> |
|||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion> |
|||
<FileAlignment>512</FileAlignment> |
|||
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> |
|||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion> |
|||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath> |
|||
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath> |
|||
<IsCodedUITest>False</IsCodedUITest> |
|||
<TestProjectType>UnitTest</TestProjectType> |
|||
</PropertyGroup> |
|||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> |
|||
<DebugSymbols>true</DebugSymbols> |
|||
<DebugType>full</DebugType> |
|||
<Optimize>false</Optimize> |
|||
<OutputPath>bin\Debug\</OutputPath> |
|||
<DefineConstants>DEBUG;TRACE</DefineConstants> |
|||
<ErrorReport>prompt</ErrorReport> |
|||
<WarningLevel>4</WarningLevel> |
|||
</PropertyGroup> |
|||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> |
|||
<DebugType>pdbonly</DebugType> |
|||
<Optimize>true</Optimize> |
|||
<OutputPath>bin\Release\</OutputPath> |
|||
<DefineConstants>TRACE</DefineConstants> |
|||
<ErrorReport>prompt</ErrorReport> |
|||
<WarningLevel>4</WarningLevel> |
|||
</PropertyGroup> |
|||
<ItemGroup> |
|||
<Reference Include="System" /> |
|||
<Reference Include="System.Reactive.Core, Version=2.1.30214.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> |
|||
<SpecificVersion>False</SpecificVersion> |
|||
<HintPath>..\packages\Rx-Core.2.1.30214.0\lib\Net45\System.Reactive.Core.dll</HintPath> |
|||
</Reference> |
|||
<Reference Include="System.Reactive.Interfaces, Version=2.1.30214.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> |
|||
<SpecificVersion>False</SpecificVersion> |
|||
<HintPath>..\packages\Rx-Interfaces.2.1.30214.0\lib\Net45\System.Reactive.Interfaces.dll</HintPath> |
|||
</Reference> |
|||
<Reference Include="System.Reactive.Linq, Version=2.1.30214.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> |
|||
<SpecificVersion>False</SpecificVersion> |
|||
<HintPath>..\packages\Rx-Linq.2.1.30214.0\lib\Net45\System.Reactive.Linq.dll</HintPath> |
|||
</Reference> |
|||
</ItemGroup> |
|||
<Choose> |
|||
<When Condition="('$(VisualStudioVersion)' == '10.0' or '$(VisualStudioVersion)' == '') and '$(TargetFrameworkVersion)' == 'v3.5'"> |
|||
<ItemGroup> |
|||
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" /> |
|||
</ItemGroup> |
|||
</When> |
|||
<Otherwise> |
|||
<ItemGroup> |
|||
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework" /> |
|||
</ItemGroup> |
|||
</Otherwise> |
|||
</Choose> |
|||
<ItemGroup> |
|||
<Compile Include="PerspexPropertyTests.cs" /> |
|||
<Compile Include="Properties\AssemblyInfo.cs" /> |
|||
<Compile Include="PerspexObjectTests.cs" /> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<ProjectReference Include="..\Perspex\Perspex.csproj"> |
|||
<Project>{3c9f40da-d2a5-43a1-a272-e965876c6d46}</Project> |
|||
<Name>Perspex</Name> |
|||
</ProjectReference> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<None Include="packages.config" /> |
|||
</ItemGroup> |
|||
<Choose> |
|||
<When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'"> |
|||
<ItemGroup> |
|||
<Reference Include="Microsoft.VisualStudio.QualityTools.CodedUITestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> |
|||
<Private>False</Private> |
|||
</Reference> |
|||
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> |
|||
<Private>False</Private> |
|||
</Reference> |
|||
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Extension, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> |
|||
<Private>False</Private> |
|||
</Reference> |
|||
<Reference Include="Microsoft.VisualStudio.TestTools.UITesting, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> |
|||
<Private>False</Private> |
|||
</Reference> |
|||
</ItemGroup> |
|||
</When> |
|||
</Choose> |
|||
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" /> |
|||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> |
|||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. |
|||
Other similar extension points exist, see Microsoft.Common.targets. |
|||
<Target Name="BeforeBuild"> |
|||
</Target> |
|||
<Target Name="AfterBuild"> |
|||
</Target> |
|||
--> |
|||
</Project> |
|||
@ -0,0 +1,313 @@ |
|||
// -----------------------------------------------------------------------
|
|||
// <copyright file="PerspexObjectTests.cs" company="Steven Kirk">
|
|||
// Copyright 2013 MIT Licence. See licence.md for more information.
|
|||
// </copyright>
|
|||
// -----------------------------------------------------------------------
|
|||
|
|||
namespace Perspex.UnitTests |
|||
{ |
|||
using System; |
|||
using System.Linq; |
|||
using System.Reactive.Linq; |
|||
using Microsoft.VisualStudio.TestTools.UnitTesting; |
|||
|
|||
[TestClass] |
|||
public class PerspexObjectTests |
|||
{ |
|||
[TestInitialize] |
|||
public void Initialize() |
|||
{ |
|||
// Ensure properties are registered.
|
|||
PerspexProperty p; |
|||
p = Class1.FooProperty; |
|||
p = Class2.BarProperty; |
|||
} |
|||
|
|||
[TestMethod] |
|||
public void GetProperties_Returns_Registered_Properties() |
|||
{ |
|||
string[] names = PerspexObject.GetProperties(typeof(Class1)).Select(x => x.Name).ToArray(); |
|||
|
|||
CollectionAssert.AreEqual(new[] { "Foo", "Baz" }, names); |
|||
} |
|||
|
|||
[TestMethod] |
|||
public void GetProperties_Returns_Registered_Properties_For_Base_Types() |
|||
{ |
|||
string[] names = PerspexObject.GetProperties(typeof(Class2)).Select(x => x.Name).ToArray(); |
|||
|
|||
CollectionAssert.AreEqual(new[] { "Bar", "Foo", "Baz" }, names); |
|||
} |
|||
|
|||
[TestMethod] |
|||
public void GetValue_Returns_Default_Value() |
|||
{ |
|||
Class1 target = new Class1(); |
|||
|
|||
Assert.AreEqual("foodefault", target.GetValue(Class1.FooProperty)); |
|||
} |
|||
|
|||
[TestMethod] |
|||
public void GetValue_Returns_Overridden_Default_Value() |
|||
{ |
|||
Class2 target = new Class2(); |
|||
|
|||
Assert.AreEqual("foooverride", target.GetValue(Class1.FooProperty)); |
|||
} |
|||
|
|||
[TestMethod] |
|||
public void GetValue_Returns_Set_Value() |
|||
{ |
|||
Class1 target = new Class1(); |
|||
|
|||
target.SetValue(Class1.FooProperty, "newvalue"); |
|||
|
|||
Assert.AreEqual("newvalue", target.GetValue(Class1.FooProperty)); |
|||
} |
|||
|
|||
[TestMethod] |
|||
public void GetValue_Returns_Inherited_Value() |
|||
{ |
|||
Class1 parent = new Class1(); |
|||
Class2 child = new Class2 { Parent = parent }; |
|||
|
|||
parent.SetValue(Class1.BazProperty, "changed"); |
|||
|
|||
Assert.AreEqual("changed", child.GetValue(Class1.BazProperty)); |
|||
} |
|||
|
|||
[TestMethod] |
|||
public void ClearValue_Clears_Value() |
|||
{ |
|||
Class1 target = new Class1(); |
|||
|
|||
target.SetValue(Class1.FooProperty, "newvalue"); |
|||
target.ClearValue(Class1.FooProperty); |
|||
|
|||
Assert.AreEqual("foodefault", target.GetValue(Class1.FooProperty)); |
|||
} |
|||
|
|||
[TestMethod] |
|||
public void SetValue_Raises_PropertyChanged() |
|||
{ |
|||
Class1 target = new Class1(); |
|||
bool raised = false; |
|||
|
|||
target.PropertyChanged += (s, e) => |
|||
{ |
|||
raised = s == target && |
|||
e.Property == Class1.FooProperty && |
|||
(string)e.OldValue == "foodefault" && |
|||
(string)e.NewValue == "newvalue"; |
|||
}; |
|||
|
|||
target.SetValue(Class1.FooProperty, "newvalue"); |
|||
|
|||
Assert.IsTrue(raised); |
|||
} |
|||
|
|||
[TestMethod] |
|||
public void SetValue_Doesnt_Raise_PropertyChanged_If_Value_Not_Changed() |
|||
{ |
|||
Class1 target = new Class1(); |
|||
bool raised = false; |
|||
|
|||
target.PropertyChanged += (s, e) => |
|||
{ |
|||
raised = true; |
|||
}; |
|||
|
|||
target.SetValue(Class1.FooProperty, "foodefault"); |
|||
|
|||
Assert.IsFalse(raised); |
|||
} |
|||
|
|||
[TestMethod] |
|||
public void GetObservable_Returns_Initial_Value() |
|||
{ |
|||
Class1 target = new Class1(); |
|||
bool raised = false; |
|||
|
|||
target.GetObservable(Class1.FooProperty).Subscribe(x => raised = x == "foodefault"); |
|||
|
|||
Assert.IsTrue(raised); |
|||
} |
|||
|
|||
[TestMethod] |
|||
public void GetObservable_Returns_Property_Change() |
|||
{ |
|||
Class1 target = new Class1(); |
|||
bool raised = false; |
|||
|
|||
target.GetObservable(Class1.FooProperty).Subscribe(x => raised = x == "newvalue"); |
|||
raised = false; |
|||
target.SetValue(Class1.FooProperty, "newvalue"); |
|||
|
|||
Assert.IsTrue(raised); |
|||
} |
|||
|
|||
[TestMethod] |
|||
public void GetObservable_Returns_Property_Change_Only_For_Correct_Property() |
|||
{ |
|||
Class2 target = new Class2(); |
|||
bool raised = false; |
|||
|
|||
target.GetObservable(Class1.FooProperty).Subscribe(x => raised = true); |
|||
raised = false; |
|||
target.SetValue(Class2.BarProperty, "newvalue"); |
|||
|
|||
Assert.IsFalse(raised); |
|||
} |
|||
|
|||
[TestMethod] |
|||
public void GetObservable_Dispose_Stops_Property_Changes() |
|||
{ |
|||
Class1 target = new Class1(); |
|||
bool raised = false; |
|||
|
|||
target.GetObservable(Class1.FooProperty) |
|||
.Subscribe(x => raised = true) |
|||
.Dispose(); |
|||
raised = false; |
|||
target.SetValue(Class1.FooProperty, "newvalue"); |
|||
|
|||
Assert.IsFalse(raised); |
|||
} |
|||
|
|||
[TestMethod] |
|||
public void Setting_InheritanceParent_Raises_PropertyChanged_When_Value_Changed_In_Parent() |
|||
{ |
|||
bool raised = false; |
|||
|
|||
Class1 parent = new Class1(); |
|||
parent.SetValue(Class1.BazProperty, "changed"); |
|||
|
|||
Class2 child = new Class2(); |
|||
child.PropertyChanged += (s, e) => |
|||
raised = s == child && |
|||
e.Property == Class1.BazProperty && |
|||
(string)e.OldValue == "bazdefault" && |
|||
(string)e.NewValue == "changed"; |
|||
|
|||
child.Parent = parent; |
|||
|
|||
Assert.IsTrue(raised); |
|||
} |
|||
|
|||
[TestMethod] |
|||
public void Setting_InheritanceParent_Doesnt_Raise_PropertyChanged_When_Local_Value_Set() |
|||
{ |
|||
bool raised = false; |
|||
|
|||
Class1 parent = new Class1(); |
|||
parent.SetValue(Class1.BazProperty, "changed"); |
|||
|
|||
Class2 child = new Class2(); |
|||
child.SetValue(Class1.BazProperty, "localvalue"); |
|||
child.PropertyChanged += (s, e) => raised = true; |
|||
|
|||
child.Parent = parent; |
|||
|
|||
Assert.IsFalse(raised); |
|||
} |
|||
|
|||
[TestMethod] |
|||
public void Setting_Value_In_InheritanceParent_Raises_PropertyChanged() |
|||
{ |
|||
bool raised = false; |
|||
|
|||
Class1 parent = new Class1(); |
|||
|
|||
Class2 child = new Class2(); |
|||
child.PropertyChanged += (s, e) => |
|||
raised = s == child && |
|||
e.Property == Class1.BazProperty && |
|||
(string)e.OldValue == "bazdefault" && |
|||
(string)e.NewValue == "changed"; |
|||
child.Parent = parent; |
|||
|
|||
parent.SetValue(Class1.BazProperty, "changed"); |
|||
|
|||
Assert.IsTrue(raised); |
|||
} |
|||
|
|||
[TestMethod] |
|||
public void Bind_Sets_Current_Value() |
|||
{ |
|||
Class1 target = new Class1(); |
|||
Class1 source = new Class1(); |
|||
|
|||
source.SetValue(Class1.FooProperty, "initial"); |
|||
target.Bind(Class1.FooProperty, source.GetObservable(Class1.FooProperty)); |
|||
|
|||
Assert.AreEqual("initial", target.GetValue(Class1.FooProperty)); |
|||
} |
|||
|
|||
[TestMethod] |
|||
public void Bind_Sets_Subsequent_Value() |
|||
{ |
|||
Class1 target = new Class1(); |
|||
Class1 source = new Class1(); |
|||
|
|||
source.SetValue(Class1.FooProperty, "initial"); |
|||
target.Bind(Class1.FooProperty, source.GetObservable(Class1.FooProperty)); |
|||
source.SetValue(Class1.FooProperty, "subsequent"); |
|||
|
|||
Assert.AreEqual("subsequent", target.GetValue(Class1.FooProperty)); |
|||
} |
|||
|
|||
[TestMethod] |
|||
public void Bind_Doesnt_Set_Value_After_Clear() |
|||
{ |
|||
Class1 target = new Class1(); |
|||
Class1 source = new Class1(); |
|||
|
|||
source.SetValue(Class1.FooProperty, "initial"); |
|||
target.Bind(Class1.FooProperty, source.GetObservable(Class1.FooProperty)); |
|||
target.ClearValue(Class1.FooProperty); |
|||
source.SetValue(Class1.FooProperty, "newvalue"); |
|||
|
|||
Assert.AreEqual("foodefault", target.GetValue(Class1.FooProperty)); |
|||
} |
|||
|
|||
[TestMethod] |
|||
public void Bind_Doesnt_Set_Value_After_Reset() |
|||
{ |
|||
Class1 target = new Class1(); |
|||
Class1 source = new Class1(); |
|||
|
|||
source.SetValue(Class1.FooProperty, "initial"); |
|||
target.Bind(Class1.FooProperty, source.GetObservable(Class1.FooProperty)); |
|||
target.SetValue(Class1.FooProperty, "reset"); |
|||
source.SetValue(Class1.FooProperty, "newvalue"); |
|||
|
|||
Assert.AreEqual("reset", target.GetValue(Class1.FooProperty)); |
|||
} |
|||
|
|||
private class Class1 : PerspexObject |
|||
{ |
|||
public static readonly PerspexProperty<string> FooProperty = |
|||
PerspexProperty.Register<Class1, string>("Foo", "foodefault"); |
|||
|
|||
public static readonly PerspexProperty<string> BazProperty = |
|||
PerspexProperty.Register<Class1, string>("Baz", "bazdefault", true); |
|||
} |
|||
|
|||
private class Class2 : Class1 |
|||
{ |
|||
public static readonly PerspexProperty<string> BarProperty = |
|||
PerspexProperty.Register<Class2, string>("Bar", "bardefault"); |
|||
|
|||
static Class2() |
|||
{ |
|||
FooProperty.OverrideDefaultValue(typeof(Class2), "foooverride"); |
|||
} |
|||
|
|||
public Class1 Parent |
|||
{ |
|||
get { return (Class1)this.InheritanceParent; } |
|||
set { this.InheritanceParent = value; } |
|||
} |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,92 @@ |
|||
// -----------------------------------------------------------------------
|
|||
// <copyright file="PerspexPropertyTests.cs" company="Steven Kirk">
|
|||
// Copyright 2013 MIT Licence. See licence.md for more information.
|
|||
// </copyright>
|
|||
// -----------------------------------------------------------------------
|
|||
|
|||
namespace Perspex.UnitTests |
|||
{ |
|||
using System; |
|||
using Microsoft.VisualStudio.TestTools.UnitTesting; |
|||
|
|||
[TestClass] |
|||
public class PerspexPropertyTests |
|||
{ |
|||
[TestMethod] |
|||
public void Constructor_Sets_Properties() |
|||
{ |
|||
PerspexProperty<string> target = new PerspexProperty<string>( |
|||
"test", |
|||
typeof(Class1), |
|||
"Foo", |
|||
false); |
|||
|
|||
Assert.AreEqual("test", target.Name); |
|||
Assert.AreEqual(typeof(string), target.ValueType); |
|||
Assert.AreEqual(typeof(Class1), target.OwnerType); |
|||
Assert.AreEqual(false, target.Inherits); |
|||
} |
|||
|
|||
[TestMethod] |
|||
public void GetDefaultValue_Returns_Registered_Value() |
|||
{ |
|||
PerspexProperty<string> target = new PerspexProperty<string>( |
|||
"test", |
|||
typeof(Class1), |
|||
"Foo", |
|||
false); |
|||
|
|||
Assert.AreEqual("Foo", target.GetDefaultValue<Class1>()); |
|||
} |
|||
|
|||
[TestMethod] |
|||
public void GetDefaultValue_Returns_Registered_Value_For_Not_Overridden_Class() |
|||
{ |
|||
PerspexProperty<string> target = new PerspexProperty<string>( |
|||
"test", |
|||
typeof(Class1), |
|||
"Foo", |
|||
false); |
|||
|
|||
Assert.AreEqual("Foo", target.GetDefaultValue<Class2>()); |
|||
} |
|||
|
|||
[TestMethod] |
|||
public void GetDefaultValue_Returns_Registered_Value_For_Unrelated_Class() |
|||
{ |
|||
PerspexProperty<string> target = new PerspexProperty<string>( |
|||
"test", |
|||
typeof(Class3), |
|||
"Foo", |
|||
false); |
|||
|
|||
Assert.AreEqual("Foo", target.GetDefaultValue<Class2>()); |
|||
} |
|||
|
|||
[TestMethod] |
|||
public void GetDefaultValue_Returns_Overridden_Value() |
|||
{ |
|||
PerspexProperty<string> target = new PerspexProperty<string>( |
|||
"test", |
|||
typeof(Class1), |
|||
"Foo", |
|||
false); |
|||
|
|||
target.OverrideDefaultValue(typeof(Class2), "Bar"); |
|||
|
|||
Assert.AreEqual("Bar", target.GetDefaultValue<Class2>()); |
|||
} |
|||
|
|||
private class Class1 : PerspexObject |
|||
{ |
|||
} |
|||
|
|||
private class Class2 : Class1 |
|||
{ |
|||
} |
|||
|
|||
private class Class3 |
|||
{ |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,36 @@ |
|||
using System.Reflection; |
|||
using System.Runtime.CompilerServices; |
|||
using System.Runtime.InteropServices; |
|||
|
|||
// General Information about an assembly is controlled through the following
|
|||
// set of attributes. Change these attribute values to modify the information
|
|||
// associated with an assembly.
|
|||
[assembly: AssemblyTitle("Perspex.UnitTests")] |
|||
[assembly: AssemblyDescription("")] |
|||
[assembly: AssemblyConfiguration("")] |
|||
[assembly: AssemblyCompany("")] |
|||
[assembly: AssemblyProduct("Perspex.UnitTests")] |
|||
[assembly: AssemblyCopyright("Copyright © 2013")] |
|||
[assembly: AssemblyTrademark("")] |
|||
[assembly: AssemblyCulture("")] |
|||
|
|||
// Setting ComVisible to false makes the types in this assembly not visible
|
|||
// to COM components. If you need to access a type in this assembly from
|
|||
// COM, set the ComVisible attribute to true on that type.
|
|||
[assembly: ComVisible(false)] |
|||
|
|||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
|||
[assembly: Guid("fd38c609-0149-487b-b095-3341c409e478")] |
|||
|
|||
// Version information for an assembly consists of the following four values:
|
|||
//
|
|||
// Major Version
|
|||
// Minor Version
|
|||
// Build Number
|
|||
// Revision
|
|||
//
|
|||
// You can specify all the values or you can default the Build and Revision Numbers
|
|||
// by using the '*' as shown below:
|
|||
// [assembly: AssemblyVersion("1.0.*")]
|
|||
[assembly: AssemblyVersion("1.0.0.0")] |
|||
[assembly: AssemblyFileVersion("1.0.0.0")] |
|||
@ -0,0 +1,6 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<packages> |
|||
<package id="Rx-Core" version="2.1.30214.0" targetFramework="net45" /> |
|||
<package id="Rx-Interfaces" version="2.1.30214.0" targetFramework="net45" /> |
|||
<package id="Rx-Linq" version="2.1.30214.0" targetFramework="net45" /> |
|||
</packages> |
|||
@ -0,0 +1,156 @@ |
|||
// -----------------------------------------------------------------------
|
|||
// <copyright file="DrawingContextDirect2D1.cs" company="Steven Kirk">
|
|||
// Copyright 2013 MIT Licence. See licence.md for more information.
|
|||
// </copyright>
|
|||
// -----------------------------------------------------------------------
|
|||
|
|||
namespace Perspex.Windows |
|||
{ |
|||
using System; |
|||
using Perspex.Media; |
|||
using Perspex.Windows.Media; |
|||
using SharpDX; |
|||
using SharpDX.Direct2D1; |
|||
|
|||
/// <summary>
|
|||
/// Draws using Direct2D1.
|
|||
/// </summary>
|
|||
public class DrawingContext : IDrawingContext, IDisposable |
|||
{ |
|||
/// <summary>
|
|||
/// The Direct2D1 render target.
|
|||
/// </summary>
|
|||
private RenderTarget renderTarget; |
|||
|
|||
/// <summary>
|
|||
/// The DirectWrite factory.
|
|||
/// </summary>
|
|||
private SharpDX.DirectWrite.Factory directWriteFactory; |
|||
|
|||
/// <summary>
|
|||
/// Initializes a new instance of the <see cref="DrawingContext"/> class.
|
|||
/// </summary>
|
|||
/// <param name="renderTarget">The render target to draw to.</param>
|
|||
/// <param name="directWriteFactory">The DirectWrite factory.</param>
|
|||
public DrawingContext( |
|||
RenderTarget renderTarget, |
|||
SharpDX.DirectWrite.Factory directWriteFactory) |
|||
{ |
|||
this.renderTarget = renderTarget; |
|||
this.directWriteFactory = directWriteFactory; |
|||
this.renderTarget.BeginDraw(); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Ends a draw operation.
|
|||
/// </summary>
|
|||
public void Dispose() |
|||
{ |
|||
this.renderTarget.EndDraw(); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Draws the outline of a rectangle.
|
|||
/// </summary>
|
|||
/// <param name="pen">The pen.</param>
|
|||
/// <param name="rect">The rectangle bounds.</param>
|
|||
public void DrawRectange(Pen pen, Rect rect) |
|||
{ |
|||
using (SharpDX.Direct2D1.SolidColorBrush brush = this.Convert(pen.Brush)) |
|||
{ |
|||
this.renderTarget.DrawRectangle( |
|||
this.Convert(rect), |
|||
brush, |
|||
(float)pen.Thickness); |
|||
} |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Draws text.
|
|||
/// </summary>
|
|||
/// <param name="foreground">The foreground brush.</param>
|
|||
/// <param name="text">The text.</param>
|
|||
public void DrawText(Perspex.Media.Brush foreground, Rect rect, FormattedText text) |
|||
{ |
|||
using (SharpDX.Direct2D1.SolidColorBrush brush = this.Convert(foreground)) |
|||
using (SharpDX.DirectWrite.TextFormat format = TextService.Convert(this.directWriteFactory, text)) |
|||
{ |
|||
this.renderTarget.DrawText( |
|||
text.Text, |
|||
format, |
|||
this.Convert(rect), |
|||
brush); |
|||
} |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Draws a filled rectangle.
|
|||
/// </summary>
|
|||
/// <param name="brush">The brush.</param>
|
|||
/// <param name="rect">The rectangle bounds.</param>
|
|||
public void FillRectange(Perspex.Media.Brush brush, Rect rect) |
|||
{ |
|||
using (SharpDX.Direct2D1.SolidColorBrush b = this.Convert(brush)) |
|||
{ |
|||
this.renderTarget.FillRectangle( |
|||
new RectangleF( |
|||
(float)rect.X, |
|||
(float)rect.Y, |
|||
(float)rect.Width, |
|||
(float)rect.Height), |
|||
b); |
|||
} |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Converts a brush to Direct2D.
|
|||
/// </summary>
|
|||
/// <param name="brush">The brush to convert.</param>
|
|||
/// <returns>The Direct2D brush.</returns>
|
|||
private SharpDX.Direct2D1.SolidColorBrush Convert(Perspex.Media.Brush brush) |
|||
{ |
|||
Perspex.Media.SolidColorBrush solidColorBrush = brush as Perspex.Media.SolidColorBrush; |
|||
|
|||
if (solidColorBrush != null) |
|||
{ |
|||
return new SharpDX.Direct2D1.SolidColorBrush( |
|||
this.renderTarget, |
|||
this.Convert(solidColorBrush.Color)); |
|||
} |
|||
else |
|||
{ |
|||
return new SharpDX.Direct2D1.SolidColorBrush( |
|||
this.renderTarget, |
|||
new Color4()); |
|||
} |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Converts a color to Direct2D.
|
|||
/// </summary>
|
|||
/// <param name="color">The color to convert.</param>
|
|||
/// <returns>The Direct2D color.</returns>
|
|||
private Color4 Convert(Perspex.Media.Color color) |
|||
{ |
|||
return new Color4( |
|||
(float)(color.R / 255.0), |
|||
(float)(color.G / 255.0), |
|||
(float)(color.B / 255.0), |
|||
(float)(color.A / 255.0)); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Converts a <see cref="Rect"/> to a <see cref="RectangleF"/>
|
|||
/// </summary>
|
|||
/// <param name="rect">The <see cref="Rect"/>.</param>
|
|||
/// <returns>The <see cref="RectangleF"/>.</returns>
|
|||
private RectangleF Convert(Rect rect) |
|||
{ |
|||
return new RectangleF( |
|||
(float)rect.X, |
|||
(float)rect.Y, |
|||
(float)rect.Width, |
|||
(float)rect.Height); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,488 @@ |
|||
// -----------------------------------------------------------------------
|
|||
// <copyright file="UnmanagedMethods.cs" company="Steven Kirk">
|
|||
// Copyright 2013 MIT Licence. See licence.md for more information.
|
|||
// </copyright>
|
|||
// -----------------------------------------------------------------------
|
|||
|
|||
namespace Perspex.Windows.Interop |
|||
{ |
|||
using System; |
|||
using System.Diagnostics.CodeAnalysis; |
|||
using System.Runtime.InteropServices; |
|||
using System.Text; |
|||
|
|||
[SuppressMessage("Microsoft.StyleCop.CSharp.NamingRules", "SA1305:FieldNamesMustNotUseHungarianNotation", Justification = "Using Win32 naming for consistency.")] |
|||
[SuppressMessage("Microsoft.StyleCop.CSharp.NamingRules", "SA1307:AccessibleFieldsMustBeginWithUpperCaseLetter", Justification = "Using Win32 naming for consistency.")] |
|||
[SuppressMessage("Microsoft.StyleCop.CSharp.NamingRules", "SA1310:FieldNamesMustNotContainUnderscore", Justification = "Using Win32 naming for consistency.")] |
|||
internal static class UnmanagedMethods |
|||
{ |
|||
public const int CW_USEDEFAULT = unchecked((int)0x80000000); |
|||
|
|||
public delegate void TimerProc(IntPtr hWnd, uint uMsg, IntPtr nIDEvent, uint dwTime); |
|||
|
|||
public delegate IntPtr WndProc(IntPtr hWnd, uint msg, IntPtr wParam, IntPtr lParam); |
|||
|
|||
public enum Cursor |
|||
{ |
|||
IDC_ARROW = 32512, |
|||
IDC_IBEAM = 32513, |
|||
IDC_WAIT = 32514, |
|||
IDC_CROSS = 32515, |
|||
IDC_UPARROW = 32516, |
|||
IDC_SIZE = 32640, |
|||
IDC_ICON = 32641, |
|||
IDC_SIZENWSE = 32642, |
|||
IDC_SIZENESW = 32643, |
|||
IDC_SIZEWE = 32644, |
|||
IDC_SIZENS = 32645, |
|||
IDC_SIZEALL = 32646, |
|||
IDC_NO = 32648, |
|||
IDC_HAND = 32649, |
|||
IDC_APPSTARTING = 32650, |
|||
IDC_HELP = 32651 |
|||
} |
|||
|
|||
[Flags] |
|||
public enum SetWindowPosFlags : uint |
|||
{ |
|||
SWP_ASYNCWINDOWPOS = 0x4000, |
|||
SWP_DEFERERASE = 0x2000, |
|||
SWP_DRAWFRAME = 0x0020, |
|||
SWP_FRAMECHANGED = 0x0020, |
|||
SWP_HIDEWINDOW = 0x0080, |
|||
SWP_NOACTIVATE = 0x0010, |
|||
SWP_NOCOPYBITS = 0x0100, |
|||
SWP_NOMOVE = 0x0002, |
|||
SWP_NOOWNERZORDER = 0x0200, |
|||
SWP_NOREDRAW = 0x0008, |
|||
SWP_NOREPOSITION = 0x0200, |
|||
SWP_NOSENDCHANGING = 0x0400, |
|||
SWP_NOSIZE = 0x0001, |
|||
SWP_NOZORDER = 0x0004, |
|||
SWP_SHOWWINDOW = 0x0040, |
|||
|
|||
SWP_RESIZE = SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOZORDER |
|||
} |
|||
|
|||
[Flags] |
|||
public enum WindowStyles : uint |
|||
{ |
|||
WS_BORDER = 0x800000, |
|||
WS_CAPTION = 0xc00000, |
|||
WS_CHILD = 0x40000000, |
|||
WS_CLIPCHILDREN = 0x2000000, |
|||
WS_CLIPSIBLINGS = 0x4000000, |
|||
WS_DISABLED = 0x8000000, |
|||
WS_DLGFRAME = 0x400000, |
|||
WS_GROUP = 0x20000, |
|||
WS_HSCROLL = 0x100000, |
|||
WS_MAXIMIZE = 0x1000000, |
|||
WS_MAXIMIZEBOX = 0x10000, |
|||
WS_MINIMIZE = 0x20000000, |
|||
WS_MINIMIZEBOX = 0x20000, |
|||
WS_OVERLAPPED = 0x0, |
|||
WS_OVERLAPPEDWINDOW = WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_SIZEFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX, |
|||
WS_POPUP = 0x80000000u, |
|||
WS_POPUPWINDOW = WS_POPUP | WS_BORDER | WS_SYSMENU, |
|||
WS_SIZEFRAME = 0x40000, |
|||
WS_SYSMENU = 0x80000, |
|||
WS_TABSTOP = 0x10000, |
|||
WS_VISIBLE = 0x10000000, |
|||
WS_VSCROLL = 0x200000, |
|||
|
|||
WS_EX_DLGMODALFRAME = 0x00000001, |
|||
WS_EX_NOPARENTNOTIFY = 0x00000004, |
|||
WS_EX_TOPMOST = 0x00000008, |
|||
WS_EX_ACCEPTFILES = 0x00000010, |
|||
WS_EX_TRANSPARENT = 0x00000020, |
|||
WS_EX_MDICHILD = 0x00000040, |
|||
WS_EX_TOOLWINDOW = 0x00000080, |
|||
WS_EX_WINDOWEDGE = 0x00000100, |
|||
WS_EX_CLIENTEDGE = 0x00000200, |
|||
WS_EX_CONTEXTHELP = 0x00000400, |
|||
WS_EX_RIGHT = 0x00001000, |
|||
WS_EX_LEFT = 0x00000000, |
|||
WS_EX_RTLREADING = 0x00002000, |
|||
WS_EX_LTRREADING = 0x00000000, |
|||
WS_EX_LEFTSCROLLBAR = 0x00004000, |
|||
WS_EX_RIGHTSCROLLBAR = 0x00000000, |
|||
WS_EX_CONTROLPARENT = 0x00010000, |
|||
WS_EX_STATICEDGE = 0x00020000, |
|||
WS_EX_APPWINDOW = 0x00040000, |
|||
WS_EX_OVERLAPPEDWINDOW = (WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE), |
|||
WS_EX_PALETTEWINDOW = (WS_EX_WINDOWEDGE | WS_EX_TOOLWINDOW | WS_EX_TOPMOST), |
|||
WS_EX_LAYERED = 0x00080000, |
|||
WS_EX_NOINHERITLAYOUT = 0x00100000, |
|||
WS_EX_LAYOUTRTL = 0x00400000, |
|||
WS_EX_COMPOSITED = 0x02000000, |
|||
WS_EX_NOACTIVATE = 0x08000000 |
|||
} |
|||
|
|||
public enum WindowsMessage : uint |
|||
{ |
|||
WM_NULL = 0x0000, |
|||
WM_CREATE = 0x0001, |
|||
WM_DESTROY = 0x0002, |
|||
WM_MOVE = 0x0003, |
|||
WM_SIZE = 0x0005, |
|||
WM_ACTIVATE = 0x0006, |
|||
WM_SETFOCUS = 0x0007, |
|||
WM_KILLFOCUS = 0x0008, |
|||
WM_ENABLE = 0x000A, |
|||
WM_SETREDRAW = 0x000B, |
|||
WM_SETTEXT = 0x000C, |
|||
WM_GETTEXT = 0x000D, |
|||
WM_GETTEXTLENGTH = 0x000E, |
|||
WM_PAINT = 0x000F, |
|||
WM_CLOSE = 0x0010, |
|||
WM_QUERYENDSESSION = 0x0011, |
|||
WM_QUERYOPEN = 0x0013, |
|||
WM_ENDSESSION = 0x0016, |
|||
WM_QUIT = 0x0012, |
|||
WM_ERASEBKGND = 0x0014, |
|||
WM_SYSCOLORCHANGE = 0x0015, |
|||
WM_SHOWWINDOW = 0x0018, |
|||
WM_WININICHANGE = 0x001A, |
|||
WM_SETTINGCHANGE = WM_WININICHANGE, |
|||
WM_DEVMODECHANGE = 0x001B, |
|||
WM_ACTIVATEAPP = 0x001C, |
|||
WM_FONTCHANGE = 0x001D, |
|||
WM_TIMECHANGE = 0x001E, |
|||
WM_CANCELMODE = 0x001F, |
|||
WM_SETCURSOR = 0x0020, |
|||
WM_MOUSEACTIVATE = 0x0021, |
|||
WM_CHILDACTIVATE = 0x0022, |
|||
WM_QUEUESYNC = 0x0023, |
|||
WM_GETMINMAXINFO = 0x0024, |
|||
WM_PAINTICON = 0x0026, |
|||
WM_ICONERASEBKGND = 0x0027, |
|||
WM_NEXTDLGCTL = 0x0028, |
|||
WM_SPOOLERSTATUS = 0x002A, |
|||
WM_DRAWITEM = 0x002B, |
|||
WM_MEASUREITEM = 0x002C, |
|||
WM_DELETEITEM = 0x002D, |
|||
WM_VKEYTOITEM = 0x002E, |
|||
WM_CHARTOITEM = 0x002F, |
|||
WM_SETFONT = 0x0030, |
|||
WM_GETFONT = 0x0031, |
|||
WM_SETHOTKEY = 0x0032, |
|||
WM_GETHOTKEY = 0x0033, |
|||
WM_QUERYDRAGICON = 0x0037, |
|||
WM_COMPAREITEM = 0x0039, |
|||
WM_GETOBJECT = 0x003D, |
|||
WM_COMPACTING = 0x0041, |
|||
WM_WINDOWPOSCHANGING = 0x0046, |
|||
WM_WINDOWPOSCHANGED = 0x0047, |
|||
WM_COPYDATA = 0x004A, |
|||
WM_CANCELJOURNAL = 0x004B, |
|||
WM_NOTIFY = 0x004E, |
|||
WM_INPUTLANGCHANGEREQUEST = 0x0050, |
|||
WM_INPUTLANGCHANGE = 0x0051, |
|||
WM_TCARD = 0x0052, |
|||
WM_HELP = 0x0053, |
|||
WM_USERCHANGED = 0x0054, |
|||
WM_NOTIFYFORMAT = 0x0055, |
|||
WM_CONTEXTMENU = 0x007B, |
|||
WM_STYLECHANGING = 0x007C, |
|||
WM_STYLECHANGED = 0x007D, |
|||
WM_DISPLAYCHANGE = 0x007E, |
|||
WM_GETICON = 0x007F, |
|||
WM_SETICON = 0x0080, |
|||
WM_NCCREATE = 0x0081, |
|||
WM_NCDESTROY = 0x0082, |
|||
WM_NCCALCSIZE = 0x0083, |
|||
WM_NCHITTEST = 0x0084, |
|||
WM_NCPAINT = 0x0085, |
|||
WM_NCACTIVATE = 0x0086, |
|||
WM_GETDLGCODE = 0x0087, |
|||
WM_SYNCPAINT = 0x0088, |
|||
WM_NCMOUSEMOVE = 0x00A0, |
|||
WM_NCLBUTTONDOWN = 0x00A1, |
|||
WM_NCLBUTTONUP = 0x00A2, |
|||
WM_NCLBUTTONDBLCLK = 0x00A3, |
|||
WM_NCRBUTTONDOWN = 0x00A4, |
|||
WM_NCRBUTTONUP = 0x00A5, |
|||
WM_NCRBUTTONDBLCLK = 0x00A6, |
|||
WM_NCMBUTTONDOWN = 0x00A7, |
|||
WM_NCMBUTTONUP = 0x00A8, |
|||
WM_NCMBUTTONDBLCLK = 0x00A9, |
|||
WM_NCXBUTTONDOWN = 0x00AB, |
|||
WM_NCXBUTTONUP = 0x00AC, |
|||
WM_NCXBUTTONDBLCLK = 0x00AD, |
|||
WM_INPUT_DEVICE_CHANGE = 0x00FE, |
|||
WM_INPUT = 0x00FF, |
|||
WM_KEYFIRST = 0x0100, |
|||
WM_KEYDOWN = 0x0100, |
|||
WM_KEYUP = 0x0101, |
|||
WM_CHAR = 0x0102, |
|||
WM_DEADCHAR = 0x0103, |
|||
WM_SYSKEYDOWN = 0x0104, |
|||
WM_SYSKEYUP = 0x0105, |
|||
WM_SYSCHAR = 0x0106, |
|||
WM_SYSDEADCHAR = 0x0107, |
|||
WM_UNICHAR = 0x0109, |
|||
WM_KEYLAST = 0x0109, |
|||
WM_IME_STARTCOMPOSITION = 0x010D, |
|||
WM_IME_ENDCOMPOSITION = 0x010E, |
|||
WM_IME_COMPOSITION = 0x010F, |
|||
WM_IME_KEYLAST = 0x010F, |
|||
WM_INITDIALOG = 0x0110, |
|||
WM_COMMAND = 0x0111, |
|||
WM_SYSCOMMAND = 0x0112, |
|||
WM_TIMER = 0x0113, |
|||
WM_HSCROLL = 0x0114, |
|||
WM_VSCROLL = 0x0115, |
|||
WM_INITMENU = 0x0116, |
|||
WM_INITMENUPOPUP = 0x0117, |
|||
WM_MENUSELECT = 0x011F, |
|||
WM_MENUCHAR = 0x0120, |
|||
WM_ENTERIDLE = 0x0121, |
|||
WM_MENURBUTTONUP = 0x0122, |
|||
WM_MENUDRAG = 0x0123, |
|||
WM_MENUGETOBJECT = 0x0124, |
|||
WM_UNINITMENUPOPUP = 0x0125, |
|||
WM_MENUCOMMAND = 0x0126, |
|||
WM_CHANGEUISTATE = 0x0127, |
|||
WM_UPDATEUISTATE = 0x0128, |
|||
WM_QUERYUISTATE = 0x0129, |
|||
WM_CTLCOLORMSGBOX = 0x0132, |
|||
WM_CTLCOLOREDIT = 0x0133, |
|||
WM_CTLCOLORLISTBOX = 0x0134, |
|||
WM_CTLCOLORBTN = 0x0135, |
|||
WM_CTLCOLORDLG = 0x0136, |
|||
WM_CTLCOLORSCROLLBAR = 0x0137, |
|||
WM_CTLCOLORSTATIC = 0x0138, |
|||
WM_MOUSEFIRST = 0x0200, |
|||
WM_MOUSEMOVE = 0x0200, |
|||
WM_LBUTTONDOWN = 0x0201, |
|||
WM_LBUTTONUP = 0x0202, |
|||
WM_LBUTTONDBLCLK = 0x0203, |
|||
WM_RBUTTONDOWN = 0x0204, |
|||
WM_RBUTTONUP = 0x0205, |
|||
WM_RBUTTONDBLCLK = 0x0206, |
|||
WM_MBUTTONDOWN = 0x0207, |
|||
WM_MBUTTONUP = 0x0208, |
|||
WM_MBUTTONDBLCLK = 0x0209, |
|||
WM_MOUSEWHEEL = 0x020A, |
|||
WM_XBUTTONDOWN = 0x020B, |
|||
WM_XBUTTONUP = 0x020C, |
|||
WM_XBUTTONDBLCLK = 0x020D, |
|||
WM_MOUSEHWHEEL = 0x020E, |
|||
WM_MOUSELAST = 0x020E, |
|||
WM_PARENTNOTIFY = 0x0210, |
|||
WM_ENTERMENULOOP = 0x0211, |
|||
WM_EXITMENULOOP = 0x0212, |
|||
WM_NEXTMENU = 0x0213, |
|||
WM_SIZING = 0x0214, |
|||
WM_CAPTURECHANGED = 0x0215, |
|||
WM_MOVING = 0x0216, |
|||
WM_POWERBROADCAST = 0x0218, |
|||
WM_DEVICECHANGE = 0x0219, |
|||
WM_MDICREATE = 0x0220, |
|||
WM_MDIDESTROY = 0x0221, |
|||
WM_MDIACTIVATE = 0x0222, |
|||
WM_MDIRESTORE = 0x0223, |
|||
WM_MDINEXT = 0x0224, |
|||
WM_MDIMAXIMIZE = 0x0225, |
|||
WM_MDITILE = 0x0226, |
|||
WM_MDICASCADE = 0x0227, |
|||
WM_MDIICONARRANGE = 0x0228, |
|||
WM_MDIGETACTIVE = 0x0229, |
|||
WM_MDISETMENU = 0x0230, |
|||
WM_ENTERSIZEMOVE = 0x0231, |
|||
WM_EXITSIZEMOVE = 0x0232, |
|||
WM_DROPFILES = 0x0233, |
|||
WM_MDIREFRESHMENU = 0x0234, |
|||
WM_IME_SETCONTEXT = 0x0281, |
|||
WM_IME_NOTIFY = 0x0282, |
|||
WM_IME_CONTROL = 0x0283, |
|||
WM_IME_COMPOSITIONFULL = 0x0284, |
|||
WM_IME_SELECT = 0x0285, |
|||
WM_IME_CHAR = 0x0286, |
|||
WM_IME_REQUEST = 0x0288, |
|||
WM_IME_KEYDOWN = 0x0290, |
|||
WM_IME_KEYUP = 0x0291, |
|||
WM_MOUSEHOVER = 0x02A1, |
|||
WM_MOUSELEAVE = 0x02A3, |
|||
WM_NCMOUSEHOVER = 0x02A0, |
|||
WM_NCMOUSELEAVE = 0x02A2, |
|||
WM_WTSSESSION_CHANGE = 0x02B1, |
|||
WM_TABLET_FIRST = 0x02c0, |
|||
WM_TABLET_LAST = 0x02df, |
|||
WM_CUT = 0x0300, |
|||
WM_COPY = 0x0301, |
|||
WM_PASTE = 0x0302, |
|||
WM_CLEAR = 0x0303, |
|||
WM_UNDO = 0x0304, |
|||
WM_RENDERFORMAT = 0x0305, |
|||
WM_RENDERALLFORMATS = 0x0306, |
|||
WM_DESTROYCLIPBOARD = 0x0307, |
|||
WM_DRAWCLIPBOARD = 0x0308, |
|||
WM_PAINTCLIPBOARD = 0x0309, |
|||
WM_VSCROLLCLIPBOARD = 0x030A, |
|||
WM_SIZECLIPBOARD = 0x030B, |
|||
WM_ASKCBFORMATNAME = 0x030C, |
|||
WM_CHANGECBCHAIN = 0x030D, |
|||
WM_HSCROLLCLIPBOARD = 0x030E, |
|||
WM_QUERYNEWPALETTE = 0x030F, |
|||
WM_PALETTEISCHANGING = 0x0310, |
|||
WM_PALETTECHANGED = 0x0311, |
|||
WM_HOTKEY = 0x0312, |
|||
WM_PRINT = 0x0317, |
|||
WM_PRINTCLIENT = 0x0318, |
|||
WM_APPCOMMAND = 0x0319, |
|||
WM_THEMECHANGED = 0x031A, |
|||
WM_CLIPBOARDUPDATE = 0x031D, |
|||
WM_DWMCOMPOSITIONCHANGED = 0x031E, |
|||
WM_DWMNCRENDERINGCHANGED = 0x031F, |
|||
WM_DWMCOLORIZATIONCOLORCHANGED = 0x0320, |
|||
WM_DWMWINDOWMAXIMIZEDCHANGE = 0x0321, |
|||
WM_GETTITLEBARINFOEX = 0x033F, |
|||
WM_HANDHELDFIRST = 0x0358, |
|||
WM_HANDHELDLAST = 0x035F, |
|||
WM_AFXFIRST = 0x0360, |
|||
WM_AFXLAST = 0x037F, |
|||
WM_PENWINFIRST = 0x0380, |
|||
WM_PENWINLAST = 0x038F, |
|||
WM_APP = 0x8000, |
|||
WM_USER = 0x0400, |
|||
|
|||
WM_DISPATCH_WORK_ITEM = WM_USER, |
|||
} |
|||
|
|||
[DllImport("user32.dll")] |
|||
public static extern bool ClientToScreen(IntPtr hWnd, ref POINT lpPoint); |
|||
|
|||
[DllImport("user32.dll")] |
|||
public static extern IntPtr DefWindowProc(IntPtr hWnd, uint msg, IntPtr wParam, IntPtr lParam); |
|||
|
|||
[DllImport("user32.dll")] |
|||
public static extern IntPtr DispatchMessage(ref MSG lpmsg); |
|||
|
|||
[DllImport("user32.dll", SetLastError = true)] |
|||
public static extern bool DestroyWindow(IntPtr hwnd); |
|||
|
|||
[DllImport("user32.dll")] |
|||
public static extern uint GetCaretBlinkTime(); |
|||
|
|||
[DllImport("user32.dll")] |
|||
public static extern bool GetClientRect(IntPtr hwnd, out RECT lpRect); |
|||
|
|||
[DllImport("user32.dll")] |
|||
public static extern bool GetCursorPos(out POINT lpPoint); |
|||
|
|||
[DllImport("user32.dll")] |
|||
public static extern bool GetKeyboardState(byte[] lpKeyState); |
|||
|
|||
[DllImport("user32.dll")] |
|||
public static extern sbyte GetMessage(out MSG lpMsg, IntPtr hWnd, uint wMsgFilterMin, uint wMsgFilterMax); |
|||
|
|||
[DllImport("kernel32.dll")] |
|||
public static extern IntPtr GetModuleHandle(string lpModuleName); |
|||
|
|||
[DllImport("user32.dll")] |
|||
public static extern bool GetWindowRect(IntPtr hwnd, out RECT lpRect); |
|||
|
|||
[DllImport("user32.dll")] |
|||
public static extern bool KillTimer(IntPtr hWnd, IntPtr uIDEvent); |
|||
|
|||
[DllImport("user32.dll")] |
|||
public static extern IntPtr LoadCursor(IntPtr hInstance, int lpCursorName); |
|||
|
|||
[DllImport("user32.dll")] |
|||
public static extern IntPtr PostMessage(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam); |
|||
|
|||
[DllImport("user32.dll", SetLastError = true)] |
|||
public static extern ushort RegisterClassEx(ref WNDCLASSEX lpwcx); |
|||
|
|||
[DllImport("user32.dll")] |
|||
public static extern bool ReleaseCapture(); |
|||
|
|||
[DllImport("user32.dll")] |
|||
public static extern bool ScreenToClient(IntPtr hWnd, ref POINT lpPoint); |
|||
|
|||
[DllImport("user32.dll")] |
|||
public static extern IntPtr SetCapture(IntPtr hWnd); |
|||
|
|||
[DllImport("user32.dll")] |
|||
public static extern IntPtr SetTimer(IntPtr hWnd, IntPtr nIDEvent, uint uElapse, TimerProc lpTimerFunc); |
|||
|
|||
[DllImport("user32.dll")] |
|||
public static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int x, int y, int cx, int cy, SetWindowPosFlags uFlags); |
|||
|
|||
[DllImport("user32.dll")] |
|||
public static extern bool ShowWindow(IntPtr hWnd, uint nCmdShow); |
|||
|
|||
[DllImport("user32.dll")] |
|||
public static extern int ToUnicode( |
|||
uint virtualKeyCode, |
|||
uint scanCode, |
|||
byte[] keyboardState, |
|||
[Out, MarshalAs(UnmanagedType.LPWStr, SizeConst = 64)] |
|||
StringBuilder receivingBuffer, |
|||
int bufferSize, |
|||
uint flags); |
|||
|
|||
[DllImport("user32.dll")] |
|||
public static extern bool TranslateMessage(ref MSG lpMsg); |
|||
|
|||
[DllImport("user32.dll")] |
|||
public static extern bool UnregisterClass(string lpClassName, IntPtr hInstance); |
|||
|
|||
[DllImport("user32.dll", SetLastError = true)] |
|||
public static extern IntPtr CreateWindowEx( |
|||
int dwExStyle, |
|||
uint lpClassName, |
|||
string lpWindowName, |
|||
int dwStyle, |
|||
int x, |
|||
int y, |
|||
int nWidth, |
|||
int nHeight, |
|||
IntPtr hWndParent, |
|||
IntPtr hMenu, |
|||
IntPtr hInstance, |
|||
IntPtr lpParam); |
|||
|
|||
public struct MSG |
|||
{ |
|||
public IntPtr hwnd; |
|||
public uint message; |
|||
public IntPtr wParam; |
|||
public IntPtr lParam; |
|||
public uint time; |
|||
public POINT pt; |
|||
} |
|||
|
|||
public struct POINT |
|||
{ |
|||
public int X; |
|||
public int Y; |
|||
} |
|||
|
|||
public struct RECT |
|||
{ |
|||
public int left; |
|||
public int top; |
|||
public int right; |
|||
public int bottom; |
|||
} |
|||
|
|||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] |
|||
public struct WNDCLASSEX |
|||
{ |
|||
public int cbSize; |
|||
public int style; |
|||
public WndProc lpfnWndProc; |
|||
public int cbClsExtra; |
|||
public int cbWndExtra; |
|||
public IntPtr hInstance; |
|||
public IntPtr hIcon; |
|||
public IntPtr hCursor; |
|||
public IntPtr hbrBackground; |
|||
public string lpszMenuName; |
|||
public string lpszClassName; |
|||
public IntPtr hIconSm; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,32 @@ |
|||
namespace Perspex.Windows.Media |
|||
{ |
|||
using Perspex.Media; |
|||
using SharpDX.DirectWrite; |
|||
|
|||
public class TextService : ITextService |
|||
{ |
|||
private Factory factory; |
|||
|
|||
public TextService(Factory factory) |
|||
{ |
|||
this.factory = factory; |
|||
} |
|||
|
|||
public static TextFormat Convert(Factory factory, FormattedText text) |
|||
{ |
|||
return new TextFormat( |
|||
factory, |
|||
text.FontFamilyName, |
|||
(float)text.FontSize); |
|||
} |
|||
|
|||
public Size Measure(FormattedText text) |
|||
{ |
|||
TextFormat f = Convert(this.factory, text); |
|||
TextLayout layout = new TextLayout(this.factory, text.Text, f, float.MaxValue, float.MaxValue); |
|||
return new Size( |
|||
layout.Metrics.WidthIncludingTrailingWhitespace, |
|||
layout.Metrics.Height); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,115 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
|||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> |
|||
<PropertyGroup> |
|||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
|||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> |
|||
<ProjectGuid>{811A76CF-1CF6-440F-963B-BBE31BD72A82}</ProjectGuid> |
|||
<OutputType>Library</OutputType> |
|||
<AppDesignerFolder>Properties</AppDesignerFolder> |
|||
<RootNamespace>Perspex.Windows</RootNamespace> |
|||
<AssemblyName>Perspex.Windows</AssemblyName> |
|||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion> |
|||
<FileAlignment>512</FileAlignment> |
|||
</PropertyGroup> |
|||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> |
|||
<DebugSymbols>true</DebugSymbols> |
|||
<DebugType>full</DebugType> |
|||
<Optimize>false</Optimize> |
|||
<OutputPath>bin\Debug\</OutputPath> |
|||
<DefineConstants>DEBUG;TRACE</DefineConstants> |
|||
<ErrorReport>prompt</ErrorReport> |
|||
<WarningLevel>4</WarningLevel> |
|||
</PropertyGroup> |
|||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> |
|||
<DebugType>pdbonly</DebugType> |
|||
<Optimize>true</Optimize> |
|||
<OutputPath>bin\Release\</OutputPath> |
|||
<DefineConstants>TRACE</DefineConstants> |
|||
<ErrorReport>prompt</ErrorReport> |
|||
<WarningLevel>4</WarningLevel> |
|||
</PropertyGroup> |
|||
<ItemGroup> |
|||
<Reference Include="SharpDX"> |
|||
<HintPath>..\packages\SharpDX.2.5.0\lib\net40\SharpDX.dll</HintPath> |
|||
</Reference> |
|||
<Reference Include="SharpDX.Direct2D1"> |
|||
<HintPath>..\packages\SharpDX.Direct2D1.2.5.0\lib\net40\SharpDX.Direct2D1.dll</HintPath> |
|||
</Reference> |
|||
<Reference Include="SharpDX.DXGI"> |
|||
<HintPath>..\packages\SharpDX.DXGI.2.5.0\lib\net40\SharpDX.DXGI.dll</HintPath> |
|||
</Reference> |
|||
<Reference Include="System" /> |
|||
<Reference Include="System.Core" /> |
|||
<Reference Include="System.Drawing" /> |
|||
<Reference Include="System.Reactive.Core"> |
|||
<HintPath>..\packages\Rx-Core.2.1.30214.0\lib\Net45\System.Reactive.Core.dll</HintPath> |
|||
</Reference> |
|||
<Reference Include="System.Reactive.Interfaces"> |
|||
<HintPath>..\packages\Rx-Interfaces.2.1.30214.0\lib\Net45\System.Reactive.Interfaces.dll</HintPath> |
|||
</Reference> |
|||
<Reference Include="System.Reactive.Linq"> |
|||
<HintPath>..\packages\Rx-Linq.2.1.30214.0\lib\Net45\System.Reactive.Linq.dll</HintPath> |
|||
</Reference> |
|||
<Reference Include="System.Reactive.PlatformServices"> |
|||
<HintPath>..\packages\Rx-PlatformServices.2.1.30214.0\lib\Net45\System.Reactive.PlatformServices.dll</HintPath> |
|||
</Reference> |
|||
<Reference Include="System.Windows.Forms" /> |
|||
<Reference Include="System.Xml.Linq" /> |
|||
<Reference Include="System.Data.DataSetExtensions" /> |
|||
<Reference Include="Microsoft.CSharp" /> |
|||
<Reference Include="System.Data" /> |
|||
<Reference Include="System.Xml" /> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<Compile Include="DrawingContext.cs" /> |
|||
<Compile Include="Media\TextService.cs" /> |
|||
<Compile Include="Renderer.cs" /> |
|||
<Compile Include="Threading\Dispatcher.cs" /> |
|||
<Compile Include="Threading\DispatcherFrame.cs" /> |
|||
<Compile Include="Threading\DispatcherOperation.cs" /> |
|||
<Compile Include="Interop\UnmanagedMethods.cs" /> |
|||
<Compile Include="Window.cs" /> |
|||
<Compile Include="Properties\AssemblyInfo.cs" /> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<ProjectReference Include="..\Perspex\Perspex.csproj"> |
|||
<Project>{3c9f40da-d2a5-43a1-a272-e965876c6d46}</Project> |
|||
<Name>Perspex</Name> |
|||
</ProjectReference> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<None Include="packages.config" /> |
|||
</ItemGroup> |
|||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> |
|||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. |
|||
Other similar extension points exist, see Microsoft.Common.targets. |
|||
<Target Name="BeforeBuild"> |
|||
</Target> |
|||
<Target Name="AfterBuild"> |
|||
</Target> |
|||
--> |
|||
<PropertyGroup> |
|||
<StyleCopMSBuildTargetsFile>..\packages\StyleCop.MSBuild.4.7.46.0\tools\StyleCop.targets</StyleCopMSBuildTargetsFile> |
|||
</PropertyGroup> |
|||
<Import Condition="Exists('$(StyleCopMSBuildTargetsFile)')" Project="$(StyleCopMSBuildTargetsFile)" /> |
|||
<PropertyGroup> |
|||
<StyleCopMSBuildMessageMissing>Failed to import StyleCop.MSBuild targets from '$(StyleCopMSBuildTargetsFile)'. The StyleCop.MSBuild package was either missing or incomplete when the project was loaded. Ensure that the package is present and then restart the build. If you are using an IDE (e.g. Visual Studio), reload the project before restarting the build.</StyleCopMSBuildMessageMissing> |
|||
<StyleCopMSBuildMessagePresent>Failed to import StyleCop.MSBuild targets from '$(StyleCopMSBuildTargetsFile)'. The StyleCop.MSBuild package was either missing or incomplete when the project was loaded (but is now present). To fix this, restart the build. If you are using an IDE (e.g. Visual Studio), reload the project before restarting the build.</StyleCopMSBuildMessagePresent> |
|||
<StyleCopMSBuildMessageRestore>Failed to import StyleCop.MSBuild targets from '$(StyleCopMSBuildTargetsFile)'. The StyleCop.MSBuild package was either missing or incomplete when the project was loaded. To fix this, restore the package and then restart the build. If you are using an IDE (e.g. Visual Studio), you may need to reload the project before restarting the build. Note that regular NuGet package restore (during build) does not work with this package because the package needs to be present before the project is loaded. If this is an automated build (e.g. CI server), you may want to ensure that the build process restores the StyleCop.MSBuild package before the project is built.</StyleCopMSBuildMessageRestore> |
|||
<StyleCopMSBuildMessageRestored>Failed to import StyleCop.MSBuild targets from '$(StyleCopMSBuildTargetsFile)'. The StyleCop.MSBuild package was either missing or incomplete when the project was loaded (but is now present). To fix this, restart the build. If you are using an IDE (e.g. Visual Studio), reload the project before restarting the build. Note that when using regular NuGet package restore (during build) the package will not be available for the initial build because the package needs to be present before the project is loaded. If package restore executes successfully in the intitial build then the package will be available for subsequent builds. If this is an automated build (e.g. CI server), you may want to ensure that the build process restores the StyleCop.MSBuild package before the initial build.</StyleCopMSBuildMessageRestored> |
|||
</PropertyGroup> |
|||
<Target Name="StyleCopMSBuildTargetsNotFound"> |
|||
<Warning Condition="!Exists('$(StyleCopMSBuildTargetsFile)') And $(RestorePackages)!=true And $(StyleCopTreatErrorsAsWarnings)!=false" Text="$(StyleCopMSBuildMessageMissing)" /> |
|||
<Warning Condition="Exists('$(StyleCopMSBuildTargetsFile)') And $(RestorePackages)!=true And $(StyleCopTreatErrorsAsWarnings)!=false" Text="$(StyleCopMSBuildMessagePresent)" /> |
|||
<Warning Condition="!Exists('$(StyleCopMSBuildTargetsFile)') And $(RestorePackages)==true And $(StyleCopTreatErrorsAsWarnings)!=false" Text="$(StyleCopMSBuildMessageRestore)" /> |
|||
<Warning Condition="Exists('$(StyleCopMSBuildTargetsFile)') And $(RestorePackages)==true And $(StyleCopTreatErrorsAsWarnings)!=false" Text="$(StyleCopMSBuildMessageRestored)" /> |
|||
<Error Condition="!Exists('$(StyleCopMSBuildTargetsFile)') And $(RestorePackages)!=true And $(StyleCopTreatErrorsAsWarnings)==false" Text="$(StyleCopMSBuildMessageMissing)" /> |
|||
<Error Condition="Exists('$(StyleCopMSBuildTargetsFile)') And $(RestorePackages)!=true And $(StyleCopTreatErrorsAsWarnings)==false" Text="$(StyleCopMSBuildMessagePresent)" /> |
|||
<Error Condition="!Exists('$(StyleCopMSBuildTargetsFile)') And $(RestorePackages)==true And $(StyleCopTreatErrorsAsWarnings)==false" Text="$(StyleCopMSBuildMessageRestore)" /> |
|||
<Error Condition="Exists('$(StyleCopMSBuildTargetsFile)') And $(RestorePackages)==true And $(StyleCopTreatErrorsAsWarnings)==false" Text="$(StyleCopMSBuildMessageRestored)" /> |
|||
</Target> |
|||
<PropertyGroup> |
|||
<PrepareForBuildDependsOn Condition="!Exists('$(StyleCopMSBuildTargetsFile)')">StyleCopMSBuildTargetsNotFound;$(PrepareForBuildDependsOn)</PrepareForBuildDependsOn> |
|||
</PropertyGroup> |
|||
</Project> |
|||
@ -0,0 +1,36 @@ |
|||
using System.Reflection; |
|||
using System.Runtime.CompilerServices; |
|||
using System.Runtime.InteropServices; |
|||
|
|||
// General Information about an assembly is controlled through the following
|
|||
// set of attributes. Change these attribute values to modify the information
|
|||
// associated with an assembly.
|
|||
[assembly: AssemblyTitle("Perspex.Windows")] |
|||
[assembly: AssemblyDescription("")] |
|||
[assembly: AssemblyConfiguration("")] |
|||
[assembly: AssemblyCompany("")] |
|||
[assembly: AssemblyProduct("Perspex.Windows")] |
|||
[assembly: AssemblyCopyright("Copyright © 2013")] |
|||
[assembly: AssemblyTrademark("")] |
|||
[assembly: AssemblyCulture("")] |
|||
|
|||
// Setting ComVisible to false makes the types in this assembly not visible
|
|||
// to COM components. If you need to access a type in this assembly from
|
|||
// COM, set the ComVisible attribute to true on that type.
|
|||
[assembly: ComVisible(false)] |
|||
|
|||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
|||
[assembly: Guid("6bef7635-86fb-490e-8a97-a5134a63ec9b")] |
|||
|
|||
// Version information for an assembly consists of the following four values:
|
|||
//
|
|||
// Major Version
|
|||
// Minor Version
|
|||
// Build Number
|
|||
// Revision
|
|||
//
|
|||
// You can specify all the values or you can default the Build and Revision Numbers
|
|||
// by using the '*' as shown below:
|
|||
// [assembly: AssemblyVersion("1.0.*")]
|
|||
[assembly: AssemblyVersion("1.0.0.0")] |
|||
[assembly: AssemblyFileVersion("1.0.0.0")] |
|||
@ -0,0 +1,106 @@ |
|||
// -----------------------------------------------------------------------
|
|||
// <copyright file="Renderer.cs" company="Steven Kirk">
|
|||
// Copyright 2013 MIT Licence. See licence.md for more information.
|
|||
// </copyright>
|
|||
// -----------------------------------------------------------------------
|
|||
|
|||
namespace Perspex.Windows |
|||
{ |
|||
using System; |
|||
using SharpDX; |
|||
using SharpDX.Direct2D1; |
|||
using DwFactory = SharpDX.DirectWrite.Factory; |
|||
|
|||
/// <summary>
|
|||
/// Renders a <see cref="Canvas"/>.
|
|||
/// </summary>
|
|||
public class Renderer |
|||
{ |
|||
/// <summary>
|
|||
/// The render target.
|
|||
/// </summary>
|
|||
private WindowRenderTarget renderTarget; |
|||
|
|||
/// <summary>
|
|||
/// Initializes a new instance of the <see cref="Renderer"/> class.
|
|||
/// </summary>
|
|||
/// <param name="hwnd">The window handle.</param>
|
|||
/// <param name="width">The width of the window.</param>
|
|||
/// <param name="height">The height of the window.</param>
|
|||
public Renderer(IntPtr hwnd, int width, int height) |
|||
{ |
|||
this.Direct2DFactory = new Factory(); |
|||
this.DirectWriteFactory = new DwFactory(); |
|||
|
|||
RenderTargetProperties renderTargetProperties = new RenderTargetProperties |
|||
{ |
|||
}; |
|||
|
|||
HwndRenderTargetProperties hwndProperties = new HwndRenderTargetProperties |
|||
{ |
|||
Hwnd = hwnd, |
|||
PixelSize = new Size2(width, height), |
|||
}; |
|||
|
|||
this.renderTarget = new WindowRenderTarget( |
|||
this.Direct2DFactory, |
|||
renderTargetProperties, |
|||
hwndProperties); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Gets the Direct2D factory.
|
|||
/// </summary>
|
|||
public Factory Direct2DFactory |
|||
{ |
|||
get; |
|||
private set; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Gets the DirectWrite factory.
|
|||
/// </summary>
|
|||
public DwFactory DirectWriteFactory |
|||
{ |
|||
get; |
|||
private set; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Renders the specified visual.
|
|||
/// </summary>
|
|||
/// <param name="visual">The visual to render.</param>
|
|||
public void Render(Visual visual) |
|||
{ |
|||
using (DrawingContext context = new DrawingContext(this.renderTarget, this.DirectWriteFactory)) |
|||
{ |
|||
this.Render(visual, context); |
|||
} |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Resizes the renderer.
|
|||
/// </summary>
|
|||
/// <param name="width">The new width.</param>
|
|||
/// <param name="height">The new height.</param>
|
|||
public void Resize(int width, int height) |
|||
{ |
|||
this.renderTarget.Resize(new Size2(width, height)); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Renders the specified visual.
|
|||
/// </summary>
|
|||
/// <param name="visual">The visual to render.</param>
|
|||
/// <param name="context">The drawing context.</param>
|
|||
private void Render(Visual visual, DrawingContext context) |
|||
{ |
|||
visual.Render(context); |
|||
|
|||
foreach (Visual child in visual.VisualChildren) |
|||
{ |
|||
this.Render(child, context); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,637 @@ |
|||
// -----------------------------------------------------------------------
|
|||
// <copyright file="Dispatcher.cs" company="Steven Kirk">
|
|||
// Copyright 2013 MIT Licence. See licence.md for more information.
|
|||
// </copyright>
|
|||
// -----------------------------------------------------------------------
|
|||
|
|||
namespace Perspex.Windows.Threading |
|||
{ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.ComponentModel; |
|||
using System.Security; |
|||
using System.Threading; |
|||
using Perspex.Windows.Interop; |
|||
|
|||
public enum DispatcherPriority |
|||
{ |
|||
Invalid = -1, |
|||
Inactive = 0, |
|||
SystemIdle = 1, |
|||
ApplicationIdle = 2, |
|||
ContextIdle = 3, |
|||
Background = 4, |
|||
Input = 5, |
|||
Loaded = 6, |
|||
Render = 7, |
|||
DataBind = 8, |
|||
Normal = 9, |
|||
Send = 10, |
|||
} |
|||
|
|||
[Flags] |
|||
internal enum Flags |
|||
{ |
|||
ShutdownStarted = 1, |
|||
Shutdown = 2, |
|||
Disabled = 4 |
|||
} |
|||
|
|||
public sealed class Dispatcher |
|||
{ |
|||
private const int TopPriority = (int)DispatcherPriority.Send; |
|||
|
|||
private static Dictionary<Thread, Dispatcher> dispatchers = new Dictionary<Thread, Dispatcher>(); |
|||
|
|||
private static object olock = new object(); |
|||
|
|||
private static DispatcherFrame mainExecutionFrame = new DispatcherFrame(); |
|||
|
|||
private Thread baseThread; |
|||
|
|||
private PokableQueue[] priorityQueues = new PokableQueue[TopPriority + 1]; |
|||
|
|||
private Flags flags; |
|||
|
|||
private int queueBits; |
|||
|
|||
private DispatcherFrame currentFrame; |
|||
|
|||
private Dispatcher(Thread t) |
|||
{ |
|||
this.baseThread = t; |
|||
|
|||
for (int i = 1; i <= (int)DispatcherPriority.Send; i++) |
|||
{ |
|||
this.priorityQueues[i] = new PokableQueue(); |
|||
} |
|||
} |
|||
|
|||
public event EventHandler ShutdownStarted; |
|||
|
|||
public event EventHandler ShutdownFinished; |
|||
|
|||
public static Dispatcher CurrentDispatcher |
|||
{ |
|||
get |
|||
{ |
|||
lock (olock) |
|||
{ |
|||
Thread t = Thread.CurrentThread; |
|||
Dispatcher dis = FromThread(t); |
|||
|
|||
if (dis != null) |
|||
{ |
|||
return dis; |
|||
} |
|||
|
|||
dis = new Dispatcher(t); |
|||
dispatchers[t] = dis; |
|||
return dis; |
|||
} |
|||
} |
|||
} |
|||
|
|||
public Thread Thread |
|||
{ |
|||
get |
|||
{ |
|||
return this.baseThread; |
|||
} |
|||
} |
|||
|
|||
public bool HasShutdownStarted |
|||
{ |
|||
get |
|||
{ |
|||
return (this.flags & Flags.ShutdownStarted) != 0; |
|||
} |
|||
} |
|||
|
|||
public bool HasShutdownFinished |
|||
{ |
|||
get |
|||
{ |
|||
return (this.flags & Flags.Shutdown) != 0; |
|||
} |
|||
} |
|||
|
|||
[SecurityCritical] |
|||
public static void ExitAllFrames() |
|||
{ |
|||
Dispatcher dis = CurrentDispatcher; |
|||
|
|||
for (DispatcherFrame frame = dis.currentFrame; frame != null; frame = frame.ParentFrame) |
|||
{ |
|||
if (frame.ExitOnRequest) |
|||
{ |
|||
frame.Continue = false; |
|||
} |
|||
else |
|||
{ |
|||
break; |
|||
} |
|||
} |
|||
} |
|||
|
|||
public static Dispatcher FromThread(Thread thread) |
|||
{ |
|||
Dispatcher dis; |
|||
|
|||
if (dispatchers.TryGetValue(thread, out dis)) |
|||
{ |
|||
return dis; |
|||
} |
|||
|
|||
return null; |
|||
} |
|||
|
|||
[SecurityCritical] |
|||
public static void PushFrame(DispatcherFrame frame) |
|||
{ |
|||
if (frame == null) |
|||
{ |
|||
throw new ArgumentNullException("frame"); |
|||
} |
|||
|
|||
Dispatcher dis = CurrentDispatcher; |
|||
|
|||
if (dis.HasShutdownFinished) |
|||
{ |
|||
throw new InvalidOperationException("The Dispatcher has shut down"); |
|||
} |
|||
|
|||
if (frame.Running != null) |
|||
{ |
|||
throw new InvalidOperationException("Frame is already running on a different dispatcher"); |
|||
} |
|||
|
|||
if ((dis.flags & Flags.Disabled) != 0) |
|||
{ |
|||
throw new InvalidOperationException("Dispatcher processing has been disabled"); |
|||
} |
|||
|
|||
frame.ParentFrame = dis.currentFrame; |
|||
dis.currentFrame = frame; |
|||
|
|||
frame.Running = dis; |
|||
|
|||
dis.RunFrame(frame); |
|||
} |
|||
|
|||
[SecurityCritical] |
|||
public static void Run() |
|||
{ |
|||
PushFrame(mainExecutionFrame); |
|||
} |
|||
|
|||
public static void ValidatePriority(DispatcherPriority priority, string parameterName) |
|||
{ |
|||
if (priority < DispatcherPriority.Inactive || priority > DispatcherPriority.Send) |
|||
{ |
|||
throw new InvalidEnumArgumentException(parameterName); |
|||
} |
|||
} |
|||
|
|||
[EditorBrowsable(EditorBrowsableState.Never)] |
|||
public bool CheckAccess() |
|||
{ |
|||
return Thread.CurrentThread == this.baseThread; |
|||
} |
|||
|
|||
[EditorBrowsable(EditorBrowsableState.Never)] |
|||
public void VerifyAccess() |
|||
{ |
|||
if (Thread.CurrentThread != this.baseThread) |
|||
{ |
|||
throw new InvalidOperationException("Invoked from a different thread"); |
|||
} |
|||
} |
|||
|
|||
public DispatcherOperation BeginInvoke(Delegate method, params object[] args) |
|||
{ |
|||
throw new NotImplementedException(); |
|||
} |
|||
|
|||
public DispatcherOperation BeginInvoke(Delegate method, DispatcherPriority priority, params object[] args) |
|||
{ |
|||
throw new NotImplementedException(); |
|||
} |
|||
|
|||
[Browsable(false)] |
|||
[EditorBrowsable(EditorBrowsableState.Never)] |
|||
public DispatcherOperation BeginInvoke(DispatcherPriority priority, Delegate method) |
|||
{ |
|||
if (priority < 0 || priority > DispatcherPriority.Send) |
|||
{ |
|||
throw new InvalidEnumArgumentException("priority"); |
|||
} |
|||
|
|||
if (priority == DispatcherPriority.Inactive) |
|||
{ |
|||
throw new ArgumentException("priority can not be inactive", "priority"); |
|||
} |
|||
|
|||
if (method == null) |
|||
{ |
|||
throw new ArgumentNullException("method"); |
|||
} |
|||
|
|||
DispatcherOperation op = new DispatcherOperation(this, priority, method); |
|||
this.Queue(priority, op); |
|||
|
|||
return op; |
|||
} |
|||
|
|||
[Browsable(false)] |
|||
[EditorBrowsable(EditorBrowsableState.Never)] |
|||
public DispatcherOperation BeginInvoke(DispatcherPriority priority, Delegate method, object arg) |
|||
{ |
|||
if (priority < 0 || priority > DispatcherPriority.Send) |
|||
{ |
|||
throw new InvalidEnumArgumentException("priority"); |
|||
} |
|||
|
|||
if (priority == DispatcherPriority.Inactive) |
|||
{ |
|||
throw new ArgumentException("priority can not be inactive", "priority"); |
|||
} |
|||
|
|||
if (method == null) |
|||
{ |
|||
throw new ArgumentNullException("method"); |
|||
} |
|||
|
|||
DispatcherOperation op = new DispatcherOperation(this, priority, method, arg); |
|||
|
|||
this.Queue(priority, op); |
|||
|
|||
return op; |
|||
} |
|||
|
|||
[Browsable(false)] |
|||
[EditorBrowsable(EditorBrowsableState.Never)] |
|||
public DispatcherOperation BeginInvoke(DispatcherPriority priority, Delegate method, object arg, params object[] args) |
|||
{ |
|||
if (priority < 0 || priority > DispatcherPriority.Send) |
|||
{ |
|||
throw new InvalidEnumArgumentException("priority"); |
|||
} |
|||
|
|||
if (priority == DispatcherPriority.Inactive) |
|||
{ |
|||
throw new ArgumentException("priority can not be inactive", "priority"); |
|||
} |
|||
|
|||
if (method == null) |
|||
{ |
|||
throw new ArgumentNullException("method"); |
|||
} |
|||
|
|||
DispatcherOperation op = new DispatcherOperation(this, priority, method, arg, args); |
|||
this.Queue(priority, op); |
|||
|
|||
return op; |
|||
} |
|||
|
|||
public object Invoke(Delegate method, params object[] args) |
|||
{ |
|||
throw new NotImplementedException(); |
|||
} |
|||
|
|||
public object Invoke(Delegate method, TimeSpan timeout, params object[] args) |
|||
{ |
|||
throw new NotImplementedException(); |
|||
} |
|||
|
|||
public object Invoke(Delegate method, TimeSpan timeout, DispatcherPriority priority, params object[] args) |
|||
{ |
|||
throw new NotImplementedException(); |
|||
} |
|||
|
|||
public object Invoke(Delegate method, DispatcherPriority priority, params object[] args) |
|||
{ |
|||
throw new NotImplementedException(); |
|||
} |
|||
|
|||
[Browsable(false)] |
|||
[EditorBrowsable(EditorBrowsableState.Never)] |
|||
public object Invoke(DispatcherPriority priority, Delegate method) |
|||
{ |
|||
if (priority < 0 || priority > DispatcherPriority.Send) |
|||
{ |
|||
throw new InvalidEnumArgumentException("priority"); |
|||
} |
|||
|
|||
if (priority == DispatcherPriority.Inactive) |
|||
{ |
|||
throw new ArgumentException("priority can not be inactive", "priority"); |
|||
} |
|||
|
|||
if (method == null) |
|||
{ |
|||
throw new ArgumentNullException("method"); |
|||
} |
|||
|
|||
DispatcherOperation op = new DispatcherOperation(this, priority, method); |
|||
this.Queue(priority, op); |
|||
PushFrame(new DispatcherFrame()); |
|||
|
|||
throw new NotImplementedException(); |
|||
} |
|||
|
|||
[Browsable(false)] |
|||
[EditorBrowsable(EditorBrowsableState.Never)] |
|||
public object Invoke(DispatcherPriority priority, Delegate method, object arg) |
|||
{ |
|||
if (priority < 0 || priority > DispatcherPriority.Send) |
|||
{ |
|||
throw new InvalidEnumArgumentException("priority"); |
|||
} |
|||
|
|||
if (priority == DispatcherPriority.Inactive) |
|||
{ |
|||
throw new ArgumentException("priority can not be inactive", "priority"); |
|||
} |
|||
|
|||
if (method == null) |
|||
{ |
|||
throw new ArgumentNullException("method"); |
|||
} |
|||
|
|||
this.Queue(priority, new DispatcherOperation(this, priority, method, arg)); |
|||
throw new NotImplementedException(); |
|||
} |
|||
|
|||
[Browsable(false)] |
|||
[EditorBrowsable(EditorBrowsableState.Never)] |
|||
public object Invoke(DispatcherPriority priority, Delegate method, object arg, params object[] args) |
|||
{ |
|||
if (priority < 0 || priority > DispatcherPriority.Send) |
|||
{ |
|||
throw new InvalidEnumArgumentException("priority"); |
|||
} |
|||
|
|||
if (priority == DispatcherPriority.Inactive) |
|||
{ |
|||
throw new ArgumentException("priority can not be inactive", "priority"); |
|||
} |
|||
|
|||
if (method == null) |
|||
{ |
|||
throw new ArgumentNullException("method"); |
|||
} |
|||
|
|||
this.Queue(priority, new DispatcherOperation(this, priority, method, arg, args)); |
|||
|
|||
throw new NotImplementedException(); |
|||
} |
|||
|
|||
[Browsable(false)] |
|||
[EditorBrowsable(EditorBrowsableState.Never)] |
|||
public object Invoke(DispatcherPriority priority, TimeSpan timeout, Delegate method) |
|||
{ |
|||
throw new NotImplementedException(); |
|||
} |
|||
|
|||
[Browsable(false)] |
|||
[EditorBrowsable(EditorBrowsableState.Never)] |
|||
public object Invoke(DispatcherPriority priority, TimeSpan timeout, Delegate method, object arg) |
|||
{ |
|||
throw new NotImplementedException(); |
|||
} |
|||
|
|||
[Browsable(false)] |
|||
[EditorBrowsable(EditorBrowsableState.Never)] |
|||
public object Invoke(DispatcherPriority priority, TimeSpan timeout, Delegate method, object arg, params object[] args) |
|||
{ |
|||
throw new NotImplementedException(); |
|||
} |
|||
|
|||
[SecurityCritical] |
|||
public void InvokeShutdown() |
|||
{ |
|||
this.flags |= Flags.ShutdownStarted; |
|||
|
|||
UnmanagedMethods.PostMessage( |
|||
IntPtr.Zero, |
|||
(int)UnmanagedMethods.WindowsMessage.WM_DISPATCH_WORK_ITEM, |
|||
IntPtr.Zero, |
|||
IntPtr.Zero); |
|||
} |
|||
|
|||
[SecurityCritical] |
|||
public void BeginInvokeShutdown(DispatcherPriority priority) |
|||
{ |
|||
throw new NotImplementedException(); |
|||
} |
|||
|
|||
internal void Reprioritize(DispatcherOperation op, DispatcherPriority oldpriority) |
|||
{ |
|||
int oldp = (int)oldpriority; |
|||
PokableQueue q = this.priorityQueues[oldp]; |
|||
|
|||
lock (q) |
|||
{ |
|||
q.Remove(op); |
|||
} |
|||
|
|||
this.Queue(op.Priority, op); |
|||
} |
|||
|
|||
private void Queue(DispatcherPriority priority, DispatcherOperation x) |
|||
{ |
|||
int p = (int)priority; |
|||
PokableQueue q = this.priorityQueues[p]; |
|||
|
|||
lock (q) |
|||
{ |
|||
int flag = 1 << p; |
|||
q.Enqueue(x); |
|||
this.queueBits |= flag; |
|||
} |
|||
|
|||
if (Thread.CurrentThread != this.baseThread) |
|||
{ |
|||
UnmanagedMethods.PostMessage( |
|||
IntPtr.Zero, |
|||
(int)UnmanagedMethods.WindowsMessage.WM_DISPATCH_WORK_ITEM, |
|||
IntPtr.Zero, |
|||
IntPtr.Zero); |
|||
} |
|||
} |
|||
|
|||
private void PerformShutdown() |
|||
{ |
|||
EventHandler h; |
|||
|
|||
h = this.ShutdownStarted; |
|||
if (h != null) |
|||
{ |
|||
h(this, new EventArgs()); |
|||
} |
|||
|
|||
this.flags |= Flags.Shutdown; |
|||
|
|||
h = this.ShutdownFinished; |
|||
if (h != null) |
|||
{ |
|||
h(this, new EventArgs()); |
|||
} |
|||
|
|||
this.priorityQueues = null; |
|||
} |
|||
|
|||
private void RunFrame(DispatcherFrame frame) |
|||
{ |
|||
do |
|||
{ |
|||
while (this.queueBits != 0) |
|||
{ |
|||
for (int i = TopPriority; i > 0 && this.queueBits != 0; i--) |
|||
{ |
|||
int currentBit = this.queueBits & (1 << i); |
|||
if (currentBit != 0) |
|||
{ |
|||
PokableQueue q = this.priorityQueues[i]; |
|||
|
|||
do |
|||
{ |
|||
DispatcherOperation task; |
|||
|
|||
lock (q) |
|||
{ |
|||
task = (DispatcherOperation)q.Dequeue(); |
|||
} |
|||
|
|||
task.Invoke(); |
|||
|
|||
if (!frame.Continue) |
|||
{ |
|||
return; |
|||
} |
|||
|
|||
if (this.HasShutdownStarted) |
|||
{ |
|||
this.PerformShutdown(); |
|||
return; |
|||
} |
|||
|
|||
lock (q) |
|||
{ |
|||
if (q.Count == 0) |
|||
{ |
|||
this.queueBits &= ~(1 << i); |
|||
break; |
|||
} |
|||
} |
|||
|
|||
if (currentBit < (this.queueBits & ~currentBit)) |
|||
{ |
|||
break; |
|||
} |
|||
} |
|||
while (true); |
|||
} |
|||
} |
|||
} |
|||
|
|||
UnmanagedMethods.MSG msg; |
|||
UnmanagedMethods.GetMessage(out msg, IntPtr.Zero, 0, 0); |
|||
UnmanagedMethods.TranslateMessage(ref msg); |
|||
UnmanagedMethods.DispatchMessage(ref msg); |
|||
|
|||
if (this.HasShutdownStarted) |
|||
{ |
|||
this.PerformShutdown(); |
|||
return; |
|||
} |
|||
} |
|||
while (frame.Continue); |
|||
} |
|||
|
|||
private class PokableQueue |
|||
{ |
|||
private const int InitialCapacity = 32; |
|||
|
|||
private int size, head, tail; |
|||
private object[] array; |
|||
|
|||
internal PokableQueue(int capacity) |
|||
{ |
|||
this.array = new object[capacity]; |
|||
} |
|||
|
|||
internal PokableQueue() |
|||
: this(InitialCapacity) |
|||
{ |
|||
} |
|||
|
|||
public int Count |
|||
{ |
|||
get |
|||
{ |
|||
return this.size; |
|||
} |
|||
} |
|||
|
|||
public void Enqueue(object obj) |
|||
{ |
|||
if (this.size == this.array.Length) |
|||
{ |
|||
this.Grow(); |
|||
} |
|||
|
|||
this.array[this.tail] = obj; |
|||
this.tail = (this.tail + 1) % this.array.Length; |
|||
this.size++; |
|||
} |
|||
|
|||
public object Dequeue() |
|||
{ |
|||
if (this.size < 1) |
|||
{ |
|||
throw new InvalidOperationException(); |
|||
} |
|||
|
|||
object result = this.array[this.head]; |
|||
this.array[this.head] = null; |
|||
this.head = (this.head + 1) % this.array.Length; |
|||
this.size--; |
|||
return result; |
|||
} |
|||
|
|||
public void Remove(object obj) |
|||
{ |
|||
for (int i = 0; i < this.size; i++) |
|||
{ |
|||
if (this.array[(this.head + i) % this.array.Length] == obj) |
|||
{ |
|||
for (int j = i; j < this.size - i; j++) |
|||
{ |
|||
this.array[(this.head + j) % this.array.Length] = this.array[(this.head + j + 1) % this.array.Length]; |
|||
} |
|||
|
|||
this.size--; |
|||
if (this.size < 0) |
|||
{ |
|||
this.size = this.array.Length - 1; |
|||
} |
|||
|
|||
this.tail--; |
|||
} |
|||
} |
|||
} |
|||
|
|||
private void Grow() |
|||
{ |
|||
int newc = this.array.Length * 2; |
|||
object[] newContents = new object[newc]; |
|||
this.array.CopyTo(newContents, 0); |
|||
this.array = newContents; |
|||
this.head = 0; |
|||
this.tail = this.head + this.size; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,25 @@ |
|||
// -----------------------------------------------------------------------
|
|||
// <copyright file="DispatcherFrame.cs" company="Steven Kirk">
|
|||
// Copyright 2013 MIT Licence. See licence.md for more information.
|
|||
// </copyright>
|
|||
// -----------------------------------------------------------------------
|
|||
|
|||
namespace Perspex.Windows.Threading |
|||
{ |
|||
public class DispatcherFrame |
|||
{ |
|||
public DispatcherFrame() |
|||
{ |
|||
this.Continue = true; |
|||
this.ExitOnRequest = true; |
|||
} |
|||
|
|||
public bool Continue { get; set; } |
|||
|
|||
internal bool ExitOnRequest { get; set; } |
|||
|
|||
internal Dispatcher Running { get; set; } |
|||
|
|||
internal DispatcherFrame ParentFrame { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,159 @@ |
|||
// -----------------------------------------------------------------------
|
|||
// <copyright file="DispatcherOperation.cs" company="Steven Kirk">
|
|||
// Copyright 2013 MIT Licence. See licence.md for more information.
|
|||
// </copyright>
|
|||
// -----------------------------------------------------------------------
|
|||
|
|||
namespace Perspex.Windows.Threading |
|||
{ |
|||
using System; |
|||
using System.Security; |
|||
|
|||
public enum DispatcherOperationStatus |
|||
{ |
|||
Pending = 0, |
|||
Aborted = 1, |
|||
Completed = 2, |
|||
Executing = 3 |
|||
} |
|||
|
|||
public sealed class DispatcherOperation |
|||
{ |
|||
private DispatcherOperationStatus status; |
|||
private DispatcherPriority priority; |
|||
private Dispatcher dispatcher; |
|||
private object result; |
|||
private Delegate delegateMethod; |
|||
private object[] delegateArgs; |
|||
|
|||
internal DispatcherOperation(Dispatcher dis, DispatcherPriority prio) |
|||
{ |
|||
this.dispatcher = dis; |
|||
this.priority = prio; |
|||
if (this.Dispatcher.HasShutdownFinished) |
|||
{ |
|||
this.status = DispatcherOperationStatus.Aborted; |
|||
} |
|||
else |
|||
{ |
|||
this.status = DispatcherOperationStatus.Pending; |
|||
} |
|||
} |
|||
|
|||
internal DispatcherOperation(Dispatcher dis, DispatcherPriority prio, Delegate d) |
|||
: this(dis, prio) |
|||
{ |
|||
this.delegateMethod = d; |
|||
} |
|||
|
|||
internal DispatcherOperation(Dispatcher dis, DispatcherPriority prio, Delegate d, object arg) |
|||
: this(dis, prio) |
|||
{ |
|||
this.delegateMethod = d; |
|||
this.delegateArgs = new object[1]; |
|||
this.delegateArgs[0] = arg; |
|||
} |
|||
|
|||
internal DispatcherOperation(Dispatcher dis, DispatcherPriority prio, Delegate d, object arg, object[] args) |
|||
: this(dis, prio) |
|||
{ |
|||
this.delegateMethod = d; |
|||
this.delegateArgs = new object[args.Length + 1]; |
|||
this.delegateArgs[0] = arg; |
|||
Array.Copy(args, 1, this.delegateArgs, 0, args.Length); |
|||
} |
|||
|
|||
public event EventHandler Completed; |
|||
|
|||
public DispatcherOperationStatus Status |
|||
{ |
|||
get |
|||
{ |
|||
return this.status; |
|||
} |
|||
|
|||
internal set |
|||
{ |
|||
this.status = value; |
|||
} |
|||
} |
|||
|
|||
public Dispatcher Dispatcher |
|||
{ |
|||
get |
|||
{ |
|||
return this.dispatcher; |
|||
} |
|||
} |
|||
|
|||
public DispatcherPriority Priority |
|||
{ |
|||
get |
|||
{ |
|||
return this.priority; |
|||
} |
|||
|
|||
set |
|||
{ |
|||
if (this.priority != value) |
|||
{ |
|||
DispatcherPriority old = this.priority; |
|||
this.priority = value; |
|||
this.dispatcher.Reprioritize(this, old); |
|||
} |
|||
} |
|||
} |
|||
|
|||
public object Result |
|||
{ |
|||
get |
|||
{ |
|||
return this.result; |
|||
} |
|||
} |
|||
|
|||
public bool Abort() |
|||
{ |
|||
this.status = DispatcherOperationStatus.Aborted; |
|||
throw new NotImplementedException(); |
|||
} |
|||
|
|||
public DispatcherOperationStatus Wait() |
|||
{ |
|||
if (this.status == DispatcherOperationStatus.Executing) |
|||
{ |
|||
throw new InvalidOperationException("Already executing"); |
|||
} |
|||
|
|||
throw new NotImplementedException(); |
|||
} |
|||
|
|||
[SecurityCritical] |
|||
public DispatcherOperationStatus Wait(TimeSpan timeout) |
|||
{ |
|||
if (this.status == DispatcherOperationStatus.Executing) |
|||
{ |
|||
throw new InvalidOperationException("Already executing"); |
|||
} |
|||
|
|||
throw new NotImplementedException(); |
|||
} |
|||
|
|||
internal void Invoke() |
|||
{ |
|||
this.status = DispatcherOperationStatus.Executing; |
|||
|
|||
if (this.delegateMethod != null) |
|||
{ |
|||
this.result = this.delegateMethod.DynamicInvoke(this.delegateArgs); |
|||
} |
|||
|
|||
this.status = DispatcherOperationStatus.Completed; |
|||
|
|||
if (this.Completed != null) |
|||
{ |
|||
this.Completed(this, EventArgs.Empty); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,149 @@ |
|||
namespace Perspex.Windows |
|||
{ |
|||
using System; |
|||
using System.ComponentModel; |
|||
using System.Diagnostics.CodeAnalysis; |
|||
using System.Runtime.InteropServices; |
|||
using Perspex.Controls; |
|||
using Perspex.Windows.Interop; |
|||
using SharpDX.Direct2D1; |
|||
using SharpDX.DXGI; |
|||
|
|||
public class Window : ContentControl |
|||
{ |
|||
private UnmanagedMethods.WndProc wndProcDelegate; |
|||
|
|||
private string className; |
|||
|
|||
private Renderer renderer; |
|||
|
|||
public Window() |
|||
{ |
|||
this.CreateWindow(); |
|||
|
|||
Size clientSize = this.ClientSize; |
|||
this.renderer = new Renderer(this.Handle, (int)clientSize.Width, (int)clientSize.Height); |
|||
} |
|||
|
|||
public Size ClientSize |
|||
{ |
|||
get |
|||
{ |
|||
UnmanagedMethods.RECT rect; |
|||
UnmanagedMethods.GetClientRect(this.Handle, out rect); |
|||
return new Size(rect.right, rect.bottom); |
|||
} |
|||
} |
|||
|
|||
public IntPtr Handle |
|||
{ |
|||
get; |
|||
private set; |
|||
} |
|||
|
|||
public void Show() |
|||
{ |
|||
UnmanagedMethods.ShowWindow(this.Handle, 4); |
|||
this.Measure(this.ClientSize); |
|||
this.Arrange(new Rect(this.ClientSize)); |
|||
this.renderer.Render(this); |
|||
} |
|||
|
|||
protected override Visual DefaultTemplate() |
|||
{ |
|||
Border border = new Border(); |
|||
border.Background = new Perspex.Media.SolidColorBrush(0xff808080); |
|||
ContentPresenter contentPresenter = new ContentPresenter(); |
|||
contentPresenter.Bind(ContentPresenter.ContentProperty, this.GetObservable(ContentProperty)); |
|||
border.Content = contentPresenter; |
|||
return border; |
|||
} |
|||
|
|||
private void CreateWindow() |
|||
{ |
|||
// Ensure that the delegate doesn't get garbage collected by storing it as a field.
|
|||
this.wndProcDelegate = new UnmanagedMethods.WndProc(this.WndProc); |
|||
|
|||
this.className = Guid.NewGuid().ToString(); |
|||
|
|||
UnmanagedMethods.WNDCLASSEX wndClassEx = new UnmanagedMethods.WNDCLASSEX |
|||
{ |
|||
cbSize = Marshal.SizeOf(typeof(UnmanagedMethods.WNDCLASSEX)), |
|||
style = 0, |
|||
lpfnWndProc = this.wndProcDelegate, |
|||
hInstance = Marshal.GetHINSTANCE(this.GetType().Module), |
|||
hCursor = UnmanagedMethods.LoadCursor(IntPtr.Zero, (int)UnmanagedMethods.Cursor.IDC_ARROW), |
|||
hbrBackground = (IntPtr)5, |
|||
lpszClassName = this.className, |
|||
}; |
|||
|
|||
ushort atom = UnmanagedMethods.RegisterClassEx(ref wndClassEx); |
|||
|
|||
if (atom == 0) |
|||
{ |
|||
throw new Win32Exception(); |
|||
} |
|||
|
|||
this.Handle = UnmanagedMethods.CreateWindowEx( |
|||
0, |
|||
atom, |
|||
null, |
|||
(int)UnmanagedMethods.WindowStyles.WS_OVERLAPPEDWINDOW, |
|||
UnmanagedMethods.CW_USEDEFAULT, |
|||
UnmanagedMethods.CW_USEDEFAULT, |
|||
UnmanagedMethods.CW_USEDEFAULT, |
|||
UnmanagedMethods.CW_USEDEFAULT, |
|||
IntPtr.Zero, |
|||
IntPtr.Zero, |
|||
IntPtr.Zero, |
|||
IntPtr.Zero); |
|||
|
|||
if (this.Handle == IntPtr.Zero) |
|||
{ |
|||
throw new Win32Exception(); |
|||
} |
|||
} |
|||
|
|||
[SuppressMessage("Microsoft.StyleCop.CSharp.NamingRules", "SA1305:FieldNamesMustNotUseHungarianNotation", Justification = "Using Win32 naming for consistency.")] |
|||
private IntPtr WndProc(IntPtr hWnd, uint msg, IntPtr wParam, IntPtr lParam) |
|||
{ |
|||
switch ((UnmanagedMethods.WindowsMessage)msg) |
|||
{ |
|||
////case UnmanagedMethods.WindowsMessage.WM_DESTROY:
|
|||
//// this.OnClosed();
|
|||
//// break;
|
|||
|
|||
////case UnmanagedMethods.WindowsMessage.WM_KEYDOWN:
|
|||
//// InputManager.Current.ProcessInput(
|
|||
//// new RawKeyEventArgs(
|
|||
//// keyboard,
|
|||
//// RawKeyEventType.KeyDown,
|
|||
//// KeyInterop.KeyFromVirtualKey((int)wParam)));
|
|||
//// break;
|
|||
|
|||
////case UnmanagedMethods.WindowsMessage.WM_LBUTTONDOWN:
|
|||
//// InputManager.Current.ProcessInput(new RawMouseEventArgs(mouse, RawMouseEventType.LeftButtonDown));
|
|||
//// break;
|
|||
|
|||
////case UnmanagedMethods.WindowsMessage.WM_LBUTTONUP:
|
|||
//// InputManager.Current.ProcessInput(new RawMouseEventArgs(mouse, RawMouseEventType.LeftButtonUp));
|
|||
//// break;
|
|||
|
|||
////case UnmanagedMethods.WindowsMessage.WM_MOUSEMOVE:
|
|||
//// InputManager.Current.ProcessInput(new RawMouseEventArgs(mouse, RawMouseEventType.Move));
|
|||
//// break;
|
|||
|
|||
////case UnmanagedMethods.WindowsMessage.WM_SIZE:
|
|||
//// if (this.renderTarget != null)
|
|||
//// {
|
|||
//// this.renderTarget.Resize(new SharpDX.DrawingSize((int)lParam & 0xffff, (int)lParam >> 16));
|
|||
//// }
|
|||
|
|||
//// this.OnResized();
|
|||
//// return IntPtr.Zero;
|
|||
} |
|||
|
|||
return UnmanagedMethods.DefWindowProc(hWnd, msg, wParam, lParam); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,12 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<packages> |
|||
<package id="Rx-Core" version="2.1.30214.0" targetFramework="net45" /> |
|||
<package id="Rx-Interfaces" version="2.1.30214.0" targetFramework="net45" /> |
|||
<package id="Rx-Linq" version="2.1.30214.0" targetFramework="net45" /> |
|||
<package id="Rx-Main" version="2.1.30214.0" targetFramework="net45" /> |
|||
<package id="Rx-PlatformServices" version="2.1.30214.0" targetFramework="net45" /> |
|||
<package id="SharpDX" version="2.5.0" targetFramework="net45" /> |
|||
<package id="SharpDX.Direct2D1" version="2.5.0" targetFramework="net45" /> |
|||
<package id="SharpDX.DXGI" version="2.5.0" targetFramework="net45" /> |
|||
<package id="StyleCop.MSBuild" version="4.7.46.0" targetFramework="net45" /> |
|||
</packages> |
|||
@ -0,0 +1,40 @@ |
|||
|
|||
Microsoft Visual Studio Solution File, Format Version 12.00 |
|||
# Visual Studio 2013 |
|||
VisualStudioVersion = 12.0.21005.1 |
|||
MinimumVisualStudioVersion = 10.0.40219.1 |
|||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Perspex", "Perspex\Perspex.csproj", "{3C9F40DA-D2A5-43A1-A272-E965876C6D46}" |
|||
EndProject |
|||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Perspex.Windows", "Perspex.Windows\Perspex.Windows.csproj", "{811A76CF-1CF6-440F-963B-BBE31BD72A82}" |
|||
EndProject |
|||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestApplication", "TestApplication\TestApplication.csproj", "{E3A1060B-50D0-44E8-88B6-F44EF2E5BD72}" |
|||
EndProject |
|||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Perspex.UnitTests", "Perspex.UnitTests\Perspex.UnitTests.csproj", "{2905FF23-53FB-45E6-AA49-6AF47A172056}" |
|||
EndProject |
|||
Global |
|||
GlobalSection(SolutionConfigurationPlatforms) = preSolution |
|||
Debug|Any CPU = Debug|Any CPU |
|||
Release|Any CPU = Release|Any CPU |
|||
EndGlobalSection |
|||
GlobalSection(ProjectConfigurationPlatforms) = postSolution |
|||
{3C9F40DA-D2A5-43A1-A272-E965876C6D46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|||
{3C9F40DA-D2A5-43A1-A272-E965876C6D46}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|||
{3C9F40DA-D2A5-43A1-A272-E965876C6D46}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|||
{3C9F40DA-D2A5-43A1-A272-E965876C6D46}.Release|Any CPU.Build.0 = Release|Any CPU |
|||
{811A76CF-1CF6-440F-963B-BBE31BD72A82}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|||
{811A76CF-1CF6-440F-963B-BBE31BD72A82}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|||
{811A76CF-1CF6-440F-963B-BBE31BD72A82}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|||
{811A76CF-1CF6-440F-963B-BBE31BD72A82}.Release|Any CPU.Build.0 = Release|Any CPU |
|||
{E3A1060B-50D0-44E8-88B6-F44EF2E5BD72}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|||
{E3A1060B-50D0-44E8-88B6-F44EF2E5BD72}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|||
{E3A1060B-50D0-44E8-88B6-F44EF2E5BD72}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|||
{E3A1060B-50D0-44E8-88B6-F44EF2E5BD72}.Release|Any CPU.Build.0 = Release|Any CPU |
|||
{2905FF23-53FB-45E6-AA49-6AF47A172056}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|||
{2905FF23-53FB-45E6-AA49-6AF47A172056}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|||
{2905FF23-53FB-45E6-AA49-6AF47A172056}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|||
{2905FF23-53FB-45E6-AA49-6AF47A172056}.Release|Any CPU.Build.0 = Release|Any CPU |
|||
EndGlobalSection |
|||
GlobalSection(SolutionProperties) = preSolution |
|||
HideSolutionNode = FALSE |
|||
EndGlobalSection |
|||
EndGlobal |
|||
@ -0,0 +1,27 @@ |
|||
namespace Perspex.Controls |
|||
{ |
|||
using System.Diagnostics.Contracts; |
|||
using Perspex.Media; |
|||
|
|||
public class Border : Decorator |
|||
{ |
|||
public static readonly PerspexProperty<Brush> BackgroundProperty = |
|||
PerspexProperty.Register<Border, Brush>("Background"); |
|||
|
|||
public Brush Background |
|||
{ |
|||
get { return this.GetValue(BackgroundProperty); } |
|||
set { this.SetValue(BackgroundProperty, value); } |
|||
} |
|||
|
|||
public override void Render(IDrawingContext context) |
|||
{ |
|||
Brush background = this.Background; |
|||
|
|||
if (background != null) |
|||
{ |
|||
context.FillRectange(background, new Rect(this.Bounds.Size)); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,46 @@ |
|||
namespace Perspex.Controls |
|||
{ |
|||
using System.Linq; |
|||
|
|||
public abstract class ContentControl : TemplatedControl |
|||
{ |
|||
public static readonly PerspexProperty<object> ContentProperty = |
|||
PerspexProperty.Register<ContentControl, object>("Content"); |
|||
|
|||
public object Content |
|||
{ |
|||
get { return this.GetValue(ContentProperty); } |
|||
set { this.SetValue(ContentProperty, value); } |
|||
} |
|||
|
|||
protected override Size ArrangeContent(Size finalSize) |
|||
{ |
|||
Control child = this.VisualChildren.SingleOrDefault() as Control; |
|||
|
|||
if (child != null) |
|||
{ |
|||
child.Arrange(new Rect(finalSize)); |
|||
return child.Bounds.Size; |
|||
} |
|||
else |
|||
{ |
|||
return new Size(); |
|||
} |
|||
} |
|||
|
|||
protected override Size MeasureContent(Size availableSize) |
|||
{ |
|||
Control child = this.VisualChildren.SingleOrDefault() as Control; |
|||
|
|||
if (child != null) |
|||
{ |
|||
child.Measure(availableSize); |
|||
return child.DesiredSize.Value; |
|||
} |
|||
else |
|||
{ |
|||
return new Size(); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,131 @@ |
|||
namespace Perspex.Controls |
|||
{ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
|
|||
public class ContentPresenter : Control |
|||
{ |
|||
public static readonly PerspexProperty<object> ContentProperty = |
|||
ContentControl.ContentProperty.AddOwner<Control>(); |
|||
|
|||
public static readonly PerspexProperty<Func<object, Visual>> DataTemplateProperty = |
|||
PerspexProperty.Register<ContentPresenter, Func<object, Visual>>("DataTemplate"); |
|||
|
|||
private Visual visualChild; |
|||
|
|||
public object Content |
|||
{ |
|||
get { return this.GetValue(ContentProperty); } |
|||
set { this.SetValue(ContentProperty, value); } |
|||
} |
|||
|
|||
public Func<object, Visual> DataTemplate |
|||
{ |
|||
get { return this.GetValue(DataTemplateProperty); } |
|||
set { this.SetValue(DataTemplateProperty, value); } |
|||
} |
|||
|
|||
public override IEnumerable<Visual> VisualChildren |
|||
{ |
|||
get |
|||
{ |
|||
object content = this.Content; |
|||
var dataTemplate = this.DataTemplate; |
|||
|
|||
if (this.visualChild == null && content != null) |
|||
{ |
|||
if (content is Visual) |
|||
{ |
|||
this.visualChild = (Visual)content; |
|||
} |
|||
else if (dataTemplate != null) |
|||
{ |
|||
this.visualChild = dataTemplate(this); |
|||
} |
|||
else |
|||
{ |
|||
this.visualChild = new TextBlock |
|||
{ |
|||
Text = content.ToString(), |
|||
}; |
|||
} |
|||
} |
|||
|
|||
return Enumerable.Repeat(this.visualChild, this.visualChild != null ? 1 : 0); |
|||
} |
|||
} |
|||
|
|||
protected override Size ArrangeContent(Size finalSize) |
|||
{ |
|||
Control child = this.VisualChildren.SingleOrDefault() as Control; |
|||
|
|||
if (child != null) |
|||
{ |
|||
double left; |
|||
double top; |
|||
double width; |
|||
double height; |
|||
|
|||
switch (child.HorizontalAlignment) |
|||
{ |
|||
case HorizontalAlignment.Left: |
|||
left = 0; |
|||
width = child.DesiredSize.Value.Width; |
|||
break; |
|||
case HorizontalAlignment.Center: |
|||
left = (finalSize.Width / 2) - (child.DesiredSize.Value.Width / 2); |
|||
width = child.DesiredSize.Value.Width; |
|||
break; |
|||
case HorizontalAlignment.Right: |
|||
left = finalSize.Width - child.DesiredSize.Value.Width; |
|||
width = child.DesiredSize.Value.Width; |
|||
break; |
|||
default: |
|||
left = 0; |
|||
width = finalSize.Width; |
|||
break; |
|||
} |
|||
|
|||
switch (child.VerticalAlignment) |
|||
{ |
|||
case VerticalAlignment.Top: |
|||
top = 0; |
|||
height = child.DesiredSize.Value.Height; |
|||
break; |
|||
case VerticalAlignment.Center: |
|||
top = (finalSize.Height / 2) - (child.DesiredSize.Value.Height / 2); |
|||
height = child.DesiredSize.Value.Height; |
|||
break; |
|||
case VerticalAlignment.Bottom: |
|||
top = finalSize.Height - child.DesiredSize.Value.Height; |
|||
height = child.DesiredSize.Value.Height; |
|||
break; |
|||
default: |
|||
top = 0; |
|||
height = finalSize.Height; |
|||
break; |
|||
} |
|||
|
|||
child.Arrange(new Rect(left, top, width, height)); |
|||
} |
|||
|
|||
return finalSize; |
|||
} |
|||
|
|||
protected override Size MeasureContent(Size availableSize) |
|||
{ |
|||
Control child = this.VisualChildren.SingleOrDefault() as Control; |
|||
|
|||
if (child != null) |
|||
{ |
|||
child.Measure(availableSize); |
|||
return child.DesiredSize.Value; |
|||
} |
|||
else |
|||
{ |
|||
return new Size(); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,76 @@ |
|||
namespace Perspex.Controls |
|||
{ |
|||
using System.Diagnostics.Contracts; |
|||
|
|||
public enum HorizontalAlignment |
|||
{ |
|||
Stretch, |
|||
Left, |
|||
Center, |
|||
Right, |
|||
} |
|||
|
|||
public enum VerticalAlignment |
|||
{ |
|||
Stretch, |
|||
Top, |
|||
Center, |
|||
Bottom, |
|||
} |
|||
|
|||
public abstract class Control : Visual |
|||
{ |
|||
public static readonly PerspexProperty<HorizontalAlignment> HorizontalAlignmentProperty = |
|||
PerspexProperty.Register<Control, HorizontalAlignment>("HorizontalAlignment"); |
|||
|
|||
public static readonly PerspexProperty<VerticalAlignment> VerticalAlignmentProperty = |
|||
PerspexProperty.Register<Control, VerticalAlignment>("VerticalAlignment"); |
|||
|
|||
public static readonly PerspexProperty<Thickness> MarginProperty = |
|||
PerspexProperty.Register<Control, Thickness>("Margin"); |
|||
|
|||
public Size? DesiredSize |
|||
{ |
|||
get; |
|||
set; |
|||
} |
|||
|
|||
public HorizontalAlignment HorizontalAlignment |
|||
{ |
|||
get { return this.GetValue(HorizontalAlignmentProperty); } |
|||
set { this.SetValue(HorizontalAlignmentProperty, value); } |
|||
} |
|||
|
|||
public VerticalAlignment VerticalAlignment |
|||
{ |
|||
get { return this.GetValue(VerticalAlignmentProperty); } |
|||
set { this.SetValue(VerticalAlignmentProperty, value); } |
|||
} |
|||
|
|||
public Thickness Margin |
|||
{ |
|||
get { return this.GetValue(MarginProperty); } |
|||
set { this.SetValue(MarginProperty, value); } |
|||
} |
|||
|
|||
public void Arrange(Rect rect) |
|||
{ |
|||
this.Bounds = new Rect( |
|||
rect.Position, |
|||
this.ArrangeContent(rect.Size.Deflate(this.Margin).Constrain(rect.Size))); |
|||
} |
|||
|
|||
public void Measure(Size availableSize) |
|||
{ |
|||
availableSize = availableSize.Deflate(this.Margin); |
|||
this.DesiredSize = this.MeasureContent(availableSize).Constrain(availableSize); |
|||
} |
|||
|
|||
protected virtual Size ArrangeContent(Size finalSize) |
|||
{ |
|||
return finalSize; |
|||
} |
|||
|
|||
protected abstract Size MeasureContent(Size availableSize); |
|||
} |
|||
} |
|||
@ -0,0 +1,54 @@ |
|||
namespace Perspex.Controls |
|||
{ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
|
|||
public abstract class Decorator : Control |
|||
{ |
|||
public static readonly PerspexProperty<Control> ContentProperty = |
|||
PerspexProperty.Register<ContentControl, Control>("Content"); |
|||
|
|||
public Control Content |
|||
{ |
|||
get { return this.GetValue(ContentProperty); } |
|||
set { this.SetValue(ContentProperty, value); } |
|||
} |
|||
|
|||
public override IEnumerable<Visual> VisualChildren |
|||
{ |
|||
get |
|||
{ |
|||
Control content = this.Content; |
|||
return Enumerable.Repeat(content, content != null ? 1 : 0); |
|||
} |
|||
} |
|||
|
|||
protected override Size ArrangeContent(Size finalSize) |
|||
{ |
|||
Control content = this.Content; |
|||
|
|||
if (content != null) |
|||
{ |
|||
content.Arrange(new Rect(finalSize)); |
|||
} |
|||
|
|||
return finalSize; |
|||
} |
|||
|
|||
protected override Size MeasureContent(Size availableSize) |
|||
{ |
|||
Control content = this.Content; |
|||
|
|||
if (content != null) |
|||
{ |
|||
content.Measure(availableSize); |
|||
return content.DesiredSize.Value; |
|||
} |
|||
else |
|||
{ |
|||
return new Size(); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,47 @@ |
|||
namespace Perspex.Controls |
|||
{ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using Perspex.Media; |
|||
|
|||
public abstract class TemplatedControl : Control |
|||
{ |
|||
public static readonly PerspexProperty<Func<TemplatedControl, Visual>> TemplateProperty = |
|||
PerspexProperty.Register<TemplatedControl, Func<TemplatedControl, Visual>>("Template"); |
|||
|
|||
private Visual visualChild; |
|||
|
|||
public TemplatedControl() |
|||
{ |
|||
this.Template = owner => this.DefaultTemplate(); |
|||
} |
|||
|
|||
public Func<TemplatedControl, Visual> Template |
|||
{ |
|||
get { return this.GetValue(TemplateProperty); } |
|||
set { this.SetValue(TemplateProperty, value); } |
|||
} |
|||
|
|||
public override IEnumerable<Visual> VisualChildren |
|||
{ |
|||
get |
|||
{ |
|||
var template = this.Template; |
|||
|
|||
if (this.visualChild == null && template != null) |
|||
{ |
|||
this.visualChild = template(this); |
|||
} |
|||
|
|||
return Enumerable.Repeat(this.visualChild, this.visualChild != null ? 1 : 0); |
|||
} |
|||
} |
|||
|
|||
public sealed override void Render(IDrawingContext context) |
|||
{ |
|||
} |
|||
|
|||
protected abstract Visual DefaultTemplate(); |
|||
} |
|||
} |
|||
@ -0,0 +1,68 @@ |
|||
namespace Perspex.Controls |
|||
{ |
|||
using Perspex.Media; |
|||
|
|||
public class TextBlock : Control |
|||
{ |
|||
public static readonly PerspexProperty<Brush> BackgroundProperty = |
|||
Border.BackgroundProperty.AddOwner<TextBlock>(); |
|||
|
|||
public static readonly PerspexProperty<Brush> ForegroundProperty = |
|||
PerspexProperty.Register<Border, Brush>( |
|||
"Foreground", |
|||
defaultValue: new SolidColorBrush(0xff000000), |
|||
inherits: true); |
|||
|
|||
public static readonly PerspexProperty<string> TextProperty = |
|||
PerspexProperty.Register<Border, string>("Text"); |
|||
|
|||
public Brush Background |
|||
{ |
|||
get { return this.GetValue(BackgroundProperty); } |
|||
set { this.SetValue(BackgroundProperty, value); } |
|||
} |
|||
|
|||
public Brush Foreground |
|||
{ |
|||
get { return this.GetValue(ForegroundProperty); } |
|||
set { this.SetValue(ForegroundProperty, value); } |
|||
} |
|||
|
|||
public string Text |
|||
{ |
|||
get { return this.GetValue(TextProperty); } |
|||
set { this.SetValue(TextProperty, value); } |
|||
} |
|||
|
|||
private FormattedText FormattedText |
|||
{ |
|||
get |
|||
{ |
|||
return new FormattedText |
|||
{ |
|||
FontFamilyName = "Segoe UI", |
|||
FontSize = 18, |
|||
Text = this.Text, |
|||
}; |
|||
} |
|||
} |
|||
|
|||
public override void Render(IDrawingContext context) |
|||
{ |
|||
Brush background = this.Background; |
|||
|
|||
if (background != null) |
|||
{ |
|||
context.FillRectange(background, this.Bounds); |
|||
} |
|||
|
|||
context.DrawText(this.Foreground, this.Bounds, this.FormattedText); |
|||
} |
|||
|
|||
protected override Size MeasureContent(Size availableSize) |
|||
{ |
|||
ITextService service = ServiceLocator.Get<ITextService>(); |
|||
return service.Measure(this.FormattedText); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,15 @@ |
|||
// -----------------------------------------------------------------------
|
|||
// <copyright file="Brush.cs" company="Steven Kirk">
|
|||
// Copyright 2013 MIT Licence. See licence.md for more information.
|
|||
// </copyright>
|
|||
// -----------------------------------------------------------------------
|
|||
|
|||
namespace Perspex.Media |
|||
{ |
|||
/// <summary>
|
|||
/// Describes how an area is painted.
|
|||
/// </summary>
|
|||
public abstract class Brush |
|||
{ |
|||
} |
|||
} |
|||
@ -0,0 +1,110 @@ |
|||
// -----------------------------------------------------------------------
|
|||
// <copyright file="Color.cs" company="Steven Kirk">
|
|||
// Copyright 2013 MIT Licence. See licence.md for more information.
|
|||
// </copyright>
|
|||
// -----------------------------------------------------------------------
|
|||
|
|||
namespace Perspex.Media |
|||
{ |
|||
/// <summary>
|
|||
/// An ARGB color.
|
|||
/// </summary>
|
|||
public struct Color |
|||
{ |
|||
/// <summary>
|
|||
/// Gets or sets the Alpha component of the color.
|
|||
/// </summary>
|
|||
public byte A { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// Gets or sets the Red component of the color.
|
|||
/// </summary>
|
|||
public byte R { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// Gets or sets the Green component of the color.
|
|||
/// </summary>
|
|||
public byte G { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// Gets or sets the Blue component of the color.
|
|||
/// </summary>
|
|||
public byte B { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// Creates a <see cref="Color"/> from alpha, red, green and blue components.
|
|||
/// </summary>
|
|||
/// <param name="a">The alpha component.</param>
|
|||
/// <param name="r">The red component.</param>
|
|||
/// <param name="g">The green component.</param>
|
|||
/// <param name="b">The blue component.</param>
|
|||
/// <returns>The color.</returns>
|
|||
public static Color FromArgb(byte a, byte r, byte g, byte b) |
|||
{ |
|||
return new Color |
|||
{ |
|||
A = a, |
|||
R = r, |
|||
G = g, |
|||
B = b, |
|||
}; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Creates a <see cref="Color"/> from red, green and blue components.
|
|||
/// </summary>
|
|||
/// <param name="r">The red component.</param>
|
|||
/// <param name="g">The green component.</param>
|
|||
/// <param name="b">The blue component.</param>
|
|||
/// <returns>The color.</returns>
|
|||
public static Color FromRgb(byte r, byte g, byte b) |
|||
{ |
|||
return new Color |
|||
{ |
|||
A = 0xff, |
|||
R = r, |
|||
G = g, |
|||
B = b, |
|||
}; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Creates a <see cref="Color"/> from an integer.
|
|||
/// </summary>
|
|||
/// <param name="value">The integer value.</param>
|
|||
/// <returns>The color.</returns>
|
|||
public static Color FromUInt32(uint value) |
|||
{ |
|||
return new Color |
|||
{ |
|||
A = (byte)((value >> 24) & 0xff), |
|||
R = (byte)((value >> 16) & 0xff), |
|||
G = (byte)((value >> 8) & 0xff), |
|||
B = (byte)(value & 0xff), |
|||
}; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Returns the string representation of the color.
|
|||
/// </summary>
|
|||
/// <returns>
|
|||
/// The string representation of the color.
|
|||
/// </returns>
|
|||
public override string ToString() |
|||
{ |
|||
uint rgb = ((uint)this.A << 24) | ((uint)this.R << 16) | ((uint)this.G << 8) | (uint)this.B; |
|||
return string.Format("#{0:x8}", rgb); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Returns the integer representation of the color.
|
|||
/// </summary>
|
|||
/// <returns>
|
|||
/// The integer representation of the color.
|
|||
/// </returns>
|
|||
public uint ToUint32() |
|||
{ |
|||
return ((uint)this.A << 24) | ((uint)this.R << 16) | ((uint)this.G << 8) | (uint)this.B; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,17 @@ |
|||
// -----------------------------------------------------------------------
|
|||
// <copyright file="FormattedText.cs" company="Steven Kirk">
|
|||
// Copyright 2013 MIT Licence. See licence.md for more information.
|
|||
// </copyright>
|
|||
// -----------------------------------------------------------------------
|
|||
|
|||
namespace Perspex.Media |
|||
{ |
|||
public class FormattedText |
|||
{ |
|||
public string FontFamilyName { get; set; } |
|||
|
|||
public double FontSize { get; set; } |
|||
|
|||
public string Text { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,36 @@ |
|||
// -----------------------------------------------------------------------
|
|||
// <copyright file="IDrawingContext.cs" company="Steven Kirk">
|
|||
// Copyright 2013 MIT Licence. See licence.md for more information.
|
|||
// </copyright>
|
|||
// -----------------------------------------------------------------------
|
|||
|
|||
namespace Perspex.Media |
|||
{ |
|||
/// <summary>
|
|||
/// Defines the interface through which drawing occurs.
|
|||
/// </summary>
|
|||
public interface IDrawingContext |
|||
{ |
|||
/// <summary>
|
|||
/// Draws the outline of a rectangle.
|
|||
/// </summary>
|
|||
/// <param name="pen">The pen.</param>
|
|||
/// <param name="rect">The rectangle bounds.</param>
|
|||
void DrawRectange(Pen pen, Rect rect); |
|||
|
|||
/// <summary>
|
|||
/// Draws text.
|
|||
/// </summary>
|
|||
/// <param name="foreground">The foreground brush.</param>
|
|||
/// <param name="rect">The bounding rectangle.</param>
|
|||
/// <param name="text">The text.</param>
|
|||
void DrawText(Brush foreground, Rect rect, FormattedText text); |
|||
|
|||
/// <summary>
|
|||
/// Draws a filled rectangle.
|
|||
/// </summary>
|
|||
/// <param name="brush">The brush.</param>
|
|||
/// <param name="rect">The rectangle bounds.</param>
|
|||
void FillRectange(Brush brush, Rect rect); |
|||
} |
|||
} |
|||
@ -0,0 +1,7 @@ |
|||
namespace Perspex.Media |
|||
{ |
|||
public interface ITextService |
|||
{ |
|||
Size Measure(FormattedText text); |
|||
} |
|||
} |
|||
@ -0,0 +1,46 @@ |
|||
// -----------------------------------------------------------------------
|
|||
// <copyright file="Pen.cs" company="Steven Kirk">
|
|||
// Copyright 2013 MIT Licence. See licence.md for more information.
|
|||
// </copyright>
|
|||
// -----------------------------------------------------------------------
|
|||
|
|||
namespace Perspex.Media |
|||
{ |
|||
/// <summary>
|
|||
/// Describes how a stroke is drawn.
|
|||
/// </summary>
|
|||
public class Pen |
|||
{ |
|||
/// <summary>
|
|||
/// Initializes a new instance of the <see cref="Pen"/> class.
|
|||
/// </summary>
|
|||
/// <param name="brush">The brush used to draw.</param>
|
|||
/// <param name="thickness">The stroke thickness.</param>
|
|||
public Pen(Brush brush, double thickness) |
|||
{ |
|||
this.Brush = brush; |
|||
this.Thickness = thickness; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Initializes a new instance of the <see cref="Pen"/> class.
|
|||
/// </summary>
|
|||
/// <param name="color">The stroke color.</param>
|
|||
/// <param name="thickness">The stroke thickness.</param>
|
|||
public Pen(uint color, double thickness) |
|||
{ |
|||
this.Brush = new SolidColorBrush(color); |
|||
this.Thickness = thickness; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Gets the brush used to draw the stroke.
|
|||
/// </summary>
|
|||
public Brush Brush { get; private set; } |
|||
|
|||
/// <summary>
|
|||
/// Gets the stroke thickness.
|
|||
/// </summary>
|
|||
public double Thickness { get; private set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,41 @@ |
|||
// -----------------------------------------------------------------------
|
|||
// <copyright file="SolidColorBrush.cs" company="Steven Kirk">
|
|||
// Copyright 2013 MIT Licence. See licence.md for more information.
|
|||
// </copyright>
|
|||
// -----------------------------------------------------------------------
|
|||
|
|||
namespace Perspex.Media |
|||
{ |
|||
/// <summary>
|
|||
/// Fills an area with a solid color.
|
|||
/// </summary>
|
|||
public class SolidColorBrush : Brush |
|||
{ |
|||
/// <summary>
|
|||
/// Initializes a new instance of the <see cref="SolidColorBrush"/> class.
|
|||
/// </summary>
|
|||
/// <param name="color">The color to use.</param>
|
|||
public SolidColorBrush(Color color) |
|||
{ |
|||
this.Color = color; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Initializes a new instance of the <see cref="SolidColorBrush"/> class.
|
|||
/// </summary>
|
|||
/// <param name="color">The color to use.</param>
|
|||
public SolidColorBrush(uint color) |
|||
: this(Color.FromUInt32(color)) |
|||
{ |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Gets the color of the brush.
|
|||
/// </summary>
|
|||
public Color Color |
|||
{ |
|||
get; |
|||
private set; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,142 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
|||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> |
|||
<PropertyGroup> |
|||
<MinimumVisualStudioVersion>11.0</MinimumVisualStudioVersion> |
|||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
|||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> |
|||
<ProjectGuid>{3C9F40DA-D2A5-43A1-A272-E965876C6D46}</ProjectGuid> |
|||
<OutputType>Library</OutputType> |
|||
<AppDesignerFolder>Properties</AppDesignerFolder> |
|||
<RootNamespace>Perspex</RootNamespace> |
|||
<AssemblyName>Perspex</AssemblyName> |
|||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion> |
|||
<TargetFrameworkProfile>Profile7</TargetFrameworkProfile> |
|||
<FileAlignment>512</FileAlignment> |
|||
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> |
|||
<CodeContractsAssemblyMode>1</CodeContractsAssemblyMode> |
|||
</PropertyGroup> |
|||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> |
|||
<DebugSymbols>true</DebugSymbols> |
|||
<DebugType>full</DebugType> |
|||
<Optimize>false</Optimize> |
|||
<OutputPath>bin\Debug\</OutputPath> |
|||
<DefineConstants>DEBUG;TRACE</DefineConstants> |
|||
<ErrorReport>prompt</ErrorReport> |
|||
<WarningLevel>4</WarningLevel> |
|||
<CodeContractsEnableRuntimeChecking>True</CodeContractsEnableRuntimeChecking> |
|||
<CodeContractsRuntimeOnlyPublicSurface>False</CodeContractsRuntimeOnlyPublicSurface> |
|||
<CodeContractsRuntimeThrowOnFailure>True</CodeContractsRuntimeThrowOnFailure> |
|||
<CodeContractsRuntimeCallSiteRequires>False</CodeContractsRuntimeCallSiteRequires> |
|||
<CodeContractsRuntimeSkipQuantifiers>False</CodeContractsRuntimeSkipQuantifiers> |
|||
<CodeContractsRunCodeAnalysis>True</CodeContractsRunCodeAnalysis> |
|||
<CodeContractsNonNullObligations>True</CodeContractsNonNullObligations> |
|||
<CodeContractsBoundsObligations>True</CodeContractsBoundsObligations> |
|||
<CodeContractsArithmeticObligations>False</CodeContractsArithmeticObligations> |
|||
<CodeContractsEnumObligations>False</CodeContractsEnumObligations> |
|||
<CodeContractsRedundantAssumptions>False</CodeContractsRedundantAssumptions> |
|||
<CodeContractsMissingPublicRequiresAsWarnings>True</CodeContractsMissingPublicRequiresAsWarnings> |
|||
<CodeContractsInferRequires>True</CodeContractsInferRequires> |
|||
<CodeContractsInferEnsures>False</CodeContractsInferEnsures> |
|||
<CodeContractsInferObjectInvariants>False</CodeContractsInferObjectInvariants> |
|||
<CodeContractsSuggestAssumptions>False</CodeContractsSuggestAssumptions> |
|||
<CodeContractsSuggestRequires>True</CodeContractsSuggestRequires> |
|||
<CodeContractsSuggestObjectInvariants>False</CodeContractsSuggestObjectInvariants> |
|||
<CodeContractsRunInBackground>True</CodeContractsRunInBackground> |
|||
<CodeContractsShowSquigglies>True</CodeContractsShowSquigglies> |
|||
<CodeContractsUseBaseLine>False</CodeContractsUseBaseLine> |
|||
<CodeContractsEmitXMLDocs>False</CodeContractsEmitXMLDocs> |
|||
<CodeContractsCustomRewriterAssembly /> |
|||
<CodeContractsCustomRewriterClass /> |
|||
<CodeContractsLibPaths /> |
|||
<CodeContractsExtraRewriteOptions /> |
|||
<CodeContractsExtraAnalysisOptions /> |
|||
<CodeContractsSQLServerOption /> |
|||
<CodeContractsBaseLineFile /> |
|||
<CodeContractsCacheAnalysisResults>True</CodeContractsCacheAnalysisResults> |
|||
<CodeContractsFailBuildOnWarnings>False</CodeContractsFailBuildOnWarnings> |
|||
<CodeContractsRuntimeCheckingLevel>Full</CodeContractsRuntimeCheckingLevel> |
|||
<CodeContractsReferenceAssembly>%28none%29</CodeContractsReferenceAssembly> |
|||
<CodeContractsAnalysisWarningLevel>0</CodeContractsAnalysisWarningLevel> |
|||
</PropertyGroup> |
|||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> |
|||
<DebugType>pdbonly</DebugType> |
|||
<Optimize>true</Optimize> |
|||
<OutputPath>bin\Release\</OutputPath> |
|||
<DefineConstants>TRACE</DefineConstants> |
|||
<ErrorReport>prompt</ErrorReport> |
|||
<WarningLevel>4</WarningLevel> |
|||
</PropertyGroup> |
|||
<ItemGroup> |
|||
<Compile Include="Controls\Border.cs" /> |
|||
<Compile Include="Controls\ContentPresenter.cs" /> |
|||
<Compile Include="Controls\Decorator.cs" /> |
|||
<Compile Include="Controls\ContentControl.cs" /> |
|||
<Compile Include="Controls\Control.cs" /> |
|||
<Compile Include="Controls\TextBlock.cs" /> |
|||
<Compile Include="Media\FormattedText.cs" /> |
|||
<Compile Include="Media\IDrawingContext.cs" /> |
|||
<Compile Include="Media\Brush.cs" /> |
|||
<Compile Include="Media\Color.cs" /> |
|||
<Compile Include="Media\ITextService.cs" /> |
|||
<Compile Include="Media\Pen.cs" /> |
|||
<Compile Include="Media\SolidColorBrush.cs" /> |
|||
<Compile Include="PerspexObject.cs" /> |
|||
<Compile Include="PerspexProperty.cs" /> |
|||
<Compile Include="PerspexPropertyChangedEventArgs.cs" /> |
|||
<Compile Include="Point.cs" /> |
|||
<Compile Include="ReadOnlyPerspexProperty.cs" /> |
|||
<Compile Include="ServiceLocator.cs" /> |
|||
<Compile Include="Size.cs" /> |
|||
<Compile Include="Rect.cs" /> |
|||
<Compile Include="Controls\TemplatedControl.cs" /> |
|||
<Compile Include="Thickness.cs" /> |
|||
<Compile Include="Visual.cs" /> |
|||
<Compile Include="Properties\AssemblyInfo.cs" /> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<Reference Include="System.Reactive.Core"> |
|||
<HintPath>..\packages\Rx-Core.2.1.30214.0\lib\Portable-Net45+WinRT45+WP8\System.Reactive.Core.dll</HintPath> |
|||
</Reference> |
|||
<Reference Include="System.Reactive.Interfaces"> |
|||
<HintPath>..\packages\Rx-Interfaces.2.1.30214.0\lib\Portable-Net45+WinRT45+WP8\System.Reactive.Interfaces.dll</HintPath> |
|||
</Reference> |
|||
<Reference Include="System.Reactive.Linq"> |
|||
<HintPath>..\packages\Rx-Linq.2.1.30214.0\lib\Portable-Net45+WinRT45+WP8\System.Reactive.Linq.dll</HintPath> |
|||
</Reference> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<None Include="packages.config" /> |
|||
</ItemGroup> |
|||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" /> |
|||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. |
|||
Other similar extension points exist, see Microsoft.Common.targets. |
|||
<Target Name="BeforeBuild"> |
|||
</Target> |
|||
<Target Name="AfterBuild"> |
|||
</Target> |
|||
--> |
|||
<PropertyGroup> |
|||
<StyleCopMSBuildTargetsFile>..\packages\StyleCop.MSBuild.4.7.46.0\tools\StyleCop.targets</StyleCopMSBuildTargetsFile> |
|||
</PropertyGroup> |
|||
<Import Condition="Exists('$(StyleCopMSBuildTargetsFile)')" Project="$(StyleCopMSBuildTargetsFile)" /> |
|||
<PropertyGroup> |
|||
<StyleCopMSBuildMessageMissing>Failed to import StyleCop.MSBuild targets from '$(StyleCopMSBuildTargetsFile)'. The StyleCop.MSBuild package was either missing or incomplete when the project was loaded. Ensure that the package is present and then restart the build. If you are using an IDE (e.g. Visual Studio), reload the project before restarting the build.</StyleCopMSBuildMessageMissing> |
|||
<StyleCopMSBuildMessagePresent>Failed to import StyleCop.MSBuild targets from '$(StyleCopMSBuildTargetsFile)'. The StyleCop.MSBuild package was either missing or incomplete when the project was loaded (but is now present). To fix this, restart the build. If you are using an IDE (e.g. Visual Studio), reload the project before restarting the build.</StyleCopMSBuildMessagePresent> |
|||
<StyleCopMSBuildMessageRestore>Failed to import StyleCop.MSBuild targets from '$(StyleCopMSBuildTargetsFile)'. The StyleCop.MSBuild package was either missing or incomplete when the project was loaded. To fix this, restore the package and then restart the build. If you are using an IDE (e.g. Visual Studio), you may need to reload the project before restarting the build. Note that regular NuGet package restore (during build) does not work with this package because the package needs to be present before the project is loaded. If this is an automated build (e.g. CI server), you may want to ensure that the build process restores the StyleCop.MSBuild package before the project is built.</StyleCopMSBuildMessageRestore> |
|||
<StyleCopMSBuildMessageRestored>Failed to import StyleCop.MSBuild targets from '$(StyleCopMSBuildTargetsFile)'. The StyleCop.MSBuild package was either missing or incomplete when the project was loaded (but is now present). To fix this, restart the build. If you are using an IDE (e.g. Visual Studio), reload the project before restarting the build. Note that when using regular NuGet package restore (during build) the package will not be available for the initial build because the package needs to be present before the project is loaded. If package restore executes successfully in the intitial build then the package will be available for subsequent builds. If this is an automated build (e.g. CI server), you may want to ensure that the build process restores the StyleCop.MSBuild package before the initial build.</StyleCopMSBuildMessageRestored> |
|||
</PropertyGroup> |
|||
<Target Name="StyleCopMSBuildTargetsNotFound"> |
|||
<Warning Condition="!Exists('$(StyleCopMSBuildTargetsFile)') And $(RestorePackages)!=true And $(StyleCopTreatErrorsAsWarnings)!=false" Text="$(StyleCopMSBuildMessageMissing)" /> |
|||
<Warning Condition="Exists('$(StyleCopMSBuildTargetsFile)') And $(RestorePackages)!=true And $(StyleCopTreatErrorsAsWarnings)!=false" Text="$(StyleCopMSBuildMessagePresent)" /> |
|||
<Warning Condition="!Exists('$(StyleCopMSBuildTargetsFile)') And $(RestorePackages)==true And $(StyleCopTreatErrorsAsWarnings)!=false" Text="$(StyleCopMSBuildMessageRestore)" /> |
|||
<Warning Condition="Exists('$(StyleCopMSBuildTargetsFile)') And $(RestorePackages)==true And $(StyleCopTreatErrorsAsWarnings)!=false" Text="$(StyleCopMSBuildMessageRestored)" /> |
|||
<Error Condition="!Exists('$(StyleCopMSBuildTargetsFile)') And $(RestorePackages)!=true And $(StyleCopTreatErrorsAsWarnings)==false" Text="$(StyleCopMSBuildMessageMissing)" /> |
|||
<Error Condition="Exists('$(StyleCopMSBuildTargetsFile)') And $(RestorePackages)!=true And $(StyleCopTreatErrorsAsWarnings)==false" Text="$(StyleCopMSBuildMessagePresent)" /> |
|||
<Error Condition="!Exists('$(StyleCopMSBuildTargetsFile)') And $(RestorePackages)==true And $(StyleCopTreatErrorsAsWarnings)==false" Text="$(StyleCopMSBuildMessageRestore)" /> |
|||
<Error Condition="Exists('$(StyleCopMSBuildTargetsFile)') And $(RestorePackages)==true And $(StyleCopTreatErrorsAsWarnings)==false" Text="$(StyleCopMSBuildMessageRestored)" /> |
|||
</Target> |
|||
<PropertyGroup> |
|||
<PrepareForBuildDependsOn Condition="!Exists('$(StyleCopMSBuildTargetsFile)')">StyleCopMSBuildTargetsNotFound;$(PrepareForBuildDependsOn)</PrepareForBuildDependsOn> |
|||
</PropertyGroup> |
|||
</Project> |
|||
@ -0,0 +1,352 @@ |
|||
// -----------------------------------------------------------------------
|
|||
// <copyright file="PerspexObject.cs" company="Tricycle">
|
|||
// Copyright 2013 Tricycle. All rights reserved.
|
|||
// </copyright>
|
|||
// -----------------------------------------------------------------------
|
|||
|
|||
namespace Perspex |
|||
{ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Diagnostics.Contracts; |
|||
using System.Linq; |
|||
using System.Reactive; |
|||
using System.Reactive.Linq; |
|||
using System.Reflection; |
|||
|
|||
/// <summary>
|
|||
/// An object with <see cref="PerspexProperty"/> support.
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// This class is analogous to DependencyObject in WPF.
|
|||
/// </remarks>
|
|||
public class PerspexObject |
|||
{ |
|||
/// <summary>
|
|||
/// The registered properties by type.
|
|||
/// </summary>
|
|||
private static Dictionary<Type, List<PerspexProperty>> registered = |
|||
new Dictionary<Type, List<PerspexProperty>>(); |
|||
|
|||
/// <summary>
|
|||
/// The parent object that inherited values are inherited from.
|
|||
/// </summary>
|
|||
private PerspexObject inheritanceParent; |
|||
|
|||
/// <summary>
|
|||
/// The set values on this object.
|
|||
/// </summary>
|
|||
private Dictionary<PerspexProperty, object> values = |
|||
new Dictionary<PerspexProperty, object>(); |
|||
|
|||
/// <summary>
|
|||
/// The current bindings on this object.
|
|||
/// </summary>
|
|||
private Dictionary<PerspexProperty, IDisposable> bindings = |
|||
new Dictionary<PerspexProperty, IDisposable>(); |
|||
|
|||
/// <summary>
|
|||
/// Raised when a <see cref="PerspexProperty"/> value changes on this object/
|
|||
/// </summary>
|
|||
public event EventHandler<PerspexPropertyChangedEventArgs> PropertyChanged; |
|||
|
|||
/// <summary>
|
|||
/// Gets or sets the parent object that inherited <see cref="PerspexProperty"/> values
|
|||
/// are inherited from.
|
|||
/// </summary>
|
|||
protected PerspexObject InheritanceParent |
|||
{ |
|||
get |
|||
{ |
|||
return this.inheritanceParent; |
|||
} |
|||
|
|||
set |
|||
{ |
|||
if (this.inheritanceParent != value) |
|||
{ |
|||
if (this.inheritanceParent != null) |
|||
{ |
|||
this.inheritanceParent.PropertyChanged -= this.ParentPropertyChanged; |
|||
} |
|||
|
|||
var inherited = (from property in GetProperties(this.GetType()) |
|||
where property.Inherits |
|||
select new |
|||
{ |
|||
Property = property, |
|||
Value = this.GetValue(property), |
|||
}).ToList(); |
|||
|
|||
this.inheritanceParent = value; |
|||
|
|||
foreach (var i in inherited) |
|||
{ |
|||
object newValue = this.GetValue(i.Property); |
|||
|
|||
if (!object.Equals(i.Value, newValue)) |
|||
{ |
|||
this.RaisePropertyChanged(i.Property, i.Value, newValue); |
|||
} |
|||
} |
|||
|
|||
if (this.inheritanceParent != null) |
|||
{ |
|||
this.inheritanceParent.PropertyChanged += this.ParentPropertyChanged; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Gets all <see cref="PerspexProperty"/>s registered on a type.
|
|||
/// </summary>
|
|||
/// <param name="type">The type.</param>
|
|||
/// <returns>A collection of <see cref="PerspexProperty"/> definitions.</returns>
|
|||
public static IEnumerable<PerspexProperty> GetProperties(Type type) |
|||
{ |
|||
Contract.Requires<NullReferenceException>(type != null); |
|||
|
|||
TypeInfo i = type.GetTypeInfo(); |
|||
|
|||
while (type != null) |
|||
{ |
|||
List<PerspexProperty> list; |
|||
|
|||
if (registered.TryGetValue(type, out list)) |
|||
{ |
|||
foreach (PerspexProperty p in list) |
|||
{ |
|||
yield return p; |
|||
} |
|||
} |
|||
|
|||
type = type.GetTypeInfo().BaseType; |
|||
} |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Registers a <see cref="PerspexProperty"/> on a type.
|
|||
/// </summary>
|
|||
/// <param name="type">The type.</param>
|
|||
/// <param name="property">The property.</param>
|
|||
/// <remarks>
|
|||
/// You won't usually want to call this method directly, instead use the
|
|||
/// <see cref="PerspexProperty.Register"/> method.
|
|||
/// </remarks>
|
|||
public static void Register(Type type, PerspexProperty property) |
|||
{ |
|||
Contract.Requires<NullReferenceException>(type != null); |
|||
Contract.Requires<NullReferenceException>(property != null); |
|||
|
|||
List<PerspexProperty> list; |
|||
|
|||
if (!registered.TryGetValue(type, out list)) |
|||
{ |
|||
list = new List<PerspexProperty>(); |
|||
registered.Add(type, list); |
|||
} |
|||
|
|||
if (!list.Contains(property)) |
|||
{ |
|||
list.Add(property); |
|||
} |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Binds a property on this object to an observable.
|
|||
/// </summary>
|
|||
/// <typeparam name="T">The type of the property.</typeparam>
|
|||
/// <param name="target">The target property.</param>
|
|||
/// <param name="source">The observable.</param>
|
|||
/// <returns>A disposable binding.</returns>
|
|||
public void Bind<T>(PerspexProperty<T> target, IObservable<T> source) |
|||
{ |
|||
Contract.Requires<NullReferenceException>(target != null); |
|||
Contract.Requires<NullReferenceException>(source != null); |
|||
|
|||
this.ClearBinding(target); |
|||
|
|||
IDisposable binding = source.Subscribe(Observer.Create<T>(value => |
|||
{ |
|||
this.SetValue(target, value); |
|||
})); |
|||
|
|||
this.bindings.Add(target, binding); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Clears a binding on a <see cref="PerspexProperty"/>, leaving the last bound value in
|
|||
/// place.
|
|||
/// </summary>
|
|||
/// <param name="property">The property.</param>
|
|||
public void ClearBinding(PerspexProperty property) |
|||
{ |
|||
Contract.Requires<NullReferenceException>(property != null); |
|||
IDisposable binding; |
|||
|
|||
if (this.bindings.TryGetValue(property, out binding)) |
|||
{ |
|||
binding.Dispose(); |
|||
this.bindings.Remove(property); |
|||
} |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Clears a <see cref="PerspexProperty"/> value, including its bindings.
|
|||
/// </summary>
|
|||
/// <param name="property">The property.</param>
|
|||
public void ClearValue(PerspexProperty property) |
|||
{ |
|||
Contract.Requires<NullReferenceException>(property != null); |
|||
this.ClearBinding(property); |
|||
this.values.Remove(property); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Gets an observable for a <see cref="PerspexProperty"/>.
|
|||
/// </summary>
|
|||
/// <typeparam name="T"></typeparam>
|
|||
/// <param name="property"></param>
|
|||
/// <returns></returns>
|
|||
public IObservable<T> GetObservable<T>(PerspexProperty<T> property) |
|||
{ |
|||
return Observable.Create<T>(observer => |
|||
{ |
|||
EventHandler<PerspexPropertyChangedEventArgs> handler = (s, e) => |
|||
{ |
|||
if (e.Property == property) |
|||
{ |
|||
observer.OnNext((T)e.NewValue); |
|||
} |
|||
}; |
|||
|
|||
this.PropertyChanged += handler; |
|||
observer.OnNext(this.GetValue(property)); |
|||
|
|||
return () => |
|||
{ |
|||
this.PropertyChanged -= handler; |
|||
}; |
|||
}); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Gets a <see cref="PerspexProperty"/> value.
|
|||
/// </summary>
|
|||
/// <param name="property">The property.</param>
|
|||
/// <returns>The value.</returns>
|
|||
public object GetValue(PerspexProperty property) |
|||
{ |
|||
Contract.Requires<NullReferenceException>(property != null); |
|||
|
|||
object value; |
|||
|
|||
if (!this.values.TryGetValue(property, out value)) |
|||
{ |
|||
if (property.Inherits && this.inheritanceParent != null) |
|||
{ |
|||
value = this.inheritanceParent.GetValue(property); |
|||
} |
|||
else |
|||
{ |
|||
value = property.GetDefaultValue(this.GetType()); |
|||
} |
|||
} |
|||
|
|||
return value; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Gets a <see cref="PerspexProperty"/> value.
|
|||
/// </summary>
|
|||
/// <param name="property">The property.</param>
|
|||
/// <returns>The value.</returns>
|
|||
public T GetValue<T>(PerspexProperty<T> property) |
|||
{ |
|||
Contract.Requires<NullReferenceException>(property != null); |
|||
|
|||
return (T)this.GetValue((PerspexProperty)property); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Gets a <see cref="ReadOnlyPerspexProperty"/> value.
|
|||
/// </summary>
|
|||
/// <typeparam name="T">The type of the property.</typeparam>
|
|||
/// <param name="property">The property.</param>
|
|||
/// <returns>The value.</returns>
|
|||
public T GetValue<T>(ReadOnlyPerspexProperty<T> property) |
|||
{ |
|||
Contract.Requires<NullReferenceException>(property != null); |
|||
|
|||
return (T)this.GetValue(property.Property); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Checks whether a <see cref="PerspexProperty"/> is set on this object.
|
|||
/// </summary>
|
|||
/// <param name="property"></param>
|
|||
/// <returns></returns>
|
|||
public bool IsSet(PerspexProperty property) |
|||
{ |
|||
Contract.Requires<NullReferenceException>(property != null); |
|||
|
|||
return this.values.ContainsKey(property); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Sets a <see cref="PerspexProperty"/> value.
|
|||
/// </summary>
|
|||
/// <typeparam name="T">The type of the property.</typeparam>
|
|||
/// <param name="property">The property.</param>
|
|||
/// <param name="value">The value.</param>
|
|||
public void SetValue<T>(PerspexProperty<T> property, T value) |
|||
{ |
|||
Contract.Requires<NullReferenceException>(property != null); |
|||
|
|||
this.ClearBinding(property); |
|||
|
|||
T oldValue = this.GetValue(property); |
|||
|
|||
if (!object.Equals(oldValue, value)) |
|||
{ |
|||
this.values[property] = value; |
|||
this.RaisePropertyChanged(property, oldValue, value); |
|||
} |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Called when a property is changed on the current <see cref="InheritanceParent"/>.
|
|||
/// </summary>
|
|||
/// <param name="sender">The event sender.</param>
|
|||
/// <param name="e">The event args.</param>
|
|||
/// <remarks>
|
|||
/// Checks for changes in an inherited property value.
|
|||
/// </remarks>
|
|||
private void ParentPropertyChanged(object sender, PerspexPropertyChangedEventArgs e) |
|||
{ |
|||
if (e.Property.Inherits && !this.IsSet(e.Property)) |
|||
{ |
|||
this.RaisePropertyChanged(e.Property, e.OldValue, e.NewValue); |
|||
} |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Raises the <see cref="PropertyChanged"/> event.
|
|||
/// </summary>
|
|||
/// <param name="property">The property that has changed.</param>
|
|||
/// <param name="oldValue">The old property value.</param>
|
|||
/// <param name="newValue">The new property value.</param>
|
|||
private void RaisePropertyChanged(PerspexProperty property, object oldValue, object newValue) |
|||
{ |
|||
Contract.Requires<NullReferenceException>(property != null); |
|||
|
|||
if (this.PropertyChanged != null) |
|||
{ |
|||
this.PropertyChanged( |
|||
this, |
|||
new PerspexPropertyChangedEventArgs(property, oldValue, newValue)); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,186 @@ |
|||
namespace Perspex |
|||
{ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Diagnostics.Contracts; |
|||
using System.Linq; |
|||
using System.Reflection; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
|
|||
/// <summary>
|
|||
/// A perspex property.
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// This class is analogous to DependencyProperty in WPF.
|
|||
/// </remarks>
|
|||
public class PerspexProperty |
|||
{ |
|||
/// <summary>
|
|||
/// The default values for the property, by type.
|
|||
/// </summary>
|
|||
private Dictionary<Type, object> defaultValues = new Dictionary<Type, object>(); |
|||
|
|||
/// <summary>
|
|||
/// Initializes a new instance of the <see cref="PerspexProperty"/> class.
|
|||
/// </summary>
|
|||
/// <param name="name">The name of the property.</param>
|
|||
/// <param name="valueType">The type of the property's value.</param>
|
|||
/// <param name="ownerType">The type of the class that registers the property.</param>
|
|||
/// <param name="defaultValue">The default value of the property.</param>
|
|||
/// <param name="inherits">Whether the property inherits its value.</param>
|
|||
public PerspexProperty( |
|||
string name, |
|||
Type valueType, |
|||
Type ownerType, |
|||
object defaultValue, |
|||
bool inherits) |
|||
{ |
|||
Contract.Requires<NullReferenceException>(name != null); |
|||
Contract.Requires<NullReferenceException>(valueType != null); |
|||
Contract.Requires<NullReferenceException>(ownerType != null); |
|||
|
|||
this.Name = name; |
|||
this.ValueType = valueType; |
|||
this.OwnerType = ownerType; |
|||
this.Inherits = inherits; |
|||
this.defaultValues.Add(ownerType, defaultValue); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// The name of the property.
|
|||
/// </summary>
|
|||
public string Name { get; private set; } |
|||
|
|||
/// <summary>
|
|||
/// The type of the property's value.
|
|||
/// </summary>
|
|||
public Type ValueType { get; private set; } |
|||
|
|||
/// <summary>
|
|||
/// The type of the class that registers the property.
|
|||
/// </summary>
|
|||
public Type OwnerType { get; private set; } |
|||
|
|||
/// <summary>
|
|||
/// Whether the property inherits its value.
|
|||
/// </summary>
|
|||
public bool Inherits { get; private set; } |
|||
|
|||
/// <summary>
|
|||
/// Registers a <see cref="PerspexProperty"/>.
|
|||
/// </summary>
|
|||
/// <typeparam name="TOwner">The type of the class that is registering the property.</typeparam>
|
|||
/// <typeparam name="TValue">The type of the property's value.</typeparam>
|
|||
/// <param name="name">The name of the property.</param>
|
|||
/// <param name="defaultValue">The default value of the property.</param>
|
|||
/// <param name="inherits">Whether the property inherits its value.</param>
|
|||
/// <returns></returns>
|
|||
public static PerspexProperty<TValue> Register<TOwner, TValue>( |
|||
string name, |
|||
TValue defaultValue = default(TValue), |
|||
bool inherits = false) |
|||
where TOwner : PerspexObject |
|||
{ |
|||
Contract.Requires<NullReferenceException>(name != null); |
|||
|
|||
PerspexProperty<TValue> result = new PerspexProperty<TValue>( |
|||
name, |
|||
typeof(TOwner), |
|||
defaultValue, |
|||
inherits); |
|||
|
|||
PerspexObject.Register(typeof(TOwner), result); |
|||
|
|||
return result; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Gets the default value for the property on the specified type.
|
|||
/// </summary>
|
|||
/// <param name="type">The type.</param>
|
|||
/// <returns>The default value.</returns>
|
|||
public object GetDefaultValue(Type type) |
|||
{ |
|||
Contract.Requires<NullReferenceException>(type != null); |
|||
|
|||
while (type != null) |
|||
{ |
|||
object result; |
|||
|
|||
if (this.defaultValues.TryGetValue(type, out result)) |
|||
{ |
|||
return result; |
|||
} |
|||
|
|||
type = type.GetTypeInfo().BaseType; |
|||
} |
|||
|
|||
return this.defaultValues[this.OwnerType]; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Gets the default value for the property on the specified type.
|
|||
/// </summary>
|
|||
/// <param name="type">The type.</param>
|
|||
/// <param name="defaultValue">The default value.</param>
|
|||
public void OverrideDefaultValue(Type type, object defaultValue) |
|||
{ |
|||
Contract.Requires<NullReferenceException>(type != null); |
|||
|
|||
// TODO: Ensure correct type.
|
|||
|
|||
if (this.defaultValues.ContainsKey(type)) |
|||
{ |
|||
throw new InvalidOperationException("Default value is already set for this property."); |
|||
} |
|||
|
|||
this.defaultValues.Add(type, defaultValue); |
|||
} |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// A typed perspex property.
|
|||
/// </summary>
|
|||
public class PerspexProperty<TValue> : PerspexProperty |
|||
{ |
|||
/// <summary>
|
|||
/// Initializes a new instance of the <see cref="PerspexProperty"/> class.
|
|||
/// </summary>
|
|||
/// <param name="name">The name of the property.</param>
|
|||
/// <param name="ownerType">The type of the class that registers the property.</param>
|
|||
/// <param name="defaultValue">The default value of the property.</param>
|
|||
/// <param name="inherits">Whether the property inherits its value.</param>
|
|||
public PerspexProperty( |
|||
string name, |
|||
Type ownerType, |
|||
TValue defaultValue, |
|||
bool inherits) |
|||
: base(name, typeof(TValue), ownerType, defaultValue, inherits) |
|||
{ |
|||
Contract.Requires<NullReferenceException>(name != null); |
|||
Contract.Requires<NullReferenceException>(ownerType != null); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Registers the property on another type.
|
|||
/// </summary>
|
|||
/// <typeparam name="TOwner">The type of the additional owner.</typeparam>
|
|||
/// <returns>The property.</returns>
|
|||
public PerspexProperty<TValue> AddOwner<TOwner>() |
|||
{ |
|||
PerspexObject.Register(typeof(TOwner), this); |
|||
return this; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Gets the default value for the property on the specified type.
|
|||
/// </summary>
|
|||
/// <typeparam name="T">The type.</typeparam>
|
|||
/// <returns>The default value.</returns>
|
|||
public TValue GetDefaultValue<T>() |
|||
{ |
|||
return (TValue)this.GetDefaultValue(typeof(T)); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,45 @@ |
|||
// -----------------------------------------------------------------------
|
|||
// <copyright file="PerspexPropertyChangedEventArgs.cs" company="Steven Kirk">
|
|||
// Copyright 2013 MIT Licence. See licence.md for more information.
|
|||
// </copyright>
|
|||
// -----------------------------------------------------------------------
|
|||
|
|||
namespace Perspex |
|||
{ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
|
|||
/// <summary>
|
|||
/// Provides information for a perspex property change.
|
|||
/// </summary>
|
|||
public class PerspexPropertyChangedEventArgs |
|||
{ |
|||
public PerspexPropertyChangedEventArgs( |
|||
PerspexProperty property, |
|||
object oldValue, |
|||
object newValue) |
|||
{ |
|||
this.Property = property; |
|||
this.OldValue = oldValue; |
|||
this.NewValue = newValue; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Gets the property that changed.
|
|||
/// </summary>
|
|||
public PerspexProperty Property { get; private set; } |
|||
|
|||
/// <summary>
|
|||
/// Gets the old value of the property.
|
|||
/// </summary>
|
|||
public object OldValue { get; private set; } |
|||
|
|||
/// <summary>
|
|||
/// Gets the new value of the property.
|
|||
/// </summary>
|
|||
public object NewValue { get; private set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,56 @@ |
|||
namespace Perspex |
|||
{ |
|||
using System.Globalization; |
|||
|
|||
/// <summary>
|
|||
/// Defines a point.
|
|||
/// </summary>
|
|||
public struct Point |
|||
{ |
|||
/// <summary>
|
|||
/// The X position.
|
|||
/// </summary>
|
|||
private double x; |
|||
|
|||
/// <summary>
|
|||
/// The Y position.
|
|||
/// </summary>
|
|||
private double y; |
|||
|
|||
/// <summary>
|
|||
/// Initializes a new instance of the <see cref="Point"/> structure.
|
|||
/// </summary>
|
|||
/// <param name="x">The X position.</param>
|
|||
/// <param name="y">The Y position.</param>
|
|||
public Point(double x, double y) |
|||
{ |
|||
this.x = x; |
|||
this.y = y; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Gets the X position.
|
|||
/// </summary>
|
|||
public double X |
|||
{ |
|||
get { return this.x; } |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Gets the Y position.
|
|||
/// </summary>
|
|||
public double Y |
|||
{ |
|||
get { return this.y; } |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Returns the string representation of the point.
|
|||
/// </summary>
|
|||
/// <returns>The string representation of the point.</returns>
|
|||
public override string ToString() |
|||
{ |
|||
return string.Format(CultureInfo.InvariantCulture, "{0}, {1}", this.x, this.y); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,28 @@ |
|||
using System.Reflection; |
|||
using System.Resources; |
|||
|
|||
// General Information about an assembly is controlled through the following
|
|||
// set of attributes. Change these attribute values to modify the information
|
|||
// associated with an assembly.
|
|||
[assembly: AssemblyTitle("Perspex")] |
|||
[assembly: AssemblyDescription("")] |
|||
[assembly: AssemblyConfiguration("")] |
|||
[assembly: AssemblyCompany("")] |
|||
[assembly: AssemblyProduct("Perspex")] |
|||
[assembly: AssemblyCopyright("Copyright © 2013")] |
|||
[assembly: AssemblyTrademark("")] |
|||
[assembly: AssemblyCulture("")] |
|||
[assembly: NeutralResourcesLanguage("en")] |
|||
|
|||
// Version information for an assembly consists of the following four values:
|
|||
//
|
|||
// Major Version
|
|||
// Minor Version
|
|||
// Build Number
|
|||
// Revision
|
|||
//
|
|||
// You can specify all the values or you can default the Build and Revision Numbers
|
|||
// by using the '*' as shown below:
|
|||
// [assembly: AssemblyVersion("1.0.*")]
|
|||
[assembly: AssemblyVersion("1.0.0.0")] |
|||
[assembly: AssemblyFileVersion("1.0.0.0")] |
|||
@ -0,0 +1,12 @@ |
|||
namespace Perspex |
|||
{ |
|||
public class ReadOnlyPerspexProperty<T> |
|||
{ |
|||
public ReadOnlyPerspexProperty(PerspexProperty property) |
|||
{ |
|||
this.Property = property; |
|||
} |
|||
|
|||
internal PerspexProperty Property { get; private set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,147 @@ |
|||
namespace Perspex |
|||
{ |
|||
using System; |
|||
using System.Globalization; |
|||
|
|||
/// <summary>
|
|||
/// Defines a rectangle.
|
|||
/// </summary>
|
|||
public struct Rect |
|||
{ |
|||
/// <summary>
|
|||
/// The X position.
|
|||
/// </summary>
|
|||
private double x; |
|||
|
|||
/// <summary>
|
|||
/// The Y position.
|
|||
/// </summary>
|
|||
private double y; |
|||
|
|||
/// <summary>
|
|||
/// The width.
|
|||
/// </summary>
|
|||
private double width; |
|||
|
|||
/// <summary>
|
|||
/// The height.
|
|||
/// </summary>
|
|||
private double height; |
|||
|
|||
/// <summary>
|
|||
/// Initializes a new instance of the <see cref="Rect"/> structure.
|
|||
/// </summary>
|
|||
/// <param name="x">The X position.</param>
|
|||
/// <param name="y">The Y position.</param>
|
|||
/// <param name="width">The width.</param>
|
|||
/// <param name="height">The height.</param>
|
|||
public Rect(double x, double y, double width, double height) |
|||
{ |
|||
this.x = x; |
|||
this.y = y; |
|||
this.width = width; |
|||
this.height = height; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Initializes a new instance of the <see cref="Rect"/> structure.
|
|||
/// </summary>
|
|||
/// <param name="size">The size of the rectangle.</param>
|
|||
public Rect(Size size) |
|||
{ |
|||
this.x = 0; |
|||
this.y = 0; |
|||
this.width = size.Width; |
|||
this.height = size.Height; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Initializes a new instance of the <see cref="Rect"/> structure.
|
|||
/// </summary>
|
|||
/// <param name="position">The position of the rectangle.</param>
|
|||
/// <param name="size">The size of the rectangle.</param>
|
|||
public Rect(Point position, Size size) |
|||
{ |
|||
this.x = position.X; |
|||
this.y = position.Y; |
|||
this.width = size.Width; |
|||
this.height = size.Height; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Gets the X position.
|
|||
/// </summary>
|
|||
public double X |
|||
{ |
|||
get { return this.x; } |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Gets the Y position.
|
|||
/// </summary>
|
|||
public double Y |
|||
{ |
|||
get { return this.y; } |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Gets the width.
|
|||
/// </summary>
|
|||
public double Width |
|||
{ |
|||
get { return this.width; } |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Gets the height.
|
|||
/// </summary>
|
|||
public double Height |
|||
{ |
|||
get { return this.height; } |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Gets the position of the rectangle.
|
|||
/// </summary>
|
|||
public Point Position |
|||
{ |
|||
get { return new Point(this.x, this.y); } |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Gets the size of the rectangle.
|
|||
/// </summary>
|
|||
public Size Size |
|||
{ |
|||
get { return new Size(this.width, this.height); } |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Deflates the rectangle by a <see cref="Thickness"/>.
|
|||
/// </summary>
|
|||
/// <param name="thickness">The thickness.</param>
|
|||
/// <returns>The deflated rectangle.</returns>
|
|||
/// <remarks>The deflated rectangle size cannot be less than 0.</remarks>
|
|||
public Rect Deflate(Thickness thickness) |
|||
{ |
|||
return new Rect( |
|||
new Point(this.x + thickness.Left, this.y + thickness.Top), |
|||
this.Size.Deflate(thickness)); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Returns the string representation of the rectangle.
|
|||
/// </summary>
|
|||
/// <returns>The string representation of the rectangle.</returns>
|
|||
public override string ToString() |
|||
{ |
|||
return string.Format( |
|||
CultureInfo.InvariantCulture, |
|||
"{0}, {1}, {2}, {3}", |
|||
this.x, |
|||
this.y, |
|||
this.width, |
|||
this.height); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,24 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace Perspex |
|||
{ |
|||
public static class ServiceLocator |
|||
{ |
|||
private static Dictionary<Type, Func<object>> services = |
|||
new Dictionary<Type, Func<object>>(); |
|||
|
|||
public static T Get<T>() |
|||
{ |
|||
return (T)services[typeof(T)](); |
|||
} |
|||
|
|||
public static void Register<T>(Func<T> func) |
|||
{ |
|||
services.Add(typeof(T), () => (object)func()); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,94 @@ |
|||
namespace Perspex |
|||
{ |
|||
using System; |
|||
using System.Globalization; |
|||
|
|||
/// <summary>
|
|||
/// Defines a size.
|
|||
/// </summary>
|
|||
public struct Size |
|||
{ |
|||
/// <summary>
|
|||
/// The width.
|
|||
/// </summary>
|
|||
private double width; |
|||
|
|||
/// <summary>
|
|||
/// The height.
|
|||
/// </summary>
|
|||
private double height; |
|||
|
|||
/// <summary>
|
|||
/// Initializes a new instance of the <see cref="Size"/> structure.
|
|||
/// </summary>
|
|||
/// <param name="width">The width.</param>
|
|||
/// <param name="height">The height.</param>
|
|||
public Size(double width, double height) |
|||
{ |
|||
this.width = width; |
|||
this.height = height; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Gets the width.
|
|||
/// </summary>
|
|||
public double Width |
|||
{ |
|||
get { return this.width; } |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Gets the height.
|
|||
/// </summary>
|
|||
public double Height |
|||
{ |
|||
get { return this.height; } |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Constrains the size.
|
|||
/// </summary>
|
|||
/// <param name="constraint">The size to constrain to.</param>
|
|||
/// <returns>The constrained size.</returns>
|
|||
public Size Constrain(Size constraint) |
|||
{ |
|||
return new Size( |
|||
Math.Min(this.width, constraint.width), |
|||
Math.Min(this.height, constraint.height)); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Deflates the size by a <see cref="Thickness"/>.
|
|||
/// </summary>
|
|||
/// <param name="thickness">The thickness.</param>
|
|||
/// <returns>The deflated size.</returns>
|
|||
/// <remarks>The deflated size cannot be less than 0.</remarks>
|
|||
public Size Deflate(Thickness thickness) |
|||
{ |
|||
return new Size( |
|||
Math.Max(0, this.width - thickness.Left - thickness.Right), |
|||
Math.Max(0, this.height - thickness.Top - thickness.Bottom)); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Inflates the size by a <see cref="Thickness"/>.
|
|||
/// </summary>
|
|||
/// <param name="thickness">The thickness.</param>
|
|||
/// <returns>The inflated size.</returns>
|
|||
public Size Inflate(Thickness thickness) |
|||
{ |
|||
return new Size( |
|||
this.width + thickness.Left + thickness.Right, |
|||
this.height + thickness.Top + thickness.Bottom); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Returns the string representation of the size.
|
|||
/// </summary>
|
|||
/// <returns>The string representation of the size</returns>
|
|||
public override string ToString() |
|||
{ |
|||
return string.Format(CultureInfo.InvariantCulture, "{0}, {1}", this.width, this.height); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,163 @@ |
|||
namespace Perspex |
|||
{ |
|||
using System; |
|||
using System.Diagnostics.Contracts; |
|||
|
|||
public struct Thickness |
|||
{ |
|||
/// <summary>
|
|||
/// The thickness on the left.
|
|||
/// </summary>
|
|||
private double left; |
|||
|
|||
/// <summary>
|
|||
/// The thickness on the top.
|
|||
/// </summary>
|
|||
private double top; |
|||
|
|||
/// <summary>
|
|||
/// The thickness on the right.
|
|||
/// </summary>
|
|||
private double right; |
|||
|
|||
/// <summary>
|
|||
/// The thickness on the bottom.
|
|||
/// </summary>
|
|||
private double bottom; |
|||
|
|||
/// <summary>
|
|||
/// Initializes a new instance of the <see cref="Thickness"/> structure.
|
|||
/// </summary>
|
|||
/// <param name="uniformLength">The length that should be applied to all sides.</param>
|
|||
public Thickness(double uniformLength) |
|||
{ |
|||
Contract.Requires<ArgumentException>(uniformLength >= 0); |
|||
|
|||
this.left = this.top = this.right = this.bottom = uniformLength; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Initializes a new instance of the <see cref="Thickness"/> structure.
|
|||
/// </summary>
|
|||
/// <param name="left">The thickness on the left.</param>
|
|||
/// <param name="top">The thickness on the top.</param>
|
|||
/// <param name="right">The thickness on the right.</param>
|
|||
/// <param name="bottom">The thickness on the bottom.</param>
|
|||
public Thickness(double left, double top, double right, double bottom) |
|||
{ |
|||
Contract.Requires<ArgumentException>(left >= 0); |
|||
Contract.Requires<ArgumentException>(top >= 0); |
|||
Contract.Requires<ArgumentException>(right >= 0); |
|||
Contract.Requires<ArgumentException>(bottom >= 0); |
|||
|
|||
this.left = left; |
|||
this.top = top; |
|||
this.right = right; |
|||
this.bottom = bottom; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Gets the thickness on the left.
|
|||
/// </summary>
|
|||
public double Left |
|||
{ |
|||
get { return this.left; } |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Gets the thickness on the top.
|
|||
/// </summary>
|
|||
public double Top |
|||
{ |
|||
get { return this.top; } |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Gets the thickness on the right.
|
|||
/// </summary>
|
|||
public double Right |
|||
{ |
|||
get { return this.right; } |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Gets the thickness on the bottom.
|
|||
/// </summary>
|
|||
public double Bottom |
|||
{ |
|||
get { return this.bottom; } |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Gets a value indicating whether all sides are set to 0.
|
|||
/// </summary>
|
|||
public bool IsEmpty |
|||
{ |
|||
get { return this.Left == 0 && this.Top == 0 && this.Right == 0 && this.Bottom == 0; } |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Compares two Thicknesses.
|
|||
/// </summary>
|
|||
/// <param name="a">The first thickness.</param>
|
|||
/// <param name="b">The second thickness.</param>
|
|||
/// <returns>The equality.</returns>
|
|||
public static bool operator ==(Thickness a, Thickness b) |
|||
{ |
|||
return a.Equals(b); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Compares two Thicknesses.
|
|||
/// </summary>
|
|||
/// <param name="a">The first thickness.</param>
|
|||
/// <param name="b">The second thickness.</param>
|
|||
/// <returns>The unequality.</returns>
|
|||
public static bool operator !=(Thickness a, Thickness b) |
|||
{ |
|||
return !a.Equals(b); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Adds two Thicknesses.
|
|||
/// </summary>
|
|||
/// <param name="a">The first thickness.</param>
|
|||
/// <param name="b">The second thickness.</param>
|
|||
/// <returns>The equality.</returns>
|
|||
public static Thickness operator +(Thickness a, Thickness b) |
|||
{ |
|||
return new Thickness( |
|||
a.Left + b.Left, |
|||
a.Top + b.Top, |
|||
a.Right + b.Right, |
|||
a.Bottom + b.Bottom); |
|||
} |
|||
|
|||
public override bool Equals(object obj) |
|||
{ |
|||
if (obj is Thickness) |
|||
{ |
|||
Thickness other = (Thickness)obj; |
|||
return this.Left == other.Left && |
|||
this.Top == other.Top && |
|||
this.Right == other.Right && |
|||
this.Bottom == other.Bottom; |
|||
} |
|||
|
|||
return false; |
|||
} |
|||
|
|||
public override int GetHashCode() |
|||
{ |
|||
unchecked |
|||
{ |
|||
int hash = 17; |
|||
hash = (hash * 23) + this.Left.GetHashCode(); |
|||
hash = (hash * 23) + this.Top.GetHashCode(); |
|||
hash = (hash * 23) + this.Right.GetHashCode(); |
|||
hash = (hash * 23) + this.Bottom.GetHashCode(); |
|||
return hash; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,33 @@ |
|||
namespace Perspex |
|||
{ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Diagnostics.Contracts; |
|||
using System.Linq; |
|||
using Perspex.Media; |
|||
|
|||
public abstract class Visual : PerspexObject |
|||
{ |
|||
public static readonly ReadOnlyPerspexProperty<Rect> BoundsProperty = |
|||
new ReadOnlyPerspexProperty<Rect>(BoundsPropertyW); |
|||
|
|||
private static readonly PerspexProperty<Rect> BoundsPropertyW = |
|||
PerspexProperty.Register<Visual, Rect>("Bounds", new Rect()); |
|||
|
|||
public Rect Bounds |
|||
{ |
|||
get { return this.GetValue(BoundsPropertyW); } |
|||
protected set { this.SetValue(BoundsPropertyW, value); } |
|||
} |
|||
|
|||
public virtual IEnumerable<Visual> VisualChildren |
|||
{ |
|||
get { return Enumerable.Empty<Visual>(); } |
|||
} |
|||
|
|||
public virtual void Render(IDrawingContext context) |
|||
{ |
|||
Contract.Requires<ArgumentNullException>(context != null); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,9 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<packages> |
|||
<package id="Rx-Core" version="2.1.30214.0" targetFramework="portable-net45+wp80+win" /> |
|||
<package id="Rx-Interfaces" version="2.1.30214.0" targetFramework="portable-net45+wp80+win" /> |
|||
<package id="Rx-Linq" version="2.1.30214.0" targetFramework="portable-net45+wp80+win" /> |
|||
<package id="Rx-Main" version="2.1.30214.0" targetFramework="portable-net45+wp80+win" /> |
|||
<package id="Rx-PlatformServices" version="2.1.30214.0" targetFramework="portable-net45+wp80+win" /> |
|||
<package id="StyleCop.MSBuild" version="4.7.46.0" targetFramework="portable-net45+wp80+win" /> |
|||
</packages> |
|||
@ -0,0 +1,6 @@ |
|||
<?xml version="1.0" encoding="utf-8" ?> |
|||
<configuration> |
|||
<startup> |
|||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /> |
|||
</startup> |
|||
</configuration> |
|||
@ -0,0 +1,34 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
using Perspex; |
|||
using Perspex.Controls; |
|||
using Perspex.Media; |
|||
using Perspex.Windows; |
|||
using Perspex.Windows.Media; |
|||
using Perspex.Windows.Threading; |
|||
namespace TestApplication |
|||
{ |
|||
class Program |
|||
{ |
|||
static void Main(string[] args) |
|||
{ |
|||
ServiceLocator.Register<ITextService>(() => new TextService(new SharpDX.DirectWrite.Factory())); |
|||
|
|||
Window window = new Window(); |
|||
|
|||
window.Content = new TextBlock |
|||
{ |
|||
Text = "Hello World", |
|||
Background = new SolidColorBrush(0xffffffff), |
|||
HorizontalAlignment = HorizontalAlignment.Center, |
|||
VerticalAlignment = VerticalAlignment.Center, |
|||
}; |
|||
|
|||
window.Show(); |
|||
Dispatcher.Run(); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,36 @@ |
|||
using System.Reflection; |
|||
using System.Runtime.CompilerServices; |
|||
using System.Runtime.InteropServices; |
|||
|
|||
// General Information about an assembly is controlled through the following
|
|||
// set of attributes. Change these attribute values to modify the information
|
|||
// associated with an assembly.
|
|||
[assembly: AssemblyTitle("TestApplication")] |
|||
[assembly: AssemblyDescription("")] |
|||
[assembly: AssemblyConfiguration("")] |
|||
[assembly: AssemblyCompany("")] |
|||
[assembly: AssemblyProduct("TestApplication")] |
|||
[assembly: AssemblyCopyright("Copyright © 2013")] |
|||
[assembly: AssemblyTrademark("")] |
|||
[assembly: AssemblyCulture("")] |
|||
|
|||
// Setting ComVisible to false makes the types in this assembly not visible
|
|||
// to COM components. If you need to access a type in this assembly from
|
|||
// COM, set the ComVisible attribute to true on that type.
|
|||
[assembly: ComVisible(false)] |
|||
|
|||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
|||
[assembly: Guid("f8dad012-f4ec-4b63-b64f-320901338290")] |
|||
|
|||
// Version information for an assembly consists of the following four values:
|
|||
//
|
|||
// Major Version
|
|||
// Minor Version
|
|||
// Build Number
|
|||
// Revision
|
|||
//
|
|||
// You can specify all the values or you can default the Build and Revision Numbers
|
|||
// by using the '*' as shown below:
|
|||
// [assembly: AssemblyVersion("1.0.*")]
|
|||
[assembly: AssemblyVersion("1.0.0.0")] |
|||
[assembly: AssemblyFileVersion("1.0.0.0")] |
|||
@ -0,0 +1,98 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
|||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> |
|||
<PropertyGroup> |
|||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
|||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> |
|||
<ProjectGuid>{E3A1060B-50D0-44E8-88B6-F44EF2E5BD72}</ProjectGuid> |
|||
<OutputType>Exe</OutputType> |
|||
<AppDesignerFolder>Properties</AppDesignerFolder> |
|||
<RootNamespace>TestApplication</RootNamespace> |
|||
<AssemblyName>TestApplication</AssemblyName> |
|||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion> |
|||
<FileAlignment>512</FileAlignment> |
|||
</PropertyGroup> |
|||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> |
|||
<PlatformTarget>AnyCPU</PlatformTarget> |
|||
<DebugSymbols>true</DebugSymbols> |
|||
<DebugType>full</DebugType> |
|||
<Optimize>false</Optimize> |
|||
<OutputPath>bin\Debug\</OutputPath> |
|||
<DefineConstants>DEBUG;TRACE</DefineConstants> |
|||
<ErrorReport>prompt</ErrorReport> |
|||
<WarningLevel>4</WarningLevel> |
|||
</PropertyGroup> |
|||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> |
|||
<PlatformTarget>AnyCPU</PlatformTarget> |
|||
<DebugType>pdbonly</DebugType> |
|||
<Optimize>true</Optimize> |
|||
<OutputPath>bin\Release\</OutputPath> |
|||
<DefineConstants>TRACE</DefineConstants> |
|||
<ErrorReport>prompt</ErrorReport> |
|||
<WarningLevel>4</WarningLevel> |
|||
</PropertyGroup> |
|||
<ItemGroup> |
|||
<Reference Include="SharpDX, Version=2.5.0.0, Culture=neutral, PublicKeyToken=627a3d6d1956f55a, processorArchitecture=MSIL"> |
|||
<SpecificVersion>False</SpecificVersion> |
|||
<HintPath>..\packages\SharpDX.2.5.0\lib\net40\SharpDX.dll</HintPath> |
|||
</Reference> |
|||
<Reference Include="SharpDX.Direct2D1, Version=2.5.0.0, Culture=neutral, PublicKeyToken=627a3d6d1956f55a, processorArchitecture=MSIL"> |
|||
<SpecificVersion>False</SpecificVersion> |
|||
<HintPath>..\packages\SharpDX.Direct2D1.2.5.0\lib\net40\SharpDX.Direct2D1.dll</HintPath> |
|||
</Reference> |
|||
<Reference Include="SharpDX.DXGI, Version=2.5.0.0, Culture=neutral, PublicKeyToken=627a3d6d1956f55a, processorArchitecture=MSIL"> |
|||
<SpecificVersion>False</SpecificVersion> |
|||
<HintPath>..\packages\SharpDX.DXGI.2.5.0\lib\net40\SharpDX.DXGI.dll</HintPath> |
|||
</Reference> |
|||
<Reference Include="System" /> |
|||
<Reference Include="System.Core" /> |
|||
<Reference Include="System.Drawing" /> |
|||
<Reference Include="System.Reactive.Core, Version=2.1.30214.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> |
|||
<SpecificVersion>False</SpecificVersion> |
|||
<HintPath>..\packages\Rx-Core.2.1.30214.0\lib\Net45\System.Reactive.Core.dll</HintPath> |
|||
</Reference> |
|||
<Reference Include="System.Reactive.Interfaces, Version=2.1.30214.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> |
|||
<SpecificVersion>False</SpecificVersion> |
|||
<HintPath>..\packages\Rx-Interfaces.2.1.30214.0\lib\Net45\System.Reactive.Interfaces.dll</HintPath> |
|||
</Reference> |
|||
<Reference Include="System.Reactive.Linq, Version=2.1.30214.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> |
|||
<SpecificVersion>False</SpecificVersion> |
|||
<HintPath>..\packages\Rx-Linq.2.1.30214.0\lib\Net45\System.Reactive.Linq.dll</HintPath> |
|||
</Reference> |
|||
<Reference Include="System.Reactive.PlatformServices"> |
|||
<HintPath>..\packages\Rx-PlatformServices.2.1.30214.0\lib\Net45\System.Reactive.PlatformServices.dll</HintPath> |
|||
</Reference> |
|||
<Reference Include="System.Windows.Forms" /> |
|||
<Reference Include="System.Xml.Linq" /> |
|||
<Reference Include="System.Data.DataSetExtensions" /> |
|||
<Reference Include="Microsoft.CSharp" /> |
|||
<Reference Include="System.Data" /> |
|||
<Reference Include="System.Xml" /> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<Compile Include="Program.cs" /> |
|||
<Compile Include="Properties\AssemblyInfo.cs" /> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<None Include="App.config" /> |
|||
<None Include="packages.config" /> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<ProjectReference Include="..\Perspex.Windows\Perspex.Windows.csproj"> |
|||
<Project>{811a76cf-1cf6-440f-963b-bbe31bd72a82}</Project> |
|||
<Name>Perspex.Windows</Name> |
|||
</ProjectReference> |
|||
<ProjectReference Include="..\Perspex\Perspex.csproj"> |
|||
<Project>{3c9f40da-d2a5-43a1-a272-e965876c6d46}</Project> |
|||
<Name>Perspex</Name> |
|||
</ProjectReference> |
|||
</ItemGroup> |
|||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> |
|||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. |
|||
Other similar extension points exist, see Microsoft.Common.targets. |
|||
<Target Name="BeforeBuild"> |
|||
</Target> |
|||
<Target Name="AfterBuild"> |
|||
</Target> |
|||
--> |
|||
</Project> |
|||
@ -0,0 +1,11 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<packages> |
|||
<package id="Rx-Core" version="2.1.30214.0" targetFramework="net45" /> |
|||
<package id="Rx-Interfaces" version="2.1.30214.0" targetFramework="net45" /> |
|||
<package id="Rx-Linq" version="2.1.30214.0" targetFramework="net45" /> |
|||
<package id="Rx-Main" version="2.1.30214.0" targetFramework="net45" /> |
|||
<package id="Rx-PlatformServices" version="2.1.30214.0" targetFramework="net45" /> |
|||
<package id="SharpDX" version="2.5.0" targetFramework="net45" /> |
|||
<package id="SharpDX.Direct2D1" version="2.5.0" targetFramework="net45" /> |
|||
<package id="SharpDX.DXGI" version="2.5.0" targetFramework="net45" /> |
|||
</packages> |
|||
Binary file not shown.
@ -0,0 +1,25 @@ |
|||
<?xml version="1.0"?> |
|||
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"> |
|||
<metadata> |
|||
<id>Rx-Core</id> |
|||
<version>2.1.30214.0</version> |
|||
<title>Reactive Extensions - Core Library</title> |
|||
<authors>Microsoft Corporation</authors> |
|||
<owners>Microsoft Corporation</owners> |
|||
<licenseUrl>http://go.microsoft.com/fwlink/?LinkID=261272</licenseUrl> |
|||
<projectUrl>http://go.microsoft.com/fwlink/?LinkID=261273</projectUrl> |
|||
<iconUrl>http://go.microsoft.com/fwlink/?LinkId=261274</iconUrl> |
|||
<requireLicenseAcceptance>true</requireLicenseAcceptance> |
|||
<description>Reactive Extensions Core Library containing base classes and scheduler infrastructure.</description> |
|||
<copyright>Microsoft Corporation © 2012</copyright> |
|||
<language>en-us</language> |
|||
<tags>Rx Reactive Extensions Observable LINQ Events</tags> |
|||
<dependencies> |
|||
<dependency id="Rx-Interfaces" version="2.1.30214.0" /> |
|||
</dependencies> |
|||
<frameworkAssemblies> |
|||
<frameworkAssembly assemblyName="System.Observable" targetFramework="Silverlight4.0-WindowsPhone71" /> |
|||
<frameworkAssembly assemblyName="Microsoft.Phone" targetFramework="Silverlight4.0-WindowsPhone71" /> |
|||
</frameworkAssemblies> |
|||
</metadata> |
|||
</package> |
|||
File diff suppressed because it is too large
Binary file not shown.
File diff suppressed because it is too large
Binary file not shown.
File diff suppressed because it is too large
Binary file not shown.
File diff suppressed because it is too large
Binary file not shown.
File diff suppressed because it is too large
Binary file not shown.
File diff suppressed because it is too large
Binary file not shown.
File diff suppressed because it is too large
Binary file not shown.
Binary file not shown.
@ -0,0 +1,21 @@ |
|||
<?xml version="1.0"?> |
|||
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"> |
|||
<metadata> |
|||
<id>Rx-Interfaces</id> |
|||
<version>2.1.30214.0</version> |
|||
<title>Reactive Extensions - Interfaces Library</title> |
|||
<authors>Microsoft Corporation</authors> |
|||
<owners>Microsoft Corporation</owners> |
|||
<licenseUrl>http://go.microsoft.com/fwlink/?LinkID=261272</licenseUrl> |
|||
<projectUrl>http://go.microsoft.com/fwlink/?LinkID=261273</projectUrl> |
|||
<iconUrl>http://go.microsoft.com/fwlink/?LinkId=261274</iconUrl> |
|||
<requireLicenseAcceptance>true</requireLicenseAcceptance> |
|||
<description>Reactive Extensions Interfaces Library containing essential interfaces.</description> |
|||
<copyright>Microsoft Corporation © 2012</copyright> |
|||
<language>en-us</language> |
|||
<tags>Rx Reactive Extensions Observable LINQ Events</tags> |
|||
<frameworkAssemblies> |
|||
<frameworkAssembly assemblyName="System.Observable" targetFramework="Silverlight4.0-WindowsPhone71" /> |
|||
</frameworkAssemblies> |
|||
</metadata> |
|||
</package> |
|||
@ -0,0 +1,336 @@ |
|||
<?xml version="1.0"?> |
|||
<doc> |
|||
<assembly> |
|||
<name>System.Reactive.Interfaces</name> |
|||
</assembly> |
|||
<members> |
|||
<member name="T:System.Reactive.NamespaceDoc"> |
|||
<summary> |
|||
The <b>System.Reactive</b> namespace contains interfaces and classes used throughout the Reactive Extensions library. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.Concurrency.NamespaceDoc"> |
|||
<summary> |
|||
The <b>System.Reactive.Concurrency</b> namespace contains interfaces and classes that provide the scheduler infrastructure used by Reactive Extensions to construct and |
|||
process event streams. Schedulers are used to parameterize the concurrency introduced by query operators, provide means to virtualize time, to process historical data, |
|||
and to write unit tests for functionality built using Reactive Extensions constructs. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.Disposables.NamespaceDoc"> |
|||
<summary> |
|||
The <b>System.Reactive.Disposables</b> namespace contains interfaces and classes that provide a compositional set of constructs used to deal with resource and subscription |
|||
management in Reactive Extensions. Those types are used extensively within the implementation of Reactive Extensions and are useful when writing custom query operators or |
|||
schedulers. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.Linq.NamespaceDoc"> |
|||
<summary> |
|||
The <b>System.Reactive.Linq</b> namespace contains interfaces and classes that support expressing queries over observable sequences, using Language Integrated Query (LINQ). |
|||
Query operators are made available as extension methods for IObservable<T> and IQbservable<T> defined on the Observable and Qbservable classes, respectively. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.Subjects.NamespaceDoc"> |
|||
<summary> |
|||
The <b>System.Reactive.Subjects</b> namespace contains interfaces and classes to represent subjects, which are objects implementing both IObservable<T> and IObserver<T>. |
|||
Subjects are often used as sources of events, allowing one party to raise events and allowing another party to write queries over the event stream. Because of their ability to |
|||
have multiple registered observers, subjects are also used as a facility to provide multicast behavior for event streams in queries. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.Concurrency.ISchedulerPeriodic"> |
|||
<summary> |
|||
Scheduler with support for running periodic tasks. |
|||
This type of scheduler can be used to run timers more efficiently instead of using recursive scheduling. |
|||
</summary> |
|||
</member> |
|||
<member name="M:System.Reactive.Concurrency.ISchedulerPeriodic.SchedulePeriodic``1(``0,System.TimeSpan,System.Func{``0,``0})"> |
|||
<summary> |
|||
Schedules a periodic piece of work. |
|||
</summary> |
|||
<typeparam name="TState">The type of the state passed to the scheduled action.</typeparam> |
|||
<param name="state">Initial state passed to the action upon the first iteration.</param> |
|||
<param name="period">Period for running the work periodically.</param> |
|||
<param name="action">Action to be executed, potentially updating the state.</param> |
|||
<returns>The disposable object used to cancel the scheduled recurring action (best effort).</returns> |
|||
</member> |
|||
<member name="T:System.Reactive.Concurrency.IStopwatchProvider"> |
|||
<summary> |
|||
Provider for IStopwatch objects. |
|||
</summary> |
|||
</member> |
|||
<member name="M:System.Reactive.Concurrency.IStopwatchProvider.StartStopwatch"> |
|||
<summary> |
|||
Starts a new stopwatch object. |
|||
</summary> |
|||
<returns>New stopwatch object; started at the time of the request.</returns> |
|||
</member> |
|||
<member name="T:System.Reactive.Concurrency.IScheduledItem`1"> |
|||
<summary> |
|||
Represents a work item that has been scheduled. |
|||
</summary> |
|||
<typeparam name="TAbsolute">Absolute time representation type.</typeparam> |
|||
</member> |
|||
<member name="M:System.Reactive.Concurrency.IScheduledItem`1.Invoke"> |
|||
<summary> |
|||
Invokes the work item. |
|||
</summary> |
|||
</member> |
|||
<member name="P:System.Reactive.Concurrency.IScheduledItem`1.DueTime"> |
|||
<summary> |
|||
Gets the absolute time at which the item is due for invocation. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.Concurrency.IScheduler"> |
|||
<summary> |
|||
Represents an object that schedules units of work. |
|||
</summary> |
|||
</member> |
|||
<member name="M:System.Reactive.Concurrency.IScheduler.Schedule``1(``0,System.Func{System.Reactive.Concurrency.IScheduler,``0,System.IDisposable})"> |
|||
<summary> |
|||
Schedules an action to be executed. |
|||
</summary> |
|||
<typeparam name="TState">The type of the state passed to the scheduled action.</typeparam> |
|||
<param name="state">State passed to the action to be executed.</param> |
|||
<param name="action">Action to be executed.</param> |
|||
<returns>The disposable object used to cancel the scheduled action (best effort).</returns> |
|||
</member> |
|||
<member name="M:System.Reactive.Concurrency.IScheduler.Schedule``1(``0,System.TimeSpan,System.Func{System.Reactive.Concurrency.IScheduler,``0,System.IDisposable})"> |
|||
<summary> |
|||
Schedules an action to be executed after dueTime. |
|||
</summary> |
|||
<typeparam name="TState">The type of the state passed to the scheduled action.</typeparam> |
|||
<param name="state">State passed to the action to be executed.</param> |
|||
<param name="action">Action to be executed.</param> |
|||
<param name="dueTime">Relative time after which to execute the action.</param> |
|||
<returns>The disposable object used to cancel the scheduled action (best effort).</returns> |
|||
</member> |
|||
<member name="M:System.Reactive.Concurrency.IScheduler.Schedule``1(``0,System.DateTimeOffset,System.Func{System.Reactive.Concurrency.IScheduler,``0,System.IDisposable})"> |
|||
<summary> |
|||
Schedules an action to be executed at dueTime. |
|||
</summary> |
|||
<typeparam name="TState">The type of the state passed to the scheduled action.</typeparam> |
|||
<param name="state">State passed to the action to be executed.</param> |
|||
<param name="action">Action to be executed.</param> |
|||
<param name="dueTime">Absolute time at which to execute the action.</param> |
|||
<returns>The disposable object used to cancel the scheduled action (best effort).</returns> |
|||
</member> |
|||
<member name="P:System.Reactive.Concurrency.IScheduler.Now"> |
|||
<summary> |
|||
Gets the scheduler's notion of current time. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.Concurrency.ISchedulerLongRunning"> |
|||
<summary> |
|||
Scheduler with support for starting long-running tasks. |
|||
This type of scheduler can be used to run loops more efficiently instead of using recursive scheduling. |
|||
</summary> |
|||
</member> |
|||
<member name="M:System.Reactive.Concurrency.ISchedulerLongRunning.ScheduleLongRunning``1(``0,System.Action{``0,System.Reactive.Disposables.ICancelable})"> |
|||
<summary> |
|||
Schedules a long-running piece of work. |
|||
</summary> |
|||
<typeparam name="TState">The type of the state passed to the scheduled action.</typeparam> |
|||
<param name="state">State passed to the action to be executed.</param> |
|||
<param name="action">Action to be executed.</param> |
|||
<returns>The disposable object used to cancel the scheduled action (best effort).</returns> |
|||
<remarks> |
|||
<para><b>Notes to implementers</b></para> |
|||
The returned disposable object should not prevent the work from starting, but only set the cancellation flag passed to the specified action. |
|||
</remarks> |
|||
</member> |
|||
<member name="T:System.Reactive.Concurrency.IStopwatch"> |
|||
<summary> |
|||
Abstraction for a stopwatch to compute time relative to a starting point. |
|||
</summary> |
|||
</member> |
|||
<member name="P:System.Reactive.Concurrency.IStopwatch.Elapsed"> |
|||
<summary> |
|||
Gets the time elapsed since the stopwatch object was obtained. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.Disposables.ICancelable"> |
|||
<summary> |
|||
Disposable resource with dipsosal state tracking. |
|||
</summary> |
|||
</member> |
|||
<member name="P:System.Reactive.Disposables.ICancelable.IsDisposed"> |
|||
<summary> |
|||
Gets a value that indicates whether the object is disposed. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.IEventPattern`2"> |
|||
<summary> |
|||
Represents a .NET event invocation consisting of the strongly typed object that raised the event and the data that was generated by the event. |
|||
</summary> |
|||
<typeparam name="TSender"> |
|||
The type of the sender that raised the event. |
|||
This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
<typeparam name="TEventArgs"> |
|||
The type of the event data generated by the event. |
|||
This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
</member> |
|||
<member name="P:System.Reactive.IEventPattern`2.Sender"> |
|||
<summary> |
|||
Gets the sender object that raised the event. |
|||
</summary> |
|||
</member> |
|||
<member name="P:System.Reactive.IEventPattern`2.EventArgs"> |
|||
<summary> |
|||
Gets the event data that was generated by the event. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.IEventPatternSource`1"> |
|||
<summary> |
|||
Represents a data stream signaling its elements by means of an event. |
|||
</summary> |
|||
<typeparam name="TEventArgs">The type of the event data generated by the event.</typeparam> |
|||
</member> |
|||
<member name="E:System.Reactive.IEventPatternSource`1.OnNext"> |
|||
<summary> |
|||
Event signaling the next element in the data stream. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.IEventSource`1"> |
|||
<summary> |
|||
Represents a data stream signaling its elements by means of an event. |
|||
</summary> |
|||
<typeparam name="T"> |
|||
The type of the event data generated by the event. |
|||
This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
</member> |
|||
<member name="E:System.Reactive.IEventSource`1.OnNext"> |
|||
<summary> |
|||
Event signaling the next element in the data stream. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.IObserver`2"> |
|||
<summary> |
|||
Provides a mechanism for receiving push-based notifications and returning a response. |
|||
</summary> |
|||
<typeparam name="TValue"> |
|||
The type of the elements received by the observer. |
|||
This type parameter is contravariant. That is, you can use either the type you specified or any type that is less derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
<typeparam name="TResult"> |
|||
The type of the result returned from the observer's notification handlers. |
|||
This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
</member> |
|||
<member name="M:System.Reactive.IObserver`2.OnNext(`0)"> |
|||
<summary> |
|||
Notifies the observer of a new element in the sequence. |
|||
</summary> |
|||
<param name="value">The new element in the sequence.</param> |
|||
<returns>Result returned upon observation of a new element.</returns> |
|||
</member> |
|||
<member name="M:System.Reactive.IObserver`2.OnError(System.Exception)"> |
|||
<summary> |
|||
Notifies the observer that an exception has occurred. |
|||
</summary> |
|||
<param name="exception">The exception that occurred.</param> |
|||
<returns>Result returned upon observation of an error.</returns> |
|||
</member> |
|||
<member name="M:System.Reactive.IObserver`2.OnCompleted"> |
|||
<summary> |
|||
Notifies the observer of the end of the sequence. |
|||
</summary> |
|||
<returns>Result returned upon observation of the sequence completion.</returns> |
|||
</member> |
|||
<member name="T:System.Reactive.Linq.IGroupedObservable`2"> |
|||
<summary> |
|||
Represents an observable sequence of elements that have a common key. |
|||
</summary> |
|||
<typeparam name="TKey"> |
|||
The type of the key shared by all elements in the group. |
|||
This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
<typeparam name="TElement"> |
|||
The type of the elements in the group. |
|||
This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
</member> |
|||
<member name="P:System.Reactive.Linq.IGroupedObservable`2.Key"> |
|||
<summary> |
|||
Gets the common key. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.Linq.IQbservable`1"> |
|||
<summary> |
|||
Provides functionality to evaluate queries against a specific data source wherein the type of the data is known. |
|||
</summary> |
|||
<typeparam name="T"> |
|||
The type of the data in the data source. |
|||
This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
</member> |
|||
<member name="T:System.Reactive.Linq.IQbservable"> |
|||
<summary> |
|||
Provides functionality to evaluate queries against a specific data source wherein the type of the data is not specified. |
|||
</summary> |
|||
</member> |
|||
<member name="P:System.Reactive.Linq.IQbservable.ElementType"> |
|||
<summary> |
|||
Gets the type of the element(s) that are returned when the expression tree associated with this instance of IQbservable is executed. |
|||
</summary> |
|||
</member> |
|||
<member name="P:System.Reactive.Linq.IQbservable.Expression"> |
|||
<summary> |
|||
Gets the expression tree that is associated with the instance of IQbservable. |
|||
</summary> |
|||
</member> |
|||
<member name="P:System.Reactive.Linq.IQbservable.Provider"> |
|||
<summary> |
|||
Gets the query provider that is associated with this data source. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.Linq.IQbservableProvider"> |
|||
<summary> |
|||
Defines methods to create and execute queries that are described by an IQbservable object. |
|||
</summary> |
|||
</member> |
|||
<member name="M:System.Reactive.Linq.IQbservableProvider.CreateQuery``1(System.Linq.Expressions.Expression)"> |
|||
<summary> |
|||
Constructs an IQbservable>TResult< object that can evaluate the query represented by a specified expression tree. |
|||
</summary> |
|||
<typeparam name="TResult">The type of the elements of the System.Reactive.Linq.IQbservable<T> that is returned.</typeparam> |
|||
<param name="expression">Expression tree representing the query.</param> |
|||
<returns>IQbservable object that can evaluate the given query expression.</returns> |
|||
</member> |
|||
<member name="T:System.Reactive.Subjects.IConnectableObservable`1"> |
|||
<summary> |
|||
Represents an observable wrapper that can be connected and disconnected from its underlying observable sequence. |
|||
</summary> |
|||
<typeparam name="T"> |
|||
The type of the elements in the sequence. |
|||
This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
</member> |
|||
<member name="M:System.Reactive.Subjects.IConnectableObservable`1.Connect"> |
|||
<summary> |
|||
Connects the observable wrapper to its source. All subscribed observers will receive values from the underlying observable sequence as long as the connection is established. |
|||
</summary> |
|||
<returns>Disposable used to disconnect the observable wrapper from its source, causing subscribed observer to stop receiving values from the underlying observable sequence.</returns> |
|||
</member> |
|||
<member name="T:System.Reactive.Subjects.ISubject`1"> |
|||
<summary> |
|||
Represents an object that is both an observable sequence as well as an observer. |
|||
</summary> |
|||
<typeparam name="T">The type of the elements processed by the subject.</typeparam> |
|||
</member> |
|||
<member name="T:System.Reactive.Subjects.ISubject`2"> |
|||
<summary> |
|||
Represents an object that is both an observable sequence as well as an observer. |
|||
</summary> |
|||
<typeparam name="TSource"> |
|||
The type of the elements received by the subject. |
|||
This type parameter is contravariant. That is, you can use either the type you specified or any type that is less derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
<typeparam name="TResult"> |
|||
The type of the elements produced by the subject. |
|||
This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
</member> |
|||
</members> |
|||
</doc> |
|||
Binary file not shown.
@ -0,0 +1,336 @@ |
|||
<?xml version="1.0"?> |
|||
<doc> |
|||
<assembly> |
|||
<name>System.Reactive.Interfaces</name> |
|||
</assembly> |
|||
<members> |
|||
<member name="T:System.Reactive.NamespaceDoc"> |
|||
<summary> |
|||
The <b>System.Reactive</b> namespace contains interfaces and classes used throughout the Reactive Extensions library. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.Concurrency.NamespaceDoc"> |
|||
<summary> |
|||
The <b>System.Reactive.Concurrency</b> namespace contains interfaces and classes that provide the scheduler infrastructure used by Reactive Extensions to construct and |
|||
process event streams. Schedulers are used to parameterize the concurrency introduced by query operators, provide means to virtualize time, to process historical data, |
|||
and to write unit tests for functionality built using Reactive Extensions constructs. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.Disposables.NamespaceDoc"> |
|||
<summary> |
|||
The <b>System.Reactive.Disposables</b> namespace contains interfaces and classes that provide a compositional set of constructs used to deal with resource and subscription |
|||
management in Reactive Extensions. Those types are used extensively within the implementation of Reactive Extensions and are useful when writing custom query operators or |
|||
schedulers. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.Linq.NamespaceDoc"> |
|||
<summary> |
|||
The <b>System.Reactive.Linq</b> namespace contains interfaces and classes that support expressing queries over observable sequences, using Language Integrated Query (LINQ). |
|||
Query operators are made available as extension methods for IObservable<T> and IQbservable<T> defined on the Observable and Qbservable classes, respectively. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.Subjects.NamespaceDoc"> |
|||
<summary> |
|||
The <b>System.Reactive.Subjects</b> namespace contains interfaces and classes to represent subjects, which are objects implementing both IObservable<T> and IObserver<T>. |
|||
Subjects are often used as sources of events, allowing one party to raise events and allowing another party to write queries over the event stream. Because of their ability to |
|||
have multiple registered observers, subjects are also used as a facility to provide multicast behavior for event streams in queries. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.Concurrency.ISchedulerPeriodic"> |
|||
<summary> |
|||
Scheduler with support for running periodic tasks. |
|||
This type of scheduler can be used to run timers more efficiently instead of using recursive scheduling. |
|||
</summary> |
|||
</member> |
|||
<member name="M:System.Reactive.Concurrency.ISchedulerPeriodic.SchedulePeriodic``1(``0,System.TimeSpan,System.Func{``0,``0})"> |
|||
<summary> |
|||
Schedules a periodic piece of work. |
|||
</summary> |
|||
<typeparam name="TState">The type of the state passed to the scheduled action.</typeparam> |
|||
<param name="state">Initial state passed to the action upon the first iteration.</param> |
|||
<param name="period">Period for running the work periodically.</param> |
|||
<param name="action">Action to be executed, potentially updating the state.</param> |
|||
<returns>The disposable object used to cancel the scheduled recurring action (best effort).</returns> |
|||
</member> |
|||
<member name="T:System.Reactive.Concurrency.IStopwatchProvider"> |
|||
<summary> |
|||
Provider for IStopwatch objects. |
|||
</summary> |
|||
</member> |
|||
<member name="M:System.Reactive.Concurrency.IStopwatchProvider.StartStopwatch"> |
|||
<summary> |
|||
Starts a new stopwatch object. |
|||
</summary> |
|||
<returns>New stopwatch object; started at the time of the request.</returns> |
|||
</member> |
|||
<member name="T:System.Reactive.Concurrency.IScheduledItem`1"> |
|||
<summary> |
|||
Represents a work item that has been scheduled. |
|||
</summary> |
|||
<typeparam name="TAbsolute">Absolute time representation type.</typeparam> |
|||
</member> |
|||
<member name="M:System.Reactive.Concurrency.IScheduledItem`1.Invoke"> |
|||
<summary> |
|||
Invokes the work item. |
|||
</summary> |
|||
</member> |
|||
<member name="P:System.Reactive.Concurrency.IScheduledItem`1.DueTime"> |
|||
<summary> |
|||
Gets the absolute time at which the item is due for invocation. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.Concurrency.IScheduler"> |
|||
<summary> |
|||
Represents an object that schedules units of work. |
|||
</summary> |
|||
</member> |
|||
<member name="M:System.Reactive.Concurrency.IScheduler.Schedule``1(``0,System.Func{System.Reactive.Concurrency.IScheduler,``0,System.IDisposable})"> |
|||
<summary> |
|||
Schedules an action to be executed. |
|||
</summary> |
|||
<typeparam name="TState">The type of the state passed to the scheduled action.</typeparam> |
|||
<param name="state">State passed to the action to be executed.</param> |
|||
<param name="action">Action to be executed.</param> |
|||
<returns>The disposable object used to cancel the scheduled action (best effort).</returns> |
|||
</member> |
|||
<member name="M:System.Reactive.Concurrency.IScheduler.Schedule``1(``0,System.TimeSpan,System.Func{System.Reactive.Concurrency.IScheduler,``0,System.IDisposable})"> |
|||
<summary> |
|||
Schedules an action to be executed after dueTime. |
|||
</summary> |
|||
<typeparam name="TState">The type of the state passed to the scheduled action.</typeparam> |
|||
<param name="state">State passed to the action to be executed.</param> |
|||
<param name="action">Action to be executed.</param> |
|||
<param name="dueTime">Relative time after which to execute the action.</param> |
|||
<returns>The disposable object used to cancel the scheduled action (best effort).</returns> |
|||
</member> |
|||
<member name="M:System.Reactive.Concurrency.IScheduler.Schedule``1(``0,System.DateTimeOffset,System.Func{System.Reactive.Concurrency.IScheduler,``0,System.IDisposable})"> |
|||
<summary> |
|||
Schedules an action to be executed at dueTime. |
|||
</summary> |
|||
<typeparam name="TState">The type of the state passed to the scheduled action.</typeparam> |
|||
<param name="state">State passed to the action to be executed.</param> |
|||
<param name="action">Action to be executed.</param> |
|||
<param name="dueTime">Absolute time at which to execute the action.</param> |
|||
<returns>The disposable object used to cancel the scheduled action (best effort).</returns> |
|||
</member> |
|||
<member name="P:System.Reactive.Concurrency.IScheduler.Now"> |
|||
<summary> |
|||
Gets the scheduler's notion of current time. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.Concurrency.ISchedulerLongRunning"> |
|||
<summary> |
|||
Scheduler with support for starting long-running tasks. |
|||
This type of scheduler can be used to run loops more efficiently instead of using recursive scheduling. |
|||
</summary> |
|||
</member> |
|||
<member name="M:System.Reactive.Concurrency.ISchedulerLongRunning.ScheduleLongRunning``1(``0,System.Action{``0,System.Reactive.Disposables.ICancelable})"> |
|||
<summary> |
|||
Schedules a long-running piece of work. |
|||
</summary> |
|||
<typeparam name="TState">The type of the state passed to the scheduled action.</typeparam> |
|||
<param name="state">State passed to the action to be executed.</param> |
|||
<param name="action">Action to be executed.</param> |
|||
<returns>The disposable object used to cancel the scheduled action (best effort).</returns> |
|||
<remarks> |
|||
<para><b>Notes to implementers</b></para> |
|||
The returned disposable object should not prevent the work from starting, but only set the cancellation flag passed to the specified action. |
|||
</remarks> |
|||
</member> |
|||
<member name="T:System.Reactive.Concurrency.IStopwatch"> |
|||
<summary> |
|||
Abstraction for a stopwatch to compute time relative to a starting point. |
|||
</summary> |
|||
</member> |
|||
<member name="P:System.Reactive.Concurrency.IStopwatch.Elapsed"> |
|||
<summary> |
|||
Gets the time elapsed since the stopwatch object was obtained. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.Disposables.ICancelable"> |
|||
<summary> |
|||
Disposable resource with dipsosal state tracking. |
|||
</summary> |
|||
</member> |
|||
<member name="P:System.Reactive.Disposables.ICancelable.IsDisposed"> |
|||
<summary> |
|||
Gets a value that indicates whether the object is disposed. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.IEventPattern`2"> |
|||
<summary> |
|||
Represents a .NET event invocation consisting of the strongly typed object that raised the event and the data that was generated by the event. |
|||
</summary> |
|||
<typeparam name="TSender"> |
|||
The type of the sender that raised the event. |
|||
This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
<typeparam name="TEventArgs"> |
|||
The type of the event data generated by the event. |
|||
This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
</member> |
|||
<member name="P:System.Reactive.IEventPattern`2.Sender"> |
|||
<summary> |
|||
Gets the sender object that raised the event. |
|||
</summary> |
|||
</member> |
|||
<member name="P:System.Reactive.IEventPattern`2.EventArgs"> |
|||
<summary> |
|||
Gets the event data that was generated by the event. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.IEventPatternSource`1"> |
|||
<summary> |
|||
Represents a data stream signaling its elements by means of an event. |
|||
</summary> |
|||
<typeparam name="TEventArgs">The type of the event data generated by the event.</typeparam> |
|||
</member> |
|||
<member name="E:System.Reactive.IEventPatternSource`1.OnNext"> |
|||
<summary> |
|||
Event signaling the next element in the data stream. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.IEventSource`1"> |
|||
<summary> |
|||
Represents a data stream signaling its elements by means of an event. |
|||
</summary> |
|||
<typeparam name="T"> |
|||
The type of the event data generated by the event. |
|||
This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
</member> |
|||
<member name="E:System.Reactive.IEventSource`1.OnNext"> |
|||
<summary> |
|||
Event signaling the next element in the data stream. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.IObserver`2"> |
|||
<summary> |
|||
Provides a mechanism for receiving push-based notifications and returning a response. |
|||
</summary> |
|||
<typeparam name="TValue"> |
|||
The type of the elements received by the observer. |
|||
This type parameter is contravariant. That is, you can use either the type you specified or any type that is less derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
<typeparam name="TResult"> |
|||
The type of the result returned from the observer's notification handlers. |
|||
This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
</member> |
|||
<member name="M:System.Reactive.IObserver`2.OnNext(`0)"> |
|||
<summary> |
|||
Notifies the observer of a new element in the sequence. |
|||
</summary> |
|||
<param name="value">The new element in the sequence.</param> |
|||
<returns>Result returned upon observation of a new element.</returns> |
|||
</member> |
|||
<member name="M:System.Reactive.IObserver`2.OnError(System.Exception)"> |
|||
<summary> |
|||
Notifies the observer that an exception has occurred. |
|||
</summary> |
|||
<param name="exception">The exception that occurred.</param> |
|||
<returns>Result returned upon observation of an error.</returns> |
|||
</member> |
|||
<member name="M:System.Reactive.IObserver`2.OnCompleted"> |
|||
<summary> |
|||
Notifies the observer of the end of the sequence. |
|||
</summary> |
|||
<returns>Result returned upon observation of the sequence completion.</returns> |
|||
</member> |
|||
<member name="T:System.Reactive.Linq.IGroupedObservable`2"> |
|||
<summary> |
|||
Represents an observable sequence of elements that have a common key. |
|||
</summary> |
|||
<typeparam name="TKey"> |
|||
The type of the key shared by all elements in the group. |
|||
This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
<typeparam name="TElement"> |
|||
The type of the elements in the group. |
|||
This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
</member> |
|||
<member name="P:System.Reactive.Linq.IGroupedObservable`2.Key"> |
|||
<summary> |
|||
Gets the common key. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.Linq.IQbservable`1"> |
|||
<summary> |
|||
Provides functionality to evaluate queries against a specific data source wherein the type of the data is known. |
|||
</summary> |
|||
<typeparam name="T"> |
|||
The type of the data in the data source. |
|||
This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
</member> |
|||
<member name="T:System.Reactive.Linq.IQbservable"> |
|||
<summary> |
|||
Provides functionality to evaluate queries against a specific data source wherein the type of the data is not specified. |
|||
</summary> |
|||
</member> |
|||
<member name="P:System.Reactive.Linq.IQbservable.ElementType"> |
|||
<summary> |
|||
Gets the type of the element(s) that are returned when the expression tree associated with this instance of IQbservable is executed. |
|||
</summary> |
|||
</member> |
|||
<member name="P:System.Reactive.Linq.IQbservable.Expression"> |
|||
<summary> |
|||
Gets the expression tree that is associated with the instance of IQbservable. |
|||
</summary> |
|||
</member> |
|||
<member name="P:System.Reactive.Linq.IQbservable.Provider"> |
|||
<summary> |
|||
Gets the query provider that is associated with this data source. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.Linq.IQbservableProvider"> |
|||
<summary> |
|||
Defines methods to create and execute queries that are described by an IQbservable object. |
|||
</summary> |
|||
</member> |
|||
<member name="M:System.Reactive.Linq.IQbservableProvider.CreateQuery``1(System.Linq.Expressions.Expression)"> |
|||
<summary> |
|||
Constructs an IQbservable>TResult< object that can evaluate the query represented by a specified expression tree. |
|||
</summary> |
|||
<typeparam name="TResult">The type of the elements of the System.Reactive.Linq.IQbservable<T> that is returned.</typeparam> |
|||
<param name="expression">Expression tree representing the query.</param> |
|||
<returns>IQbservable object that can evaluate the given query expression.</returns> |
|||
</member> |
|||
<member name="T:System.Reactive.Subjects.IConnectableObservable`1"> |
|||
<summary> |
|||
Represents an observable wrapper that can be connected and disconnected from its underlying observable sequence. |
|||
</summary> |
|||
<typeparam name="T"> |
|||
The type of the elements in the sequence. |
|||
This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
</member> |
|||
<member name="M:System.Reactive.Subjects.IConnectableObservable`1.Connect"> |
|||
<summary> |
|||
Connects the observable wrapper to its source. All subscribed observers will receive values from the underlying observable sequence as long as the connection is established. |
|||
</summary> |
|||
<returns>Disposable used to disconnect the observable wrapper from its source, causing subscribed observer to stop receiving values from the underlying observable sequence.</returns> |
|||
</member> |
|||
<member name="T:System.Reactive.Subjects.ISubject`1"> |
|||
<summary> |
|||
Represents an object that is both an observable sequence as well as an observer. |
|||
</summary> |
|||
<typeparam name="T">The type of the elements processed by the subject.</typeparam> |
|||
</member> |
|||
<member name="T:System.Reactive.Subjects.ISubject`2"> |
|||
<summary> |
|||
Represents an object that is both an observable sequence as well as an observer. |
|||
</summary> |
|||
<typeparam name="TSource"> |
|||
The type of the elements received by the subject. |
|||
This type parameter is contravariant. That is, you can use either the type you specified or any type that is less derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
<typeparam name="TResult"> |
|||
The type of the elements produced by the subject. |
|||
This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
</member> |
|||
</members> |
|||
</doc> |
|||
Binary file not shown.
@ -0,0 +1,336 @@ |
|||
<?xml version="1.0"?> |
|||
<doc> |
|||
<assembly> |
|||
<name>System.Reactive.Interfaces</name> |
|||
</assembly> |
|||
<members> |
|||
<member name="T:System.Reactive.NamespaceDoc"> |
|||
<summary> |
|||
The <b>System.Reactive</b> namespace contains interfaces and classes used throughout the Reactive Extensions library. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.Concurrency.NamespaceDoc"> |
|||
<summary> |
|||
The <b>System.Reactive.Concurrency</b> namespace contains interfaces and classes that provide the scheduler infrastructure used by Reactive Extensions to construct and |
|||
process event streams. Schedulers are used to parameterize the concurrency introduced by query operators, provide means to virtualize time, to process historical data, |
|||
and to write unit tests for functionality built using Reactive Extensions constructs. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.Disposables.NamespaceDoc"> |
|||
<summary> |
|||
The <b>System.Reactive.Disposables</b> namespace contains interfaces and classes that provide a compositional set of constructs used to deal with resource and subscription |
|||
management in Reactive Extensions. Those types are used extensively within the implementation of Reactive Extensions and are useful when writing custom query operators or |
|||
schedulers. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.Linq.NamespaceDoc"> |
|||
<summary> |
|||
The <b>System.Reactive.Linq</b> namespace contains interfaces and classes that support expressing queries over observable sequences, using Language Integrated Query (LINQ). |
|||
Query operators are made available as extension methods for IObservable<T> and IQbservable<T> defined on the Observable and Qbservable classes, respectively. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.Subjects.NamespaceDoc"> |
|||
<summary> |
|||
The <b>System.Reactive.Subjects</b> namespace contains interfaces and classes to represent subjects, which are objects implementing both IObservable<T> and IObserver<T>. |
|||
Subjects are often used as sources of events, allowing one party to raise events and allowing another party to write queries over the event stream. Because of their ability to |
|||
have multiple registered observers, subjects are also used as a facility to provide multicast behavior for event streams in queries. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.Concurrency.ISchedulerPeriodic"> |
|||
<summary> |
|||
Scheduler with support for running periodic tasks. |
|||
This type of scheduler can be used to run timers more efficiently instead of using recursive scheduling. |
|||
</summary> |
|||
</member> |
|||
<member name="M:System.Reactive.Concurrency.ISchedulerPeriodic.SchedulePeriodic``1(``0,System.TimeSpan,System.Func{``0,``0})"> |
|||
<summary> |
|||
Schedules a periodic piece of work. |
|||
</summary> |
|||
<typeparam name="TState">The type of the state passed to the scheduled action.</typeparam> |
|||
<param name="state">Initial state passed to the action upon the first iteration.</param> |
|||
<param name="period">Period for running the work periodically.</param> |
|||
<param name="action">Action to be executed, potentially updating the state.</param> |
|||
<returns>The disposable object used to cancel the scheduled recurring action (best effort).</returns> |
|||
</member> |
|||
<member name="T:System.Reactive.Concurrency.IStopwatchProvider"> |
|||
<summary> |
|||
Provider for IStopwatch objects. |
|||
</summary> |
|||
</member> |
|||
<member name="M:System.Reactive.Concurrency.IStopwatchProvider.StartStopwatch"> |
|||
<summary> |
|||
Starts a new stopwatch object. |
|||
</summary> |
|||
<returns>New stopwatch object; started at the time of the request.</returns> |
|||
</member> |
|||
<member name="T:System.Reactive.Concurrency.IScheduledItem`1"> |
|||
<summary> |
|||
Represents a work item that has been scheduled. |
|||
</summary> |
|||
<typeparam name="TAbsolute">Absolute time representation type.</typeparam> |
|||
</member> |
|||
<member name="M:System.Reactive.Concurrency.IScheduledItem`1.Invoke"> |
|||
<summary> |
|||
Invokes the work item. |
|||
</summary> |
|||
</member> |
|||
<member name="P:System.Reactive.Concurrency.IScheduledItem`1.DueTime"> |
|||
<summary> |
|||
Gets the absolute time at which the item is due for invocation. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.Concurrency.IScheduler"> |
|||
<summary> |
|||
Represents an object that schedules units of work. |
|||
</summary> |
|||
</member> |
|||
<member name="M:System.Reactive.Concurrency.IScheduler.Schedule``1(``0,System.Func{System.Reactive.Concurrency.IScheduler,``0,System.IDisposable})"> |
|||
<summary> |
|||
Schedules an action to be executed. |
|||
</summary> |
|||
<typeparam name="TState">The type of the state passed to the scheduled action.</typeparam> |
|||
<param name="state">State passed to the action to be executed.</param> |
|||
<param name="action">Action to be executed.</param> |
|||
<returns>The disposable object used to cancel the scheduled action (best effort).</returns> |
|||
</member> |
|||
<member name="M:System.Reactive.Concurrency.IScheduler.Schedule``1(``0,System.TimeSpan,System.Func{System.Reactive.Concurrency.IScheduler,``0,System.IDisposable})"> |
|||
<summary> |
|||
Schedules an action to be executed after dueTime. |
|||
</summary> |
|||
<typeparam name="TState">The type of the state passed to the scheduled action.</typeparam> |
|||
<param name="state">State passed to the action to be executed.</param> |
|||
<param name="action">Action to be executed.</param> |
|||
<param name="dueTime">Relative time after which to execute the action.</param> |
|||
<returns>The disposable object used to cancel the scheduled action (best effort).</returns> |
|||
</member> |
|||
<member name="M:System.Reactive.Concurrency.IScheduler.Schedule``1(``0,System.DateTimeOffset,System.Func{System.Reactive.Concurrency.IScheduler,``0,System.IDisposable})"> |
|||
<summary> |
|||
Schedules an action to be executed at dueTime. |
|||
</summary> |
|||
<typeparam name="TState">The type of the state passed to the scheduled action.</typeparam> |
|||
<param name="state">State passed to the action to be executed.</param> |
|||
<param name="action">Action to be executed.</param> |
|||
<param name="dueTime">Absolute time at which to execute the action.</param> |
|||
<returns>The disposable object used to cancel the scheduled action (best effort).</returns> |
|||
</member> |
|||
<member name="P:System.Reactive.Concurrency.IScheduler.Now"> |
|||
<summary> |
|||
Gets the scheduler's notion of current time. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.Concurrency.ISchedulerLongRunning"> |
|||
<summary> |
|||
Scheduler with support for starting long-running tasks. |
|||
This type of scheduler can be used to run loops more efficiently instead of using recursive scheduling. |
|||
</summary> |
|||
</member> |
|||
<member name="M:System.Reactive.Concurrency.ISchedulerLongRunning.ScheduleLongRunning``1(``0,System.Action{``0,System.Reactive.Disposables.ICancelable})"> |
|||
<summary> |
|||
Schedules a long-running piece of work. |
|||
</summary> |
|||
<typeparam name="TState">The type of the state passed to the scheduled action.</typeparam> |
|||
<param name="state">State passed to the action to be executed.</param> |
|||
<param name="action">Action to be executed.</param> |
|||
<returns>The disposable object used to cancel the scheduled action (best effort).</returns> |
|||
<remarks> |
|||
<para><b>Notes to implementers</b></para> |
|||
The returned disposable object should not prevent the work from starting, but only set the cancellation flag passed to the specified action. |
|||
</remarks> |
|||
</member> |
|||
<member name="T:System.Reactive.Concurrency.IStopwatch"> |
|||
<summary> |
|||
Abstraction for a stopwatch to compute time relative to a starting point. |
|||
</summary> |
|||
</member> |
|||
<member name="P:System.Reactive.Concurrency.IStopwatch.Elapsed"> |
|||
<summary> |
|||
Gets the time elapsed since the stopwatch object was obtained. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.Disposables.ICancelable"> |
|||
<summary> |
|||
Disposable resource with dipsosal state tracking. |
|||
</summary> |
|||
</member> |
|||
<member name="P:System.Reactive.Disposables.ICancelable.IsDisposed"> |
|||
<summary> |
|||
Gets a value that indicates whether the object is disposed. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.IEventPattern`2"> |
|||
<summary> |
|||
Represents a .NET event invocation consisting of the strongly typed object that raised the event and the data that was generated by the event. |
|||
</summary> |
|||
<typeparam name="TSender"> |
|||
The type of the sender that raised the event. |
|||
This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
<typeparam name="TEventArgs"> |
|||
The type of the event data generated by the event. |
|||
This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
</member> |
|||
<member name="P:System.Reactive.IEventPattern`2.Sender"> |
|||
<summary> |
|||
Gets the sender object that raised the event. |
|||
</summary> |
|||
</member> |
|||
<member name="P:System.Reactive.IEventPattern`2.EventArgs"> |
|||
<summary> |
|||
Gets the event data that was generated by the event. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.IEventPatternSource`1"> |
|||
<summary> |
|||
Represents a data stream signaling its elements by means of an event. |
|||
</summary> |
|||
<typeparam name="TEventArgs">The type of the event data generated by the event.</typeparam> |
|||
</member> |
|||
<member name="E:System.Reactive.IEventPatternSource`1.OnNext"> |
|||
<summary> |
|||
Event signaling the next element in the data stream. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.IEventSource`1"> |
|||
<summary> |
|||
Represents a data stream signaling its elements by means of an event. |
|||
</summary> |
|||
<typeparam name="T"> |
|||
The type of the event data generated by the event. |
|||
This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
</member> |
|||
<member name="E:System.Reactive.IEventSource`1.OnNext"> |
|||
<summary> |
|||
Event signaling the next element in the data stream. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.IObserver`2"> |
|||
<summary> |
|||
Provides a mechanism for receiving push-based notifications and returning a response. |
|||
</summary> |
|||
<typeparam name="TValue"> |
|||
The type of the elements received by the observer. |
|||
This type parameter is contravariant. That is, you can use either the type you specified or any type that is less derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
<typeparam name="TResult"> |
|||
The type of the result returned from the observer's notification handlers. |
|||
This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
</member> |
|||
<member name="M:System.Reactive.IObserver`2.OnNext(`0)"> |
|||
<summary> |
|||
Notifies the observer of a new element in the sequence. |
|||
</summary> |
|||
<param name="value">The new element in the sequence.</param> |
|||
<returns>Result returned upon observation of a new element.</returns> |
|||
</member> |
|||
<member name="M:System.Reactive.IObserver`2.OnError(System.Exception)"> |
|||
<summary> |
|||
Notifies the observer that an exception has occurred. |
|||
</summary> |
|||
<param name="exception">The exception that occurred.</param> |
|||
<returns>Result returned upon observation of an error.</returns> |
|||
</member> |
|||
<member name="M:System.Reactive.IObserver`2.OnCompleted"> |
|||
<summary> |
|||
Notifies the observer of the end of the sequence. |
|||
</summary> |
|||
<returns>Result returned upon observation of the sequence completion.</returns> |
|||
</member> |
|||
<member name="T:System.Reactive.Linq.IGroupedObservable`2"> |
|||
<summary> |
|||
Represents an observable sequence of elements that have a common key. |
|||
</summary> |
|||
<typeparam name="TKey"> |
|||
The type of the key shared by all elements in the group. |
|||
This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
<typeparam name="TElement"> |
|||
The type of the elements in the group. |
|||
This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
</member> |
|||
<member name="P:System.Reactive.Linq.IGroupedObservable`2.Key"> |
|||
<summary> |
|||
Gets the common key. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.Linq.IQbservable`1"> |
|||
<summary> |
|||
Provides functionality to evaluate queries against a specific data source wherein the type of the data is known. |
|||
</summary> |
|||
<typeparam name="T"> |
|||
The type of the data in the data source. |
|||
This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
</member> |
|||
<member name="T:System.Reactive.Linq.IQbservable"> |
|||
<summary> |
|||
Provides functionality to evaluate queries against a specific data source wherein the type of the data is not specified. |
|||
</summary> |
|||
</member> |
|||
<member name="P:System.Reactive.Linq.IQbservable.ElementType"> |
|||
<summary> |
|||
Gets the type of the element(s) that are returned when the expression tree associated with this instance of IQbservable is executed. |
|||
</summary> |
|||
</member> |
|||
<member name="P:System.Reactive.Linq.IQbservable.Expression"> |
|||
<summary> |
|||
Gets the expression tree that is associated with the instance of IQbservable. |
|||
</summary> |
|||
</member> |
|||
<member name="P:System.Reactive.Linq.IQbservable.Provider"> |
|||
<summary> |
|||
Gets the query provider that is associated with this data source. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.Linq.IQbservableProvider"> |
|||
<summary> |
|||
Defines methods to create and execute queries that are described by an IQbservable object. |
|||
</summary> |
|||
</member> |
|||
<member name="M:System.Reactive.Linq.IQbservableProvider.CreateQuery``1(System.Linq.Expressions.Expression)"> |
|||
<summary> |
|||
Constructs an IQbservable>TResult< object that can evaluate the query represented by a specified expression tree. |
|||
</summary> |
|||
<typeparam name="TResult">The type of the elements of the System.Reactive.Linq.IQbservable<T> that is returned.</typeparam> |
|||
<param name="expression">Expression tree representing the query.</param> |
|||
<returns>IQbservable object that can evaluate the given query expression.</returns> |
|||
</member> |
|||
<member name="T:System.Reactive.Subjects.IConnectableObservable`1"> |
|||
<summary> |
|||
Represents an observable wrapper that can be connected and disconnected from its underlying observable sequence. |
|||
</summary> |
|||
<typeparam name="T"> |
|||
The type of the elements in the sequence. |
|||
This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
</member> |
|||
<member name="M:System.Reactive.Subjects.IConnectableObservable`1.Connect"> |
|||
<summary> |
|||
Connects the observable wrapper to its source. All subscribed observers will receive values from the underlying observable sequence as long as the connection is established. |
|||
</summary> |
|||
<returns>Disposable used to disconnect the observable wrapper from its source, causing subscribed observer to stop receiving values from the underlying observable sequence.</returns> |
|||
</member> |
|||
<member name="T:System.Reactive.Subjects.ISubject`1"> |
|||
<summary> |
|||
Represents an object that is both an observable sequence as well as an observer. |
|||
</summary> |
|||
<typeparam name="T">The type of the elements processed by the subject.</typeparam> |
|||
</member> |
|||
<member name="T:System.Reactive.Subjects.ISubject`2"> |
|||
<summary> |
|||
Represents an object that is both an observable sequence as well as an observer. |
|||
</summary> |
|||
<typeparam name="TSource"> |
|||
The type of the elements received by the subject. |
|||
This type parameter is contravariant. That is, you can use either the type you specified or any type that is less derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
<typeparam name="TResult"> |
|||
The type of the elements produced by the subject. |
|||
This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
</member> |
|||
</members> |
|||
</doc> |
|||
Binary file not shown.
@ -0,0 +1,336 @@ |
|||
<?xml version="1.0"?> |
|||
<doc> |
|||
<assembly> |
|||
<name>System.Reactive.Interfaces</name> |
|||
</assembly> |
|||
<members> |
|||
<member name="T:System.Reactive.NamespaceDoc"> |
|||
<summary> |
|||
The <b>System.Reactive</b> namespace contains interfaces and classes used throughout the Reactive Extensions library. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.Concurrency.NamespaceDoc"> |
|||
<summary> |
|||
The <b>System.Reactive.Concurrency</b> namespace contains interfaces and classes that provide the scheduler infrastructure used by Reactive Extensions to construct and |
|||
process event streams. Schedulers are used to parameterize the concurrency introduced by query operators, provide means to virtualize time, to process historical data, |
|||
and to write unit tests for functionality built using Reactive Extensions constructs. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.Disposables.NamespaceDoc"> |
|||
<summary> |
|||
The <b>System.Reactive.Disposables</b> namespace contains interfaces and classes that provide a compositional set of constructs used to deal with resource and subscription |
|||
management in Reactive Extensions. Those types are used extensively within the implementation of Reactive Extensions and are useful when writing custom query operators or |
|||
schedulers. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.Linq.NamespaceDoc"> |
|||
<summary> |
|||
The <b>System.Reactive.Linq</b> namespace contains interfaces and classes that support expressing queries over observable sequences, using Language Integrated Query (LINQ). |
|||
Query operators are made available as extension methods for IObservable<T> and IQbservable<T> defined on the Observable and Qbservable classes, respectively. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.Subjects.NamespaceDoc"> |
|||
<summary> |
|||
The <b>System.Reactive.Subjects</b> namespace contains interfaces and classes to represent subjects, which are objects implementing both IObservable<T> and IObserver<T>. |
|||
Subjects are often used as sources of events, allowing one party to raise events and allowing another party to write queries over the event stream. Because of their ability to |
|||
have multiple registered observers, subjects are also used as a facility to provide multicast behavior for event streams in queries. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.Concurrency.ISchedulerPeriodic"> |
|||
<summary> |
|||
Scheduler with support for running periodic tasks. |
|||
This type of scheduler can be used to run timers more efficiently instead of using recursive scheduling. |
|||
</summary> |
|||
</member> |
|||
<member name="M:System.Reactive.Concurrency.ISchedulerPeriodic.SchedulePeriodic``1(``0,System.TimeSpan,System.Func{``0,``0})"> |
|||
<summary> |
|||
Schedules a periodic piece of work. |
|||
</summary> |
|||
<typeparam name="TState">The type of the state passed to the scheduled action.</typeparam> |
|||
<param name="state">Initial state passed to the action upon the first iteration.</param> |
|||
<param name="period">Period for running the work periodically.</param> |
|||
<param name="action">Action to be executed, potentially updating the state.</param> |
|||
<returns>The disposable object used to cancel the scheduled recurring action (best effort).</returns> |
|||
</member> |
|||
<member name="T:System.Reactive.Concurrency.IStopwatchProvider"> |
|||
<summary> |
|||
Provider for IStopwatch objects. |
|||
</summary> |
|||
</member> |
|||
<member name="M:System.Reactive.Concurrency.IStopwatchProvider.StartStopwatch"> |
|||
<summary> |
|||
Starts a new stopwatch object. |
|||
</summary> |
|||
<returns>New stopwatch object; started at the time of the request.</returns> |
|||
</member> |
|||
<member name="T:System.Reactive.Concurrency.IScheduledItem`1"> |
|||
<summary> |
|||
Represents a work item that has been scheduled. |
|||
</summary> |
|||
<typeparam name="TAbsolute">Absolute time representation type.</typeparam> |
|||
</member> |
|||
<member name="M:System.Reactive.Concurrency.IScheduledItem`1.Invoke"> |
|||
<summary> |
|||
Invokes the work item. |
|||
</summary> |
|||
</member> |
|||
<member name="P:System.Reactive.Concurrency.IScheduledItem`1.DueTime"> |
|||
<summary> |
|||
Gets the absolute time at which the item is due for invocation. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.Concurrency.IScheduler"> |
|||
<summary> |
|||
Represents an object that schedules units of work. |
|||
</summary> |
|||
</member> |
|||
<member name="M:System.Reactive.Concurrency.IScheduler.Schedule``1(``0,System.Func{System.Reactive.Concurrency.IScheduler,``0,System.IDisposable})"> |
|||
<summary> |
|||
Schedules an action to be executed. |
|||
</summary> |
|||
<typeparam name="TState">The type of the state passed to the scheduled action.</typeparam> |
|||
<param name="state">State passed to the action to be executed.</param> |
|||
<param name="action">Action to be executed.</param> |
|||
<returns>The disposable object used to cancel the scheduled action (best effort).</returns> |
|||
</member> |
|||
<member name="M:System.Reactive.Concurrency.IScheduler.Schedule``1(``0,System.TimeSpan,System.Func{System.Reactive.Concurrency.IScheduler,``0,System.IDisposable})"> |
|||
<summary> |
|||
Schedules an action to be executed after dueTime. |
|||
</summary> |
|||
<typeparam name="TState">The type of the state passed to the scheduled action.</typeparam> |
|||
<param name="state">State passed to the action to be executed.</param> |
|||
<param name="action">Action to be executed.</param> |
|||
<param name="dueTime">Relative time after which to execute the action.</param> |
|||
<returns>The disposable object used to cancel the scheduled action (best effort).</returns> |
|||
</member> |
|||
<member name="M:System.Reactive.Concurrency.IScheduler.Schedule``1(``0,System.DateTimeOffset,System.Func{System.Reactive.Concurrency.IScheduler,``0,System.IDisposable})"> |
|||
<summary> |
|||
Schedules an action to be executed at dueTime. |
|||
</summary> |
|||
<typeparam name="TState">The type of the state passed to the scheduled action.</typeparam> |
|||
<param name="state">State passed to the action to be executed.</param> |
|||
<param name="action">Action to be executed.</param> |
|||
<param name="dueTime">Absolute time at which to execute the action.</param> |
|||
<returns>The disposable object used to cancel the scheduled action (best effort).</returns> |
|||
</member> |
|||
<member name="P:System.Reactive.Concurrency.IScheduler.Now"> |
|||
<summary> |
|||
Gets the scheduler's notion of current time. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.Concurrency.ISchedulerLongRunning"> |
|||
<summary> |
|||
Scheduler with support for starting long-running tasks. |
|||
This type of scheduler can be used to run loops more efficiently instead of using recursive scheduling. |
|||
</summary> |
|||
</member> |
|||
<member name="M:System.Reactive.Concurrency.ISchedulerLongRunning.ScheduleLongRunning``1(``0,System.Action{``0,System.Reactive.Disposables.ICancelable})"> |
|||
<summary> |
|||
Schedules a long-running piece of work. |
|||
</summary> |
|||
<typeparam name="TState">The type of the state passed to the scheduled action.</typeparam> |
|||
<param name="state">State passed to the action to be executed.</param> |
|||
<param name="action">Action to be executed.</param> |
|||
<returns>The disposable object used to cancel the scheduled action (best effort).</returns> |
|||
<remarks> |
|||
<para><b>Notes to implementers</b></para> |
|||
The returned disposable object should not prevent the work from starting, but only set the cancellation flag passed to the specified action. |
|||
</remarks> |
|||
</member> |
|||
<member name="T:System.Reactive.Concurrency.IStopwatch"> |
|||
<summary> |
|||
Abstraction for a stopwatch to compute time relative to a starting point. |
|||
</summary> |
|||
</member> |
|||
<member name="P:System.Reactive.Concurrency.IStopwatch.Elapsed"> |
|||
<summary> |
|||
Gets the time elapsed since the stopwatch object was obtained. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.Disposables.ICancelable"> |
|||
<summary> |
|||
Disposable resource with dipsosal state tracking. |
|||
</summary> |
|||
</member> |
|||
<member name="P:System.Reactive.Disposables.ICancelable.IsDisposed"> |
|||
<summary> |
|||
Gets a value that indicates whether the object is disposed. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.IEventPattern`2"> |
|||
<summary> |
|||
Represents a .NET event invocation consisting of the strongly typed object that raised the event and the data that was generated by the event. |
|||
</summary> |
|||
<typeparam name="TSender"> |
|||
The type of the sender that raised the event. |
|||
This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
<typeparam name="TEventArgs"> |
|||
The type of the event data generated by the event. |
|||
This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
</member> |
|||
<member name="P:System.Reactive.IEventPattern`2.Sender"> |
|||
<summary> |
|||
Gets the sender object that raised the event. |
|||
</summary> |
|||
</member> |
|||
<member name="P:System.Reactive.IEventPattern`2.EventArgs"> |
|||
<summary> |
|||
Gets the event data that was generated by the event. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.IEventPatternSource`1"> |
|||
<summary> |
|||
Represents a data stream signaling its elements by means of an event. |
|||
</summary> |
|||
<typeparam name="TEventArgs">The type of the event data generated by the event.</typeparam> |
|||
</member> |
|||
<member name="E:System.Reactive.IEventPatternSource`1.OnNext"> |
|||
<summary> |
|||
Event signaling the next element in the data stream. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.IEventSource`1"> |
|||
<summary> |
|||
Represents a data stream signaling its elements by means of an event. |
|||
</summary> |
|||
<typeparam name="T"> |
|||
The type of the event data generated by the event. |
|||
This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
</member> |
|||
<member name="E:System.Reactive.IEventSource`1.OnNext"> |
|||
<summary> |
|||
Event signaling the next element in the data stream. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.IObserver`2"> |
|||
<summary> |
|||
Provides a mechanism for receiving push-based notifications and returning a response. |
|||
</summary> |
|||
<typeparam name="TValue"> |
|||
The type of the elements received by the observer. |
|||
This type parameter is contravariant. That is, you can use either the type you specified or any type that is less derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
<typeparam name="TResult"> |
|||
The type of the result returned from the observer's notification handlers. |
|||
This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
</member> |
|||
<member name="M:System.Reactive.IObserver`2.OnNext(`0)"> |
|||
<summary> |
|||
Notifies the observer of a new element in the sequence. |
|||
</summary> |
|||
<param name="value">The new element in the sequence.</param> |
|||
<returns>Result returned upon observation of a new element.</returns> |
|||
</member> |
|||
<member name="M:System.Reactive.IObserver`2.OnError(System.Exception)"> |
|||
<summary> |
|||
Notifies the observer that an exception has occurred. |
|||
</summary> |
|||
<param name="exception">The exception that occurred.</param> |
|||
<returns>Result returned upon observation of an error.</returns> |
|||
</member> |
|||
<member name="M:System.Reactive.IObserver`2.OnCompleted"> |
|||
<summary> |
|||
Notifies the observer of the end of the sequence. |
|||
</summary> |
|||
<returns>Result returned upon observation of the sequence completion.</returns> |
|||
</member> |
|||
<member name="T:System.Reactive.Linq.IGroupedObservable`2"> |
|||
<summary> |
|||
Represents an observable sequence of elements that have a common key. |
|||
</summary> |
|||
<typeparam name="TKey"> |
|||
The type of the key shared by all elements in the group. |
|||
This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
<typeparam name="TElement"> |
|||
The type of the elements in the group. |
|||
This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
</member> |
|||
<member name="P:System.Reactive.Linq.IGroupedObservable`2.Key"> |
|||
<summary> |
|||
Gets the common key. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.Linq.IQbservable`1"> |
|||
<summary> |
|||
Provides functionality to evaluate queries against a specific data source wherein the type of the data is known. |
|||
</summary> |
|||
<typeparam name="T"> |
|||
The type of the data in the data source. |
|||
This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
</member> |
|||
<member name="T:System.Reactive.Linq.IQbservable"> |
|||
<summary> |
|||
Provides functionality to evaluate queries against a specific data source wherein the type of the data is not specified. |
|||
</summary> |
|||
</member> |
|||
<member name="P:System.Reactive.Linq.IQbservable.ElementType"> |
|||
<summary> |
|||
Gets the type of the element(s) that are returned when the expression tree associated with this instance of IQbservable is executed. |
|||
</summary> |
|||
</member> |
|||
<member name="P:System.Reactive.Linq.IQbservable.Expression"> |
|||
<summary> |
|||
Gets the expression tree that is associated with the instance of IQbservable. |
|||
</summary> |
|||
</member> |
|||
<member name="P:System.Reactive.Linq.IQbservable.Provider"> |
|||
<summary> |
|||
Gets the query provider that is associated with this data source. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.Linq.IQbservableProvider"> |
|||
<summary> |
|||
Defines methods to create and execute queries that are described by an IQbservable object. |
|||
</summary> |
|||
</member> |
|||
<member name="M:System.Reactive.Linq.IQbservableProvider.CreateQuery``1(System.Linq.Expressions.Expression)"> |
|||
<summary> |
|||
Constructs an IQbservable>TResult< object that can evaluate the query represented by a specified expression tree. |
|||
</summary> |
|||
<typeparam name="TResult">The type of the elements of the System.Reactive.Linq.IQbservable<T> that is returned.</typeparam> |
|||
<param name="expression">Expression tree representing the query.</param> |
|||
<returns>IQbservable object that can evaluate the given query expression.</returns> |
|||
</member> |
|||
<member name="T:System.Reactive.Subjects.IConnectableObservable`1"> |
|||
<summary> |
|||
Represents an observable wrapper that can be connected and disconnected from its underlying observable sequence. |
|||
</summary> |
|||
<typeparam name="T"> |
|||
The type of the elements in the sequence. |
|||
This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
</member> |
|||
<member name="M:System.Reactive.Subjects.IConnectableObservable`1.Connect"> |
|||
<summary> |
|||
Connects the observable wrapper to its source. All subscribed observers will receive values from the underlying observable sequence as long as the connection is established. |
|||
</summary> |
|||
<returns>Disposable used to disconnect the observable wrapper from its source, causing subscribed observer to stop receiving values from the underlying observable sequence.</returns> |
|||
</member> |
|||
<member name="T:System.Reactive.Subjects.ISubject`1"> |
|||
<summary> |
|||
Represents an object that is both an observable sequence as well as an observer. |
|||
</summary> |
|||
<typeparam name="T">The type of the elements processed by the subject.</typeparam> |
|||
</member> |
|||
<member name="T:System.Reactive.Subjects.ISubject`2"> |
|||
<summary> |
|||
Represents an object that is both an observable sequence as well as an observer. |
|||
</summary> |
|||
<typeparam name="TSource"> |
|||
The type of the elements received by the subject. |
|||
This type parameter is contravariant. That is, you can use either the type you specified or any type that is less derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
<typeparam name="TResult"> |
|||
The type of the elements produced by the subject. |
|||
This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
</member> |
|||
</members> |
|||
</doc> |
|||
Binary file not shown.
@ -0,0 +1,336 @@ |
|||
<?xml version="1.0"?> |
|||
<doc> |
|||
<assembly> |
|||
<name>System.Reactive.Interfaces</name> |
|||
</assembly> |
|||
<members> |
|||
<member name="T:System.Reactive.NamespaceDoc"> |
|||
<summary> |
|||
The <b>System.Reactive</b> namespace contains interfaces and classes used throughout the Reactive Extensions library. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.Concurrency.NamespaceDoc"> |
|||
<summary> |
|||
The <b>System.Reactive.Concurrency</b> namespace contains interfaces and classes that provide the scheduler infrastructure used by Reactive Extensions to construct and |
|||
process event streams. Schedulers are used to parameterize the concurrency introduced by query operators, provide means to virtualize time, to process historical data, |
|||
and to write unit tests for functionality built using Reactive Extensions constructs. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.Disposables.NamespaceDoc"> |
|||
<summary> |
|||
The <b>System.Reactive.Disposables</b> namespace contains interfaces and classes that provide a compositional set of constructs used to deal with resource and subscription |
|||
management in Reactive Extensions. Those types are used extensively within the implementation of Reactive Extensions and are useful when writing custom query operators or |
|||
schedulers. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.Linq.NamespaceDoc"> |
|||
<summary> |
|||
The <b>System.Reactive.Linq</b> namespace contains interfaces and classes that support expressing queries over observable sequences, using Language Integrated Query (LINQ). |
|||
Query operators are made available as extension methods for IObservable<T> and IQbservable<T> defined on the Observable and Qbservable classes, respectively. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.Subjects.NamespaceDoc"> |
|||
<summary> |
|||
The <b>System.Reactive.Subjects</b> namespace contains interfaces and classes to represent subjects, which are objects implementing both IObservable<T> and IObserver<T>. |
|||
Subjects are often used as sources of events, allowing one party to raise events and allowing another party to write queries over the event stream. Because of their ability to |
|||
have multiple registered observers, subjects are also used as a facility to provide multicast behavior for event streams in queries. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.Concurrency.ISchedulerPeriodic"> |
|||
<summary> |
|||
Scheduler with support for running periodic tasks. |
|||
This type of scheduler can be used to run timers more efficiently instead of using recursive scheduling. |
|||
</summary> |
|||
</member> |
|||
<member name="M:System.Reactive.Concurrency.ISchedulerPeriodic.SchedulePeriodic``1(``0,System.TimeSpan,System.Func{``0,``0})"> |
|||
<summary> |
|||
Schedules a periodic piece of work. |
|||
</summary> |
|||
<typeparam name="TState">The type of the state passed to the scheduled action.</typeparam> |
|||
<param name="state">Initial state passed to the action upon the first iteration.</param> |
|||
<param name="period">Period for running the work periodically.</param> |
|||
<param name="action">Action to be executed, potentially updating the state.</param> |
|||
<returns>The disposable object used to cancel the scheduled recurring action (best effort).</returns> |
|||
</member> |
|||
<member name="T:System.Reactive.Concurrency.IStopwatchProvider"> |
|||
<summary> |
|||
Provider for IStopwatch objects. |
|||
</summary> |
|||
</member> |
|||
<member name="M:System.Reactive.Concurrency.IStopwatchProvider.StartStopwatch"> |
|||
<summary> |
|||
Starts a new stopwatch object. |
|||
</summary> |
|||
<returns>New stopwatch object; started at the time of the request.</returns> |
|||
</member> |
|||
<member name="T:System.Reactive.Concurrency.IScheduledItem`1"> |
|||
<summary> |
|||
Represents a work item that has been scheduled. |
|||
</summary> |
|||
<typeparam name="TAbsolute">Absolute time representation type.</typeparam> |
|||
</member> |
|||
<member name="M:System.Reactive.Concurrency.IScheduledItem`1.Invoke"> |
|||
<summary> |
|||
Invokes the work item. |
|||
</summary> |
|||
</member> |
|||
<member name="P:System.Reactive.Concurrency.IScheduledItem`1.DueTime"> |
|||
<summary> |
|||
Gets the absolute time at which the item is due for invocation. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.Concurrency.IScheduler"> |
|||
<summary> |
|||
Represents an object that schedules units of work. |
|||
</summary> |
|||
</member> |
|||
<member name="M:System.Reactive.Concurrency.IScheduler.Schedule``1(``0,System.Func{System.Reactive.Concurrency.IScheduler,``0,System.IDisposable})"> |
|||
<summary> |
|||
Schedules an action to be executed. |
|||
</summary> |
|||
<typeparam name="TState">The type of the state passed to the scheduled action.</typeparam> |
|||
<param name="state">State passed to the action to be executed.</param> |
|||
<param name="action">Action to be executed.</param> |
|||
<returns>The disposable object used to cancel the scheduled action (best effort).</returns> |
|||
</member> |
|||
<member name="M:System.Reactive.Concurrency.IScheduler.Schedule``1(``0,System.TimeSpan,System.Func{System.Reactive.Concurrency.IScheduler,``0,System.IDisposable})"> |
|||
<summary> |
|||
Schedules an action to be executed after dueTime. |
|||
</summary> |
|||
<typeparam name="TState">The type of the state passed to the scheduled action.</typeparam> |
|||
<param name="state">State passed to the action to be executed.</param> |
|||
<param name="action">Action to be executed.</param> |
|||
<param name="dueTime">Relative time after which to execute the action.</param> |
|||
<returns>The disposable object used to cancel the scheduled action (best effort).</returns> |
|||
</member> |
|||
<member name="M:System.Reactive.Concurrency.IScheduler.Schedule``1(``0,System.DateTimeOffset,System.Func{System.Reactive.Concurrency.IScheduler,``0,System.IDisposable})"> |
|||
<summary> |
|||
Schedules an action to be executed at dueTime. |
|||
</summary> |
|||
<typeparam name="TState">The type of the state passed to the scheduled action.</typeparam> |
|||
<param name="state">State passed to the action to be executed.</param> |
|||
<param name="action">Action to be executed.</param> |
|||
<param name="dueTime">Absolute time at which to execute the action.</param> |
|||
<returns>The disposable object used to cancel the scheduled action (best effort).</returns> |
|||
</member> |
|||
<member name="P:System.Reactive.Concurrency.IScheduler.Now"> |
|||
<summary> |
|||
Gets the scheduler's notion of current time. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.Concurrency.ISchedulerLongRunning"> |
|||
<summary> |
|||
Scheduler with support for starting long-running tasks. |
|||
This type of scheduler can be used to run loops more efficiently instead of using recursive scheduling. |
|||
</summary> |
|||
</member> |
|||
<member name="M:System.Reactive.Concurrency.ISchedulerLongRunning.ScheduleLongRunning``1(``0,System.Action{``0,System.Reactive.Disposables.ICancelable})"> |
|||
<summary> |
|||
Schedules a long-running piece of work. |
|||
</summary> |
|||
<typeparam name="TState">The type of the state passed to the scheduled action.</typeparam> |
|||
<param name="state">State passed to the action to be executed.</param> |
|||
<param name="action">Action to be executed.</param> |
|||
<returns>The disposable object used to cancel the scheduled action (best effort).</returns> |
|||
<remarks> |
|||
<para><b>Notes to implementers</b></para> |
|||
The returned disposable object should not prevent the work from starting, but only set the cancellation flag passed to the specified action. |
|||
</remarks> |
|||
</member> |
|||
<member name="T:System.Reactive.Concurrency.IStopwatch"> |
|||
<summary> |
|||
Abstraction for a stopwatch to compute time relative to a starting point. |
|||
</summary> |
|||
</member> |
|||
<member name="P:System.Reactive.Concurrency.IStopwatch.Elapsed"> |
|||
<summary> |
|||
Gets the time elapsed since the stopwatch object was obtained. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.Disposables.ICancelable"> |
|||
<summary> |
|||
Disposable resource with dipsosal state tracking. |
|||
</summary> |
|||
</member> |
|||
<member name="P:System.Reactive.Disposables.ICancelable.IsDisposed"> |
|||
<summary> |
|||
Gets a value that indicates whether the object is disposed. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.IEventPattern`2"> |
|||
<summary> |
|||
Represents a .NET event invocation consisting of the strongly typed object that raised the event and the data that was generated by the event. |
|||
</summary> |
|||
<typeparam name="TSender"> |
|||
The type of the sender that raised the event. |
|||
This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
<typeparam name="TEventArgs"> |
|||
The type of the event data generated by the event. |
|||
This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
</member> |
|||
<member name="P:System.Reactive.IEventPattern`2.Sender"> |
|||
<summary> |
|||
Gets the sender object that raised the event. |
|||
</summary> |
|||
</member> |
|||
<member name="P:System.Reactive.IEventPattern`2.EventArgs"> |
|||
<summary> |
|||
Gets the event data that was generated by the event. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.IEventPatternSource`1"> |
|||
<summary> |
|||
Represents a data stream signaling its elements by means of an event. |
|||
</summary> |
|||
<typeparam name="TEventArgs">The type of the event data generated by the event.</typeparam> |
|||
</member> |
|||
<member name="E:System.Reactive.IEventPatternSource`1.OnNext"> |
|||
<summary> |
|||
Event signaling the next element in the data stream. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.IEventSource`1"> |
|||
<summary> |
|||
Represents a data stream signaling its elements by means of an event. |
|||
</summary> |
|||
<typeparam name="T"> |
|||
The type of the event data generated by the event. |
|||
This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
</member> |
|||
<member name="E:System.Reactive.IEventSource`1.OnNext"> |
|||
<summary> |
|||
Event signaling the next element in the data stream. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.IObserver`2"> |
|||
<summary> |
|||
Provides a mechanism for receiving push-based notifications and returning a response. |
|||
</summary> |
|||
<typeparam name="TValue"> |
|||
The type of the elements received by the observer. |
|||
This type parameter is contravariant. That is, you can use either the type you specified or any type that is less derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
<typeparam name="TResult"> |
|||
The type of the result returned from the observer's notification handlers. |
|||
This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
</member> |
|||
<member name="M:System.Reactive.IObserver`2.OnNext(`0)"> |
|||
<summary> |
|||
Notifies the observer of a new element in the sequence. |
|||
</summary> |
|||
<param name="value">The new element in the sequence.</param> |
|||
<returns>Result returned upon observation of a new element.</returns> |
|||
</member> |
|||
<member name="M:System.Reactive.IObserver`2.OnError(System.Exception)"> |
|||
<summary> |
|||
Notifies the observer that an exception has occurred. |
|||
</summary> |
|||
<param name="exception">The exception that occurred.</param> |
|||
<returns>Result returned upon observation of an error.</returns> |
|||
</member> |
|||
<member name="M:System.Reactive.IObserver`2.OnCompleted"> |
|||
<summary> |
|||
Notifies the observer of the end of the sequence. |
|||
</summary> |
|||
<returns>Result returned upon observation of the sequence completion.</returns> |
|||
</member> |
|||
<member name="T:System.Reactive.Linq.IGroupedObservable`2"> |
|||
<summary> |
|||
Represents an observable sequence of elements that have a common key. |
|||
</summary> |
|||
<typeparam name="TKey"> |
|||
The type of the key shared by all elements in the group. |
|||
This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
<typeparam name="TElement"> |
|||
The type of the elements in the group. |
|||
This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
</member> |
|||
<member name="P:System.Reactive.Linq.IGroupedObservable`2.Key"> |
|||
<summary> |
|||
Gets the common key. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.Linq.IQbservable`1"> |
|||
<summary> |
|||
Provides functionality to evaluate queries against a specific data source wherein the type of the data is known. |
|||
</summary> |
|||
<typeparam name="T"> |
|||
The type of the data in the data source. |
|||
This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
</member> |
|||
<member name="T:System.Reactive.Linq.IQbservable"> |
|||
<summary> |
|||
Provides functionality to evaluate queries against a specific data source wherein the type of the data is not specified. |
|||
</summary> |
|||
</member> |
|||
<member name="P:System.Reactive.Linq.IQbservable.ElementType"> |
|||
<summary> |
|||
Gets the type of the element(s) that are returned when the expression tree associated with this instance of IQbservable is executed. |
|||
</summary> |
|||
</member> |
|||
<member name="P:System.Reactive.Linq.IQbservable.Expression"> |
|||
<summary> |
|||
Gets the expression tree that is associated with the instance of IQbservable. |
|||
</summary> |
|||
</member> |
|||
<member name="P:System.Reactive.Linq.IQbservable.Provider"> |
|||
<summary> |
|||
Gets the query provider that is associated with this data source. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.Linq.IQbservableProvider"> |
|||
<summary> |
|||
Defines methods to create and execute queries that are described by an IQbservable object. |
|||
</summary> |
|||
</member> |
|||
<member name="M:System.Reactive.Linq.IQbservableProvider.CreateQuery``1(System.Linq.Expressions.Expression)"> |
|||
<summary> |
|||
Constructs an IQbservable>TResult< object that can evaluate the query represented by a specified expression tree. |
|||
</summary> |
|||
<typeparam name="TResult">The type of the elements of the System.Reactive.Linq.IQbservable<T> that is returned.</typeparam> |
|||
<param name="expression">Expression tree representing the query.</param> |
|||
<returns>IQbservable object that can evaluate the given query expression.</returns> |
|||
</member> |
|||
<member name="T:System.Reactive.Subjects.IConnectableObservable`1"> |
|||
<summary> |
|||
Represents an observable wrapper that can be connected and disconnected from its underlying observable sequence. |
|||
</summary> |
|||
<typeparam name="T"> |
|||
The type of the elements in the sequence. |
|||
This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
</member> |
|||
<member name="M:System.Reactive.Subjects.IConnectableObservable`1.Connect"> |
|||
<summary> |
|||
Connects the observable wrapper to its source. All subscribed observers will receive values from the underlying observable sequence as long as the connection is established. |
|||
</summary> |
|||
<returns>Disposable used to disconnect the observable wrapper from its source, causing subscribed observer to stop receiving values from the underlying observable sequence.</returns> |
|||
</member> |
|||
<member name="T:System.Reactive.Subjects.ISubject`1"> |
|||
<summary> |
|||
Represents an object that is both an observable sequence as well as an observer. |
|||
</summary> |
|||
<typeparam name="T">The type of the elements processed by the subject.</typeparam> |
|||
</member> |
|||
<member name="T:System.Reactive.Subjects.ISubject`2"> |
|||
<summary> |
|||
Represents an object that is both an observable sequence as well as an observer. |
|||
</summary> |
|||
<typeparam name="TSource"> |
|||
The type of the elements received by the subject. |
|||
This type parameter is contravariant. That is, you can use either the type you specified or any type that is less derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
<typeparam name="TResult"> |
|||
The type of the elements produced by the subject. |
|||
This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
</member> |
|||
</members> |
|||
</doc> |
|||
Binary file not shown.
@ -0,0 +1,368 @@ |
|||
<?xml version="1.0"?> |
|||
<doc> |
|||
<assembly> |
|||
<name>System.Reactive.Interfaces</name> |
|||
</assembly> |
|||
<members> |
|||
<member name="T:System.IObservable`1"> |
|||
<summary> |
|||
Represents a push-style collection. |
|||
</summary> |
|||
</member> |
|||
<member name="M:System.IObservable`1.Subscribe(System.IObserver{`0})"> |
|||
<summary> |
|||
Subscribes an observer to the observable sequence. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.IObserver`1"> |
|||
<summary> |
|||
Supports push-style iteration over an observable sequence. |
|||
</summary> |
|||
</member> |
|||
<member name="M:System.IObserver`1.OnNext(`0)"> |
|||
<summary> |
|||
Notifies the observer of a new element in the sequence. |
|||
</summary> |
|||
<param name="value">Next element in the sequence.</param> |
|||
</member> |
|||
<member name="M:System.IObserver`1.OnError(System.Exception)"> |
|||
<summary> |
|||
Notifies the observer that an exception has occurred. |
|||
</summary> |
|||
<param name="error">The error that has occurred.</param> |
|||
</member> |
|||
<member name="M:System.IObserver`1.OnCompleted"> |
|||
<summary> |
|||
Notifies the observer of the end of the sequence. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.NamespaceDoc"> |
|||
<summary> |
|||
The <b>System.Reactive</b> namespace contains interfaces and classes used throughout the Reactive Extensions library. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.Concurrency.NamespaceDoc"> |
|||
<summary> |
|||
The <b>System.Reactive.Concurrency</b> namespace contains interfaces and classes that provide the scheduler infrastructure used by Reactive Extensions to construct and |
|||
process event streams. Schedulers are used to parameterize the concurrency introduced by query operators, provide means to virtualize time, to process historical data, |
|||
and to write unit tests for functionality built using Reactive Extensions constructs. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.Disposables.NamespaceDoc"> |
|||
<summary> |
|||
The <b>System.Reactive.Disposables</b> namespace contains interfaces and classes that provide a compositional set of constructs used to deal with resource and subscription |
|||
management in Reactive Extensions. Those types are used extensively within the implementation of Reactive Extensions and are useful when writing custom query operators or |
|||
schedulers. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.Linq.NamespaceDoc"> |
|||
<summary> |
|||
The <b>System.Reactive.Linq</b> namespace contains interfaces and classes that support expressing queries over observable sequences, using Language Integrated Query (LINQ). |
|||
Query operators are made available as extension methods for IObservable<T> and IQbservable<T> defined on the Observable and Qbservable classes, respectively. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.Subjects.NamespaceDoc"> |
|||
<summary> |
|||
The <b>System.Reactive.Subjects</b> namespace contains interfaces and classes to represent subjects, which are objects implementing both IObservable<T> and IObserver<T>. |
|||
Subjects are often used as sources of events, allowing one party to raise events and allowing another party to write queries over the event stream. Because of their ability to |
|||
have multiple registered observers, subjects are also used as a facility to provide multicast behavior for event streams in queries. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.Concurrency.ISchedulerPeriodic"> |
|||
<summary> |
|||
Scheduler with support for running periodic tasks. |
|||
This type of scheduler can be used to run timers more efficiently instead of using recursive scheduling. |
|||
</summary> |
|||
</member> |
|||
<member name="M:System.Reactive.Concurrency.ISchedulerPeriodic.SchedulePeriodic``1(``0,System.TimeSpan,System.Func{``0,``0})"> |
|||
<summary> |
|||
Schedules a periodic piece of work. |
|||
</summary> |
|||
<typeparam name="TState">The type of the state passed to the scheduled action.</typeparam> |
|||
<param name="state">Initial state passed to the action upon the first iteration.</param> |
|||
<param name="period">Period for running the work periodically.</param> |
|||
<param name="action">Action to be executed, potentially updating the state.</param> |
|||
<returns>The disposable object used to cancel the scheduled recurring action (best effort).</returns> |
|||
</member> |
|||
<member name="T:System.Reactive.Concurrency.IStopwatchProvider"> |
|||
<summary> |
|||
Provider for IStopwatch objects. |
|||
</summary> |
|||
</member> |
|||
<member name="M:System.Reactive.Concurrency.IStopwatchProvider.StartStopwatch"> |
|||
<summary> |
|||
Starts a new stopwatch object. |
|||
</summary> |
|||
<returns>New stopwatch object; started at the time of the request.</returns> |
|||
</member> |
|||
<member name="T:System.Reactive.Concurrency.IScheduledItem`1"> |
|||
<summary> |
|||
Represents a work item that has been scheduled. |
|||
</summary> |
|||
<typeparam name="TAbsolute">Absolute time representation type.</typeparam> |
|||
</member> |
|||
<member name="M:System.Reactive.Concurrency.IScheduledItem`1.Invoke"> |
|||
<summary> |
|||
Invokes the work item. |
|||
</summary> |
|||
</member> |
|||
<member name="P:System.Reactive.Concurrency.IScheduledItem`1.DueTime"> |
|||
<summary> |
|||
Gets the absolute time at which the item is due for invocation. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.Concurrency.IScheduler"> |
|||
<summary> |
|||
Represents an object that schedules units of work. |
|||
</summary> |
|||
</member> |
|||
<member name="M:System.Reactive.Concurrency.IScheduler.Schedule``1(``0,System.Func{System.Reactive.Concurrency.IScheduler,``0,System.IDisposable})"> |
|||
<summary> |
|||
Schedules an action to be executed. |
|||
</summary> |
|||
<typeparam name="TState">The type of the state passed to the scheduled action.</typeparam> |
|||
<param name="state">State passed to the action to be executed.</param> |
|||
<param name="action">Action to be executed.</param> |
|||
<returns>The disposable object used to cancel the scheduled action (best effort).</returns> |
|||
</member> |
|||
<member name="M:System.Reactive.Concurrency.IScheduler.Schedule``1(``0,System.TimeSpan,System.Func{System.Reactive.Concurrency.IScheduler,``0,System.IDisposable})"> |
|||
<summary> |
|||
Schedules an action to be executed after dueTime. |
|||
</summary> |
|||
<typeparam name="TState">The type of the state passed to the scheduled action.</typeparam> |
|||
<param name="state">State passed to the action to be executed.</param> |
|||
<param name="action">Action to be executed.</param> |
|||
<param name="dueTime">Relative time after which to execute the action.</param> |
|||
<returns>The disposable object used to cancel the scheduled action (best effort).</returns> |
|||
</member> |
|||
<member name="M:System.Reactive.Concurrency.IScheduler.Schedule``1(``0,System.DateTimeOffset,System.Func{System.Reactive.Concurrency.IScheduler,``0,System.IDisposable})"> |
|||
<summary> |
|||
Schedules an action to be executed at dueTime. |
|||
</summary> |
|||
<typeparam name="TState">The type of the state passed to the scheduled action.</typeparam> |
|||
<param name="state">State passed to the action to be executed.</param> |
|||
<param name="action">Action to be executed.</param> |
|||
<param name="dueTime">Absolute time at which to execute the action.</param> |
|||
<returns>The disposable object used to cancel the scheduled action (best effort).</returns> |
|||
</member> |
|||
<member name="P:System.Reactive.Concurrency.IScheduler.Now"> |
|||
<summary> |
|||
Gets the scheduler's notion of current time. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.Concurrency.ISchedulerLongRunning"> |
|||
<summary> |
|||
Scheduler with support for starting long-running tasks. |
|||
This type of scheduler can be used to run loops more efficiently instead of using recursive scheduling. |
|||
</summary> |
|||
</member> |
|||
<member name="M:System.Reactive.Concurrency.ISchedulerLongRunning.ScheduleLongRunning``1(``0,System.Action{``0,System.Reactive.Disposables.ICancelable})"> |
|||
<summary> |
|||
Schedules a long-running piece of work. |
|||
</summary> |
|||
<typeparam name="TState">The type of the state passed to the scheduled action.</typeparam> |
|||
<param name="state">State passed to the action to be executed.</param> |
|||
<param name="action">Action to be executed.</param> |
|||
<returns>The disposable object used to cancel the scheduled action (best effort).</returns> |
|||
<remarks> |
|||
<para><b>Notes to implementers</b></para> |
|||
The returned disposable object should not prevent the work from starting, but only set the cancellation flag passed to the specified action. |
|||
</remarks> |
|||
</member> |
|||
<member name="T:System.Reactive.Concurrency.IStopwatch"> |
|||
<summary> |
|||
Abstraction for a stopwatch to compute time relative to a starting point. |
|||
</summary> |
|||
</member> |
|||
<member name="P:System.Reactive.Concurrency.IStopwatch.Elapsed"> |
|||
<summary> |
|||
Gets the time elapsed since the stopwatch object was obtained. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.Disposables.ICancelable"> |
|||
<summary> |
|||
Disposable resource with dipsosal state tracking. |
|||
</summary> |
|||
</member> |
|||
<member name="P:System.Reactive.Disposables.ICancelable.IsDisposed"> |
|||
<summary> |
|||
Gets a value that indicates whether the object is disposed. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.IEventPattern`2"> |
|||
<summary> |
|||
Represents a .NET event invocation consisting of the strongly typed object that raised the event and the data that was generated by the event. |
|||
</summary> |
|||
<typeparam name="TSender"> |
|||
The type of the sender that raised the event. |
|||
This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
<typeparam name="TEventArgs"> |
|||
The type of the event data generated by the event. |
|||
This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
</member> |
|||
<member name="P:System.Reactive.IEventPattern`2.Sender"> |
|||
<summary> |
|||
Gets the sender object that raised the event. |
|||
</summary> |
|||
</member> |
|||
<member name="P:System.Reactive.IEventPattern`2.EventArgs"> |
|||
<summary> |
|||
Gets the event data that was generated by the event. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.IEventPatternSource`1"> |
|||
<summary> |
|||
Represents a data stream signaling its elements by means of an event. |
|||
</summary> |
|||
<typeparam name="TEventArgs">The type of the event data generated by the event.</typeparam> |
|||
</member> |
|||
<member name="E:System.Reactive.IEventPatternSource`1.OnNext"> |
|||
<summary> |
|||
Event signaling the next element in the data stream. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.IEventSource`1"> |
|||
<summary> |
|||
Represents a data stream signaling its elements by means of an event. |
|||
</summary> |
|||
<typeparam name="T"> |
|||
The type of the event data generated by the event. |
|||
This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
</member> |
|||
<member name="E:System.Reactive.IEventSource`1.OnNext"> |
|||
<summary> |
|||
Event signaling the next element in the data stream. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.IObserver`2"> |
|||
<summary> |
|||
Provides a mechanism for receiving push-based notifications and returning a response. |
|||
</summary> |
|||
<typeparam name="TValue"> |
|||
The type of the elements received by the observer. |
|||
This type parameter is contravariant. That is, you can use either the type you specified or any type that is less derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
<typeparam name="TResult"> |
|||
The type of the result returned from the observer's notification handlers. |
|||
This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
</member> |
|||
<member name="M:System.Reactive.IObserver`2.OnNext(`0)"> |
|||
<summary> |
|||
Notifies the observer of a new element in the sequence. |
|||
</summary> |
|||
<param name="value">The new element in the sequence.</param> |
|||
<returns>Result returned upon observation of a new element.</returns> |
|||
</member> |
|||
<member name="M:System.Reactive.IObserver`2.OnError(System.Exception)"> |
|||
<summary> |
|||
Notifies the observer that an exception has occurred. |
|||
</summary> |
|||
<param name="exception">The exception that occurred.</param> |
|||
<returns>Result returned upon observation of an error.</returns> |
|||
</member> |
|||
<member name="M:System.Reactive.IObserver`2.OnCompleted"> |
|||
<summary> |
|||
Notifies the observer of the end of the sequence. |
|||
</summary> |
|||
<returns>Result returned upon observation of the sequence completion.</returns> |
|||
</member> |
|||
<member name="T:System.Reactive.Linq.IGroupedObservable`2"> |
|||
<summary> |
|||
Represents an observable sequence of elements that have a common key. |
|||
</summary> |
|||
<typeparam name="TKey"> |
|||
The type of the key shared by all elements in the group. |
|||
This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
<typeparam name="TElement"> |
|||
The type of the elements in the group. |
|||
This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
</member> |
|||
<member name="P:System.Reactive.Linq.IGroupedObservable`2.Key"> |
|||
<summary> |
|||
Gets the common key. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.Linq.IQbservable`1"> |
|||
<summary> |
|||
Provides functionality to evaluate queries against a specific data source wherein the type of the data is known. |
|||
</summary> |
|||
<typeparam name="T"> |
|||
The type of the data in the data source. |
|||
This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
</member> |
|||
<member name="T:System.Reactive.Linq.IQbservable"> |
|||
<summary> |
|||
Provides functionality to evaluate queries against a specific data source wherein the type of the data is not specified. |
|||
</summary> |
|||
</member> |
|||
<member name="P:System.Reactive.Linq.IQbservable.ElementType"> |
|||
<summary> |
|||
Gets the type of the element(s) that are returned when the expression tree associated with this instance of IQbservable is executed. |
|||
</summary> |
|||
</member> |
|||
<member name="P:System.Reactive.Linq.IQbservable.Expression"> |
|||
<summary> |
|||
Gets the expression tree that is associated with the instance of IQbservable. |
|||
</summary> |
|||
</member> |
|||
<member name="P:System.Reactive.Linq.IQbservable.Provider"> |
|||
<summary> |
|||
Gets the query provider that is associated with this data source. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.Linq.IQbservableProvider"> |
|||
<summary> |
|||
Defines methods to create and execute queries that are described by an IQbservable object. |
|||
</summary> |
|||
</member> |
|||
<member name="M:System.Reactive.Linq.IQbservableProvider.CreateQuery``1(System.Linq.Expressions.Expression)"> |
|||
<summary> |
|||
Constructs an IQbservable>TResult< object that can evaluate the query represented by a specified expression tree. |
|||
</summary> |
|||
<typeparam name="TResult">The type of the elements of the System.Reactive.Linq.IQbservable<T> that is returned.</typeparam> |
|||
<param name="expression">Expression tree representing the query.</param> |
|||
<returns>IQbservable object that can evaluate the given query expression.</returns> |
|||
</member> |
|||
<member name="T:System.Reactive.Subjects.IConnectableObservable`1"> |
|||
<summary> |
|||
Represents an observable wrapper that can be connected and disconnected from its underlying observable sequence. |
|||
</summary> |
|||
<typeparam name="T"> |
|||
The type of the elements in the sequence. |
|||
This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
</member> |
|||
<member name="M:System.Reactive.Subjects.IConnectableObservable`1.Connect"> |
|||
<summary> |
|||
Connects the observable wrapper to its source. All subscribed observers will receive values from the underlying observable sequence as long as the connection is established. |
|||
</summary> |
|||
<returns>Disposable used to disconnect the observable wrapper from its source, causing subscribed observer to stop receiving values from the underlying observable sequence.</returns> |
|||
</member> |
|||
<member name="T:System.Reactive.Subjects.ISubject`1"> |
|||
<summary> |
|||
Represents an object that is both an observable sequence as well as an observer. |
|||
</summary> |
|||
<typeparam name="T">The type of the elements processed by the subject.</typeparam> |
|||
</member> |
|||
<member name="T:System.Reactive.Subjects.ISubject`2"> |
|||
<summary> |
|||
Represents an object that is both an observable sequence as well as an observer. |
|||
</summary> |
|||
<typeparam name="TSource"> |
|||
The type of the elements received by the subject. |
|||
This type parameter is contravariant. That is, you can use either the type you specified or any type that is less derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
<typeparam name="TResult"> |
|||
The type of the elements produced by the subject. |
|||
This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
</member> |
|||
</members> |
|||
</doc> |
|||
Binary file not shown.
@ -0,0 +1,336 @@ |
|||
<?xml version="1.0"?> |
|||
<doc> |
|||
<assembly> |
|||
<name>System.Reactive.Interfaces</name> |
|||
</assembly> |
|||
<members> |
|||
<member name="T:System.Reactive.NamespaceDoc"> |
|||
<summary> |
|||
The <b>System.Reactive</b> namespace contains interfaces and classes used throughout the Reactive Extensions library. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.Concurrency.NamespaceDoc"> |
|||
<summary> |
|||
The <b>System.Reactive.Concurrency</b> namespace contains interfaces and classes that provide the scheduler infrastructure used by Reactive Extensions to construct and |
|||
process event streams. Schedulers are used to parameterize the concurrency introduced by query operators, provide means to virtualize time, to process historical data, |
|||
and to write unit tests for functionality built using Reactive Extensions constructs. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.Disposables.NamespaceDoc"> |
|||
<summary> |
|||
The <b>System.Reactive.Disposables</b> namespace contains interfaces and classes that provide a compositional set of constructs used to deal with resource and subscription |
|||
management in Reactive Extensions. Those types are used extensively within the implementation of Reactive Extensions and are useful when writing custom query operators or |
|||
schedulers. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.Linq.NamespaceDoc"> |
|||
<summary> |
|||
The <b>System.Reactive.Linq</b> namespace contains interfaces and classes that support expressing queries over observable sequences, using Language Integrated Query (LINQ). |
|||
Query operators are made available as extension methods for IObservable<T> and IQbservable<T> defined on the Observable and Qbservable classes, respectively. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.Subjects.NamespaceDoc"> |
|||
<summary> |
|||
The <b>System.Reactive.Subjects</b> namespace contains interfaces and classes to represent subjects, which are objects implementing both IObservable<T> and IObserver<T>. |
|||
Subjects are often used as sources of events, allowing one party to raise events and allowing another party to write queries over the event stream. Because of their ability to |
|||
have multiple registered observers, subjects are also used as a facility to provide multicast behavior for event streams in queries. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.Concurrency.ISchedulerPeriodic"> |
|||
<summary> |
|||
Scheduler with support for running periodic tasks. |
|||
This type of scheduler can be used to run timers more efficiently instead of using recursive scheduling. |
|||
</summary> |
|||
</member> |
|||
<member name="M:System.Reactive.Concurrency.ISchedulerPeriodic.SchedulePeriodic``1(``0,System.TimeSpan,System.Func{``0,``0})"> |
|||
<summary> |
|||
Schedules a periodic piece of work. |
|||
</summary> |
|||
<typeparam name="TState">The type of the state passed to the scheduled action.</typeparam> |
|||
<param name="state">Initial state passed to the action upon the first iteration.</param> |
|||
<param name="period">Period for running the work periodically.</param> |
|||
<param name="action">Action to be executed, potentially updating the state.</param> |
|||
<returns>The disposable object used to cancel the scheduled recurring action (best effort).</returns> |
|||
</member> |
|||
<member name="T:System.Reactive.Concurrency.IStopwatchProvider"> |
|||
<summary> |
|||
Provider for IStopwatch objects. |
|||
</summary> |
|||
</member> |
|||
<member name="M:System.Reactive.Concurrency.IStopwatchProvider.StartStopwatch"> |
|||
<summary> |
|||
Starts a new stopwatch object. |
|||
</summary> |
|||
<returns>New stopwatch object; started at the time of the request.</returns> |
|||
</member> |
|||
<member name="T:System.Reactive.Concurrency.IScheduledItem`1"> |
|||
<summary> |
|||
Represents a work item that has been scheduled. |
|||
</summary> |
|||
<typeparam name="TAbsolute">Absolute time representation type.</typeparam> |
|||
</member> |
|||
<member name="M:System.Reactive.Concurrency.IScheduledItem`1.Invoke"> |
|||
<summary> |
|||
Invokes the work item. |
|||
</summary> |
|||
</member> |
|||
<member name="P:System.Reactive.Concurrency.IScheduledItem`1.DueTime"> |
|||
<summary> |
|||
Gets the absolute time at which the item is due for invocation. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.Concurrency.IScheduler"> |
|||
<summary> |
|||
Represents an object that schedules units of work. |
|||
</summary> |
|||
</member> |
|||
<member name="M:System.Reactive.Concurrency.IScheduler.Schedule``1(``0,System.Func{System.Reactive.Concurrency.IScheduler,``0,System.IDisposable})"> |
|||
<summary> |
|||
Schedules an action to be executed. |
|||
</summary> |
|||
<typeparam name="TState">The type of the state passed to the scheduled action.</typeparam> |
|||
<param name="state">State passed to the action to be executed.</param> |
|||
<param name="action">Action to be executed.</param> |
|||
<returns>The disposable object used to cancel the scheduled action (best effort).</returns> |
|||
</member> |
|||
<member name="M:System.Reactive.Concurrency.IScheduler.Schedule``1(``0,System.TimeSpan,System.Func{System.Reactive.Concurrency.IScheduler,``0,System.IDisposable})"> |
|||
<summary> |
|||
Schedules an action to be executed after dueTime. |
|||
</summary> |
|||
<typeparam name="TState">The type of the state passed to the scheduled action.</typeparam> |
|||
<param name="state">State passed to the action to be executed.</param> |
|||
<param name="action">Action to be executed.</param> |
|||
<param name="dueTime">Relative time after which to execute the action.</param> |
|||
<returns>The disposable object used to cancel the scheduled action (best effort).</returns> |
|||
</member> |
|||
<member name="M:System.Reactive.Concurrency.IScheduler.Schedule``1(``0,System.DateTimeOffset,System.Func{System.Reactive.Concurrency.IScheduler,``0,System.IDisposable})"> |
|||
<summary> |
|||
Schedules an action to be executed at dueTime. |
|||
</summary> |
|||
<typeparam name="TState">The type of the state passed to the scheduled action.</typeparam> |
|||
<param name="state">State passed to the action to be executed.</param> |
|||
<param name="action">Action to be executed.</param> |
|||
<param name="dueTime">Absolute time at which to execute the action.</param> |
|||
<returns>The disposable object used to cancel the scheduled action (best effort).</returns> |
|||
</member> |
|||
<member name="P:System.Reactive.Concurrency.IScheduler.Now"> |
|||
<summary> |
|||
Gets the scheduler's notion of current time. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.Concurrency.ISchedulerLongRunning"> |
|||
<summary> |
|||
Scheduler with support for starting long-running tasks. |
|||
This type of scheduler can be used to run loops more efficiently instead of using recursive scheduling. |
|||
</summary> |
|||
</member> |
|||
<member name="M:System.Reactive.Concurrency.ISchedulerLongRunning.ScheduleLongRunning``1(``0,System.Action{``0,System.Reactive.Disposables.ICancelable})"> |
|||
<summary> |
|||
Schedules a long-running piece of work. |
|||
</summary> |
|||
<typeparam name="TState">The type of the state passed to the scheduled action.</typeparam> |
|||
<param name="state">State passed to the action to be executed.</param> |
|||
<param name="action">Action to be executed.</param> |
|||
<returns>The disposable object used to cancel the scheduled action (best effort).</returns> |
|||
<remarks> |
|||
<para><b>Notes to implementers</b></para> |
|||
The returned disposable object should not prevent the work from starting, but only set the cancellation flag passed to the specified action. |
|||
</remarks> |
|||
</member> |
|||
<member name="T:System.Reactive.Concurrency.IStopwatch"> |
|||
<summary> |
|||
Abstraction for a stopwatch to compute time relative to a starting point. |
|||
</summary> |
|||
</member> |
|||
<member name="P:System.Reactive.Concurrency.IStopwatch.Elapsed"> |
|||
<summary> |
|||
Gets the time elapsed since the stopwatch object was obtained. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.Disposables.ICancelable"> |
|||
<summary> |
|||
Disposable resource with dipsosal state tracking. |
|||
</summary> |
|||
</member> |
|||
<member name="P:System.Reactive.Disposables.ICancelable.IsDisposed"> |
|||
<summary> |
|||
Gets a value that indicates whether the object is disposed. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.IEventPattern`2"> |
|||
<summary> |
|||
Represents a .NET event invocation consisting of the strongly typed object that raised the event and the data that was generated by the event. |
|||
</summary> |
|||
<typeparam name="TSender"> |
|||
The type of the sender that raised the event. |
|||
This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
<typeparam name="TEventArgs"> |
|||
The type of the event data generated by the event. |
|||
This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
</member> |
|||
<member name="P:System.Reactive.IEventPattern`2.Sender"> |
|||
<summary> |
|||
Gets the sender object that raised the event. |
|||
</summary> |
|||
</member> |
|||
<member name="P:System.Reactive.IEventPattern`2.EventArgs"> |
|||
<summary> |
|||
Gets the event data that was generated by the event. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.IEventPatternSource`1"> |
|||
<summary> |
|||
Represents a data stream signaling its elements by means of an event. |
|||
</summary> |
|||
<typeparam name="TEventArgs">The type of the event data generated by the event.</typeparam> |
|||
</member> |
|||
<member name="E:System.Reactive.IEventPatternSource`1.OnNext"> |
|||
<summary> |
|||
Event signaling the next element in the data stream. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.IEventSource`1"> |
|||
<summary> |
|||
Represents a data stream signaling its elements by means of an event. |
|||
</summary> |
|||
<typeparam name="T"> |
|||
The type of the event data generated by the event. |
|||
This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
</member> |
|||
<member name="E:System.Reactive.IEventSource`1.OnNext"> |
|||
<summary> |
|||
Event signaling the next element in the data stream. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.IObserver`2"> |
|||
<summary> |
|||
Provides a mechanism for receiving push-based notifications and returning a response. |
|||
</summary> |
|||
<typeparam name="TValue"> |
|||
The type of the elements received by the observer. |
|||
This type parameter is contravariant. That is, you can use either the type you specified or any type that is less derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
<typeparam name="TResult"> |
|||
The type of the result returned from the observer's notification handlers. |
|||
This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
</member> |
|||
<member name="M:System.Reactive.IObserver`2.OnNext(`0)"> |
|||
<summary> |
|||
Notifies the observer of a new element in the sequence. |
|||
</summary> |
|||
<param name="value">The new element in the sequence.</param> |
|||
<returns>Result returned upon observation of a new element.</returns> |
|||
</member> |
|||
<member name="M:System.Reactive.IObserver`2.OnError(System.Exception)"> |
|||
<summary> |
|||
Notifies the observer that an exception has occurred. |
|||
</summary> |
|||
<param name="exception">The exception that occurred.</param> |
|||
<returns>Result returned upon observation of an error.</returns> |
|||
</member> |
|||
<member name="M:System.Reactive.IObserver`2.OnCompleted"> |
|||
<summary> |
|||
Notifies the observer of the end of the sequence. |
|||
</summary> |
|||
<returns>Result returned upon observation of the sequence completion.</returns> |
|||
</member> |
|||
<member name="T:System.Reactive.Linq.IGroupedObservable`2"> |
|||
<summary> |
|||
Represents an observable sequence of elements that have a common key. |
|||
</summary> |
|||
<typeparam name="TKey"> |
|||
The type of the key shared by all elements in the group. |
|||
This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
<typeparam name="TElement"> |
|||
The type of the elements in the group. |
|||
This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
</member> |
|||
<member name="P:System.Reactive.Linq.IGroupedObservable`2.Key"> |
|||
<summary> |
|||
Gets the common key. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.Linq.IQbservable`1"> |
|||
<summary> |
|||
Provides functionality to evaluate queries against a specific data source wherein the type of the data is known. |
|||
</summary> |
|||
<typeparam name="T"> |
|||
The type of the data in the data source. |
|||
This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
</member> |
|||
<member name="T:System.Reactive.Linq.IQbservable"> |
|||
<summary> |
|||
Provides functionality to evaluate queries against a specific data source wherein the type of the data is not specified. |
|||
</summary> |
|||
</member> |
|||
<member name="P:System.Reactive.Linq.IQbservable.ElementType"> |
|||
<summary> |
|||
Gets the type of the element(s) that are returned when the expression tree associated with this instance of IQbservable is executed. |
|||
</summary> |
|||
</member> |
|||
<member name="P:System.Reactive.Linq.IQbservable.Expression"> |
|||
<summary> |
|||
Gets the expression tree that is associated with the instance of IQbservable. |
|||
</summary> |
|||
</member> |
|||
<member name="P:System.Reactive.Linq.IQbservable.Provider"> |
|||
<summary> |
|||
Gets the query provider that is associated with this data source. |
|||
</summary> |
|||
</member> |
|||
<member name="T:System.Reactive.Linq.IQbservableProvider"> |
|||
<summary> |
|||
Defines methods to create and execute queries that are described by an IQbservable object. |
|||
</summary> |
|||
</member> |
|||
<member name="M:System.Reactive.Linq.IQbservableProvider.CreateQuery``1(System.Linq.Expressions.Expression)"> |
|||
<summary> |
|||
Constructs an IQbservable>TResult< object that can evaluate the query represented by a specified expression tree. |
|||
</summary> |
|||
<typeparam name="TResult">The type of the elements of the System.Reactive.Linq.IQbservable<T> that is returned.</typeparam> |
|||
<param name="expression">Expression tree representing the query.</param> |
|||
<returns>IQbservable object that can evaluate the given query expression.</returns> |
|||
</member> |
|||
<member name="T:System.Reactive.Subjects.IConnectableObservable`1"> |
|||
<summary> |
|||
Represents an observable wrapper that can be connected and disconnected from its underlying observable sequence. |
|||
</summary> |
|||
<typeparam name="T"> |
|||
The type of the elements in the sequence. |
|||
This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
</member> |
|||
<member name="M:System.Reactive.Subjects.IConnectableObservable`1.Connect"> |
|||
<summary> |
|||
Connects the observable wrapper to its source. All subscribed observers will receive values from the underlying observable sequence as long as the connection is established. |
|||
</summary> |
|||
<returns>Disposable used to disconnect the observable wrapper from its source, causing subscribed observer to stop receiving values from the underlying observable sequence.</returns> |
|||
</member> |
|||
<member name="T:System.Reactive.Subjects.ISubject`1"> |
|||
<summary> |
|||
Represents an object that is both an observable sequence as well as an observer. |
|||
</summary> |
|||
<typeparam name="T">The type of the elements processed by the subject.</typeparam> |
|||
</member> |
|||
<member name="T:System.Reactive.Subjects.ISubject`2"> |
|||
<summary> |
|||
Represents an object that is both an observable sequence as well as an observer. |
|||
</summary> |
|||
<typeparam name="TSource"> |
|||
The type of the elements received by the subject. |
|||
This type parameter is contravariant. That is, you can use either the type you specified or any type that is less derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
<typeparam name="TResult"> |
|||
The type of the elements produced by the subject. |
|||
This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics. |
|||
</typeparam> |
|||
</member> |
|||
</members> |
|||
</doc> |
|||
Binary file not shown.
Binary file not shown.
@ -0,0 +1,26 @@ |
|||
<?xml version="1.0"?> |
|||
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"> |
|||
<metadata> |
|||
<id>Rx-Linq</id> |
|||
<version>2.1.30214.0</version> |
|||
<title>Reactive Extensions - Query Library</title> |
|||
<authors>Microsoft Corporation</authors> |
|||
<owners>Microsoft Corporation</owners> |
|||
<licenseUrl>http://go.microsoft.com/fwlink/?LinkID=261272</licenseUrl> |
|||
<projectUrl>http://go.microsoft.com/fwlink/?LinkID=261273</projectUrl> |
|||
<iconUrl>http://go.microsoft.com/fwlink/?LinkId=261274</iconUrl> |
|||
<requireLicenseAcceptance>true</requireLicenseAcceptance> |
|||
<description>Reactive Extensions Query Library used to express complex event processing queries over observable sequences.</description> |
|||
<copyright>Microsoft Corporation © 2012</copyright> |
|||
<language>en-us</language> |
|||
<tags>Rx Reactive Extensions Observable LINQ Events</tags> |
|||
<dependencies> |
|||
<dependency id="Rx-Interfaces" version="2.1.30214.0" /> |
|||
<dependency id="Rx-Core" version="2.1.30214.0" /> |
|||
</dependencies> |
|||
<frameworkAssemblies> |
|||
<frameworkAssembly assemblyName="System.Observable" targetFramework="Silverlight4.0-WindowsPhone71" /> |
|||
<frameworkAssembly assemblyName="Microsoft.Phone" targetFramework="Silverlight4.0-WindowsPhone71" /> |
|||
</frameworkAssemblies> |
|||
</metadata> |
|||
</package> |
|||
File diff suppressed because it is too large
Binary file not shown.
File diff suppressed because it is too large
Binary file not shown.
File diff suppressed because it is too large
Binary file not shown.
File diff suppressed because it is too large
Binary file not shown.
File diff suppressed because it is too large
Binary file not shown.
File diff suppressed because it is too large
Binary file not shown.
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue