@@ -0,0 +1,15 | |||
|
1 | using System; | |
|
2 | using System.Collections.Generic; | |
|
3 | using System.Linq; | |
|
4 | using System.Text; | |
|
5 | ||
|
6 | namespace Implab.Fx | |
|
7 | { | |
|
8 | public class Animation | |
|
9 | { | |
|
10 | int m_duration; | |
|
11 | int m_fps; | |
|
12 | ||
|
13 | ||
|
14 | } | |
|
15 | } |
@@ -0,0 +1,56 | |||
|
1 | using System; | |
|
2 | using System.Collections.Generic; | |
|
3 | using System.Linq; | |
|
4 | using System.Text; | |
|
5 | using System.Windows.Forms; | |
|
6 | ||
|
7 | namespace Implab.Fx | |
|
8 | { | |
|
9 | public static class ControlHelpers | |
|
10 | { | |
|
11 | /// <summary> | |
|
12 | /// Переключает обработку обещания в поток указанного элемента управления. | |
|
13 | /// </summary> | |
|
14 | /// <typeparam name="T">Тип результата обещания</typeparam> | |
|
15 | /// <param name="that">Исходное обещание</param> | |
|
16 | /// <param name="ctl">Элемент управления</param> | |
|
17 | /// <returns>Новое обещание, обработчики которого будут выполнены в потоке элемента управления.</returns> | |
|
18 | /// <exception cref="ArgumentNullException">Параметр не может быть <c>null</c>.</exception> | |
|
19 | /// <example> | |
|
20 | /// client | |
|
21 | /// .Get("description.txt") // returns a promise | |
|
22 | /// .DirectToControl(m_ctl) // handle the promise in the thread of the control | |
|
23 | /// .Then( | |
|
24 | /// description => m_ctl.Text = description // now it's safe | |
|
25 | /// ) | |
|
26 | /// </example> | |
|
27 | public static Promise<T> DirectToControl<T>(this Promise<T> that, Control ctl) | |
|
28 | { | |
|
29 | if (that == null) | |
|
30 | throw new ArgumentNullException("that"); | |
|
31 | if (ctl == null) | |
|
32 | throw new ArgumentNullException("ctl"); | |
|
33 | ||
|
34 | var directed = new Promise<T>(); | |
|
35 | ||
|
36 | that.Then( | |
|
37 | res => | |
|
38 | { | |
|
39 | if (ctl.InvokeRequired) | |
|
40 | ctl.Invoke(new Action<T>(directed.Resolve),res); | |
|
41 | else | |
|
42 | directed.Resolve(res); | |
|
43 | }, | |
|
44 | err => | |
|
45 | { | |
|
46 | if (ctl.InvokeRequired) | |
|
47 | ctl.Invoke(new Action<Exception>(directed.Reject), err); | |
|
48 | else | |
|
49 | directed.Reject(err); | |
|
50 | } | |
|
51 | ); | |
|
52 | ||
|
53 | return directed; | |
|
54 | } | |
|
55 | } | |
|
56 | } |
@@ -0,0 +1,61 | |||
|
1 | <?xml version="1.0" encoding="utf-8"?> | |
|
2 | <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
|
3 | <PropertyGroup> | |
|
4 | <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | |
|
5 | <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | |
|
6 | <ProductVersion>8.0.30703</ProductVersion> | |
|
7 | <SchemaVersion>2.0</SchemaVersion> | |
|
8 | <ProjectGuid>{06E706F8-6881-43EB-927E-FFC503AF6ABC}</ProjectGuid> | |
|
9 | <OutputType>Library</OutputType> | |
|
10 | <AppDesignerFolder>Properties</AppDesignerFolder> | |
|
11 | <RootNamespace>Implab.Fx</RootNamespace> | |
|
12 | <AssemblyName>Implab.Fx</AssemblyName> | |
|
13 | <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> | |
|
14 | <FileAlignment>512</FileAlignment> | |
|
15 | </PropertyGroup> | |
|
16 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | |
|
17 | <DebugSymbols>true</DebugSymbols> | |
|
18 | <DebugType>full</DebugType> | |
|
19 | <Optimize>false</Optimize> | |
|
20 | <OutputPath>bin\Debug\</OutputPath> | |
|
21 | <DefineConstants>DEBUG;TRACE</DefineConstants> | |
|
22 | <ErrorReport>prompt</ErrorReport> | |
|
23 | <WarningLevel>4</WarningLevel> | |
|
24 | </PropertyGroup> | |
|
25 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | |
|
26 | <DebugType>pdbonly</DebugType> | |
|
27 | <Optimize>true</Optimize> | |
|
28 | <OutputPath>bin\Release\</OutputPath> | |
|
29 | <DefineConstants>TRACE</DefineConstants> | |
|
30 | <ErrorReport>prompt</ErrorReport> | |
|
31 | <WarningLevel>4</WarningLevel> | |
|
32 | </PropertyGroup> | |
|
33 | <ItemGroup> | |
|
34 | <Reference Include="System" /> | |
|
35 | <Reference Include="System.Core" /> | |
|
36 | <Reference Include="System.Windows.Forms" /> | |
|
37 | <Reference Include="System.Xml.Linq" /> | |
|
38 | <Reference Include="System.Data.DataSetExtensions" /> | |
|
39 | <Reference Include="Microsoft.CSharp" /> | |
|
40 | <Reference Include="System.Data" /> | |
|
41 | <Reference Include="System.Xml" /> | |
|
42 | </ItemGroup> | |
|
43 | <ItemGroup> | |
|
44 | <Compile Include="ControlHelpers.cs" /> | |
|
45 | <Compile Include="Properties\AssemblyInfo.cs" /> | |
|
46 | </ItemGroup> | |
|
47 | <ItemGroup> | |
|
48 | <ProjectReference Include="..\Implab\Implab.csproj"> | |
|
49 | <Project>{99B95D0D-9CF9-4F70-8ADF-F4D0AA5CB0D9}</Project> | |
|
50 | <Name>Implab</Name> | |
|
51 | </ProjectReference> | |
|
52 | </ItemGroup> | |
|
53 | <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | |
|
54 | <!-- To modify your build process, add your task inside one of the targets below and uncomment it. | |
|
55 | Other similar extension points exist, see Microsoft.Common.targets. | |
|
56 | <Target Name="BeforeBuild"> | |
|
57 | </Target> | |
|
58 | <Target Name="AfterBuild"> | |
|
59 | </Target> | |
|
60 | --> | |
|
61 | </Project> No newline at end of file |
@@ -0,0 +1,36 | |||
|
1 | using System.Reflection; | |
|
2 | using System.Runtime.CompilerServices; | |
|
3 | using System.Runtime.InteropServices; | |
|
4 | ||
|
5 | // General Information about an assembly is controlled through the following | |
|
6 | // set of attributes. Change these attribute values to modify the information | |
|
7 | // associated with an assembly. | |
|
8 | [assembly: AssemblyTitle("Implab.Fx")] | |
|
9 | [assembly: AssemblyDescription("")] | |
|
10 | [assembly: AssemblyConfiguration("")] | |
|
11 | [assembly: AssemblyCompany("")] | |
|
12 | [assembly: AssemblyProduct("Implab.Fx")] | |
|
13 | [assembly: AssemblyCopyright("Copyright © 2013")] | |
|
14 | [assembly: AssemblyTrademark("")] | |
|
15 | [assembly: AssemblyCulture("")] | |
|
16 | ||
|
17 | // Setting ComVisible to false makes the types in this assembly not visible | |
|
18 | // to COM components. If you need to access a type in this assembly from | |
|
19 | // COM, set the ComVisible attribute to true on that type. | |
|
20 | [assembly: ComVisible(false)] | |
|
21 | ||
|
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM | |
|
23 | [assembly: Guid("d239c29f-98e2-4942-9569-554a8511d07b")] | |
|
24 | ||
|
25 | // Version information for an assembly consists of the following four values: | |
|
26 | // | |
|
27 | // Major Version | |
|
28 | // Minor Version | |
|
29 | // Build Number | |
|
30 | // Revision | |
|
31 | // | |
|
32 | // You can specify all the values or you can default the Build and Revision Numbers | |
|
33 | // by using the '*' as shown below: | |
|
34 | // [assembly: AssemblyVersion("1.0.*")] | |
|
35 | [assembly: AssemblyVersion("1.0.0.0")] | |
|
36 | [assembly: AssemblyFileVersion("1.0.0.0")] |
@@ -1,8 +1,9 | |||
|
1 | 1 | syntax: glob |
|
2 | 2 | Implab.Test/bin/ |
|
3 | 3 | *.user |
|
4 | 4 | Implab.Test/obj/ |
|
5 | 5 | *.userprefs |
|
6 | 6 | Implab/bin/ |
|
7 | 7 | Implab/obj/ |
|
8 | 8 | TestResults/ |
|
9 | Implab.Fx/obj/ |
@@ -1,39 +1,45 | |||
|
1 | 1 | |
|
2 | 2 | Microsoft Visual Studio Solution File, Format Version 11.00 |
|
3 | 3 | # Visual Studio 2010 |
|
4 | 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Implab", "Implab\Implab.csproj", "{99B95D0D-9CF9-4F70-8ADF-F4D0AA5CB0D9}" |
|
5 | 5 | EndProject |
|
6 | 6 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{CE8D8D18-437A-445C-B662-4C2CE79A76F6}" |
|
7 | 7 | ProjectSection(SolutionItems) = preProject |
|
8 | 8 | Implab.vsmdi = Implab.vsmdi |
|
9 | 9 | Local.testsettings = Local.testsettings |
|
10 | 10 | TraceAndTestImpact.testsettings = TraceAndTestImpact.testsettings |
|
11 | 11 | EndProjectSection |
|
12 | 12 | EndProject |
|
13 | 13 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Implab.Test", "Implab.Test\Implab.Test.csproj", "{63F92C0C-61BF-48C0-A377-8D67C3C661D0}" |
|
14 | 14 | EndProject |
|
15 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Implab.Fx", "Implab.Fx\Implab.Fx.csproj", "{06E706F8-6881-43EB-927E-FFC503AF6ABC}" | |
|
16 | EndProject | |
|
15 | 17 | Global |
|
16 | 18 | GlobalSection(TestCaseManagementSettings) = postSolution |
|
17 | 19 | CategoryFile = Implab.vsmdi |
|
18 | 20 | EndGlobalSection |
|
19 | 21 | GlobalSection(SolutionConfigurationPlatforms) = preSolution |
|
20 | 22 | Debug|Any CPU = Debug|Any CPU |
|
21 | 23 | Release|Any CPU = Release|Any CPU |
|
22 | 24 | EndGlobalSection |
|
23 | 25 | GlobalSection(ProjectConfigurationPlatforms) = postSolution |
|
24 | 26 | {99B95D0D-9CF9-4F70-8ADF-F4D0AA5CB0D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|
25 | 27 | {99B95D0D-9CF9-4F70-8ADF-F4D0AA5CB0D9}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|
26 | 28 | {99B95D0D-9CF9-4F70-8ADF-F4D0AA5CB0D9}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|
27 | 29 | {99B95D0D-9CF9-4F70-8ADF-F4D0AA5CB0D9}.Release|Any CPU.Build.0 = Release|Any CPU |
|
28 | 30 | {63F92C0C-61BF-48C0-A377-8D67C3C661D0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|
29 | 31 | {63F92C0C-61BF-48C0-A377-8D67C3C661D0}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|
30 | 32 | {63F92C0C-61BF-48C0-A377-8D67C3C661D0}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|
31 | 33 | {63F92C0C-61BF-48C0-A377-8D67C3C661D0}.Release|Any CPU.Build.0 = Release|Any CPU |
|
34 | {06E706F8-6881-43EB-927E-FFC503AF6ABC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | |
|
35 | {06E706F8-6881-43EB-927E-FFC503AF6ABC}.Debug|Any CPU.Build.0 = Debug|Any CPU | |
|
36 | {06E706F8-6881-43EB-927E-FFC503AF6ABC}.Release|Any CPU.ActiveCfg = Release|Any CPU | |
|
37 | {06E706F8-6881-43EB-927E-FFC503AF6ABC}.Release|Any CPU.Build.0 = Release|Any CPU | |
|
32 | 38 | EndGlobalSection |
|
33 | 39 | GlobalSection(SolutionProperties) = preSolution |
|
34 | 40 | HideSolutionNode = FALSE |
|
35 | 41 | EndGlobalSection |
|
36 | 42 | GlobalSection(MonoDevelopProperties) = preSolution |
|
37 | 43 | StartupItem = Implab\Implab.csproj |
|
38 | 44 | EndGlobalSection |
|
39 | 45 | EndGlobal |
|
1 | NO CONTENT: modified file, binary diff hidden |
General Comments 0
You need to be logged in to leave comments.
Login now