src/FingersDance.ViewModel/ProjectViewModel.cs
author cavaliet
Thu, 12 Nov 2009 16:15:19 +0100
changeset 192 11083c390ce4
parent 182 25b49d4f1635
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:
143
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
     1
using System;
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
     2
using System.Collections.Generic;
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
     3
using System.Linq;
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
     4
using System.Text;
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
     5
using FingersDance.Data;
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
     6
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
     7
namespace FingersDance.ViewModels
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
     8
{
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
     9
    public class ProjectViewModel : ViewModelBase
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    10
    {
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: 148
diff changeset
    11
        private 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: 148
diff changeset
    12
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: 148
diff changeset
    13
        private Dictionary<String, Cutting> _cuttingsDict = new Dictionary<string,Cutting>();
143
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    14
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    15
        #region Constructor
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    16
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    17
        public ProjectViewModel() { }
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    18
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    19
        public ProjectViewModel(Project p)
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    20
        {
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    21
            project = p;
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
    22
            _cuttingsDict = new Dictionary<string, Cutting>();
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
    23
            foreach(Cutting cut in project.Cuttings)
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
    24
            {
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
    25
                _cuttingsDict.Add(cut.Title, cut);
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
            }
143
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    27
        }
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    28
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    29
        #endregion
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    30
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    31
        #region Properties
148
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 143
diff changeset
    32
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 143
diff changeset
    33
        public Project Project
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 143
diff changeset
    34
        {
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 143
diff changeset
    35
            get { return project; }
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: 148
diff changeset
    36
            set { project = value; }
148
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 143
diff changeset
    37
        }
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 143
diff changeset
    38
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 143
diff changeset
    39
        public string Date
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 143
diff changeset
    40
        {
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 143
diff changeset
    41
            get { return project.Date; }
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 143
diff changeset
    42
            set { project.Date = value; }
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 143
diff changeset
    43
        }
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 143
diff changeset
    44
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 143
diff changeset
    45
        public string Name
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 143
diff changeset
    46
        {
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 143
diff changeset
    47
            get { return project.Name; }
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 143
diff changeset
    48
            set { project.Name = value; }
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 143
diff changeset
    49
        }
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 143
diff changeset
    50
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 143
diff changeset
    51
        public string Description
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 143
diff changeset
    52
        {
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 143
diff changeset
    53
            get { return project.Description; }
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 143
diff changeset
    54
            set { project.Description = value; }
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 143
diff changeset
    55
        }
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 143
diff changeset
    56
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: 148
diff changeset
    57
        public String VideoPath
143
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    58
        {
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: 148
diff changeset
    59
            get { return project.VideoPath; }
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: 148
diff changeset
    60
            set { project.VideoPath = value; }
143
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    61
        }
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    62
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: 148
diff changeset
    63
        public List<Cutting> Cuttings
143
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    64
        {
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: 148
diff changeset
    65
            get { return project.Cuttings; }
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: 148
diff changeset
    66
            set { project.Cuttings = 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: 148
diff changeset
    67
        }
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: 148
diff changeset
    68
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: 148
diff changeset
    69
        public Dictionary<String, Cutting> CuttingsDict
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: 148
diff changeset
    70
        {
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: 148
diff changeset
    71
            get { return _cuttingsDict;  }
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: 148
diff changeset
    72
            set { _cuttingsDict = value; }
143
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    73
        }
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    74
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    75
        #endregion
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    76
    }
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    77
}