src/FingersDance/MainSurfaceWindow.xaml.cs
author cavaliet
Wed, 25 Nov 2009 10:48:46 +0100
changeset 230 010a2af88bb7
parent 229 05aba5def1fc
parent 227 89f9e7e3ff54
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
45
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
     1
using System;
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
     2
using System.Collections.Generic;
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
     3
using System.Linq;
191
8a25a85f2656 First step of data saving in a ldt/xml file. First step of displaying the existing ldt files (not loaded yet)
cavaliet
parents: 190
diff changeset
     4
using System.Xml;
8a25a85f2656 First step of data saving in a ldt/xml file. First step of displaying the existing ldt files (not loaded yet)
cavaliet
parents: 190
diff changeset
     5
using System.Xml.Linq;
45
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
     6
using System.Text;
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
     7
using System.Windows;
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
     8
using System.Windows.Controls;
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
     9
using System.Windows.Data;
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
    10
using System.Windows.Documents;
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
    11
using System.Windows.Input;
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
    12
using System.Windows.Media;
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
    13
using System.Windows.Media.Imaging;
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
    14
using System.Windows.Shapes;
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
    15
using System.Windows.Threading;
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
    16
using Microsoft.Surface;
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
    17
using Microsoft.Surface.Presentation;
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
    18
using Microsoft.Surface.Presentation.Controls;
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
    19
60
b4008a356f90 Resolution Inertie du Pivot.
sarias
parents: 58
diff changeset
    20
using FingersDance.Control.UserPanel;
82
c37122b567fa Work ControlScreen
sarias
parents: 77
diff changeset
    21
using FingersDance.Control.Screen;
143
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
    22
using FingersDance.Control.Close;
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
    23
using FingersDance.ViewModels;
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
    24
using FingersDance.Data;
156
e16c8c913c65 Color Factory et application des couleurs au pivot
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 152
diff changeset
    25
using FingersDance.Factory;
60
b4008a356f90 Resolution Inertie du Pivot.
sarias
parents: 58
diff changeset
    26
45
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
    27
