src/FingersDance.Data/Annotation.cs
author cavaliet
Wed, 28 Oct 2009 17:07:27 +0100
changeset 182 25b49d4f1635
parent 160 e940ca798fe3
child 192 11083c390ce4
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:
55
1ec0ef228158 data, viewmodel and view added
cavaliet
parents:
diff changeset
     1
using System;
1ec0ef228158 data, viewmodel and view added
cavaliet
parents:
diff changeset
     2
using System.Collections.Generic;
1ec0ef228158 data, viewmodel and view added
cavaliet
parents:
diff changeset
     3
using System.Linq;
1ec0ef228158 data, viewmodel and view added
cavaliet
parents:
diff changeset
     4
using System.Text;
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: 150
diff changeset
     5
using System.Windows.Media;
55
1ec0ef228158 data, viewmodel and view added
cavaliet
parents:
diff changeset
     6
1ec0ef228158 data, viewmodel and view added
cavaliet
parents:
diff changeset
     7
namespace FingersDance.Data
1ec0ef228158 data, viewmodel and view added
cavaliet
parents:
diff changeset
     8
{
69
a4c44555f205 First Data binding for annotations and timeline
cavaliet
parents: 55
diff changeset
     9
    public class Annotation
55
1ec0ef228158 data, viewmodel and view added
cavaliet
parents:
diff changeset
    10
    {
69
a4c44555f205 First Data binding for annotations and timeline
cavaliet
parents: 55
diff changeset
    11
        private float _tcBegin;
a4c44555f205 First Data binding for annotations and timeline
cavaliet
parents: 55
diff changeset
    12
        private float _dur;
a4c44555f205 First Data binding for annotations and timeline
cavaliet
parents: 55
diff changeset
    13
        private string _gestureType;
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: 150
diff changeset
    14
        private Color _color;
55
1ec0ef228158 data, viewmodel and view added
cavaliet
parents:
diff changeset
    15
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: 150
diff changeset
    16
        public Annotation(float tcBeginPar, float durPar, string gesturePar, Color colorPar)
55
1ec0ef228158 data, viewmodel and view added
cavaliet
parents:
diff changeset
    17
        {
69
a4c44555f205 First Data binding for annotations and timeline
cavaliet
parents: 55
diff changeset
    18
            this._tcBegin = tcBeginPar;
a4c44555f205 First Data binding for annotations and timeline
cavaliet
parents: 55
diff changeset
    19
            this._dur = durPar;
a4c44555f205 First Data binding for annotations and timeline
cavaliet
parents: 55
diff changeset
    20
            this._gestureType = gesturePar;
150
569925b65604 Annotations are now colored with the same color as the pivot's button
cavaliet
parents: 69
diff changeset
    21
            this._color = colorPar;
69
a4c44555f205 First Data binding for annotations and timeline
cavaliet
parents: 55
diff changeset
    22
        }
55
1ec0ef228158 data, viewmodel and view added
cavaliet
parents:
diff changeset
    23
69
a4c44555f205 First Data binding for annotations and timeline
cavaliet
parents: 55
diff changeset
    24
        public float TcBegin
a4c44555f205 First Data binding for annotations and timeline
cavaliet
parents: 55
diff changeset
    25
        {
a4c44555f205 First Data binding for annotations and timeline
cavaliet
parents: 55
diff changeset
    26
            get { return _tcBegin; }
a4c44555f205 First Data binding for annotations and timeline
cavaliet
parents: 55
diff changeset
    27
            set
a4c44555f205 First Data binding for annotations and timeline
cavaliet
parents: 55
diff changeset
    28
            {
a4c44555f205 First Data binding for annotations and timeline
cavaliet
parents: 55
diff changeset
    29
                if (value == _tcBegin || float.IsNaN(value))
a4c44555f205 First Data binding for annotations and timeline
cavaliet
parents: 55
diff changeset
    30
                    return;
a4c44555f205 First Data binding for annotations and timeline
cavaliet
parents: 55
diff changeset
    31
                _tcBegin = value;
a4c44555f205 First Data binding for annotations and timeline
cavaliet
parents: 55
diff changeset
    32
            }
a4c44555f205 First Data binding for annotations and timeline
cavaliet
parents: 55
diff changeset
    33
        }
a4c44555f205 First Data binding for annotations and timeline
cavaliet
parents: 55
diff changeset
    34
        public float Dur
a4c44555f205 First Data binding for annotations and timeline
cavaliet
parents: 55
diff changeset
    35
        {
a4c44555f205 First Data binding for annotations and timeline
cavaliet
parents: 55
diff changeset
    36
            get { return _dur; }
a4c44555f205 First Data binding for annotations and timeline
cavaliet
parents: 55
diff changeset
    37
            set
a4c44555f205 First Data binding for annotations and timeline
cavaliet
parents: 55
diff changeset
    38
            {
a4c44555f205 First Data binding for annotations and timeline
cavaliet
parents: 55
diff changeset
    39
                if (value == _dur || float.IsNaN(value))
a4c44555f205 First Data binding for annotations and timeline
cavaliet
parents: 55
diff changeset
    40
                    return;
a4c44555f205 First Data binding for annotations and timeline
cavaliet
parents: 55
diff changeset
    41
                _dur = value;
a4c44555f205 First Data binding for annotations and timeline
cavaliet
parents: 55
diff changeset
    42
            }
a4c44555f205 First Data binding for annotations and timeline
cavaliet
parents: 55
diff changeset
    43
        }
a4c44555f205 First Data binding for annotations and timeline
cavaliet
parents: 55
diff changeset
    44
        public String GestureType
a4c44555f205 First Data binding for annotations and timeline
cavaliet
parents: 55
diff changeset
    45
        {
a4c44555f205 First Data binding for annotations and timeline
cavaliet
parents: 55
diff changeset
    46
            get { return _gestureType; }
a4c44555f205 First Data binding for annotations and timeline
cavaliet
parents: 55
diff changeset
    47
            set
a4c44555f205 First Data binding for annotations and timeline
cavaliet
parents: 55
diff changeset
    48
            {
a4c44555f205 First Data binding for annotations and timeline
cavaliet
parents: 55
diff changeset
    49
                if (value == _gestureType || String.IsNullOrEmpty(value))
a4c44555f205 First Data binding for annotations and timeline
cavaliet
parents: 55
diff changeset
    50
                    return;
a4c44555f205 First Data binding for annotations and timeline
cavaliet
parents: 55
diff changeset
    51
                _gestureType = value;
a4c44555f205 First Data binding for annotations and timeline
cavaliet
parents: 55
diff changeset
    52
            }
55
1ec0ef228158 data, viewmodel and view added
cavaliet
parents:
diff changeset
    53
        }
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: 150
diff changeset
    54
        public Color Color
150
569925b65604 Annotations are now colored with the same color as the pivot's button
cavaliet
parents: 69
diff changeset
    55
        {
569925b65604 Annotations are now colored with the same color as the pivot's button
cavaliet
parents: 69
diff changeset
    56
            get { return _color; }
569925b65604 Annotations are now colored with the same color as the pivot's button
cavaliet
parents: 69
diff changeset
    57
            set
569925b65604 Annotations are now colored with the same color as the pivot's button
cavaliet
parents: 69
diff changeset
    58
            {
569925b65604 Annotations are now colored with the same color as the pivot's button
cavaliet
parents: 69
diff changeset
    59
                if (value == _color)
569925b65604 Annotations are now colored with the same color as the pivot's button
cavaliet
parents: 69
diff changeset
    60
                    return;
569925b65604 Annotations are now colored with the same color as the pivot's button
cavaliet
parents: 69
diff changeset
    61
                _color = value;
569925b65604 Annotations are now colored with the same color as the pivot's button
cavaliet
parents: 69
diff changeset
    62
            }
569925b65604 Annotations are now colored with the same color as the pivot's button
cavaliet
parents: 69
diff changeset
    63
        }
569925b65604 Annotations are now colored with the same color as the pivot's button
cavaliet
parents: 69
diff changeset
    64
55
1ec0ef228158 data, viewmodel and view added
cavaliet
parents:
diff changeset
    65
    }
1ec0ef228158 data, viewmodel and view added
cavaliet
parents:
diff changeset
    66
1ec0ef228158 data, viewmodel and view added
cavaliet
parents:
diff changeset
    67
}