author | PAMPHILE Jonathan <pamphile@efrei.fr> |
Fri, 16 Oct 2009 03:37:48 +0200 | |
changeset 156 | e16c8c913c65 |
parent 112 | 08bc8eac9e71 |
child 157 | 0fd2b41ab402 |
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. |
24 |
} |
|
60 | 25 |
|
26 |
private void SurfaceButtonPlayer1_ContactDown(object sender, Microsoft.Surface.Presentation.ContactEventArgs e) |
|
27 |
{ |
|
112 | 28 |
if(EH_SurfaceButtonPlayer_ContactDown!=null) |
29 |
EH_SurfaceButtonPlayer_ContactDown(1, new EventArgs()); |
|
60 | 30 |
} |
31 |
||
32 |
private void SurfaceButtonPlayer2_ContactDown(object sender, Microsoft.Surface.Presentation.ContactEventArgs e) |
|
33 |
{ |
|
112 | 34 |
if (EH_SurfaceButtonPlayer_ContactDown != null) |
35 |
EH_SurfaceButtonPlayer_ContactDown(2, new EventArgs()); |
|
60 | 36 |
} |
37 |
||
38 |
private void SurfaceButtonPlayer3_ContactDown(object sender, Microsoft.Surface.Presentation.ContactEventArgs e) |
|
39 |
{ |
|
112 | 40 |
if (EH_SurfaceButtonPlayer_ContactDown != null) |
41 |
EH_SurfaceButtonPlayer_ContactDown(3, new EventArgs()); |
|
60 | 42 |
} |
43 |
||
44 |
private void SurfaceButtonPlayer4_ContactDown(object sender, Microsoft.Surface.Presentation.ContactEventArgs e) |
|
45 |
{ |
|
112 | 46 |
if (EH_SurfaceButtonPlayer_ContactDown != null) |
47 |
EH_SurfaceButtonPlayer_ContactDown(4, new EventArgs()); |
|
60 | 48 |
} |
49 |
||
50 |
private void SurfaceButtonPlayer1_Click(object sender, RoutedEventArgs e) |
|
51 |
{ |
|
52 |
SurfaceButtonPlayer1_ContactDown(this,null); |
|
53 |
} |
|
54 |
||
55 |
private void SurfaceButtonPlayer2_Click(object sender, RoutedEventArgs e) |
|
56 |
{ |
|
57 |
SurfaceButtonPlayer2_ContactDown(this, null); |
|
58 |
} |
|
59 |
||
60 |
private void SurfaceButtonPlayer3_Click(object sender, RoutedEventArgs e) |
|
61 |
{ |
|
62 |
SurfaceButtonPlayer3_ContactDown(this, null); |
|
63 |
} |
|
64 |
||
65 |
private void SurfaceButtonPlayer4_Click(object sender, RoutedEventArgs e) |
|
66 |
{ |
|
67 |
SurfaceButtonPlayer4_ContactDown(this, null); |
|
68 |
} |
|
156
e16c8c913c65
Color Factory et application des couleurs au pivot
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
112
diff
changeset
|
69 |
|
e16c8c913c65
Color Factory et application des couleurs au pivot
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
112
diff
changeset
|
70 |
public void ApplyColor(int id, string color) |
e16c8c913c65
Color Factory et application des couleurs au pivot
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
112
diff
changeset
|
71 |
{ |
e16c8c913c65
Color Factory et application des couleurs au pivot
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
112
diff
changeset
|
72 |
try |
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 |
switch (id) |
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 |
case 1: |
e16c8c913c65
Color Factory et application des couleurs au pivot
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
112
diff
changeset
|
77 |
SurfaceButtonPlayer1.Background = (Brush)FindResource((new ColorFactory()).Colors[color]); |
e16c8c913c65
Color Factory et application des couleurs au pivot
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
112
diff
changeset
|
78 |
break; |
e16c8c913c65
Color Factory et application des couleurs au pivot
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
112
diff
changeset
|
79 |
case 2: |
e16c8c913c65
Color Factory et application des couleurs au pivot
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
112
diff
changeset
|
80 |
SurfaceButtonPlayer2.Background = (Brush)FindResource((new ColorFactory()).Colors[color]); |
e16c8c913c65
Color Factory et application des couleurs au pivot
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
112
diff
changeset
|
81 |
break; |
e16c8c913c65
Color Factory et application des couleurs au pivot
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
112
diff
changeset
|
82 |
case 3: |
e16c8c913c65
Color Factory et application des couleurs au pivot
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
112
diff
changeset
|
83 |
SurfaceButtonPlayer3.Background = (Brush)FindResource((new ColorFactory()).Colors[color]); |
e16c8c913c65
Color Factory et application des couleurs au pivot
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
112
diff
changeset
|
84 |
break; |
e16c8c913c65
Color Factory et application des couleurs au pivot
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
112
diff
changeset
|
85 |
case 4: |
e16c8c913c65
Color Factory et application des couleurs au pivot
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
112
diff
changeset
|
86 |
SurfaceButtonPlayer4.Background = (Brush)FindResource((new ColorFactory()).Colors[color]); |
e16c8c913c65
Color Factory et application des couleurs au pivot
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
112
diff
changeset
|
87 |
break; |
e16c8c913c65
Color Factory et application des couleurs au pivot
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
112
diff
changeset
|
88 |
} |
e16c8c913c65
Color Factory et application des couleurs au pivot
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
112
diff
changeset
|
89 |
} |
e16c8c913c65
Color Factory et application des couleurs au pivot
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
112
diff
changeset
|
90 |
catch (Exception) { } |
e16c8c913c65
Color Factory et application des couleurs au pivot
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
112
diff
changeset
|
91 |
} |
35 | 92 |
} |
93 |
} |