namespace FingersDance
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
    28
{
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
    29
    /// <summary>
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
    30
    /// Interaction logic for SurfaceWindow1.xaml
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
    31
    /// </summary>
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
    32
    public partial class SurfaceWindow1 : SurfaceWindow
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
    33
    {
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
    34
        /// <summary>
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
    35
        /// Default constructor.
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
    36
        /// </summary>
54
c724ac229181 Singleton de la factory
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 45
diff changeset
    37
        /// 
60
b4008a356f90 Resolution Inertie du Pivot.
sarias
parents: 58
diff changeset
    38
        #region Variables
143
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
    39
112
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 104
diff changeset
    40
        private UserControlUserPanel Panel1 = null;
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 104
diff changeset
    41
        private UserControlUserPanel Panel2 = null;
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 104
diff changeset
    42
        private UserControlUserPanel Panel3 = null;
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 104
diff changeset
    43
        private UserControlUserPanel Panel4 = null;
156
e16c8c913c65 Color Factory et application des couleurs au pivot
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 152
diff changeset
    44
        ActionGenerator _Factory = (new ActionFactory()).GetGenerator();
162
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
    45
        private MainViewModel _mainviewmodel = new MainViewModel();
227
89f9e7e3ff54 Debug Contact Leave
ARIAS Santiago
parents: 225
diff changeset
    46
        bool pivotContactDown = false;
60
b4008a356f90 Resolution Inertie du Pivot.
sarias
parents: 58
diff changeset
    47
        #endregion
54
c724ac229181 Singleton de la factory
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 45
diff changeset
    48
c724ac229181 Singleton de la factory
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 45
diff changeset
    49
143
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
    50
        #region Constructor
45
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
    51
        public SurfaceWindow1()
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
    52
        {
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
    53
            InitializeComponent();
60
b4008a356f90 Resolution Inertie du Pivot.
sarias
parents: 58
diff changeset
    54
            //Permet d'initialiser l'inertie du Pivot une fois relach�.
b4008a356f90 Resolution Inertie du Pivot.
sarias
parents: 58
diff changeset
    55
            InitPivotInertia();
58
d7313fb1806c Initialisation de la position du Pivot au centre et des positions des 4 Grids
sarias
parents: 54
diff changeset
    56
            //Permet d'initialiser les quand Grid � la position initiale du pivot
d7313fb1806c Initialisation de la position du Pivot au centre et des positions des 4 Grids
sarias
parents: 54
diff changeset
    57
            InitGridPositions();
45
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
    58
            // Add handlers for Application activation events
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
    59
            AddActivationHandlers();
217
6cfd723a1378 add credit panel
cavaliet
parents: 214
diff changeset
    60
            // Add credit text
6cfd723a1378 add credit panel
cavaliet
parents: 214
diff changeset
    61
            CreditsText1.Text = CreditsText2.Text = CreditsText3.Text = CreditsText4.Text =
225
b60e13ed75c8 Now an annotation has a list of gesture string and not simple gesture string. These are saved into and loaded from the ldt xml file.
cavaliet
parents: 224
diff changeset
    62
                "MICROSOFT :\nPierre-Louis Xech\n\nEFREI :\nSantiago Arias\nRiley Ikni\nJonathan Pamphile\n\nSTRATE COLLEGE :\nAnnabelle Eug�nia\nHuieun Kim\nBaptiste Lanne\nIoana Ocnarescu\nVanessa Reiser\nDominique Sciamma\n\nINSTITUT DE RECHERCHE ET D'INNOVATION\nThibaut Cavali�\nYves-Marie Haussonne\nVincent Puig";
45
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
    63
        }
143
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
    64
        #endregion
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
    65
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
    66
        #region Initialization
45
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
    67
60
b4008a356f90 Resolution Inertie du Pivot.
sarias
parents: 58
diff changeset
    68
        private void InitPivotInertia()
b4008a356f90 Resolution Inertie du Pivot.
sarias
parents: 58
diff changeset
    69
        {
b4008a356f90 Resolution Inertie du Pivot.
sarias
parents: 58
diff changeset
    70
            try
b4008a356f90 Resolution Inertie du Pivot.
sarias
parents: 58
diff changeset
    71
            {
77
e95e916eb018 Travail sur le Pivot et le control Session Input
sarias
parents: 73
diff changeset
    72
                ScatterViewItem item = (ScatterViewItem)scaterview.Items.GetItemAt(0);
60
b4008a356f90 Resolution Inertie du Pivot.
sarias
parents: 58
diff changeset
    73
                item.DecelerationRate = double.NaN;
b4008a356f90 Resolution Inertie du Pivot.
sarias
parents: 58
diff changeset
    74
            }
b4008a356f90 Resolution Inertie du Pivot.
sarias
parents: 58
diff changeset
    75
            catch (Exception ex) { }
b4008a356f90 Resolution Inertie du Pivot.
sarias
parents: 58
diff changeset
    76
        }
b4008a356f90 Resolution Inertie du Pivot.
sarias
parents: 58
diff changeset
    77
58
d7313fb1806c Initialisation de la position du Pivot au centre et des positions des 4 Grids
sarias
parents: 54
diff changeset
    78
        private void InitGridPositions()
d7313fb1806c Initialisation de la position du Pivot au centre et des positions des 4 Grids
sarias
parents: 54
diff changeset
    79
        {
d7313fb1806c Initialisation de la position du Pivot au centre et des positions des 4 Grids
sarias
parents: 54
diff changeset
    80
            //Initialise les 4 Grids � la positions initiale du Pivot.   
d7313fb1806c Initialisation de la position du Pivot au centre et des positions des 4 Grids
sarias
parents: 54
diff changeset
    81
            try
d7313fb1806c Initialisation de la position du Pivot au centre et des positions des 4 Grids
sarias
parents: 54
diff changeset
    82
            {
77
e95e916eb018 Travail sur le Pivot et le control Session Input
sarias
parents: 73
diff changeset
    83
                ScatterViewItem item = (ScatterViewItem)scaterview.Items.GetItemAt(0);
58
d7313fb1806c Initialisation de la position du Pivot au centre et des positions des 4 Grids
sarias
parents: 54
diff changeset
    84
                Grid1.Width =item.Center.X;
d7313fb1806c Initialisation de la position du Pivot au centre et des positions des 4 Grids
sarias
parents: 54
diff changeset
    85
                Grid1.Height = item.Center.Y;
d7313fb1806c Initialisation de la position du Pivot au centre et des positions des 4 Grids
sarias
parents: 54
diff changeset
    86
                
d7313fb1806c Initialisation de la position du Pivot au centre et des positions des 4 Grids
sarias
parents: 54
diff changeset
    87
                Grid2.Width = item.Center.X;
d7313fb1806c Initialisation de la position du Pivot au centre et des positions des 4 Grids
sarias
parents: 54
diff changeset
    88
                Grid2.Height = 768 - item.Center.Y;
d7313fb1806c Initialisation de la position du Pivot au centre et des positions des 4 Grids
sarias
parents: 54
diff changeset
    89
d7313fb1806c Initialisation de la position du Pivot au centre et des positions des 4 Grids
sarias
parents: 54
diff changeset
    90
                Grid3.Width = 1024 - item.Center.X;
d7313fb1806c Initialisation de la position du Pivot au centre et des positions des 4 Grids
sarias
parents: 54
diff changeset
    91
                Grid3.Height = 768 - item.Center.Y;
d7313fb1806c Initialisation de la position du Pivot au centre et des positions des 4 Grids
sarias
parents: 54
diff changeset
    92
d7313fb1806c Initialisation de la position du Pivot au centre et des positions des 4 Grids
sarias
parents: 54
diff changeset
    93
                Grid4.Width = 1024 - item.Center.X;
d7313fb1806c Initialisation de la position du Pivot au centre et des positions des 4 Grids
sarias
parents: 54
diff changeset
    94
                Grid4.Height = item.Center.Y;
d7313fb1806c Initialisation de la position du Pivot au centre et des positions des 4 Grids
sarias
parents: 54
diff changeset
    95
            }
d7313fb1806c Initialisation de la position du Pivot au centre et des positions des 4 Grids
sarias
parents: 54
diff changeset
    96
            catch (Exception ex) { }
d7313fb1806c Initialisation de la position du Pivot au centre et des positions des 4 Grids
sarias
parents: 54
diff changeset
    97
        }
d7313fb1806c Initialisation de la position du Pivot au centre et des positions des 4 Grids
sarias
parents: 54
diff changeset
    98
143
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
    99
        #endregion
45
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   100
162
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
   101
        #region Application Default Functions
45
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   102
        /// <summary>
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   103
        /// Occurs when the window is about to close. 
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   104
        /// </summary>
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   105
        /// <param name="e"></param>
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   106
        protected override void OnClosed(EventArgs e)
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   107
        {
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   108
            base.OnClosed(e);
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   109
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   110
            // Remove handlers for Application activation events
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   111
            RemoveActivationHandlers();
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   112
        }
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   113
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   114
        /// <summary>
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   115
        /// Adds handlers for Application activation events.
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   116
        /// </summary>
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   117
        private void AddActivationHandlers()
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   118
        {
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   119
            // Subscribe to surface application activation events
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   120
            ApplicationLauncher.ApplicationActivated += OnApplicationActivated;
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   121
            ApplicationLauncher.ApplicationPreviewed += OnApplicationPreviewed;
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   122
            ApplicationLauncher.ApplicationDeactivated += OnApplicationDeactivated;
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   123
        }
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   124
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   125
        /// <summary>
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   126
        /// Removes handlers for Application activation events.
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   127
        /// </summary>
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   128
        private void RemoveActivationHandlers()
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   129
        {
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   130
            // Unsubscribe from surface application activation events
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   131
            ApplicationLauncher.ApplicationActivated -= OnApplicationActivated;
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   132
            ApplicationLauncher.ApplicationPreviewed -= OnApplicationPreviewed;
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   133
            ApplicationLauncher.ApplicationDeactivated -= OnApplicationDeactivated;
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   134
        }
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   135
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   136
        /// <summary>
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   137
        /// This is called when application has been activated.
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   138
        /// </summary>
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   139
        /// <param name="sender"></param>
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   140
        /// <param name="e"></param>
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   141
        private void OnApplicationActivated(object sender, EventArgs e)
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   142
        {
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   143
            //TODO: enable audio, animations here
143
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   144
45
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   145
        }
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   146
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   147
        /// <summary>
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   148
        /// This is called when application is in preview mode.
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   149
        /// </summary>
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   150
        /// <param name="sender"></param>
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   151
        /// <param name="e"></param>
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   152
        private void OnApplicationPreviewed(object sender, EventArgs e)
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   153
        {
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   154
            //TODO: Disable audio here if it is enabled
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   155
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   156
            //TODO: optionally enable animations here
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   157
        }
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   158
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   159
        /// <summary>
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   160
        ///  This is called when application has been deactivated.
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   161
        /// </summary>
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   162
        /// <param name="sender"></param>
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   163
        /// <param name="e"></param>
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   164
        private void OnApplicationDeactivated(object sender, EventArgs e)
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   165
        {
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   166
            //TODO: disable audio, animations here
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   167
        }
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   168
143
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   169
        /// <summary>
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   170
        ///  This is called when application has been loaded, we change the orientation
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   171
        ///  of the application
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   172
        /// </summary>
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   173
        /// <param name="sender"></param>
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   174
        /// <param name="e"></param>
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   175
        private void mainSurfaceWindow_Loaded(object sender, RoutedEventArgs e)
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   176
        {
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   177
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   178
            if (ApplicationLauncher.InitialOrientation == UserOrientation.Top)
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   179
            {
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   180
                // Rotate the main canvas by 180 degrees.
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   181
                this.MainGrid.LayoutTransform = new RotateTransform(180.0);
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   182
            }
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   183
            else
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   184
            {
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   185
                // Remove the rotate transform on the main canvas.
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   186
                this.MainGrid.LayoutTransform = null;
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   187
            }
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   188
            // Dismiss the loading screen.
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   189
            ApplicationLauncher.SignalApplicationLoadComplete();
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   190
        }
162
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
   191
        #endregion
143
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   192
162
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
   193
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
   194
        
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
   195
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
   196
        #region Pivot Actions
77
e95e916eb018 Travail sur le Pivot et le control Session Input
sarias
parents: 73
diff changeset
   197
        private void scaterview_ContactChanged(object sender, ContactEventArgs e)
162
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
   198
        { }
77
e95e916eb018 Travail sur le Pivot et le control Session Input
sarias
parents: 73
diff changeset
   199
        private void ScatterViewItemPivot_ContactChanged(object sender, ContactEventArgs e)
45
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   200
        {
58
d7313fb1806c Initialisation de la position du Pivot au centre et des positions des 4 Grids
sarias
parents: 54
diff changeset
   201
            //Permet la MAJ des 4 Grids � la position du pivot
45
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   202
            try
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   203
            {
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   204
                Grid1.Width = e.GetPosition(mainSurfaceWindow).X;
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   205
                Grid1.Height = e.GetPosition(mainSurfaceWindow).Y;
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   206
60
b4008a356f90 Resolution Inertie du Pivot.
sarias
parents: 58
diff changeset
   207
                Grid3.Width = e.GetPosition(mainSurfaceWindow).X;
45
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   208
                Grid3.Height = 768 - e.GetPosition(mainSurfaceWindow).Y;
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   209
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   210
                Grid4.Width = 1024 - e.GetPosition(mainSurfaceWindow).X;
60
b4008a356f90 Resolution Inertie du Pivot.
sarias
parents: 58
diff changeset
   211
                Grid4.Height = 768 - e.GetPosition(mainSurfaceWindow).Y;
b4008a356f90 Resolution Inertie du Pivot.
sarias
parents: 58
diff changeset
   212
b4008a356f90 Resolution Inertie du Pivot.
sarias
parents: 58
diff changeset
   213
                Grid2.Width = 1024 - e.GetPosition(mainSurfaceWindow).X;
b4008a356f90 Resolution Inertie du Pivot.
sarias
parents: 58
diff changeset
   214
                Grid2.Height = e.GetPosition(mainSurfaceWindow).Y;
89
f9a931434910 Grisage lors du resize.
sarias
parents: 82
diff changeset
   215
91
0f29e2660bb7 grisage sur le les controls
sarias
parents: 89
diff changeset
   216
                //GRISAGE
0f29e2660bb7 grisage sur le les controls
sarias
parents: 89
diff changeset
   217
                //Grid1
0f29e2660bb7 grisage sur le les controls
sarias
parents: 89
diff changeset
   218
                if (Grid1.Width < (1024 / 4) || Grid2.Height < (768 / 4))
89
f9a931434910 Grisage lors du resize.
sarias
parents: 82
diff changeset
   219
                {
91
0f29e2660bb7 grisage sur le les controls
sarias
parents: 89
diff changeset
   220
                    try
152
46577fd0a294 PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 150
diff changeset
   221
                    {
46577fd0a294 PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 150
diff changeset
   222
                        if (Panel1 != null)
224
874de6d84a2e Panels visibility
ARIAS Santiago
parents: 223
diff changeset
   223
                        {
152
46577fd0a294 PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 150
diff changeset
   224
                            Panel1.PlayerPause();
224
874de6d84a2e Panels visibility
ARIAS Santiago
parents: 223
diff changeset
   225
                            Panel1.PanelVisibility(Visibility.Hidden);
874de6d84a2e Panels visibility
ARIAS Santiago
parents: 223
diff changeset
   226
                        }
152
46577fd0a294 PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 150
diff changeset
   227
                        Grid1.Children[1].Visibility = Visibility.Hidden;
224
874de6d84a2e Panels visibility
ARIAS Santiago
parents: 223
diff changeset
   228
152
46577fd0a294 PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 150
diff changeset
   229
                    }
91
0f29e2660bb7 grisage sur le les controls
sarias
parents: 89
diff changeset
   230
                    catch (Exception) { }
89
f9a931434910 Grisage lors du resize.
sarias
parents: 82
diff changeset
   231
                }
91
0f29e2660bb7 grisage sur le les controls
sarias
parents: 89
diff changeset
   232
                else
0f29e2660bb7 grisage sur le les controls
sarias
parents: 89
diff changeset
   233
                {
0f29e2660bb7 grisage sur le les controls
sarias
parents: 89
diff changeset
   234
                    try
152
46577fd0a294 PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 150
diff changeset
   235
                    { 
224
874de6d84a2e Panels visibility
ARIAS Santiago
parents: 223
diff changeset
   236
                        Grid1.Children[1].Visibility = Visibility.Visible;
874de6d84a2e Panels visibility
ARIAS Santiago
parents: 223
diff changeset
   237
                        if (Panel1 != null)
874de6d84a2e Panels visibility
ARIAS Santiago
parents: 223
diff changeset
   238
                        {
874de6d84a2e Panels visibility
ARIAS Santiago
parents: 223
diff changeset
   239
                            Panel1.PanelVisibility(Visibility.Visible);
874de6d84a2e Panels visibility
ARIAS Santiago
parents: 223
diff changeset
   240
                        }
152
46577fd0a294 PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 150
diff changeset
   241
                    }
91
0f29e2660bb7 grisage sur le les controls
sarias
parents: 89
diff changeset
   242
                    catch (Exception) { }
0f29e2660bb7 grisage sur le les controls
sarias
parents: 89
diff changeset
   243
                }
0f29e2660bb7 grisage sur le les controls
sarias
parents: 89
diff changeset
   244
                //Grid2
0f29e2660bb7 grisage sur le les controls
sarias
parents: 89
diff changeset
   245
                if (Grid2.Width < (1024 / 4) || Grid2.Height < (768 / 4))
89
f9a931434910 Grisage lors du resize.
sarias
parents: 82
diff changeset
   246
                {
91
0f29e2660bb7 grisage sur le les controls
sarias
parents: 89
diff changeset
   247
                    try
152
46577fd0a294 PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 150
diff changeset
   248
                    {
46577fd0a294 PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 150
diff changeset
   249
                        if (Panel2 != null)
224
874de6d84a2e Panels visibility
ARIAS Santiago
parents: 223
diff changeset
   250
                        {
152
46577fd0a294 PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 150
diff changeset
   251
                            Panel2.PlayerPause();
224
874de6d84a2e Panels visibility
ARIAS Santiago
parents: 223
diff changeset
   252
                            Panel2.PanelVisibility(Visibility.Hidden);
874de6d84a2e Panels visibility
ARIAS Santiago
parents: 223
diff changeset
   253
                        }
152
46577fd0a294 PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 150
diff changeset
   254
                        Grid2.Children[1].Visibility = Visibility.Hidden; 
46577fd0a294 PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 150
diff changeset
   255
                    }
91
0f29e2660bb7 grisage sur le les controls
sarias
parents: 89
diff changeset
   256
                    catch (Exception) { }
0f29e2660bb7 grisage sur le les controls
sarias
parents: 89
diff changeset
   257
                }
0f29e2660bb7 grisage sur le les controls
sarias
parents: 89
diff changeset
   258
                else
0f29e2660bb7 grisage sur le les controls
sarias
parents: 89
diff changeset
   259
                {
0f29e2660bb7 grisage sur le les controls
sarias
parents: 89
diff changeset
   260
                    try
152
46577fd0a294 PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 150
diff changeset
   261
                    {
224
874de6d84a2e Panels visibility
ARIAS Santiago
parents: 223
diff changeset
   262
                        Grid2.Children[1].Visibility = Visibility.Visible;
874de6d84a2e Panels visibility
ARIAS Santiago
parents: 223
diff changeset
   263
                        if (Panel2 != null)
874de6d84a2e Panels visibility
ARIAS Santiago
parents: 223
diff changeset
   264
                        {
874de6d84a2e Panels visibility
ARIAS Santiago
parents: 223
diff changeset
   265
                            Panel2.PanelVisibility(Visibility.Visible);
874de6d84a2e Panels visibility
ARIAS Santiago
parents: 223
diff changeset
   266
                        }
152
46577fd0a294 PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 150
diff changeset
   267
                    }
91
0f29e2660bb7 grisage sur le les controls
sarias
parents: 89
diff changeset
   268
                    catch (Exception) { }
89
f9a931434910 Grisage lors du resize.
sarias
parents: 82
diff changeset
   269
                }
91
0f29e2660bb7 grisage sur le les controls
sarias
parents: 89
diff changeset
   270
                //Grid3
0f29e2660bb7 grisage sur le les controls
sarias
parents: 89
diff changeset
   271
                if (Grid3.Width < (1024 / 4) || Grid3.Height < (768 / 4))
89
f9a931434910 Grisage lors du resize.
sarias
parents: 82
diff changeset
   272
                {
91
0f29e2660bb7 grisage sur le les controls
sarias
parents: 89
diff changeset
   273
                    try
152
46577fd0a294 PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 150
diff changeset
   274
                    {
46577fd0a294 PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 150
diff changeset
   275
                        if (Panel3 != null)
224
874de6d84a2e Panels visibility
ARIAS Santiago
parents: 223
diff changeset
   276
                        {
152
46577fd0a294 PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 150
diff changeset
   277
                            Panel3.PlayerPause();
224
874de6d84a2e Panels visibility
ARIAS Santiago
parents: 223
diff changeset
   278
                            Panel3.PanelVisibility(Visibility.Hidden);
874de6d84a2e Panels visibility
ARIAS Santiago
parents: 223
diff changeset
   279
                        }
152
46577fd0a294 PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 150
diff changeset
   280
                        Grid3.Children[1].Visibility = Visibility.Hidden;
46577fd0a294 PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 150
diff changeset
   281
                    }
91
0f29e2660bb7 grisage sur le les controls
sarias
parents: 89
diff changeset
   282
                    catch (Exception) { }
0f29e2660bb7 grisage sur le les controls
sarias
parents: 89
diff changeset
   283
                }
0f29e2660bb7 grisage sur le les controls
sarias
parents: 89
diff changeset
   284
                else
0f29e2660bb7 grisage sur le les controls
sarias
parents: 89
diff changeset
   285
                {
0f29e2660bb7 grisage sur le les controls
sarias
parents: 89
diff changeset
   286
                    try
152
46577fd0a294 PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 150
diff changeset
   287
                    {
224
874de6d84a2e Panels visibility
ARIAS Santiago
parents: 223
diff changeset
   288
                        Grid3.Children[1].Visibility = Visibility.Visible;
874de6d84a2e Panels visibility
ARIAS Santiago
parents: 223
diff changeset
   289
                        if (Panel3 != null)
874de6d84a2e Panels visibility
ARIAS Santiago
parents: 223
diff changeset
   290
                        {
874de6d84a2e Panels visibility
ARIAS Santiago
parents: 223
diff changeset
   291
                            Panel3.PanelVisibility(Visibility.Visible);
874de6d84a2e Panels visibility
ARIAS Santiago
parents: 223
diff changeset
   292
                        }
152
46577fd0a294 PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 150
diff changeset
   293
                    }
91
0f29e2660bb7 grisage sur le les controls
sarias
parents: 89
diff changeset
   294
                    catch (Exception) { }
89
f9a931434910 Grisage lors du resize.
sarias
parents: 82
diff changeset
   295
                }
91
0f29e2660bb7 grisage sur le les controls
sarias
parents: 89
diff changeset
   296
                //Grid4
0f29e2660bb7 grisage sur le les controls
sarias
parents: 89
diff changeset
   297
                if (Grid4.Width < (1024 / 4) || Grid4.Height < (768 / 4))
89
f9a931434910 Grisage lors du resize.
sarias
parents: 82
diff changeset
   298
                {
91
0f29e2660bb7 grisage sur le les controls
sarias
parents: 89
diff changeset
   299
                    try
152
46577fd0a294 PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 150
diff changeset
   300
                    {
46577fd0a294 PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 150
diff changeset
   301
                        if (Panel4 != null)
224
874de6d84a2e Panels visibility
ARIAS Santiago
parents: 223
diff changeset
   302
                        {
152
46577fd0a294 PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 150
diff changeset
   303
                            Panel4.PlayerPause();
224
874de6d84a2e Panels visibility
ARIAS Santiago
parents: 223
diff changeset
   304
                            Panel4.PanelVisibility(Visibility.Hidden);
874de6d84a2e Panels visibility
ARIAS Santiago
parents: 223
diff changeset
   305
                        }
152
46577fd0a294 PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 150
diff changeset
   306
                        Grid4.Children[1].Visibility = Visibility.Hidden;
46577fd0a294 PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 150
diff changeset
   307
                    }
91
0f29e2660bb7 grisage sur le les controls
sarias
parents: 89
diff changeset
   308
                    catch (Exception) { }
89
f9a931434910 Grisage lors du resize.
sarias
parents: 82
diff changeset
   309
                }
91
0f29e2660bb7 grisage sur le les controls
sarias
parents: 89
diff changeset
   310
                else
0f29e2660bb7 grisage sur le les controls
sarias
parents: 89
diff changeset
   311
                {
0f29e2660bb7 grisage sur le les controls
sarias
parents: 89
diff changeset
   312
                    try
152
46577fd0a294 PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 150
diff changeset
   313
                    { 
46577fd0a294 PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 150
diff changeset
   314
                        Grid4.Children[1].Visibility = Visibility.Visible;
224
874de6d84a2e Panels visibility
ARIAS Santiago
parents: 223
diff changeset
   315
                        if (Panel4 != null)
874de6d84a2e Panels visibility
ARIAS Santiago
parents: 223
diff changeset
   316
                        {
874de6d84a2e Panels visibility
ARIAS Santiago
parents: 223
diff changeset
   317
                            Panel4.PanelVisibility(Visibility.Visible);
874de6d84a2e Panels visibility
ARIAS Santiago
parents: 223
diff changeset
   318
                        }
152
46577fd0a294 PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 150
diff changeset
   319
                    }
91
0f29e2660bb7 grisage sur le les controls
sarias
parents: 89
diff changeset
   320
                    catch (Exception) { }
0f29e2660bb7 grisage sur le les controls
sarias
parents: 89
diff changeset
   321
                }
45
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   322
            }
91
0f29e2660bb7 grisage sur le les controls
sarias
parents: 89
diff changeset
   323
            catch (Exception) { }
45
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   324
        }
60
b4008a356f90 Resolution Inertie du Pivot.
sarias
parents: 58
diff changeset
   325
224
874de6d84a2e Panels visibility
ARIAS Santiago
parents: 223
diff changeset
   326
        //SAR
874de6d84a2e Panels visibility
ARIAS Santiago
parents: 223
diff changeset
   327
        private void ScatterViewItemPivot_ContactLeave(object sender, ContactEventArgs e)
874de6d84a2e Panels visibility
ARIAS Santiago
parents: 223
diff changeset
   328
        {
874de6d84a2e Panels visibility
ARIAS Santiago
parents: 223
diff changeset
   329
            //Permet la MAJ des 4 Grids � la position du pivot
874de6d84a2e Panels visibility
ARIAS Santiago
parents: 223
diff changeset
   330
            try
874de6d84a2e Panels visibility
ARIAS Santiago
parents: 223
diff changeset
   331
            {
227
89f9e7e3ff54 Debug Contact Leave
ARIAS Santiago
parents: 225
diff changeset
   332
                if (!pivotContactDown)
89f9e7e3ff54 Debug Contact Leave
ARIAS Santiago
parents: 225
diff changeset
   333
                {
89f9e7e3ff54 Debug Contact Leave
ARIAS Santiago
parents: 225
diff changeset
   334
                    Grid1.Width = e.GetPosition(mainSurfaceWindow).X;
89f9e7e3ff54 Debug Contact Leave
ARIAS Santiago
parents: 225
diff changeset
   335
                    Grid1.Height = e.GetPosition(mainSurfaceWindow).Y;
224
874de6d84a2e Panels visibility
ARIAS Santiago
parents: 223
diff changeset
   336
227
89f9e7e3ff54 Debug Contact Leave
ARIAS Santiago
parents: 225
diff changeset
   337
                    Grid3.Width = e.GetPosition(mainSurfaceWindow).X;
89f9e7e3ff54 Debug Contact Leave
ARIAS Santiago
parents: 225
diff changeset
   338
                    Grid3.Height = 768 - e.GetPosition(mainSurfaceWindow).Y;
224
874de6d84a2e Panels visibility
ARIAS Santiago
parents: 223
diff changeset
   339
227
89f9e7e3ff54 Debug Contact Leave
ARIAS Santiago
parents: 225
diff changeset
   340
                    Grid4.Width = 1024 - e.GetPosition(mainSurfaceWindow).X;
89f9e7e3ff54 Debug Contact Leave
ARIAS Santiago
parents: 225
diff changeset
   341
                    Grid4.Height = 768 - e.GetPosition(mainSurfaceWindow).Y;
224
874de6d84a2e Panels visibility
ARIAS Santiago
parents: 223
diff changeset
   342
227
89f9e7e3ff54 Debug Contact Leave
ARIAS Santiago
parents: 225
diff changeset
   343
                    Grid2.Width = 1024 - e.GetPosition(mainSurfaceWindow).X;
89f9e7e3ff54 Debug Contact Leave
ARIAS Santiago
parents: 225
diff changeset
   344
                    Grid2.Height = e.GetPosition(mainSurfaceWindow).Y;
89f9e7e3ff54 Debug Contact Leave
ARIAS Santiago
parents: 225
diff changeset
   345
                    ((ScatterViewItem)sender).Center = new Point(e.GetPosition(mainSurfaceWindow).X, e.GetPosition(mainSurfaceWindow).Y);
89f9e7e3ff54 Debug Contact Leave
ARIAS Santiago
parents: 225
diff changeset
   346
                }
89f9e7e3ff54 Debug Contact Leave
ARIAS Santiago
parents: 225
diff changeset
   347
                pivotContactDown = false;
224
874de6d84a2e Panels visibility
ARIAS Santiago
parents: 223
diff changeset
   348
            }
874de6d84a2e Panels visibility
ARIAS Santiago
parents: 223
diff changeset
   349
            catch (Exception) { }
874de6d84a2e Panels visibility
ARIAS Santiago
parents: 223
diff changeset
   350
        }
874de6d84a2e Panels visibility
ARIAS Santiago
parents: 223
diff changeset
   351
112
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 104
diff changeset
   352
        private void UserControlPivot_EH_SurfaceButtonPlayer_ContactDown(object sender, EventArgs e)
60
b4008a356f90 Resolution Inertie du Pivot.
sarias
parents: 58
diff changeset
   353
        {
227
89f9e7e3ff54 Debug Contact Leave
ARIAS Santiago
parents: 225
diff changeset
   354
            pivotContactDown = true;
143
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   355
            //  Traitement du contact down sur le pivot (Cr�ation d'un screen ou suppression d'un panel
112
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 104
diff changeset
   356
            switch ((int)sender)
60
b4008a356f90 Resolution Inertie du Pivot.
sarias
parents: 58
diff changeset
   357
            {
112
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 104
diff changeset
   358
                case 1:
217
6cfd723a1378 add credit panel
cavaliet
parents: 214
diff changeset
   359
                    if (Panel1 == null && Grid1.Children.Count == 3)
112
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 104
diff changeset
   360
                    {
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 104
diff changeset
   361
                        //1-Creation du control Screen
143
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   362
                        UserControlScreen Screen = new UserControlScreen(1, _mainviewmodel);
112
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 104
diff changeset
   363
                        Screen.Name = "Screen1";
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 104
diff changeset
   364
                        Screen.contexteGrid = Grid1.Name.ToString();
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 104
diff changeset
   365
                        //2-Rajout du screen dans la grid correspondante
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 104
diff changeset
   366
                        Grid1.Children.Add(Screen);
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 104
diff changeset
   367
190
619ca3ae13c7 MainViewModel is now well linked to all the users'cuttings. At any moment, the MVM has all annotations. This step prepares data saving.
cavaliet
parents: 188
diff changeset
   368
                        Screen.UC_Screen_NewCutting += new System.EventHandler(this.SessionInput_EH_SurfaceButtonSubmit_ContactDown); 
112
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 104
diff changeset
   369
                    }
143
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   370
                    else //Affichage du message de confirmation
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   371
                    {
217
6cfd723a1378 add credit panel
cavaliet
parents: 214
diff changeset
   372
                        if (Panel1 != null && Grid1.Children.Count == 4)
143
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   373
                        {
140
fc7c12f9da30 Add a confirm dialog box before deleting an annotation by drag and drop. Now the UserControlClose is a generic confirm dialog box sending a ConfirmYesOrNo Event.
cavaliet
parents: 139
diff changeset
   374
                            UserControlClose UCclose = new UserControlClose(1, "�tes-vous s�r de vouloir quitter ?");
143
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   375
                            UCclose.Name = "CloseAlert1";
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   376
                            Grid1.Children.Add(UCclose);
140
fc7c12f9da30 Add a confirm dialog box before deleting an annotation by drag and drop. Now the UserControlClose is a generic confirm dialog box sending a ConfirmYesOrNo Event.
cavaliet
parents: 139
diff changeset
   377
                            UCclose.ConfirmYesOrNo += new EventHandler<ConfirmEventArgs>(CloseAlert_EH_SurfaceButton_ContactDown);
143
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   378
                        }
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   379
                    }
112
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 104
diff changeset
   380
                    break;
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 104
diff changeset
   381
                case 2:
217
6cfd723a1378 add credit panel
cavaliet
parents: 214
diff changeset
   382
                    if (Panel2 == null && Grid2.Children.Count == 3)
112
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 104
diff changeset
   383
                    {
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 104
diff changeset
   384
                        //1-Creation du control Screen
143
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   385
                        UserControlScreen Screen = new UserControlScreen(2, _mainviewmodel);
112
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 104
diff changeset
   386
                        Screen.Name = "Screen2";
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 104
diff changeset
   387
                        Screen.contexteGrid = Grid2.Name.ToString();
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 104
diff changeset
   388
                        //2-Rajout du screen dans la grid correspondante
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 104
diff changeset
   389
                        Grid2.Children.Add(Screen);
72
f1ca0958c992 Travail sur le control List Video et comunication entre ListVideo et FingersDance
sarias
parents: 60
diff changeset
   390
182
25b49d4f1635 First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents: 168
diff changeset
   391
                        Screen.UC_Screen_NewCutting += new System.EventHandler(this.SessionInput_EH_SurfaceButtonSubmit_ContactDown);
112
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 104
diff changeset
   392
                    }
143
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   393
                    else //Affichage du message de confirmation
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   394
                    {
217
6cfd723a1378 add credit panel
cavaliet
parents: 214
diff changeset
   395
                        if (Panel2 != null && Grid2.Children.Count == 4)
143
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   396
                        {
140
fc7c12f9da30 Add a confirm dialog box before deleting an annotation by drag and drop. Now the UserControlClose is a generic confirm dialog box sending a ConfirmYesOrNo Event.
cavaliet
parents: 139
diff changeset
   397
                            UserControlClose UCclose = new UserControlClose(2, "�tes-vous s�r de vouloir quitter ?");
143
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   398
                            UCclose.Name = "CloseAlert2";
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   399
                            Grid2.Children.Add(UCclose);
140
fc7c12f9da30 Add a confirm dialog box before deleting an annotation by drag and drop. Now the UserControlClose is a generic confirm dialog box sending a ConfirmYesOrNo Event.
cavaliet
parents: 139
diff changeset
   400
                            UCclose.ConfirmYesOrNo += new EventHandler<ConfirmEventArgs>(CloseAlert_EH_SurfaceButton_ContactDown);
143
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   401
                        }
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   402
                    }
112
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 104
diff changeset
   403
                    break;
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 104
diff changeset
   404
                case 3:
217
6cfd723a1378 add credit panel
cavaliet
parents: 214
diff changeset
   405
                    if (Panel3 == null && Grid3.Children.Count == 3)
112
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 104
diff changeset
   406
                    {
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 104
diff changeset
   407
                        //1-Creation du control Screen
143
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   408
                        UserControlScreen Screen = new UserControlScreen(3, _mainviewmodel);
112
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 104
diff changeset
   409
                        Screen.Name = "Screen3";
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 104
diff changeset
   410
                        Screen.contexteGrid = Grid3.Name.ToString();
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 104
diff changeset
   411
                        //2-Rajout du screen dans la grid correspondante
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 104
diff changeset
   412
                        Grid3.Children.Add(Screen);
72
f1ca0958c992 Travail sur le control List Video et comunication entre ListVideo et FingersDance
sarias
parents: 60
diff changeset
   413
182
25b49d4f1635 First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents: 168
diff changeset
   414
                        Screen.UC_Screen_NewCutting += new System.EventHandler(this.SessionInput_EH_SurfaceButtonSubmit_ContactDown);
112
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 104
diff changeset
   415
                    }
143
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   416
                    else //Affichage du message de confirmation
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   417
                    {
217
6cfd723a1378 add credit panel
cavaliet
parents: 214
diff changeset
   418
                        if (Panel3 != null && Grid3.Children.Count == 4)
143
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   419
                        {
140
fc7c12f9da30 Add a confirm dialog box before deleting an annotation by drag and drop. Now the UserControlClose is a generic confirm dialog box sending a ConfirmYesOrNo Event.
cavaliet
parents: 139
diff changeset
   420
                            UserControlClose UCclose = new UserControlClose(3, "�tes-vous s�r de vouloir quitter ?");
143
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   421
                            UCclose.Name = "CloseAlert3";
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   422
                            Grid3.Children.Add(UCclose);
140
fc7c12f9da30 Add a confirm dialog box before deleting an annotation by drag and drop. Now the UserControlClose is a generic confirm dialog box sending a ConfirmYesOrNo Event.
cavaliet
parents: 139
diff changeset
   423
                            UCclose.ConfirmYesOrNo += new EventHandler<ConfirmEventArgs>(CloseAlert_EH_SurfaceButton_ContactDown);
143
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   424
                        }
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   425
                    }
112
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 104
diff changeset
   426
                    break;
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 104
diff changeset
   427
                case 4:
217
6cfd723a1378 add credit panel
cavaliet
parents: 214
diff changeset
   428
                    if (Panel4 == null && Grid4.Children.Count == 3)
112
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 104
diff changeset
   429
                    {
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 104
diff changeset
   430
                        //1-Creation du control Screen
143
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   431
                        UserControlScreen Screen = new UserControlScreen(4, _mainviewmodel);
112
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 104
diff changeset
   432
                        Screen.Name = "Screen4";
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 104
diff changeset
   433
                        Screen.contexteGrid = Grid4.Name.ToString();
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 104
diff changeset
   434
                        //2-Rajout du screen dans la grid correspondante
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 104
diff changeset
   435
                        Grid4.Children.Add(Screen);
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 104
diff changeset
   436
182
25b49d4f1635 First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents: 168
diff changeset
   437
                        Screen.UC_Screen_NewCutting += new System.EventHandler(this.SessionInput_EH_SurfaceButtonSubmit_ContactDown);
112
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 104
diff changeset
   438
                    }
143
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   439
                    else //Affichage du message de confirmation
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   440
                    {
217
6cfd723a1378 add credit panel
cavaliet
parents: 214
diff changeset
   441
                        if (Panel4 != null && Grid4.Children.Count == 4)
143
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   442
                        {
140
fc7c12f9da30 Add a confirm dialog box before deleting an annotation by drag and drop. Now the UserControlClose is a generic confirm dialog box sending a ConfirmYesOrNo Event.
cavaliet
parents: 139
diff changeset
   443
                            UserControlClose UCclose = new UserControlClose(4, "�tes-vous s�r de vouloir quitter ?");
143
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   444
                            UCclose.Name = "CloseAlert4";
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   445
                            Grid4.Children.Add(UCclose);
140
fc7c12f9da30 Add a confirm dialog box before deleting an annotation by drag and drop. Now the UserControlClose is a generic confirm dialog box sending a ConfirmYesOrNo Event.
cavaliet
parents: 139
diff changeset
   446
                            UCclose.ConfirmYesOrNo += new EventHandler<ConfirmEventArgs>(CloseAlert_EH_SurfaceButton_ContactDown);
143
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   447
                        }
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   448
                    }
112
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 104
diff changeset
   449
                    break;
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 104
diff changeset
   450
            }
73
bda95242e600 Travail sur Enchainement New Session --> UserPanel.
sarias
parents: 72
diff changeset
   451
        }
72
f1ca0958c992 Travail sur le control List Video et comunication entre ListVideo et FingersDance
sarias
parents: 60
diff changeset
   452
162
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
   453
        #endregion
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
   454
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
   455
73
bda95242e600 Travail sur Enchainement New Session --> UserPanel.
sarias
parents: 72
diff changeset
   456
        //Button Submit du control SessionInput
bda95242e600 Travail sur Enchainement New Session --> UserPanel.
sarias
parents: 72
diff changeset
   457
        private void SessionInput_EH_SurfaceButtonSubmit_ContactDown(object sender, EventArgs e)
bda95242e600 Travail sur Enchainement New Session --> UserPanel.
sarias
parents: 72
diff changeset
   458
        {
bda95242e600 Travail sur Enchainement New Session --> UserPanel.
sarias
parents: 72
diff changeset
   459
            try
bda95242e600 Travail sur Enchainement New Session --> UserPanel.
sarias
parents: 72
diff changeset
   460
            {
191
8a25a85f2656 First step of data saving in a ldt/xml file. First step of displaying the existing ldt files (not loaded yet)
cavaliet
parents: 190
diff changeset
   461
                // We get UserControlScreen's instance and content
104
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 97
diff changeset
   462
                Grid root = (Grid)(((UserControlScreen)sender).Parent);
191
8a25a85f2656 First step of data saving in a ldt/xml file. First step of displaying the existing ldt files (not loaded yet)
cavaliet
parents: 190
diff changeset
   463
                // We remove the UserControlScreen's instance
104
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 97
diff changeset
   464
                root.Children.Remove(((UserControlScreen)sender));
211
50e6fe2c2ea2 second step for search. Menu created and UserPanel modified for search mode.
cavaliet
parents: 195
diff changeset
   465
50e6fe2c2ea2 second step for search. Menu created and UserPanel modified for search mode.
cavaliet
parents: 195
diff changeset
   466
                if ((((UserControlScreen)sender).Cutting != null && ((UserControlScreen)sender).AnnotationOrSearchMode == "Annotation") || (((UserControlScreen)sender).AnnotationOrSearchMode == "Search"))
112
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 104
diff changeset
   467
                {
152
46577fd0a294 PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 150
diff changeset
   468
                    //2-Creation du User Panel
190
619ca3ae13c7 MainViewModel is now well linked to all the users'cuttings. At any moment, the MVM has all annotations. This step prepares data saving.
cavaliet
parents: 188
diff changeset
   469
                    Cutting newCutting = ((UserControlScreen)sender).Cutting;
229
05aba5def1fc add an attribute Color to a Cutting, save it in ldt xml file and redisplay it in the pivot's button. Make ColorFactory truly static.
cavaliet
parents: 225
diff changeset
   470
                    uint UintIdColor = 0;
152
46577fd0a294 PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 150
diff changeset
   471
186
83615722dbab Debug data management for others panels to redisplay.
cavaliet
parents: 182
diff changeset
   472
                    // We test if each Panel does not already own the sent cuttingVM
211
50e6fe2c2ea2 second step for search. Menu created and UserPanel modified for search mode.
cavaliet
parents: 195
diff changeset
   473
                    if (((UserControlScreen)sender).Cutting != null && ((UserControlScreen)sender).AnnotationOrSearchMode == "Annotation")
50e6fe2c2ea2 second step for search. Menu created and UserPanel modified for search mode.
cavaliet
parents: 195
diff changeset
   474
                    {
50e6fe2c2ea2 second step for search. Menu created and UserPanel modified for search mode.
cavaliet
parents: 195
diff changeset
   475
                        if (Panel1 != null)
214
beebae32b1ed third step of search : better integration of search panel and debug from loaded search project and annotated project.
cavaliet
parents: 211
diff changeset
   476
                            if (Panel1.Cutting != null)
beebae32b1ed third step of search : better integration of search panel and debug from loaded search project and annotated project.
cavaliet
parents: 211
diff changeset
   477
                                if (Panel1.Cutting.Title==newCutting.Title)
beebae32b1ed third step of search : better integration of search panel and debug from loaded search project and annotated project.
cavaliet
parents: 211
diff changeset
   478
                                    return;
211
50e6fe2c2ea2 second step for search. Menu created and UserPanel modified for search mode.
cavaliet
parents: 195
diff changeset
   479
                        if (Panel2 != null)
214
beebae32b1ed third step of search : better integration of search panel and debug from loaded search project and annotated project.
cavaliet
parents: 211
diff changeset
   480
                            if (Panel2.Cutting != null)
beebae32b1ed third step of search : better integration of search panel and debug from loaded search project and annotated project.
cavaliet
parents: 211
diff changeset
   481
                                if (Panel2.Cutting.Title == newCutting.Title)
beebae32b1ed third step of search : better integration of search panel and debug from loaded search project and annotated project.
cavaliet
parents: 211
diff changeset
   482
                                    return;
211
50e6fe2c2ea2 second step for search. Menu created and UserPanel modified for search mode.
cavaliet
parents: 195
diff changeset
   483
                        if (Panel3 != null)
214
beebae32b1ed third step of search : better integration of search panel and debug from loaded search project and annotated project.
cavaliet
parents: 211
diff changeset
   484
                            if (Panel3.Cutting != null)
beebae32b1ed third step of search : better integration of search panel and debug from loaded search project and annotated project.
cavaliet
parents: 211
diff changeset
   485
                                if (Panel3.Cutting.Title == newCutting.Title)
beebae32b1ed third step of search : better integration of search panel and debug from loaded search project and annotated project.
cavaliet
parents: 211
diff changeset
   486
                                    return;
211
50e6fe2c2ea2 second step for search. Menu created and UserPanel modified for search mode.
cavaliet
parents: 195
diff changeset
   487
                        if (Panel4 != null)
214
beebae32b1ed third step of search : better integration of search panel and debug from loaded search project and annotated project.
cavaliet
parents: 211
diff changeset
   488
                            if (Panel4.Cutting != null)
beebae32b1ed third step of search : better integration of search panel and debug from loaded search project and annotated project.
cavaliet
parents: 211
diff changeset
   489
                                if (Panel4.Cutting.Title == newCutting.Title)
beebae32b1ed third step of search : better integration of search panel and debug from loaded search project and annotated project.
cavaliet
parents: 211
diff changeset
   490
                                    return;
152
46577fd0a294 PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 150
diff changeset
   491
211
50e6fe2c2ea2 second step for search. Menu created and UserPanel modified for search mode.
cavaliet
parents: 195
diff changeset
   492
                        // We add the new cutting to the _mainviewmodel's datas IF THE CUTTING IS NEW (if not it means that it is from a loaded project)
50e6fe2c2ea2 second step for search. Menu created and UserPanel modified for search mode.
cavaliet
parents: 195
diff changeset
   493
                        if (!_mainviewmodel.Project.CuttingsDict.ContainsKey(newCutting.Title))
50e6fe2c2ea2 second step for search. Menu created and UserPanel modified for search mode.
cavaliet
parents: 195
diff changeset
   494
                        {
50e6fe2c2ea2 second step for search. Menu created and UserPanel modified for search mode.
cavaliet
parents: 195
diff changeset
   495
                            _mainviewmodel.Project.Cuttings.Add(newCutting);
50e6fe2c2ea2 second step for search. Menu created and UserPanel modified for search mode.
cavaliet
parents: 195
diff changeset
   496
                            _mainviewmodel.Project.CuttingsDict.Add(newCutting.Title, newCutting);
229
05aba5def1fc add an attribute Color to a Cutting, save it in ldt xml file and redisplay it in the pivot's button. Make ColorFactory truly static.
cavaliet
parents: 225
diff changeset
   497
                            // In this case, we have to find a new color in the available ones.
05aba5def1fc add an attribute Color to a Cutting, save it in ldt xml file and redisplay it in the pivot's button. Make ColorFactory truly static.
cavaliet
parents: 225
diff changeset
   498
                            KeyValuePair<uint,Color> kvp = ColorFactory.getAvailablePairUintColor();
05aba5def1fc add an attribute Color to a Cutting, save it in ldt xml file and redisplay it in the pivot's button. Make ColorFactory truly static.
cavaliet
parents: 225
diff changeset
   499
                            newCutting.Color = kvp.Value;
05aba5def1fc add an attribute Color to a Cutting, save it in ldt xml file and redisplay it in the pivot's button. Make ColorFactory truly static.
cavaliet
parents: 225
diff changeset
   500
                            UintIdColor = kvp.Key;
05aba5def1fc add an attribute Color to a Cutting, save it in ldt xml file and redisplay it in the pivot's button. Make ColorFactory truly static.
cavaliet
parents: 225
diff changeset
   501
                            // Now we can take off this new color from the available colors
05aba5def1fc add an attribute Color to a Cutting, save it in ldt xml file and redisplay it in the pivot's button. Make ColorFactory truly static.
cavaliet
parents: 225
diff changeset
   502
                            ColorFactory.TakeOffColor(kvp.Value);
05aba5def1fc add an attribute Color to a Cutting, save it in ldt xml file and redisplay it in the pivot's button. Make ColorFactory truly static.
cavaliet
parents: 225
diff changeset
   503
                        }
05aba5def1fc add an attribute Color to a Cutting, save it in ldt xml file and redisplay it in the pivot's button. Make ColorFactory truly static.
cavaliet
parents: 225
diff changeset
   504
                        else{
05aba5def1fc add an attribute Color to a Cutting, save it in ldt xml file and redisplay it in the pivot's button. Make ColorFactory truly static.
cavaliet
parents: 225
diff changeset
   505
                            // If the color 
05aba5def1fc add an attribute Color to a Cutting, save it in ldt xml file and redisplay it in the pivot's button. Make ColorFactory truly static.
cavaliet
parents: 225
diff changeset
   506
                            UintIdColor = ColorFactory.getId(newCutting.Color);
211
50e6fe2c2ea2 second step for search. Menu created and UserPanel modified for search mode.
cavaliet
parents: 195
diff changeset
   507
                        }
192
11083c390ce4 Second step of data saving : id added for cutting and annotation, and now we can load/display/change the already existing projects.
cavaliet
parents: 191
diff changeset
   508
                    }
186
83615722dbab Debug data management for others panels to redisplay.
cavaliet
parents: 182
diff changeset
   509
                    // And now we build the new UserPanel
152
46577fd0a294 PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 150
diff changeset
   510
                    switch (((UserControlScreen)sender).id)
46577fd0a294 PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 150
diff changeset
   511
                    {
46577fd0a294 PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 150
diff changeset
   512
                        case 1:
229
05aba5def1fc add an attribute Color to a Cutting, save it in ldt xml file and redisplay it in the pivot's button. Make ColorFactory truly static.
cavaliet
parents: 225
diff changeset
   513
                            UserControlPivot.ApplyColor(1, UintIdColor);
05aba5def1fc add an attribute Color to a Cutting, save it in ldt xml file and redisplay it in the pivot's button. Make ColorFactory truly static.
cavaliet
parents: 225
diff changeset
   514
                            Panel1 = new UserControlUserPanel(1, newCutting, _mainviewmodel.Project.VideoPath, ((UserControlScreen)sender).AnnotationOrSearchMode, ((UserControlScreen)sender).SearchedProject);
152
46577fd0a294 PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 150
diff changeset
   515
                            Panel1.Name = "UserPanel1";
162
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
   516
                            Panel1.OnSuccessAnnotation += new EventHandler(Panel_OnSuccessAnnotation);
188
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   517
                            Panel1.OnTagVisualisation += new EventHandler(Panel_OnTagVisualisation);
229
05aba5def1fc add an attribute Color to a Cutting, save it in ldt xml file and redisplay it in the pivot's button. Make ColorFactory truly static.
cavaliet
parents: 225
diff changeset
   518
                            Panel1.idcolor = UintIdColor;
152
46577fd0a294 PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 150
diff changeset
   519
                            //3-Rajout sur la Grid Root
46577fd0a294 PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 150
diff changeset
   520
                            root.Children.Add(Panel1);
46577fd0a294 PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 150
diff changeset
   521
                            break;
46577fd0a294 PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 150
diff changeset
   522
                        case 2:
229
05aba5def1fc add an attribute Color to a Cutting, save it in ldt xml file and redisplay it in the pivot's button. Make ColorFactory truly static.
cavaliet
parents: 225
diff changeset
   523
                            UserControlPivot.ApplyColor(2, UintIdColor);
05aba5def1fc add an attribute Color to a Cutting, save it in ldt xml file and redisplay it in the pivot's button. Make ColorFactory truly static.
cavaliet
parents: 225
diff changeset
   524
                            Panel2 = new UserControlUserPanel(2, newCutting, _mainviewmodel.Project.VideoPath, ((UserControlScreen)sender).AnnotationOrSearchMode, ((UserControlScreen)sender).SearchedProject);
152
46577fd0a294 PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 150
diff changeset
   525
                            Panel2.Name = "UserPanel2";
162
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
   526
                            Panel2.OnSuccessAnnotation += new EventHandler(Panel_OnSuccessAnnotation);
188
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   527
                            Panel2.OnTagVisualisation += new EventHandler(Panel_OnTagVisualisation);
229
05aba5def1fc add an attribute Color to a Cutting, save it in ldt xml file and redisplay it in the pivot's button. Make ColorFactory truly static.
cavaliet
parents: 225
diff changeset
   528
                            Panel2.idcolor = UintIdColor;
152
46577fd0a294 PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 150
diff changeset
   529
                            //3-Rajout sur la Grid Root
46577fd0a294 PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 150
diff changeset
   530
                            root.Children.Add(Panel2);
46577fd0a294 PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 150
diff changeset
   531
                            break;
46577fd0a294 PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 150
diff changeset
   532
                        case 3:
229
05aba5def1fc add an attribute Color to a Cutting, save it in ldt xml file and redisplay it in the pivot's button. Make ColorFactory truly static.
cavaliet
parents: 225
diff changeset
   533
                            UserControlPivot.ApplyColor(3, UintIdColor);
05aba5def1fc add an attribute Color to a Cutting, save it in ldt xml file and redisplay it in the pivot's button. Make ColorFactory truly static.
cavaliet
parents: 225
diff changeset
   534
                            Panel3 = new UserControlUserPanel(3, newCutting, _mainviewmodel.Project.VideoPath, ((UserControlScreen)sender).AnnotationOrSearchMode, ((UserControlScreen)sender).SearchedProject);
152
46577fd0a294 PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 150
diff changeset
   535
                            Panel3.Name = "UserPanel3";
162
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
   536
                            Panel3.OnSuccessAnnotation += new EventHandler(Panel_OnSuccessAnnotation);
188
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   537
                            Panel3.OnTagVisualisation += new EventHandler(Panel_OnTagVisualisation);
229
05aba5def1fc add an attribute Color to a Cutting, save it in ldt xml file and redisplay it in the pivot's button. Make ColorFactory truly static.
cavaliet
parents: 225
diff changeset
   538
                            Panel3.idcolor = UintIdColor;
152
46577fd0a294 PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 150
diff changeset
   539
                            //3-Rajout sur la Grid Root
46577fd0a294 PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 150
diff changeset
   540
                            root.Children.Add(Panel3);
46577fd0a294 PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 150
diff changeset
   541
                            break;
46577fd0a294 PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 150
diff changeset
   542
                        case 4:
229
05aba5def1fc add an attribute Color to a Cutting, save it in ldt xml file and redisplay it in the pivot's button. Make ColorFactory truly static.
cavaliet
parents: 225
diff changeset
   543
                            UserControlPivot.ApplyColor(4, UintIdColor);
05aba5def1fc add an attribute Color to a Cutting, save it in ldt xml file and redisplay it in the pivot's button. Make ColorFactory truly static.
cavaliet
parents: 225
diff changeset
   544
                            Panel4 = new UserControlUserPanel(4, newCutting, _mainviewmodel.Project.VideoPath, ((UserControlScreen)sender).AnnotationOrSearchMode, ((UserControlScreen)sender).SearchedProject);
152
46577fd0a294 PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 150
diff changeset
   545
                            Panel4.Name = "UserPanel4";
162
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
   546
                            Panel4.OnSuccessAnnotation += new EventHandler(Panel_OnSuccessAnnotation);
188
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   547
                            Panel4.OnTagVisualisation += new EventHandler(Panel_OnTagVisualisation);
229
05aba5def1fc add an attribute Color to a Cutting, save it in ldt xml file and redisplay it in the pivot's button. Make ColorFactory truly static.
cavaliet
parents: 225
diff changeset
   548
                            Panel4.idcolor = UintIdColor;
152
46577fd0a294 PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 150
diff changeset
   549
                            //3-Rajout sur la Grid Root
46577fd0a294 PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 150
diff changeset
   550
                            root.Children.Add(Panel4);
46577fd0a294 PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 150
diff changeset
   551
                            break;
46577fd0a294 PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 150
diff changeset
   552
                    }
112
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 104
diff changeset
   553
                }
73
bda95242e600 Travail sur Enchainement New Session --> UserPanel.
sarias
parents: 72
diff changeset
   554
            }
bda95242e600 Travail sur Enchainement New Session --> UserPanel.
sarias
parents: 72
diff changeset
   555
            catch (Exception ex) { }
72
f1ca0958c992 Travail sur le control List Video et comunication entre ListVideo et FingersDance
sarias
parents: 60
diff changeset
   556
        }
73
bda95242e600 Travail sur Enchainement New Session --> UserPanel.
sarias
parents: 72
diff changeset
   557
143
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   558
        //Actions du boutton Alert selon l'action close OK ou NON
141
923687896770 UserControlClose more readable and MainSurfaceWindow now uses the ConfirmYesOrNo event.
cavaliet
parents: 140
diff changeset
   559
        private void CloseAlert_EH_SurfaceButton_ContactDown(object sender, ConfirmEventArgs e)
143
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   560
        {
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   561
            Grid root = (Grid)(((UserControlClose)sender).Parent);
141
923687896770 UserControlClose more readable and MainSurfaceWindow now uses the ConfirmYesOrNo event.
cavaliet
parents: 140
diff changeset
   562
            if(e.Confirmed==true)
143
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   563
            {
141
923687896770 UserControlClose more readable and MainSurfaceWindow now uses the ConfirmYesOrNo event.
cavaliet
parents: 140
diff changeset
   564
                switch(e.PanelNumber)
143
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   565
                {
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   566
                    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: 156
diff changeset
   567
                        UserControlPivot.ApplyColor(1, 0);
143
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   568
                        root.Children.Remove(Panel1);
224
874de6d84a2e Panels visibility
ARIAS Santiago
parents: 223
diff changeset
   569
                        Panel1.PanelClose();
143
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   570
                        Panel1 = null;
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   571
                        break;
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   572
                    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: 156
diff changeset
   573
                        UserControlPivot.ApplyColor(2, 0);
143
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   574
                        root.Children.Remove(Panel2);
224
874de6d84a2e Panels visibility
ARIAS Santiago
parents: 223
diff changeset
   575
                        Panel2.PanelClose();
143
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   576
                        Panel2 = null;
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   577
                        break;
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   578
                    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: 156
diff changeset
   579
                        UserControlPivot.ApplyColor(3, 0);
143
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   580
                        root.Children.Remove(Panel3);
224
874de6d84a2e Panels visibility
ARIAS Santiago
parents: 223
diff changeset
   581
                        Panel3.PanelClose();
143
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   582
                        Panel3 = null;
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   583
                        break;
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   584
                    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: 156
diff changeset
   585
                        UserControlPivot.ApplyColor(4, 0);
143
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   586
                        root.Children.Remove(Panel4);
224
874de6d84a2e Panels visibility
ARIAS Santiago
parents: 223
diff changeset
   587
                        Panel4.PanelClose();
143
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   588
                        Panel4 = null;
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   589
                        break;
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   590
                }
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   591
            }
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   592
            root.Children.Remove(((UserControlClose)sender));
168
d70ee2002f75 Thumb Timeline Rotation and Debug Closing Panels
ARIAS Santiago
parents: 162
diff changeset
   593
            if (Panel1 == null && Panel2 == null && Panel3 == null && Panel4 == null)
182
25b49d4f1635 First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents: 168
diff changeset
   594
                _mainviewmodel.CloseProject();
143
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 119
diff changeset
   595
        }
77
e95e916eb018 Travail sur le Pivot et le control Session Input
sarias
parents: 73
diff changeset
   596
162
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
   597
211
50e6fe2c2ea2 second step for search. Menu created and UserPanel modified for search mode.
cavaliet
parents: 195
diff changeset
   598
        //On success annotation we save the update datas
162
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
   599
        private void Panel_OnSuccessAnnotation(object sender, EventArgs e)
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
   600
        {
191
8a25a85f2656 First step of data saving in a ldt/xml file. First step of displaying the existing ldt files (not loaded yet)
cavaliet
parents: 190
diff changeset
   601
            // We save datas
8a25a85f2656 First step of data saving in a ldt/xml file. First step of displaying the existing ldt files (not loaded yet)
cavaliet
parents: 190
diff changeset
   602
            saveDatas();
188
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   603
        }
191
8a25a85f2656 First step of data saving in a ldt/xml file. First step of displaying the existing ldt files (not loaded yet)
cavaliet
parents: 190
diff changeset
   604
8a25a85f2656 First step of data saving in a ldt/xml file. First step of displaying the existing ldt files (not loaded yet)
cavaliet
parents: 190
diff changeset
   605
        //
8a25a85f2656 First step of data saving in a ldt/xml file. First step of displaying the existing ldt files (not loaded yet)
cavaliet
parents: 190
diff changeset
   606
        // Enable to save datas in a xml file with LDT format
8a25a85f2656 First step of data saving in a ldt/xml file. First step of displaying the existing ldt files (not loaded yet)
cavaliet
parents: 190
diff changeset
   607
        //
8a25a85f2656 First step of data saving in a ldt/xml file. First step of displaying the existing ldt files (not loaded yet)
cavaliet
parents: 190
diff changeset
   608
        private void saveDatas()
8a25a85f2656 First step of data saving in a ldt/xml file. First step of displaying the existing ldt files (not loaded yet)
cavaliet
parents: 190
diff changeset
   609
        {
192
11083c390ce4 Second step of data saving : id added for cutting and annotation, and now we can load/display/change the already existing projects.
cavaliet
parents: 191
diff changeset
   610
            // We build the xml to be saved, with the ldt format
191
8a25a85f2656 First step of data saving in a ldt/xml file. First step of displaying the existing ldt files (not loaded yet)
cavaliet
parents: 190
diff changeset
   611
            XDocument d = new XDocument(
8a25a85f2656 First step of data saving in a ldt/xml file. First step of displaying the existing ldt files (not loaded yet)
cavaliet
parents: 190
diff changeset
   612
                new XElement("iri",
8a25a85f2656 First step of data saving in a ldt/xml file. First step of displaying the existing ldt files (not loaded yet)
cavaliet
parents: 190
diff changeset
   613
                    new XElement("project",
8a25a85f2656 First step of data saving in a ldt/xml file. First step of displaying the existing ldt files (not loaded yet)
cavaliet
parents: 190
diff changeset
   614
                        new XAttribute("id", "1"),
8a25a85f2656 First step of data saving in a ldt/xml file. First step of displaying the existing ldt files (not loaded yet)
cavaliet
parents: 190
diff changeset
   615
                        new XAttribute("user", "IRI-Strate-EFREI"),
8a25a85f2656 First step of data saving in a ldt/xml file. First step of displaying the existing ldt files (not loaded yet)
cavaliet
parents: 190
diff changeset
   616
                        new XAttribute("title", _mainviewmodel.Project.Name),
8a25a85f2656 First step of data saving in a ldt/xml file. First step of displaying the existing ldt files (not loaded yet)
cavaliet
parents: 190
diff changeset
   617
                        new XAttribute("abstract", _mainviewmodel.Project.Description)
8a25a85f2656 First step of data saving in a ldt/xml file. First step of displaying the existing ldt files (not loaded yet)
cavaliet
parents: 190
diff changeset
   618
                    ),
8a25a85f2656 First step of data saving in a ldt/xml file. First step of displaying the existing ldt files (not loaded yet)
cavaliet
parents: 190
diff changeset
   619
                    new XElement("medias",
8a25a85f2656 First step of data saving in a ldt/xml file. First step of displaying the existing ldt files (not loaded yet)
cavaliet
parents: 190
diff changeset
   620
                        new XElement("media",
8a25a85f2656 First step of data saving in a ldt/xml file. First step of displaying the existing ldt files (not loaded yet)
cavaliet
parents: 190
diff changeset
   621
                            new XAttribute("id","for_oneflat"),
8a25a85f2656 First step of data saving in a ldt/xml file. First step of displaying the existing ldt files (not loaded yet)
cavaliet
parents: 190
diff changeset
   622
                            new XAttribute("src","srcIri"),
8a25a85f2656 First step of data saving in a ldt/xml file. First step of displaying the existing ldt files (not loaded yet)
cavaliet
parents: 190
diff changeset
   623
                            new XAttribute("video",""),
8a25a85f2656 First step of data saving in a ldt/xml file. First step of displaying the existing ldt files (not loaded yet)
cavaliet
parents: 190
diff changeset
   624
                            new XAttribute("extra",""),
8a25a85f2656 First step of data saving in a ldt/xml file. First step of displaying the existing ldt files (not loaded yet)
cavaliet
parents: 190
diff changeset
   625
                            new XAttribute("pict","")
8a25a85f2656 First step of data saving in a ldt/xml file. First step of displaying the existing ldt files (not loaded yet)
cavaliet
parents: 190
diff changeset
   626
                        )
8a25a85f2656 First step of data saving in a ldt/xml file. First step of displaying the existing ldt files (not loaded yet)
cavaliet
parents: 190
diff changeset
   627
                    ),
8a25a85f2656 First step of data saving in a ldt/xml file. First step of displaying the existing ldt files (not loaded yet)
cavaliet
parents: 190
diff changeset
   628
                    new XElement("annotations",
8a25a85f2656 First step of data saving in a ldt/xml file. First step of displaying the existing ldt files (not loaded yet)
cavaliet
parents: 190
diff changeset
   629
                        new XElement("content",
8a25a85f2656 First step of data saving in a ldt/xml file. First step of displaying the existing ldt files (not loaded yet)
cavaliet
parents: 190
diff changeset
   630
                            new XAttribute("id", "for_oneflat"),
8a25a85f2656 First step of data saving in a ldt/xml file. First step of displaying the existing ldt files (not loaded yet)
cavaliet
parents: 190
diff changeset
   631
                            new XAttribute("title", "D�c. personnels"),
8a25a85f2656 First step of data saving in a ldt/xml file. First step of displaying the existing ldt files (not loaded yet)
cavaliet
parents: 190
diff changeset
   632
                            new XAttribute("author", "perso"),
8a25a85f2656 First step of data saving in a ldt/xml file. First step of displaying the existing ldt files (not loaded yet)
cavaliet
parents: 190
diff changeset
   633
                            new XAttribute("abstract", "Ensemble de d�coupages d�finis par un utilisateur")
8a25a85f2656 First step of data saving in a ldt/xml file. First step of displaying the existing ldt files (not loaded yet)
cavaliet
parents: 190
diff changeset
   634
                        )
8a25a85f2656 First step of data saving in a ldt/xml file. First step of displaying the existing ldt files (not loaded yet)
cavaliet
parents: 190
diff changeset
   635
                    ),
8a25a85f2656 First step of data saving in a ldt/xml file. First step of displaying the existing ldt files (not loaded yet)
cavaliet
parents: 190
diff changeset
   636
                    new XElement("displays"),
8a25a85f2656 First step of data saving in a ldt/xml file. First step of displaying the existing ldt files (not loaded yet)
cavaliet
parents: 190
diff changeset
   637
                    new XElement("edits")
8a25a85f2656 First step of data saving in a ldt/xml file. First step of displaying the existing ldt files (not loaded yet)
cavaliet
parents: 190
diff changeset
   638
                )
8a25a85f2656 First step of data saving in a ldt/xml file. First step of displaying the existing ldt files (not loaded yet)
cavaliet
parents: 190
diff changeset
   639
            );
8a25a85f2656 First step of data saving in a ldt/xml file. First step of displaying the existing ldt files (not loaded yet)
cavaliet
parents: 190
diff changeset
   640
            // We add each cutting
8a25a85f2656 First step of data saving in a ldt/xml file. First step of displaying the existing ldt files (not loaded yet)
cavaliet
parents: 190
diff changeset
   641
            XElement annotContent = (XElement)(d.Root.Elements().ToList()[2]).FirstNode;
8a25a85f2656 First step of data saving in a ldt/xml file. First step of displaying the existing ldt files (not loaded yet)
cavaliet
parents: 190
diff changeset
   642
            foreach (Cutting cut in _mainviewmodel.Project.Cuttings)
8a25a85f2656 First step of data saving in a ldt/xml file. First step of displaying the existing ldt files (not loaded yet)
cavaliet
parents: 190
diff changeset
   643
            {
229
05aba5def1fc add an attribute Color to a Cutting, save it in ldt xml file and redisplay it in the pivot's button. Make ColorFactory truly static.
cavaliet
parents: 225
diff changeset
   644
                XElement cutNode = new XElement("decoupage", new XAttribute("id", cut.Id), new XAttribute("author", "perso"), new XAttribute("color", "0x" + cut.Color.ToString().Substring(3)), // Color.ToString() return #AARRGGBB and we keep only 0xRRGGBB);
05aba5def1fc add an attribute Color to a Cutting, save it in ldt xml file and redisplay it in the pivot's button. Make ColorFactory truly static.
cavaliet
parents: 225
diff changeset
   645
                                                new XElement("title", cut.Title),
05aba5def1fc add an attribute Color to a Cutting, save it in ldt xml file and redisplay it in the pivot's button. Make ColorFactory truly static.
cavaliet
parents: 225
diff changeset
   646
                                                new XElement("abstract", ""));
191
8a25a85f2656 First step of data saving in a ldt/xml file. First step of displaying the existing ldt files (not loaded yet)
cavaliet
parents: 190
diff changeset
   647
                XElement cutElmts = new XElement("elements");
8a25a85f2656 First step of data saving in a ldt/xml file. First step of displaying the existing ldt files (not loaded yet)
cavaliet
parents: 190
diff changeset
   648
                cutNode.Add(cutElmts);
8a25a85f2656 First step of data saving in a ldt/xml file. First step of displaying the existing ldt files (not loaded yet)
cavaliet
parents: 190
diff changeset
   649
                foreach (Annotation annot in cut.AnnotList)
8a25a85f2656 First step of data saving in a ldt/xml file. First step of displaying the existing ldt files (not loaded yet)
cavaliet
parents: 190
diff changeset
   650
                {
192
11083c390ce4 Second step of data saving : id added for cutting and annotation, and now we can load/display/change the already existing projects.
cavaliet
parents: 191
diff changeset
   651
                    cutElmts.Add(new XElement("element", new XAttribute("id", annot.Id),
191
8a25a85f2656 First step of data saving in a ldt/xml file. First step of displaying the existing ldt files (not loaded yet)
cavaliet
parents: 190
diff changeset
   652
                                                         new XAttribute("begin", annot.TcBegin),
8a25a85f2656 First step of data saving in a ldt/xml file. First step of displaying the existing ldt files (not loaded yet)
cavaliet
parents: 190
diff changeset
   653
                                                         new XAttribute("dur", annot.Dur),
8a25a85f2656 First step of data saving in a ldt/xml file. First step of displaying the existing ldt files (not loaded yet)
cavaliet
parents: 190
diff changeset
   654
                                                         new XAttribute("author", cut.Title),
8a25a85f2656 First step of data saving in a ldt/xml file. First step of displaying the existing ldt files (not loaded yet)
cavaliet
parents: 190
diff changeset
   655
                                                         new XAttribute("date", DateTime.Now.Day.ToString() + "/" + DateTime.Now.Month.ToString() + "/" + DateTime.Now.Year.ToString()),
192
11083c390ce4 Second step of data saving : id added for cutting and annotation, and now we can load/display/change the already existing projects.
cavaliet
parents: 191
diff changeset
   656
                                                         new XAttribute("color", "0x" + annot.Color.ToString().Substring(3)), // Color.ToString() return #AARRGGBB and we keep only 0xRRGGBB
191
8a25a85f2656 First step of data saving in a ldt/xml file. First step of displaying the existing ldt files (not loaded yet)
cavaliet
parents: 190
diff changeset
   657
                                                         new XAttribute("src", ""),
225
b60e13ed75c8 Now an annotation has a list of gesture string and not simple gesture string. These are saved into and loaded from the ldt xml file.
cavaliet
parents: 224
diff changeset
   658
                                                         new XElement("title", String.Join(",", annot.GestureType.ToArray())),
191
8a25a85f2656 First step of data saving in a ldt/xml file. First step of displaying the existing ldt files (not loaded yet)
cavaliet
parents: 190
diff changeset
   659
                                                         new XElement("abstract"),
8a25a85f2656 First step of data saving in a ldt/xml file. First step of displaying the existing ldt files (not loaded yet)
cavaliet
parents: 190
diff changeset
   660
                                                         new XElement("audio"),
8a25a85f2656 First step of data saving in a ldt/xml file. First step of displaying the existing ldt files (not loaded yet)
cavaliet
parents: 190
diff changeset
   661
                                                         new XElement("tags"),
225
b60e13ed75c8 Now an annotation has a list of gesture string and not simple gesture string. These are saved into and loaded from the ldt xml file.
cavaliet
parents: 224
diff changeset
   662
                                                         new XElement("gestureType", String.Join(",", annot.GestureType.ToArray()))));
191
8a25a85f2656 First step of data saving in a ldt/xml file. First step of displaying the existing ldt files (not loaded yet)
cavaliet
parents: 190
diff changeset
   663
                }
8a25a85f2656 First step of data saving in a ldt/xml file. First step of displaying the existing ldt files (not loaded yet)
cavaliet
parents: 190
diff changeset
   664
                annotContent.Add(cutNode);
8a25a85f2656 First step of data saving in a ldt/xml file. First step of displaying the existing ldt files (not loaded yet)
cavaliet
parents: 190
diff changeset
   665
            }
8a25a85f2656 First step of data saving in a ldt/xml file. First step of displaying the existing ldt files (not loaded yet)
cavaliet
parents: 190
diff changeset
   666
8a25a85f2656 First step of data saving in a ldt/xml file. First step of displaying the existing ldt files (not loaded yet)
cavaliet
parents: 190
diff changeset
   667
            d.Declaration = new XDeclaration("1.0", "utf-8", "true");
192
11083c390ce4 Second step of data saving : id added for cutting and annotation, and now we can load/display/change the already existing projects.
cavaliet
parents: 191
diff changeset
   668
            //Console.WriteLine(d);
223
90d2be5c3d39 commit with changes for real table file management
cavaliet
parents: 217
diff changeset
   669
            String path = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "/" + _mainviewmodel.Project.Name + ".ldt";
90d2be5c3d39 commit with changes for real table file management
cavaliet
parents: 217
diff changeset
   670
            d.Save(path);
191
8a25a85f2656 First step of data saving in a ldt/xml file. First step of displaying the existing ldt files (not loaded yet)
cavaliet
parents: 190
diff changeset
   671
8a25a85f2656 First step of data saving in a ldt/xml file. First step of displaying the existing ldt files (not loaded yet)
cavaliet
parents: 190
diff changeset
   672
        }
8a25a85f2656 First step of data saving in a ldt/xml file. First step of displaying the existing ldt files (not loaded yet)
cavaliet
parents: 190
diff changeset
   673
8a25a85f2656 First step of data saving in a ldt/xml file. First step of displaying the existing ldt files (not loaded yet)
cavaliet
parents: 190
diff changeset
   674
188
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   675
        //On Tag Visualisation Mute all the other Players
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   676
        private void Panel_OnTagVisualisation(object sender, EventArgs e)
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   677
        {
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   678
            UserControlUserPanel PanelMaster = (UserControlUserPanel)sender;
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   679
            if (Panel1 != null)
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   680
            {
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   681
               if (!PanelMaster.Name.Equals(Panel1.Name))
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   682
                   Panel1.PlayerMute(true);
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   683
            }
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   684
            if (Panel2 != null)
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   685
            {
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   686
                if (!PanelMaster.Name.Equals(Panel2.Name))
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   687
                    Panel2.PlayerMute(true);
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   688
            }
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   689
            if (Panel3 != null)
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   690
            {
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   691
                if (!PanelMaster.Name.Equals(Panel3.Name))
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   692
                    Panel3.PlayerMute(true);
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   693
            }
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   694
            if (Panel4 != null)
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   695
            {
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   696
                if (!PanelMaster.Name.Equals(Panel4.Name))
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   697
                    Panel4.PlayerMute(true);
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   698
                
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   699
            }
162
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
   700
        }
217
6cfd723a1378 add credit panel
cavaliet
parents: 214
diff changeset
   701
6cfd723a1378 add credit panel
cavaliet
parents: 214
diff changeset
   702
        private void CreditsButton_ContactDown(object sender, EventArgs e)
6cfd723a1378 add credit panel
cavaliet
parents: 214
diff changeset
   703
        {
6cfd723a1378 add credit panel
cavaliet
parents: 214
diff changeset
   704
            Console.WriteLine("CreditsButton_ContactDown");
6cfd723a1378 add credit panel
cavaliet
parents: 214
diff changeset
   705
            if(sender==CreditsButton1)
6cfd723a1378 add credit panel
cavaliet
parents: 214
diff changeset
   706
            {
6cfd723a1378 add credit panel
cavaliet
parents: 214
diff changeset
   707
                CreditsScroll1.Visibility = (CreditsScroll1.Visibility == Visibility.Hidden) ? Visibility.Visible : Visibility.Hidden;
6cfd723a1378 add credit panel
cavaliet
parents: 214
diff changeset
   708
            }
6cfd723a1378 add credit panel
cavaliet
parents: 214
diff changeset
   709
            else if (sender == CreditsButton2)
6cfd723a1378 add credit panel
cavaliet
parents: 214
diff changeset
   710
            {
6cfd723a1378 add credit panel
cavaliet
parents: 214
diff changeset
   711
                CreditsScroll2.Visibility = (CreditsScroll2.Visibility == Visibility.Hidden) ? Visibility.Visible : Visibility.Hidden;
6cfd723a1378 add credit panel
cavaliet
parents: 214
diff changeset
   712
            }
6cfd723a1378 add credit panel
cavaliet
parents: 214
diff changeset
   713
            else if (sender == CreditsButton3)
6cfd723a1378 add credit panel
cavaliet
parents: 214
diff changeset
   714
            {
6cfd723a1378 add credit panel
cavaliet
parents: 214
diff changeset
   715
                CreditsScroll3.Visibility = (CreditsScroll3.Visibility == Visibility.Hidden) ? Visibility.Visible : Visibility.Hidden;
6cfd723a1378 add credit panel
cavaliet
parents: 214
diff changeset
   716
            }
6cfd723a1378 add credit panel
cavaliet
parents: 214
diff changeset
   717
            else if (sender == CreditsButton4)
6cfd723a1378 add credit panel
cavaliet
parents: 214
diff changeset
   718
            {
6cfd723a1378 add credit panel
cavaliet
parents: 214
diff changeset
   719
                CreditsScroll4.Visibility = (CreditsScroll4.Visibility == Visibility.Hidden) ? Visibility.Visible : Visibility.Hidden;
6cfd723a1378 add credit panel
cavaliet
parents: 214
diff changeset
   720
            }
6cfd723a1378 add credit panel
cavaliet
parents: 214
diff changeset
   721
        }
224
874de6d84a2e Panels visibility
ARIAS Santiago
parents: 223
diff changeset
   722
874de6d84a2e Panels visibility
ARIAS Santiago
parents: 223
diff changeset
   723
        
45
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   724
    }
f003ae353cd7 Dev des 4 User Panels Resizables avec un pivot basique.
sarias
parents:
diff changeset
   725
}