src/FingersDance.Data/Annotation.cs
author cavaliet
Thu, 12 Nov 2009 16:15:19 +0100
changeset 192 11083c390ce4
parent 182 25b49d4f1635
child 225 b60e13ed75c8
permissions -rw-r--r--
Second step of data saving : id added for cutting and annotation, and now we can load/display/change the already existing projects.
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
    {
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: 182
diff changeset
    11
        private String _id;
69
a4c44555f205 First Data binding for annotations and timeline
cavaliet
parents: 55
diff changeset
    12
        private float _tcBegin;
a4c44555f205 First Data binding for annotations and timeline
cavaliet
parents: 55
diff changeset
    13
        private float _dur;
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: 182
diff changeset
    14
        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
    15
        private Color _color;
55
1ec0ef228158 data, viewmodel and view added
cavaliet
parents:
diff changeset
    16
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: 182
diff changeset
    17
        public Annotation(String idPar, float tcBeginPar, float durPar, String gesturePar, Color colorPar)
55
1ec0ef228158 data, viewmodel and view added
cavaliet
parents:
diff changeset
    18
        {
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: 182
diff changeset
    19
            this._id = idPar;
69
a4c44555f205 First Data binding for annotations and timeline
cavaliet
parents: 55
diff changeset
    20
            this._tcBegin = tcBeginPar;
a4c44555f205 First Data binding for annotations and timeline
cavaliet
parents: 55
diff changeset
    21
            this._dur = durPar;
a4c44555f205 First Data binding for annotations and timeline
cavaliet
parents: 55
diff changeset
    22
            this._gestureType = gesturePar;
150
569925b65604 Annotations are now colored with the same color as the pivot's button
cavaliet
parents: 69
diff changeset
    23
            this._color = colorPar;
69
a4c44555f205 First Data binding for annotations and timeline
cavaliet
parents: 55
diff changeset
    24
        }
55
1ec0ef228158 data, viewmodel and view added
cavaliet
parents:
diff changeset
    25
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: 182
diff changeset
    26
        public String Id
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: 182
diff changeset
    27
        {
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: 182
diff changeset
    28
            get { return _id; }
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: 182
diff changeset
    29
            set
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: 182
diff changeset
    30
            {
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: 182
diff changeset
    31
                if (value == _id || String.IsNullOrEmpty(value))
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: 182
diff changeset
    32
                    return;
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: 182
diff changeset
    33
                _id = value;
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: 182
diff changeset
    34
            }
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: 182
diff changeset
    35
        }
69
a4c44555f205 First Data binding for annotations and timeline
cavaliet
parents: 55
diff changeset
    36
        public float TcBegin
a4c44555f205 First Data binding for annotations and timeline
cavaliet
parents: 55
diff changeset
    37
        {
a4c44555f205 First Data binding for annotations and timeline
cavaliet
parents: 55
diff changeset
    38
            get { return _tcBegin; }
a4c44555f205 First Data binding for annotations and timeline
cavaliet
parents: 55
diff changeset
    39
            set
a4c44555f205 First Data binding for annotations and timeline
cavaliet
parents: 55
diff changeset
    40
            {
a4c44555f205 First Data binding for annotations and timeline
cavaliet
parents: 55
diff changeset
    41
                if (value == _tcBegin || float.IsNaN(value))
a4c44555f205 First Data binding for annotations and timeline
cavaliet
parents: 55
diff changeset
    42
                    return;
a4c44555f205 First Data binding for annotations and timeline
cavaliet
parents: 55
diff changeset
    43
                _tcBegin = value;
a4c44555f205 First Data binding for annotations and timeline
cavaliet
parents: 55
diff changeset
    44
            }
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
        public float Dur
a4c44555f205 First Data binding for annotations and timeline
cavaliet
parents: 55
diff changeset
    47
        {
a4c44555f205 First Data binding for annotations and timeline
cavaliet
parents: 55
diff changeset
    48
            get { return _dur; }
a4c44555f205 First Data binding for annotations and timeline
cavaliet
parents: 55
diff changeset
    49
            set
a4c44555f205 First Data binding for annotations and timeline
cavaliet
parents: 55
diff changeset
    50
            {
a4c44555f205 First Data binding for annotations and timeline
cavaliet
parents: 55
diff changeset
    51
                if (value == _dur || float.IsNaN(value))
a4c44555f205 First Data binding for annotations and timeline
cavaliet
parents: 55
diff changeset
    52
                    return;
a4c44555f205 First Data binding for annotations and timeline
cavaliet
parents: 55
diff changeset
    53
                _dur = value;
a4c44555f205 First Data binding for annotations and timeline
cavaliet
parents: 55
diff changeset
    54
            }
a4c44555f205 First Data binding for annotations and timeline
cavaliet
parents: 55
diff changeset
    55
        }
a4c44555f205 First Data binding for annotations and timeline
cavaliet
parents: 55
diff changeset
    56
        public String GestureType
a4c44555f205 First Data binding for annotations and timeline
cavaliet
parents: 55
diff changeset
    57
        {
a4c44555f205 First Data binding for annotations and timeline
cavaliet
parents: 55
diff changeset
    58
            get { return _gestureType; }
a4c44555f205 First Data binding for annotations and timeline
cavaliet
parents: 55
diff changeset
    59
            set
a4c44555f205 First Data binding for annotations and timeline
cavaliet
parents: 55
diff changeset
    60
            {
a4c44555f205 First Data binding for annotations and timeline
cavaliet
parents: 55
diff changeset
    61
                if (value == _gestureType || String.IsNullOrEmpty(value))
a4c44555f205 First Data binding for annotations and timeline
cavaliet
parents: 55
diff changeset
    62
                    return;
a4c44555f205 First Data binding for annotations and timeline
cavaliet
parents: 55
diff changeset
    63
                _gestureType = value;
a4c44555f205 First Data binding for annotations and timeline
cavaliet
parents: 55
diff changeset
    64
            }
55
1ec0ef228158 data, viewmodel and view added
cavaliet
parents:
diff changeset
    65
        }
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
    66
        public Color Color
150
569925b65604 Annotations are now colored with the same color as the pivot's button
cavaliet
parents: 69
diff changeset
    67
        {
569925b65604 Annotations are now colored with the same color as the pivot's button
cavaliet
parents: 69
diff changeset
    68
            get { return _color; }
569925b65604 Annotations are now colored with the same color as the pivot's button
cavaliet
parents: 69
diff changeset
    69
            set
569925b65604 Annotations are now colored with the same color as the pivot's button
cavaliet
parents: 69
diff changeset
    70
            {
569925b65604 Annotations are now colored with the same color as the pivot's button
cavaliet
parents: 69
diff changeset
    71
                if (value == _color)
569925b65604 Annotations are now colored with the same color as the pivot's button
cavaliet
parents: 69
diff changeset
    72
                    return;
569925b65604 Annotations are now colored with the same color as the pivot's button
cavaliet
parents: 69
diff changeset
    73
                _color = value;
569925b65604 Annotations are now colored with the same color as the pivot's button
cavaliet
parents: 69
diff changeset
    74
            }
569925b65604 Annotations are now colored with the same color as the pivot's button
cavaliet
parents: 69
diff changeset
    75
        }
569925b65604 Annotations are now colored with the same color as the pivot's button
cavaliet
parents: 69
diff changeset
    76
55
1ec0ef228158 data, viewmodel and view added
cavaliet
parents:
diff changeset
    77
    }
1ec0ef228158 data, viewmodel and view added
cavaliet
parents:
diff changeset
    78
1ec0ef228158 data, viewmodel and view added
cavaliet
parents:
diff changeset
    79
}