src/FingersDance.Control.UserPanel/UserControlUserPanel.xaml.cs
author cavaliet
Wed, 28 Oct 2009 17:07:27 +0100
changeset 182 25b49d4f1635
parent 162 0b9f989bcb37
child 183 026018ce69e5
permissions -rw-r--r--
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.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
35
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
     1
using System;
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
     2
using System.IO;
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
     3
using System.Net;
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
     4
using System.Windows;
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
     5
using System.Windows.Controls;
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
     6
using System.Windows.Data;
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
     7
using System.Windows.Media;
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
     8
using System.Windows.Media.Animation;
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
     9
using System.Windows.Navigation;
143
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 121
diff changeset
    10
using FingersDance.Data;
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: 162
diff changeset
    11
using FingersDance.ViewModels;
35
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
    12
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
    13
namespace FingersDance.Control.UserPanel
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
    14
{
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
    15
	public partial class UserControlUserPanel
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
    16
	{
162
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
    17
        #region Variables
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
    18
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
    19
        public event EventHandler OnSuccessAnnotation;  //Event to display ColorAnnotation from different Users        
131
9331c3dea175 Close Control
sarias
parents: 121
diff changeset
    20
        public int id = 0;
162
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
    21
        public uint idcolor = 0;    //The color of the Pivot Button
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: 162
diff changeset
    22
        //Project _Project = new Project();
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: 162
diff changeset
    23
        private CuttingViewModel cutVM;
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: 162
diff changeset
    24
162
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
    25
        #endregion
143
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 121
diff changeset
    26
162
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
    27
        #region Properties
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: 162
diff changeset
    28
        public CuttingViewModel CuttingVM
143
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 121
diff changeset
    29
        {
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: 162
diff changeset
    30
            get { return cutVM; }
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: 162
diff changeset
    31
            set { cutVM = value; }
143
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 121
diff changeset
    32
        }
162
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
    33
        #endregion
143
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 121
diff changeset
    34
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: 162
diff changeset
    35
        //#region Properties
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: 162
diff changeset
    36
        //public Project Project
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: 162
diff changeset
    37
        //{
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: 162
diff changeset
    38
        //    get { return _Project; }
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: 162
diff changeset
    39
        //    set { _Project = value; }
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: 162
diff changeset
    40
        //}
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: 162
diff changeset
    41
        //#endregion
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: 162
diff changeset
    42
162
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
    43
        #region Constructors
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
    44
        public UserControlUserPanel()
35
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
    45
		{
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
    46
			this.InitializeComponent();
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
    47
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
    48
			// Insert code required on object creation below this point.
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
    49
		}
119
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 35
diff changeset
    50
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: 162
diff changeset
    51
        public UserControlUserPanel(int idPar, Color col, Cutting cut, string path)
119
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 35
diff changeset
    52
        {
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 35
diff changeset
    53
            this.InitializeComponent();
150
569925b65604 Annotations are now colored with the same color as the pivot's button
cavaliet
parents: 146
diff changeset
    54
            id = idPar;
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: 162
diff changeset
    55
            //_Project = p;
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: 162
diff changeset
    56
            this.UserControlSyncSource.Load(path, col, cut);
162
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
    57
            UserControlSyncSource.OnSuccessAnnotation+=new EventHandler(UserControlSyncSource_OnSuccessAnnotation);
119
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 35
diff changeset
    58
        }
162
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
    59
        #endregion
152
46577fd0a294 PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 150
diff changeset
    60
46577fd0a294 PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 150
diff changeset
    61
        public void PlayerPause()
46577fd0a294 PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 150
diff changeset
    62
        {
46577fd0a294 PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 150
diff changeset
    63
            UserControlSyncSource.PlayerPause();
46577fd0a294 PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 150
diff changeset
    64
        }
162
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
    65
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
    66
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
    67
        private void UserControlSyncSource_OnSuccessAnnotation(object sender, EventArgs e)
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
    68
        {
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
    69
            OnSuccessAnnotation(this, new EventArgs());
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
    70
        }
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
    71
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
    72
        public void UserControlSyncSource_DisplayAnnotation(int id, Brush b)
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
    73
        {
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
    74
            UserControlSyncSource.UserControlPlayer_DisplayAnnotation(id, b);
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
    75
        }
35
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
    76
	}
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
    77
}