src/FingersDance.ViewModel/MainViewModel.cs
author PAMPHILE Jonathan <pamphile@efrei.fr>
Tue, 17 Nov 2009 13:22:14 +0100
changeset 205 468f3757f1f8
parent 182 25b49d4f1635
child 214 beebae32b1ed
permissions -rw-r--r--
Correction probleme tc annotation
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 System.Collections.ObjectModel;
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
     6
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
     7
using FingersDance.Data;
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
     8
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
     9
namespace FingersDance.ViewModels
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    10
{
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    11
    public class MainViewModel
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    12
    {
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    13
        #region Attributes
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    14
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    15
        public Dictionary<String, UserViewModel> Users = new Dictionary<string,UserViewModel>();
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: 143
diff changeset
    16
        //public SessionViewModel Session = new SessionViewModel();
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: 143
diff changeset
    17
        public ProjectViewModel Project = new ProjectViewModel();
143
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    18
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    19
        #endregion
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    20
        
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    21
        #region Methods
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    22
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: 143
diff changeset
    23
        public void CreateProject(string videoName, string videoPath)
143
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    24
        {
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: 143
diff changeset
    25
            Project = new ProjectViewModel(new Project(videoName, videoPath));
143
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    26
        }
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    27
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: 143
diff changeset
    28
        //public Project CreateProject(User u)
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: 143
diff changeset
    29
        //{
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: 143
diff changeset
    30
        //    if (Users.ContainsKey(u.Email))
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: 143
diff changeset
    31
        //    {
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: 143
diff changeset
    32
        //        if (Project.CuttingsDict.ContainsKey(u.Email))
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: 143
diff changeset
    33
        //            return Project.CuttingsDict[u.Email];
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: 143
diff changeset
    34
        //        else
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: 143
diff changeset
    35
        //        {
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: 143
diff changeset
    36
        //            Project p = new Project(u, new Cutting());
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: 143
diff changeset
    37
        //            Session.Projects.Add(u.Email, 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: 143
diff changeset
    38
        //            return 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: 143
diff changeset
    39
        //        }
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: 143
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: 143
diff changeset
    41
        //    else
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: 143
diff changeset
    42
        //    {
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: 143
diff changeset
    43
        //        AddUser(u);
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: 143
diff changeset
    44
        //        Project p = new Project(u, new Cutting());
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: 143
diff changeset
    45
        //        Session.Projects.Add(u.Email, 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: 143
diff changeset
    46
        //        return 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: 143
diff changeset
    47
        //    }
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: 143
diff changeset
    48
        //}
143
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    49
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: 143
diff changeset
    50
        //public void CreateSession(string name, string path)
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: 143
diff changeset
    51
        //{
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: 143
diff changeset
    52
        //    Session = new SessionViewModel(new Session(name, path));
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: 143
diff changeset
    53
        //}
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: 143
diff changeset
    54
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: 143
diff changeset
    55
        //public void CloseSession()
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: 143
diff changeset
    56
        //{
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: 143
diff changeset
    57
        //    Session = null;
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: 143
diff changeset
    58
        //    Session = new SessionViewModel();
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: 143
diff changeset
    59
        //}
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: 143
diff changeset
    60
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: 143
diff changeset
    61
        public void CloseProject()
143
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: 143
diff changeset
    63
            Project = null;
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: 143
diff changeset
    64
            Project = new ProjectViewModel();
143
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    65
        }
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    66
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    67
        private void AddUser(User u)
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    68
        {
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    69
            UserViewModel uvm = new UserViewModel(u);
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    70
            Users.Add(u.Email, uvm);
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    71
        }
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    72
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    73
        #endregion
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    74
    }
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
diff changeset
    75
}