src/FingersDance.Control.UserPanel/UserControlUserPanel.xaml.cs
author sarias
Fri, 16 Oct 2009 21:37:16 +0200
changeset 163 d5148710e229
parent 162 0b9f989bcb37
child 180 1c4ad413c837
child 182 25b49d4f1635
permissions -rw-r--r--
Display Annotations with storyboard effect
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;
35
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
    11
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
    12
namespace FingersDance.Control.UserPanel
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
    13
{
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
    14
	public partial class UserControlUserPanel
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
    15
	{
162
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
    16
        #region Variables
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
    17
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
    18
        public event EventHandler OnSuccessAnnotation;  //Event to display ColorAnnotation from different Users        
131
9331c3dea175 Close Control
sarias
parents: 121
diff changeset
    19
        public int id = 0;
162
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
    20
        public uint idcolor = 0;    //The color of the Pivot Button
143
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 121
diff changeset
    21
        Project _Project = new Project();
162
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
    22
        #endregion
143
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 121
diff changeset
    23
162
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
    24
        #region Properties
143
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 121
diff changeset
    25
        public Project Project
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 121
diff changeset
    26
        {
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 121
diff changeset
    27
            get { return _Project; }
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 121
diff changeset
    28
            set { _Project = value; }
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 121
diff changeset
    29
        }
162
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
    30
        #endregion
143
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 121
diff changeset
    31
162
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
    32
        #region Constructors
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
    33
        public UserControlUserPanel()
35
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
    34
		{
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
    35
			this.InitializeComponent();
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
    36
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
    37
			// Insert code required on object creation below this point.
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
    38
		}
119
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 35
diff changeset
    39
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: 152
diff changeset
    40
        public UserControlUserPanel(int idPar, Color col, Project p, string path)
119
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 35
diff changeset
    41
        {
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 35
diff changeset
    42
            this.InitializeComponent();
150
569925b65604 Annotations are now colored with the same color as the pivot's button
cavaliet
parents: 146
diff changeset
    43
            id = idPar;
143
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 121
diff changeset
    44
            _Project = p;
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: 152
diff changeset
    45
            this.UserControlSyncSource.Load(path, col, _Project.Cutting);
162
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
    46
            UserControlSyncSource.OnSuccessAnnotation+=new EventHandler(UserControlSyncSource_OnSuccessAnnotation);
119
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 35
diff changeset
    47
        }
162
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
    48
        #endregion
152
46577fd0a294 PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 150
diff changeset
    49
46577fd0a294 PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 150
diff changeset
    50
        public void PlayerPause()
46577fd0a294 PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 150
diff changeset
    51
        {
46577fd0a294 PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 150
diff changeset
    52
            UserControlSyncSource.PlayerPause();
46577fd0a294 PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 150
diff changeset
    53
        }
162
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
    54
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
    55
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
    56
        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
    57
        {
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
    58
            OnSuccessAnnotation(this, new EventArgs());
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
    59
        }
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
    60
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
    61
        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
    62
        {
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
    63
            UserControlSyncSource.UserControlPlayer_DisplayAnnotation(id, b);
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
    64
        }
35
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
    65
	}
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
    66
}