# HG changeset patch # User PAMPHILE Jonathan # Date 1255520755 -7200 # Node ID 1a5da89daee972cc210c6185d2df5798188d29fd # Parent dd8ed4d3beb639b45abdae1aaea770b828f11791 Merge diff -r dd8ed4d3beb6 -r 1a5da89daee9 .hgignore --- a/.hgignore Wed Oct 14 13:44:25 2009 +0200 +++ b/.hgignore Wed Oct 14 13:45:55 2009 +0200 @@ -35,4 +35,5 @@ glob:*.csproj.user glob:desktop.ini glob:*.orig -glob:src\FingersDance\Resources\videos.xml \ No newline at end of file +glob:src\FingersDance\Resources\videos.xml +relre:glob:*.wmv diff -r dd8ed4d3beb6 -r 1a5da89daee9 src/FingersDance.Control.SessionInput/UserControlListProject.xaml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/FingersDance.Control.SessionInput/UserControlListProject.xaml Wed Oct 14 13:45:55 2009 +0200 @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + diff -r dd8ed4d3beb6 -r 1a5da89daee9 src/FingersDance.Control.SessionInput/UserControlListProject.xaml.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/FingersDance.Control.SessionInput/UserControlListProject.xaml.cs Wed Oct 14 13:45:55 2009 +0200 @@ -0,0 +1,67 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; +using FingersDance.Data; +using FingersDance.Control; + +namespace FingersDance.Control.SessionInput +{ + /// + /// Interaction logic for UserControlListProject.xaml + /// + public partial class UserControlListProject + { + //Creation d'un Event pour Chaque Item Video + public event EventHandler EH_Item_ContactDown; + public string SelectedItem = ""; + + public UserControlListProject(Dictionary projects) + { + InitializeComponent(); + OpenSessions(projects); + } + + private void OpenSessions(Dictionary projects) + { + try + { + CustomListBoxItem Contener = new CustomListBoxItem(); + Contener.Name = "New Project"; + Label l = new Label(); + l.Content = "New Project"; + Contener.Content = l; + stackPanel.Children.Add(Contener); + Contener.ContactTapGesture += Item_ContactTapGesture; + foreach (KeyValuePair elt in projects) + { + Contener = new CustomListBoxItem(); + Contener.Name = elt.Key; + l = new Label(); + l.Content = elt.Key; + Contener.Content = l; + stackPanel.Children.Add(Contener); + Contener.ContactTapGesture += Item_ContactTapGesture; + } + } + catch (Exception) { } + } + + //Event appelé lors de la selection d'un Item dans la Liste + private void Item_ContactTapGesture(object sender, Microsoft.Surface.Presentation.ContactEventArgs e) + { + SelectedItem = ((CustomListBoxItem)sender).Name; + if (EH_Item_ContactDown != null) + EH_Item_ContactDown(this, new EventArgs()); + } + } +} diff -r dd8ed4d3beb6 -r 1a5da89daee9 src/FingersDance.Control.SessionInput/UserControlListSession.xaml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/FingersDance.Control.SessionInput/UserControlListSession.xaml Wed Oct 14 13:45:55 2009 +0200 @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + diff -r dd8ed4d3beb6 -r 1a5da89daee9 src/FingersDance.Control.SessionInput/UserControlListSession.xaml.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/FingersDance.Control.SessionInput/UserControlListSession.xaml.cs Wed Oct 14 13:45:55 2009 +0200 @@ -0,0 +1,63 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; +using FingersDance.Data; +using FingersDance.Control; + +namespace FingersDance.Control.SessionInput +{ + /// + /// Interaction logic for UserControlListSession.xaml + /// + public partial class UserControlListSession + { + //Creation d'un Event pour Chaque Item Video + public event EventHandler EH_List_ContactDown; + public string SelectedItem = ""; + + public UserControlListSession(List sessions) + { + InitializeComponent(); + OpenSessions(sessions); + } + + private void OpenSessions(List sessions) + { + CustomListBoxItem Contener = new CustomListBoxItem(); + Contener.Name = "New Session"; + Label l = new Label(); + l.Content = "New Session"; + Contener.Content = l; + stackPanel.Children.Add(Contener); + Contener.ContactTapGesture += Item_ContactTapGesture; + foreach (Session elt in sessions) + { + Contener = new CustomListBoxItem(); + Contener.Name = elt.Name; + l = new Label(); + l.Content = elt.Name; + Contener.Content = l; + stackPanel.Children.Add(Contener); + Contener.ContactTapGesture += Item_ContactTapGesture; + } + } + + //Event appelé lors de la selection d'un Item dans la Liste + private void Item_ContactTapGesture(object sender, Microsoft.Surface.Presentation.ContactEventArgs e) + { + SelectedItem = ((CustomListBoxItem)sender).Name; + if (EH_List_ContactDown != null) + EH_List_ContactDown(this, new EventArgs()); + } + } +} diff -r dd8ed4d3beb6 -r 1a5da89daee9 src/FingersDance.Control.SessionInput/UserControlNewProject.xaml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/FingersDance.Control.SessionInput/UserControlNewProject.xaml Wed Oct 14 13:45:55 2009 +0200 @@ -0,0 +1,341 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r dd8ed4d3beb6 -r 1a5da89daee9 src/FingersDance.Control.SessionInput/UserControlNewProject.xaml.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/FingersDance.Control.SessionInput/UserControlNewProject.xaml.cs Wed Oct 14 13:45:55 2009 +0200 @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; +using FingersDance.Data; + +namespace FingersDance.Control.SessionInput +{ + /// + /// Interaction logic for UserControlNewProject.xaml + /// + public partial class UserControlNewProject : UserControl + { + public event EventHandler EH_NewProject_ContactDown; + public Project Project = new Project(); + User _User = new User(); + + public UserControlNewProject(User u) + { + InitializeComponent(); + ST_Date.Text = DateTime.Now.Day.ToString() + "/" + DateTime.Now.Month.ToString() + "/" + DateTime.Now.Year.ToString(); + _User = u; + + + } + + #region Actions + + private void SurfaceButtonSubmit_ContactDown(object sender, Microsoft.Surface.Presentation.ContactEventArgs e) + { + Project = new Project(_User, new Cutting()); + if (EH_NewProject_ContactDown != null) + EH_NewProject_ContactDown(this, new EventArgs()); + } + + private void SurfaceButtonSubmit_Click(object sender, RoutedEventArgs e) + { + Project = new Project(ST_ProjectName.Text, ST_Date.Text, ST_Desc.Text, _User, new Cutting()); + if (EH_NewProject_ContactDown != null) + EH_NewProject_ContactDown(this, new EventArgs()); + } + + #endregion + } +} diff -r dd8ed4d3beb6 -r 1a5da89daee9 src/FingersDance.Control/CustomListBoxItem.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/FingersDance.Control/CustomListBoxItem.cs Wed Oct 14 13:45:55 2009 +0200 @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Microsoft.Surface; +using Microsoft.Surface.Presentation; +using Microsoft.Surface.Presentation.Controls; + +namespace FingersDance.Control +{ + public class CustomListBoxItem:SurfaceListBoxItem + { + public string Name = ""; + public string Path = ""; + } +}