author | cavaliet |
Wed, 25 Nov 2009 10:49:44 +0100 | |
changeset 231 | 4eff6b0c9215 |
parent 162 | 0b9f989bcb37 |
permissions | -rw-r--r-- |
35 | 1 |
using System; |
2 |
using System.IO; |
|
3 |
using System.Net; |
|
4 |
using System.Windows; |
|
5 |
using System.Windows.Controls; |
|
6 |
using System.Windows.Data; |
|
7 |
using System.Windows.Media; |
|
8 |
using System.Windows.Media.Animation; |
|
9 |
using System.Windows.Navigation; |
|
156
e16c8c913c65
Color Factory et application des couleurs au pivot
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
112
diff
changeset
|
10 |
using FingersDance.Factory; |
35 | 11 |
|
12 |
namespace FingersDance.Control.Pivot |
|
13 |
{ |
|
14 |
public partial class UserControlPivot |
|
15 |
{ |
|
77 | 16 |
//Events pour chaque Boutton du Pivot |
112 | 17 |
public event EventHandler EH_SurfaceButtonPlayer_ContactDown; |
60 | 18 |
|
35 | 19 |
public UserControlPivot() |
20 |
{ |
|
21 |
this.InitializeComponent(); |
|
65 | 22 |
|
35 | 23 |
// Insert code required on object creation below this point. |
162
0b9f989bcb37
Display annotations in all opened UserPanels with the user's color
sarias
parents:
160
diff
changeset
|
24 |
} |
60 | 25 |
|
162
0b9f989bcb37
Display annotations in all opened UserPanels with the user's color
sarias
parents:
160
diff
changeset
|
26 |
#region Pivot Button Actions |
60 | 27 |
private void SurfaceButtonPlayer1_ContactDown(object sender, Microsoft.Surface.Presentation.ContactEventArgs e) |
28 |
{ |
|
112 | 29 |
if(EH_SurfaceButtonPlayer_ContactDown!=null) |
30 |
EH_SurfaceButtonPlayer_ContactDown(1, new EventArgs()); |
|
60 | 31 |
} |
32 |
||
33 |
private void SurfaceButtonPlayer2_ContactDown(object sender, Microsoft.Surface.Presentation.ContactEventArgs e) |
|
34 |
{ |
|
112 | 35 |
if (EH_SurfaceButtonPlayer_ContactDown != null) |
36 |
EH_SurfaceButtonPlayer_ContactDown(2, new EventArgs()); |
|
60 | 37 |
} |
38 |
||
39 |
private void SurfaceButtonPlayer3_ContactDown(object sender, Microsoft.Surface.Presentation.ContactEventArgs e) |
|
40 |
{ |
|
112 | 41 |
if (EH_SurfaceButtonPlayer_ContactDown != null) |
42 |
EH_SurfaceButtonPlayer_ContactDown(3, new EventArgs()); |
|
60 | 43 |
} |
44 |
||
45 |
private void SurfaceButtonPlayer4_ContactDown(object sender, Microsoft.Surface.Presentation.ContactEventArgs e) |
|
46 |
{ |
|
112 | 47 |
if (EH_SurfaceButtonPlayer_ContactDown != null) |
48 |
EH_SurfaceButtonPlayer_ContactDown(4, new EventArgs()); |
|
60 | 49 |
} |
50 |
||
51 |
private void SurfaceButtonPlayer1_Click(object sender, RoutedEventArgs e) |
|
52 |
{ |
|
53 |
SurfaceButtonPlayer1_ContactDown(this,null); |
|
54 |
} |
|
55 |
||
56 |
private void SurfaceButtonPlayer2_Click(object sender, RoutedEventArgs e) |
|
57 |
{ |
|
58 |
SurfaceButtonPlayer2_ContactDown(this, null); |
|
59 |
} |
|
60 |
||
61 |
private void SurfaceButtonPlayer3_Click(object sender, RoutedEventArgs e) |
|
62 |
{ |
|
63 |
SurfaceButtonPlayer3_ContactDown(this, null); |
|
64 |
} |
|
65 |
||
66 |
private void SurfaceButtonPlayer4_Click(object sender, RoutedEventArgs e) |
|
67 |
{ |
|
68 |
SurfaceButtonPlayer4_ContactDown(this, null); |
|
69 |
} |
|
162
0b9f989bcb37
Display annotations in all opened UserPanels with the user's color
sarias
parents:
160
diff
changeset
|
70 |
#endregion |
156
e16c8c913c65
Color Factory et application des couleurs au pivot
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
112
diff
changeset
|
71 |
|
160
e940ca798fe3
Enhance color factory and send the current project (data) to the timeline instance in order to build the project's cutting's annotation list.
cavaliet
parents:
157
diff
changeset
|
72 |
public void ApplyColor(int id, uint color) |
156
e16c8c913c65
Color Factory et application des couleurs au pivot
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
112
diff
changeset
|
73 |
{ |
e16c8c913c65
Color Factory et application des couleurs au pivot
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
112
diff
changeset
|
74 |
try |
e16c8c913c65
Color Factory et application des couleurs au pivot
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
112
diff
changeset
|
75 |
{ |
e16c8c913c65
Color Factory et application des couleurs au pivot
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
112
diff
changeset
|
76 |
switch (id) |
e16c8c913c65
Color Factory et application des couleurs au pivot
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
112
diff
changeset
|
77 |
{ |
e16c8c913c65
Color Factory et application des couleurs au pivot
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
112
diff
changeset
|
78 |
case 1: |
160
e940ca798fe3
Enhance color factory and send the current project (data) to the timeline instance in order to build the project's cutting's annotation list.
cavaliet
parents:
157
diff
changeset
|
79 |
SurfaceButtonPlayer1.Background = (Brush)FindResource((new ColorFactory()).ColorsStringId[color]); |
156
e16c8c913c65
Color Factory et application des couleurs au pivot
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
112
diff
changeset
|
80 |
break; |
e16c8c913c65
Color Factory et application des couleurs au pivot
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
112
diff
changeset
|
81 |
case 2: |
160
e940ca798fe3
Enhance color factory and send the current project (data) to the timeline instance in order to build the project's cutting's annotation list.
cavaliet
parents:
157
diff
changeset
|
82 |
SurfaceButtonPlayer2.Background = (Brush)FindResource((new ColorFactory()).ColorsStringId[color]); |
156
e16c8c913c65
Color Factory et application des couleurs au pivot
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
112
diff
changeset
|
83 |
break; |
e16c8c913c65
Color Factory et application des couleurs au pivot
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
112
diff
changeset
|
84 |
case 3: |
160
e940ca798fe3
Enhance color factory and send the current project (data) to the timeline instance in order to build the project's cutting's annotation list.
cavaliet
parents:
157
diff
changeset
|
85 |
SurfaceButtonPlayer3.Background = (Brush)FindResource((new ColorFactory()).ColorsStringId[color]); |
156
e16c8c913c65
Color Factory et application des couleurs au pivot
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
112
diff
changeset
|
86 |
break; |
e16c8c913c65
Color Factory et application des couleurs au pivot
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
112
diff
changeset
|
87 |
case 4: |
160
e940ca798fe3
Enhance color factory and send the current project (data) to the timeline instance in order to build the project's cutting's annotation list.
cavaliet
parents:
157
diff
changeset
|
88 |
SurfaceButtonPlayer4.Background = (Brush)FindResource((new ColorFactory()).ColorsStringId[color]); |
156
e16c8c913c65
Color Factory et application des couleurs au pivot
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
112
diff
changeset
|
89 |
break; |
e16c8c913c65
Color Factory et application des couleurs au pivot
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
112
diff
changeset
|
90 |
} |
157
0fd2b41ab402
Color Factory et application des couleurs au pivot
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
156
diff
changeset
|
91 |
|
156
e16c8c913c65
Color Factory et application des couleurs au pivot
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
112
diff
changeset
|
92 |
} |
e16c8c913c65
Color Factory et application des couleurs au pivot
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
112
diff
changeset
|
93 |
catch (Exception) { } |
e16c8c913c65
Color Factory et application des couleurs au pivot
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
112
diff
changeset
|
94 |
} |
35 | 95 |
} |
96 |
} |