# HG changeset patch # User Matthieu Totet # Date 1260781015 -3600 # Node ID 253f142174acf6b450edc97cf14c890f372e823c # Parent c2dd8119a6c10323200537dc56794426aa93525d Update ProductionView diff -r c2dd8119a6c1 -r 253f142174ac client/src/Iri.Modernisation.BaseMVVM/Commands/Commands.cs --- a/client/src/Iri.Modernisation.BaseMVVM/Commands/Commands.cs Fri Dec 11 10:48:58 2009 +0100 +++ b/client/src/Iri.Modernisation.BaseMVVM/Commands/Commands.cs Mon Dec 14 09:56:55 2009 +0100 @@ -376,6 +376,12 @@ { EditorPartSelected = new Command("EditorPartSelected"); EditorPartFinished = new Command("EditorPartFinished"); + IndexSelected = new Command("IndexSelected"); + } + public static Command IndexSelected + { + get; + private set; } public static Command EditorPartSelected { diff -r c2dd8119a6c1 -r 253f142174ac client/src/Iri.Modernisation.Controls/Iri.Modernisation.Controls.csproj --- a/client/src/Iri.Modernisation.Controls/Iri.Modernisation.Controls.csproj Fri Dec 11 10:48:58 2009 +0100 +++ b/client/src/Iri.Modernisation.Controls/Iri.Modernisation.Controls.csproj Mon Dec 14 09:56:55 2009 +0100 @@ -85,6 +85,7 @@ + diff -r c2dd8119a6c1 -r 253f142174ac client/src/Iri.Modernisation.Controls/View/ProductionEditor/ProductionEditor.xaml --- a/client/src/Iri.Modernisation.Controls/View/ProductionEditor/ProductionEditor.xaml Fri Dec 11 10:48:58 2009 +0100 +++ b/client/src/Iri.Modernisation.Controls/View/ProductionEditor/ProductionEditor.xaml Mon Dec 14 09:56:55 2009 +0100 @@ -9,9 +9,9 @@ - - - + + + diff -r c2dd8119a6c1 -r 253f142174ac client/src/Iri.Modernisation.Controls/View/ProductionTimeLine/ProductionTimeLine.xaml.cs --- a/client/src/Iri.Modernisation.Controls/View/ProductionTimeLine/ProductionTimeLine.xaml.cs Fri Dec 11 10:48:58 2009 +0100 +++ b/client/src/Iri.Modernisation.Controls/View/ProductionTimeLine/ProductionTimeLine.xaml.cs Mon Dec 14 09:56:55 2009 +0100 @@ -107,6 +107,7 @@ an.MouseLeftButtonUp += new MouseButtonEventHandler(an_MouseLeftButtonUp); //((ProductionTimeLineVM)DataContext).SelectedBookChapter); AnnotationTimeStrip.Children.Add(an); + } @@ -148,6 +149,28 @@ _comePoint = e.GetPosition(((CustomableIndexElement)sender)); _isTrimRightCapturated = true; } + foreach(ObservableCollection Ocsi in ((ProductionTimeLineVM)DataContext).ListIndex) + { + foreach (SegmentIndex Si in Ocsi ) + { + + if (((CustomableIndexElementVM)_selectedIndex.DataContext).SegmentIndex == Si) + { + if (Ocsi == ((ProductionTimeLineVM)DataContext).SelectedIndex) + { + Commands.ProductionTimeLine.IndexSelected.Execute(true,Si); + } + else + { + + Commands.ProductionTimeLine.IndexSelected.Execute(false, Si); + } + + } + } + } + + } private void AddSequenceButton_Click(object sender, System.Windows.RoutedEventArgs e) diff -r c2dd8119a6c1 -r 253f142174ac client/src/Iri.Modernisation.Controls/View/ProductionView/ProductionView.xaml --- a/client/src/Iri.Modernisation.Controls/View/ProductionView/ProductionView.xaml Fri Dec 11 10:48:58 2009 +0100 +++ b/client/src/Iri.Modernisation.Controls/View/ProductionView/ProductionView.xaml Mon Dec 14 09:56:55 2009 +0100 @@ -14,7 +14,7 @@ - + diff -r c2dd8119a6c1 -r 253f142174ac client/src/Iri.Modernisation.Controls/ViewModel/ProductionEditor/ProductionEditorVM.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/Iri.Modernisation.Controls/ViewModel/ProductionEditor/ProductionEditorVM.cs Mon Dec 14 09:56:55 2009 +0100 @@ -0,0 +1,135 @@ +using System; +using System.Net; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Documents; +using System.Windows.Ink; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Animation; +using System.Windows.Shapes; +using Iri.Modernisation.BaseMVVM; +using Iri.Modernisation.Data.Models; +using System.Collections.Generic; +using System.Linq; +using Iri.Modernisation.BaseMVVM.Commands; +namespace Iri.Modernisation.Controls.ViewModel +{ + public class ProductionEditorVM: BaseMVVM.ViewModel.ViewModel + { + private VideoViewerVM _videoViewerVM; + public VideoViewerVM ViewModelVideoViewer + { + get + { + return _videoViewerVM; + } + set + { + _videoViewerVM = value; + OnPropertyChanged("ViewModelVideoViewer"); + } + } + + private PolemicElement _selectedSegmentIndex; + + private String _selectedIndexTitle; + public String SelectedIndexTitle + { + get + { + return _selectedIndexTitle; + } + set + { + _selectedIndexTitle = value; + _selectedSegmentIndex.Title = value; + OnPropertyChanged("SelectedIndexTitle"); + } + } + + private String _selectedIndexDescription; + public String SelectedIndexDescription + { + get + { + return _selectedIndexDescription; + } + set + { + _selectedIndexDescription = value; + _selectedSegmentIndex.Description = value; + OnPropertyChanged("SelectedIndexDescription"); + } + } + + private List _selectedIndexTags = new List(); + public String SelectedIndexTags + { + get + { + try + { + return String.Join(",", _selectedIndexTags.ToArray()); + } + catch + { + return String.Empty; + } + } + set + { + String val = (String)value; + _selectedIndexTags = val.Split(',').ToList(); + _selectedSegmentIndex.Tags = val.Split(',').ToList(); + OnPropertyChanged("Tags"); + + + } + } + + private bool _isRecordMode; + public bool IsRecordMode + { + get + { + return _isRecordMode; + } + set + { + _isRecordMode = value; + OnPropertyChanged("IsRecordMode"); + } + } + + private bool _isEditableIndex; + public bool IsEditableIndex + { + get + { + return _isEditableIndex; + } + set + { + _isEditableIndex = value; + OnPropertyChanged("IsEditableIndex"); + } + } + + public ProductionEditorVM() + { + Commands.ProductionTimeLine.IndexSelected.Executed += new EventHandler(IndexSelected_Executed); + + } + + void IndexSelected_Executed(object sender, SLExtensions.Input.ExecutedEventArgs e) + { + IsEditableIndex = (bool)e.Parameter; + _selectedSegmentIndex = (SegmentIndex)e.Source; + _selectedIndexTitle = _selectedSegmentIndex.Title; + _selectedIndexTags = _selectedSegmentIndex.Tags; + _selectedIndexDescription = _selectedSegmentIndex.Description; + OnPropertyChanged(String.Empty); + } + } +} diff -r c2dd8119a6c1 -r 253f142174ac client/src/Iri.Modernisation.Controls/ViewModel/ProductionView/ProductionViewVM.cs --- a/client/src/Iri.Modernisation.Controls/ViewModel/ProductionView/ProductionViewVM.cs Fri Dec 11 10:48:58 2009 +0100 +++ b/client/src/Iri.Modernisation.Controls/ViewModel/ProductionView/ProductionViewVM.cs Mon Dec 14 09:56:55 2009 +0100 @@ -75,12 +75,27 @@ OnPropertyChanged("ViewModelProductionTimeLine"); } } + + private ProductionEditorVM _productionEditorVM; + public ProductionEditorVM ViewModelProductionEditor + { + get + { + return _productionEditorVM; + } + set + { + _productionEditorVM = value; + OnPropertyChanged("ViewModelProductionEditor"); + } + } //SelectedChapter public ProductionViewVM() { RecordedVideoSequences = new ObservableCollection(); ViewModelHeaderProduction = new HeaderProductionVM(); ViewModelProductionTimeLine = new ProductionTimeLineVM(); + ViewModelProductionEditor = new ProductionEditorVM(); Commands.ProductionView.ClickAddSelectedRecord.Executed += new EventHandler(ClickAddSelectedRecord_Executed); Random rndNumbers = new Random(); for (int i = 0; i < 10; i++)