src/FingersDance.Control.Pivot/UserControlPivot.xaml.cs
author cavaliet
Wed, 25 Nov 2009 10:49:44 +0100
changeset 231 4eff6b0c9215
parent 162 0b9f989bcb37
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
35
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
     1
using System;
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
     2
using System.IO;
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
     3
using System.Net;
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
     4
using System.Windows;
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
     5
using System.Windows.Controls;
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
     6
using System.Windows.Data;
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
     7
using System.Windows.Media;
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
     8
using System.Windows.Media.Animation;
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
     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
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
    11
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
    12
namespace FingersDance.Control.Pivot
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
    13
{
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
    14
	public partial class UserControlPivot
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
    15
	{
77
e95e916eb018 Travail sur le Pivot et le control Session Input
sarias
parents: 65
diff changeset
    16
        //Events pour chaque Boutton du Pivot
112
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 77
diff changeset
    17
        public event EventHandler EH_SurfaceButtonPlayer_ContactDown;
60
b4008a356f90 Resolution Inertie du Pivot.
sarias
parents: 35
diff changeset
    18
35
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
    19
		public UserControlPivot()
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
    20
		{
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
    21
			this.InitializeComponent();
65
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 60
diff changeset
    22
            
35
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
    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
b4008a356f90 Resolution Inertie du Pivot.
sarias
parents: 35
diff changeset
    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
b4008a356f90 Resolution Inertie du Pivot.
sarias
parents: 35
diff changeset
    27
        private void SurfaceButtonPlayer1_ContactDown(object sender, Microsoft.Surface.Presentation.ContactEventArgs e)
b4008a356f90 Resolution Inertie du Pivot.
sarias
parents: 35
diff changeset
    28
        {
112
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 77
diff changeset
    29
            if(EH_SurfaceButtonPlayer_ContactDown!=null)
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 77
diff changeset
    30
                EH_SurfaceButtonPlayer_ContactDown(1, new EventArgs());
60
b4008a356f90 Resolution Inertie du Pivot.
sarias
parents: 35
diff changeset
    31
        }
b4008a356f90 Resolution Inertie du Pivot.
sarias
parents: 35
diff changeset
    32
b4008a356f90 Resolution Inertie du Pivot.
sarias
parents: 35
diff changeset
    33
        private void SurfaceButtonPlayer2_ContactDown(object sender, Microsoft.Surface.Presentation.ContactEventArgs e)
b4008a356f90 Resolution Inertie du Pivot.
sarias
parents: 35
diff changeset
    34
        {
112
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 77
diff changeset
    35
            if (EH_SurfaceButtonPlayer_ContactDown != null)
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 77
diff changeset
    36
                EH_SurfaceButtonPlayer_ContactDown(2, new EventArgs());
60
b4008a356f90 Resolution Inertie du Pivot.
sarias
parents: 35
diff changeset
    37
        }
b4008a356f90 Resolution Inertie du Pivot.
sarias
parents: 35
diff changeset
    38
b4008a356f90 Resolution Inertie du Pivot.
sarias
parents: 35
diff changeset
    39
        private void SurfaceButtonPlayer3_ContactDown(object sender, Microsoft.Surface.Presentation.ContactEventArgs e)
b4008a356f90 Resolution Inertie du Pivot.
sarias
parents: 35
diff changeset
    40
        {
112
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 77
diff changeset
    41
            if (EH_SurfaceButtonPlayer_ContactDown != null)
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 77
diff changeset
    42
                EH_SurfaceButtonPlayer_ContactDown(3, new EventArgs());
60
b4008a356f90 Resolution Inertie du Pivot.
sarias
parents: 35
diff changeset
    43
        }
b4008a356f90 Resolution Inertie du Pivot.
sarias
parents: 35
diff changeset
    44
b4008a356f90 Resolution Inertie du Pivot.
sarias
parents: 35
diff changeset
    45
        private void SurfaceButtonPlayer4_ContactDown(object sender, Microsoft.Surface.Presentation.ContactEventArgs e)
b4008a356f90 Resolution Inertie du Pivot.
sarias
parents: 35
diff changeset
    46
        {
112
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 77
diff changeset
    47
            if (EH_SurfaceButtonPlayer_ContactDown != null)
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 77
diff changeset
    48
                EH_SurfaceButtonPlayer_ContactDown(4, new EventArgs());
60
b4008a356f90 Resolution Inertie du Pivot.
sarias
parents: 35
diff changeset
    49
        }
b4008a356f90 Resolution Inertie du Pivot.
sarias
parents: 35
diff changeset
    50
b4008a356f90 Resolution Inertie du Pivot.
sarias
parents: 35
diff changeset
    51
        private void SurfaceButtonPlayer1_Click(object sender, RoutedEventArgs e)
b4008a356f90 Resolution Inertie du Pivot.
sarias
parents: 35
diff changeset
    52
        {
b4008a356f90 Resolution Inertie du Pivot.
sarias
parents: 35
diff changeset
    53
            SurfaceButtonPlayer1_ContactDown(this,null);
b4008a356f90 Resolution Inertie du Pivot.
sarias
parents: 35
diff changeset
    54
        }
b4008a356f90 Resolution Inertie du Pivot.
sarias
parents: 35
diff changeset
    55
b4008a356f90 Resolution Inertie du Pivot.
sarias
parents: 35
diff changeset
    56
        private void SurfaceButtonPlayer2_Click(object sender, RoutedEventArgs e)
b4008a356f90 Resolution Inertie du Pivot.
sarias
parents: 35
diff changeset
    57
        {
b4008a356f90 Resolution Inertie du Pivot.
sarias
parents: 35
diff changeset
    58
            SurfaceButtonPlayer2_ContactDown(this, null);
b4008a356f90 Resolution Inertie du Pivot.
sarias
parents: 35
diff changeset
    59
        }
b4008a356f90 Resolution Inertie du Pivot.
sarias
parents: 35
diff changeset
    60
b4008a356f90 Resolution Inertie du Pivot.
sarias
parents: 35
diff changeset
    61
        private void SurfaceButtonPlayer3_Click(object sender, RoutedEventArgs e)
b4008a356f90 Resolution Inertie du Pivot.
sarias
parents: 35
diff changeset
    62
        {
b4008a356f90 Resolution Inertie du Pivot.
sarias
parents: 35
diff changeset
    63
            SurfaceButtonPlayer3_ContactDown(this, null);
b4008a356f90 Resolution Inertie du Pivot.
sarias
parents: 35
diff changeset
    64
        }
b4008a356f90 Resolution Inertie du Pivot.
sarias
parents: 35
diff changeset
    65
b4008a356f90 Resolution Inertie du Pivot.
sarias
parents: 35
diff changeset
    66
        private void SurfaceButtonPlayer4_Click(object sender, RoutedEventArgs e)
b4008a356f90 Resolution Inertie du Pivot.
sarias
parents: 35
diff changeset
    67
        {
b4008a356f90 Resolution Inertie du Pivot.
sarias
parents: 35
diff changeset
    68
            SurfaceButtonPlayer4_ContactDown(this, null);
b4008a356f90 Resolution Inertie du Pivot.
sarias
parents: 35
diff changeset
    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
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
    95
	}
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
    96
}