##// END OF EJS Templates
implemented overlay helpers and some animation heplers improvments
cin -
r5:f2559580b481 default
parent child
Show More
@@ -0,0 +1,94
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>
7 </ProductVersion>
8 <SchemaVersion>2.0</SchemaVersion>
9 <ProjectGuid>{2F31E405-E267-4195-A05D-574093C21209}</ProjectGuid>
10 <OutputType>Library</OutputType>
11 <AppDesignerFolder>Properties</AppDesignerFolder>
12 <RootNamespace>Implab.Fx.Test</RootNamespace>
13 <AssemblyName>Implab.Fx.Test</AssemblyName>
14 <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
15 <FileAlignment>512</FileAlignment>
16 <ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
17 </PropertyGroup>
18 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
19 <DebugSymbols>true</DebugSymbols>
20 <DebugType>full</DebugType>
21 <Optimize>false</Optimize>
22 <OutputPath>bin\Debug\</OutputPath>
23 <DefineConstants>DEBUG;TRACE</DefineConstants>
24 <ErrorReport>prompt</ErrorReport>
25 <WarningLevel>4</WarningLevel>
26 </PropertyGroup>
27 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
28 <DebugType>pdbonly</DebugType>
29 <Optimize>true</Optimize>
30 <OutputPath>bin\Release\</OutputPath>
31 <DefineConstants>TRACE</DefineConstants>
32 <ErrorReport>prompt</ErrorReport>
33 <WarningLevel>4</WarningLevel>
34 </PropertyGroup>
35 <ItemGroup>
36 <Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
37 <Reference Include="System" />
38 <Reference Include="System.Core">
39 <RequiredTargetFramework>3.5</RequiredTargetFramework>
40 </Reference>
41 <Reference Include="System.Data" />
42 <Reference Include="System.Drawing" />
43 <Reference Include="System.Windows.Forms" />
44 <Reference Include="System.Xml" />
45 <Reference Include="WindowsBase" />
46 </ItemGroup>
47 <ItemGroup>
48 <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
49 <Visible>False</Visible>
50 </CodeAnalysisDependentAssemblyPaths>
51 </ItemGroup>
52 <ItemGroup>
53 <Compile Include="Properties\AssemblyInfo.cs" />
54 <Compile Include="OverlayTest.cs" />
55 <Compile Include="Sample\MainForm.cs">
56 <SubType>Form</SubType>
57 </Compile>
58 <Compile Include="Sample\MainForm.Designer.cs">
59 <DependentUpon>MainForm.cs</DependentUpon>
60 </Compile>
61 <Compile Include="Sample\OverlayForm.cs">
62 <SubType>Form</SubType>
63 </Compile>
64 <Compile Include="Sample\OverlayForm.Designer.cs">
65 <DependentUpon>OverlayForm.cs</DependentUpon>
66 </Compile>
67 </ItemGroup>
68 <ItemGroup>
69 <EmbeddedResource Include="Sample\MainForm.resx">
70 <DependentUpon>MainForm.cs</DependentUpon>
71 </EmbeddedResource>
72 <EmbeddedResource Include="Sample\OverlayForm.resx">
73 <DependentUpon>OverlayForm.cs</DependentUpon>
74 </EmbeddedResource>
75 </ItemGroup>
76 <ItemGroup>
77 <ProjectReference Include="..\Implab.Fx\Implab.Fx.csproj">
78 <Project>{06E706F8-6881-43EB-927E-FFC503AF6ABC}</Project>
79 <Name>Implab.Fx</Name>
80 </ProjectReference>
81 <ProjectReference Include="..\Implab\Implab.csproj">
82 <Project>{F550F1F8-8746-4AD0-9614-855F4C4B7F05}</Project>
83 <Name>Implab</Name>
84 </ProjectReference>
85 </ItemGroup>
86 <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
87 <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
88 Other similar extension points exist, see Microsoft.Common.targets.
89 <Target Name="BeforeBuild">
90 </Target>
91 <Target Name="AfterBuild">
92 </Target>
93 -->
94 </Project> No newline at end of file
@@ -0,0 +1,35
1 using System;
2 using System.Text;
3 using System.Collections.Generic;
4 using System.Linq;
5 using Microsoft.VisualStudio.TestTools.UnitTesting;
6 using System.Windows.Forms;
7 using Implab.Fx.Test.Sample;
8 using System.Drawing;
9 using Implab.Fx;
10
11 namespace Implab.Fx.Test
12 {
13 [TestClass]
14 public class OverlayTest
15 {
16 [TestMethod]
17 public void TestMethod1()
18 {
19 var mainForm = new MainForm();
20
21 mainForm.ButtonEvent += (sender, args) =>
22 {
23 var overlay = new OverlayForm();
24 mainForm.OverlayFadeIn(overlay).Then(
25 o => o.ButtonEvent += (s2, args2) =>
26 {
27 o.CloseFadeOut();
28 }
29 );
30 };
31
32 Application.Run(mainForm);
33 }
34 }
35 }
@@ -0,0 +1,35
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.Test")]
9 [assembly: AssemblyDescription("")]
10 [assembly: AssemblyConfiguration("")]
11 [assembly: AssemblyCompany("")]
12 [assembly: AssemblyProduct("Implab.Fx.Test")]
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("ac9cc552-177e-4b6d-923c-763dc6f87dd6")]
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.0.0")]
35 [assembly: AssemblyFileVersion("1.0.0.0")]
@@ -0,0 +1,82
1 namespace Implab.Fx.Test.Sample
2 {
3 partial class MainForm
4 {
5 /// <summary>
6 /// Required designer variable.
7 /// </summary>
8 private System.ComponentModel.IContainer components = null;
9
10 /// <summary>
11 /// Clean up any resources being used.
12 /// </summary>
13 /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
14 protected override void Dispose(bool disposing)
15 {
16 if (disposing && (components != null))
17 {
18 components.Dispose();
19 }
20 base.Dispose(disposing);
21 }
22
23 #region Windows Form Designer generated code
24
25 /// <summary>
26 /// Required method for Designer support - do not modify
27 /// the contents of this method with the code editor.
28 /// </summary>
29 private void InitializeComponent()
30 {
31 this.button1 = new System.Windows.Forms.Button();
32 this.comboBox1 = new System.Windows.Forms.ComboBox();
33 this.listBox1 = new System.Windows.Forms.ListBox();
34 this.SuspendLayout();
35 //
36 // button1
37 //
38 this.button1.Location = new System.Drawing.Point(138, 12);
39 this.button1.Name = "button1";
40 this.button1.Size = new System.Drawing.Size(75, 23);
41 this.button1.TabIndex = 0;
42 this.button1.Text = "button1";
43 this.button1.UseVisualStyleBackColor = true;
44 this.button1.Click += new System.EventHandler(this.button1_Click);
45 //
46 // comboBox1
47 //
48 this.comboBox1.FormattingEnabled = true;
49 this.comboBox1.Location = new System.Drawing.Point(138, 41);
50 this.comboBox1.Name = "comboBox1";
51 this.comboBox1.Size = new System.Drawing.Size(121, 21);
52 this.comboBox1.TabIndex = 1;
53 //
54 // listBox1
55 //
56 this.listBox1.FormattingEnabled = true;
57 this.listBox1.Location = new System.Drawing.Point(12, 12);
58 this.listBox1.Name = "listBox1";
59 this.listBox1.Size = new System.Drawing.Size(120, 95);
60 this.listBox1.TabIndex = 2;
61 //
62 // MainForm
63 //
64 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
65 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
66 this.ClientSize = new System.Drawing.Size(284, 262);
67 this.Controls.Add(this.listBox1);
68 this.Controls.Add(this.comboBox1);
69 this.Controls.Add(this.button1);
70 this.Name = "MainForm";
71 this.Text = "MainForm";
72 this.ResumeLayout(false);
73
74 }
75
76 #endregion
77
78 private System.Windows.Forms.Button button1;
79 private System.Windows.Forms.ComboBox comboBox1;
80 private System.Windows.Forms.ListBox listBox1;
81 }
82 } No newline at end of file
@@ -0,0 +1,30
1 using System;
2 using System.Collections.Generic;
3 using System.ComponentModel;
4 using System.Data;
5 using System.Drawing;
6 using System.Linq;
7 using System.Text;
8 using System.Windows.Forms;
9
10 namespace Implab.Fx.Test.Sample
11 {
12 public partial class MainForm : Form
13 {
14 public event EventHandler ButtonEvent;
15
16 public MainForm()
17 {
18 InitializeComponent();
19 }
20
21 private void button1_Click(object sender, EventArgs e)
22 {
23 EventHandler temp = ButtonEvent;
24 if (temp != null)
25 {
26 temp(this,new EventArgs());
27 }
28 }
29 }
30 }
@@ -0,0 +1,120
1 <?xml version="1.0" encoding="utf-8"?>
2 <root>
3 <!--
4 Microsoft ResX Schema
5
6 Version 2.0
7
8 The primary goals of this format is to allow a simple XML format
9 that is mostly human readable. The generation and parsing of the
10 various data types are done through the TypeConverter classes
11 associated with the data types.
12
13 Example:
14
15 ... ado.net/XML headers & schema ...
16 <resheader name="resmimetype">text/microsoft-resx</resheader>
17 <resheader name="version">2.0</resheader>
18 <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
19 <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
20 <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
21 <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
22 <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
23 <value>[base64 mime encoded serialized .NET Framework object]</value>
24 </data>
25 <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
26 <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
27 <comment>This is a comment</comment>
28 </data>
29
30 There are any number of "resheader" rows that contain simple
31 name/value pairs.
32
33 Each data row contains a name, and value. The row also contains a
34 type or mimetype. Type corresponds to a .NET class that support
35 text/value conversion through the TypeConverter architecture.
36 Classes that don't support this are serialized and stored with the
37 mimetype set.
38
39 The mimetype is used for serialized objects, and tells the
40 ResXResourceReader how to depersist the object. This is currently not
41 extensible. For a given mimetype the value must be set accordingly:
42
43 Note - application/x-microsoft.net.object.binary.base64 is the format
44 that the ResXResourceWriter will generate, however the reader can
45 read any of the formats listed below.
46
47 mimetype: application/x-microsoft.net.object.binary.base64
48 value : The object must be serialized with
49 : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
50 : and then encoded with base64 encoding.
51
52 mimetype: application/x-microsoft.net.object.soap.base64
53 value : The object must be serialized with
54 : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
55 : and then encoded with base64 encoding.
56
57 mimetype: application/x-microsoft.net.object.bytearray.base64
58 value : The object must be serialized into a byte array
59 : using a System.ComponentModel.TypeConverter
60 : and then encoded with base64 encoding.
61 -->
62 <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
63 <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
64 <xsd:element name="root" msdata:IsDataSet="true">
65 <xsd:complexType>
66 <xsd:choice maxOccurs="unbounded">
67 <xsd:element name="metadata">
68 <xsd:complexType>
69 <xsd:sequence>
70 <xsd:element name="value" type="xsd:string" minOccurs="0" />
71 </xsd:sequence>
72 <xsd:attribute name="name" use="required" type="xsd:string" />
73 <xsd:attribute name="type" type="xsd:string" />
74 <xsd:attribute name="mimetype" type="xsd:string" />
75 <xsd:attribute ref="xml:space" />
76 </xsd:complexType>
77 </xsd:element>
78 <xsd:element name="assembly">
79 <xsd:complexType>
80 <xsd:attribute name="alias" type="xsd:string" />
81 <xsd:attribute name="name" type="xsd:string" />
82 </xsd:complexType>
83 </xsd:element>
84 <xsd:element name="data">
85 <xsd:complexType>
86 <xsd:sequence>
87 <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
88 <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
89 </xsd:sequence>
90 <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
91 <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
92 <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
93 <xsd:attribute ref="xml:space" />
94 </xsd:complexType>
95 </xsd:element>
96 <xsd:element name="resheader">
97 <xsd:complexType>
98 <xsd:sequence>
99 <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
100 </xsd:sequence>
101 <xsd:attribute name="name" type="xsd:string" use="required" />
102 </xsd:complexType>
103 </xsd:element>
104 </xsd:choice>
105 </xsd:complexType>
106 </xsd:element>
107 </xsd:schema>
108 <resheader name="resmimetype">
109 <value>text/microsoft-resx</value>
110 </resheader>
111 <resheader name="version">
112 <value>2.0</value>
113 </resheader>
114 <resheader name="reader">
115 <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
116 </resheader>
117 <resheader name="writer">
118 <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119 </resheader>
120 </root> No newline at end of file
@@ -0,0 +1,99
1 namespace Implab.Fx.Test.Sample
2 {
3 partial class OverlayForm
4 {
5 /// <summary>
6 /// Required designer variable.
7 /// </summary>
8 private System.ComponentModel.IContainer components = null;
9
10 /// <summary>
11 /// Clean up any resources being used.
12 /// </summary>
13 /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
14 protected override void Dispose(bool disposing)
15 {
16 if (disposing && (components != null))
17 {
18 components.Dispose();
19 }
20 base.Dispose(disposing);
21 }
22
23 #region Windows Form Designer generated code
24
25 /// <summary>
26 /// Required method for Designer support - do not modify
27 /// the contents of this method with the code editor.
28 /// </summary>
29 private void InitializeComponent()
30 {
31 this.button1 = new System.Windows.Forms.Button();
32 this.checkBox1 = new System.Windows.Forms.CheckBox();
33 this.label1 = new System.Windows.Forms.Label();
34 this.progressBar1 = new System.Windows.Forms.ProgressBar();
35 this.SuspendLayout();
36 //
37 // button1
38 //
39 this.button1.Location = new System.Drawing.Point(12, 12);
40 this.button1.Name = "button1";
41 this.button1.Size = new System.Drawing.Size(75, 23);
42 this.button1.TabIndex = 0;
43 this.button1.Text = "button1";
44 this.button1.UseVisualStyleBackColor = true;
45 this.button1.Click += new System.EventHandler(this.button1_Click);
46 //
47 // checkBox1
48 //
49 this.checkBox1.AutoSize = true;
50 this.checkBox1.Location = new System.Drawing.Point(12, 88);
51 this.checkBox1.Name = "checkBox1";
52 this.checkBox1.Size = new System.Drawing.Size(80, 17);
53 this.checkBox1.TabIndex = 1;
54 this.checkBox1.Text = "checkBox1";
55 this.checkBox1.UseVisualStyleBackColor = true;
56 //
57 // label1
58 //
59 this.label1.AutoSize = true;
60 this.label1.Location = new System.Drawing.Point(13, 42);
61 this.label1.Name = "label1";
62 this.label1.Size = new System.Drawing.Size(35, 13);
63 this.label1.TabIndex = 2;
64 this.label1.Text = "label1";
65 //
66 // progressBar1
67 //
68 this.progressBar1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
69 | System.Windows.Forms.AnchorStyles.Left)
70 | System.Windows.Forms.AnchorStyles.Right)));
71 this.progressBar1.Location = new System.Drawing.Point(12, 59);
72 this.progressBar1.Name = "progressBar1";
73 this.progressBar1.Size = new System.Drawing.Size(260, 23);
74 this.progressBar1.TabIndex = 3;
75 //
76 // OverlayForm
77 //
78 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
79 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
80 this.ClientSize = new System.Drawing.Size(284, 262);
81 this.Controls.Add(this.progressBar1);
82 this.Controls.Add(this.label1);
83 this.Controls.Add(this.checkBox1);
84 this.Controls.Add(this.button1);
85 this.Name = "OverlayForm";
86 this.Text = "OverlayForm";
87 this.ResumeLayout(false);
88 this.PerformLayout();
89
90 }
91
92 #endregion
93
94 private System.Windows.Forms.Button button1;
95 private System.Windows.Forms.CheckBox checkBox1;
96 private System.Windows.Forms.Label label1;
97 private System.Windows.Forms.ProgressBar progressBar1;
98 }
99 } No newline at end of file
@@ -0,0 +1,30
1 using System;
2 using System.Collections.Generic;
3 using System.ComponentModel;
4 using System.Data;
5 using System.Drawing;
6 using System.Linq;
7 using System.Text;
8 using System.Windows.Forms;
9
10 namespace Implab.Fx.Test.Sample
11 {
12 public partial class OverlayForm : Form
13 {
14 public event EventHandler ButtonEvent;
15
16 public OverlayForm()
17 {
18 InitializeComponent();
19 }
20
21 private void button1_Click(object sender, EventArgs e)
22 {
23 EventHandler temp = ButtonEvent;
24 if (temp != null)
25 {
26 temp(this,new EventArgs());
27 }
28 }
29 }
30 }
@@ -0,0 +1,120
1 <?xml version="1.0" encoding="utf-8"?>
2 <root>
3 <!--
4 Microsoft ResX Schema
5
6 Version 2.0
7
8 The primary goals of this format is to allow a simple XML format
9 that is mostly human readable. The generation and parsing of the
10 various data types are done through the TypeConverter classes
11 associated with the data types.
12
13 Example:
14
15 ... ado.net/XML headers & schema ...
16 <resheader name="resmimetype">text/microsoft-resx</resheader>
17 <resheader name="version">2.0</resheader>
18 <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
19 <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
20 <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
21 <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
22 <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
23 <value>[base64 mime encoded serialized .NET Framework object]</value>
24 </data>
25 <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
26 <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
27 <comment>This is a comment</comment>
28 </data>
29
30 There are any number of "resheader" rows that contain simple
31 name/value pairs.
32
33 Each data row contains a name, and value. The row also contains a
34 type or mimetype. Type corresponds to a .NET class that support
35 text/value conversion through the TypeConverter architecture.
36 Classes that don't support this are serialized and stored with the
37 mimetype set.
38
39 The mimetype is used for serialized objects, and tells the
40 ResXResourceReader how to depersist the object. This is currently not
41 extensible. For a given mimetype the value must be set accordingly:
42
43 Note - application/x-microsoft.net.object.binary.base64 is the format
44 that the ResXResourceWriter will generate, however the reader can
45 read any of the formats listed below.
46
47 mimetype: application/x-microsoft.net.object.binary.base64
48 value : The object must be serialized with
49 : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
50 : and then encoded with base64 encoding.
51
52 mimetype: application/x-microsoft.net.object.soap.base64
53 value : The object must be serialized with
54 : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
55 : and then encoded with base64 encoding.
56
57 mimetype: application/x-microsoft.net.object.bytearray.base64
58 value : The object must be serialized into a byte array
59 : using a System.ComponentModel.TypeConverter
60 : and then encoded with base64 encoding.
61 -->
62 <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
63 <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
64 <xsd:element name="root" msdata:IsDataSet="true">
65 <xsd:complexType>
66 <xsd:choice maxOccurs="unbounded">
67 <xsd:element name="metadata">
68 <xsd:complexType>
69 <xsd:sequence>
70 <xsd:element name="value" type="xsd:string" minOccurs="0" />
71 </xsd:sequence>
72 <xsd:attribute name="name" use="required" type="xsd:string" />
73 <xsd:attribute name="type" type="xsd:string" />
74 <xsd:attribute name="mimetype" type="xsd:string" />
75 <xsd:attribute ref="xml:space" />
76 </xsd:complexType>
77 </xsd:element>
78 <xsd:element name="assembly">
79 <xsd:complexType>
80 <xsd:attribute name="alias" type="xsd:string" />
81 <xsd:attribute name="name" type="xsd:string" />
82 </xsd:complexType>
83 </xsd:element>
84 <xsd:element name="data">
85 <xsd:complexType>
86 <xsd:sequence>
87 <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
88 <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
89 </xsd:sequence>
90 <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
91 <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
92 <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
93 <xsd:attribute ref="xml:space" />
94 </xsd:complexType>
95 </xsd:element>
96 <xsd:element name="resheader">
97 <xsd:complexType>
98 <xsd:sequence>
99 <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
100 </xsd:sequence>
101 <xsd:attribute name="name" type="xsd:string" use="required" />
102 </xsd:complexType>
103 </xsd:element>
104 </xsd:choice>
105 </xsd:complexType>
106 </xsd:element>
107 </xsd:schema>
108 <resheader name="resmimetype">
109 <value>text/microsoft-resx</value>
110 </resheader>
111 <resheader name="version">
112 <value>2.0</value>
113 </resheader>
114 <resheader name="reader">
115 <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
116 </resheader>
117 <resheader name="writer">
118 <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119 </resheader>
120 </root> No newline at end of file
@@ -8,3 +8,5 Implab/obj/
8 8 TestResults/
9 9 Implab.Fx/obj/
10 10 Implab.Fx/bin/
11 Implab.Fx.Test/bin/
12 Implab.Fx.Test/obj/
@@ -9,7 +9,7 namespace Implab.Fx
9 9 {
10 10 public static class AnimationHelpers
11 11 {
12 public static Animation<TTarget> AnimateProperty<TTarget,TVal>(this Animation<TTarget> animation, Action<TTarget,TVal> setter, Func<TTarget,TVal> getter, TVal newValue, Func<TVal,TVal,int,int,TVal> fx) where TTarget: class
12 public static Animation<TTarget> AnimateProperty<TTarget, TVal>(this Animation<TTarget> animation, Action<TTarget, TVal> setter, Func<TTarget, TVal> getter, TVal newValue, Func<TVal, TVal, int, int, TVal> fx) where TTarget : class
13 13 {
14 14 if (animation == null)
15 15 throw new ArgumentNullException("animation");
@@ -25,9 +25,9 namespace Implab.Fx
25 25 return animation;
26 26 }
27 27
28 public static Animation<Form> AnimateTransparency(this Form ctl, float newValue)
28 public static Animation<T> AnimateTransparency<T>(this T ctl, float newValue) where T : Form
29 29 {
30 var anim = new Animation<Form>(ctl);
30 var anim = new Animation<T>(ctl);
31 31
32 32 anim.AnimateProperty(
33 33 (target, value) => target.Opacity = value,
@@ -37,5 +37,53 namespace Implab.Fx
37 37 );
38 38 return anim;
39 39 }
40
41 public static Promise<T> CloseFadeOut<T>(this T ctl) where T : Form
42 {
43 var anim = ctl.AnimateTransparency(0);
44
45 return anim.Play().DispatchToControl(ctl).Then(frm => frm.Close());
46 }
47
48 public static Promise<T> OverlayFadeIn<T>(this Form that, T overlay) where T : Form
49 {
50 if (that == null)
51 throw new ArgumentNullException("that");
52 if (overlay == null)
53 throw new ArgumentNullException("overlay");
54
55 // setup overlay
56 overlay.Opacity = 0;
57 overlay.FormBorderStyle = FormBorderStyle.None;
58 overlay.ShowInTaskbar = false;
59
60 that.AddOwnedForm(overlay);
61
62 EventHandler handler = (object sender, EventArgs args) =>
63 {
64 overlay.Bounds = that.RectangleToScreen(that.ClientRectangle);
65 };
66
67 // attach handlers
68 that.Move += handler;
69 that.Resize += handler;
70 that.Shown += handler;
71
72 // remove handlers to release overlay
73 overlay.FormClosed += (sender, args) =>
74 {
75 that.Move -= handler;
76 that.Resize -= handler;
77 that.Shown -= handler;
78 };
79
80 overlay.Show(that);
81 overlay.Bounds = that.RectangleToScreen(that.ClientRectangle);
82
83 return overlay
84 .AnimateTransparency(1)
85 .Play()
86 .DispatchToControl(overlay);
87 }
40 88 }
41 89 }
@@ -33,6 +33,7
33 33 <ItemGroup>
34 34 <Reference Include="System" />
35 35 <Reference Include="System.Core" />
36 <Reference Include="System.Drawing" />
36 37 <Reference Include="System.Windows.Forms" />
37 38 <Reference Include="System.Xml.Linq" />
38 39 <Reference Include="System.Data.DataSetExtensions" />
@@ -14,6 +14,8 Project("{FAE04EC0-301F-11D3-BF4B-00C04F
14 14 EndProject
15 15 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Implab.Fx", "Implab.Fx\Implab.Fx.csproj", "{06E706F8-6881-43EB-927E-FFC503AF6ABC}"
16 16 EndProject
17 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Implab.Fx.Test", "Implab.Fx.Test\Implab.Fx.Test.csproj", "{2F31E405-E267-4195-A05D-574093C21209}"
18 EndProject
17 19 Global
18 20 GlobalSection(TestCaseManagementSettings) = postSolution
19 21 CategoryFile = Implab.vsmdi
@@ -35,6 +37,10 Global
35 37 {06E706F8-6881-43EB-927E-FFC503AF6ABC}.Debug|Any CPU.Build.0 = Debug|Any CPU
36 38 {06E706F8-6881-43EB-927E-FFC503AF6ABC}.Release|Any CPU.ActiveCfg = Release|Any CPU
37 39 {06E706F8-6881-43EB-927E-FFC503AF6ABC}.Release|Any CPU.Build.0 = Release|Any CPU
40 {2F31E405-E267-4195-A05D-574093C21209}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
41 {2F31E405-E267-4195-A05D-574093C21209}.Debug|Any CPU.Build.0 = Debug|Any CPU
42 {2F31E405-E267-4195-A05D-574093C21209}.Release|Any CPU.ActiveCfg = Release|Any CPU
43 {2F31E405-E267-4195-A05D-574093C21209}.Release|Any CPU.Build.0 = Release|Any CPU
38 44 EndGlobalSection
39 45 GlobalSection(SolutionProperties) = preSolution
40 46 HideSolutionNode = FALSE
1 NO CONTENT: modified file, binary diff hidden
General Comments 0
You need to be logged in to leave comments. Login now