client/src/Iri.Modernisation.Controls/ViewModel/AnnotationMaker/AnnotationMakerVM.cs
changeset 28 2d4ec5ab2a40
parent 25 a9c815025a1b
child 30 644e3cd48034
--- a/client/src/Iri.Modernisation.Controls/ViewModel/AnnotationMaker/AnnotationMakerVM.cs	Mon Jan 04 10:29:39 2010 +0100
+++ b/client/src/Iri.Modernisation.Controls/ViewModel/AnnotationMaker/AnnotationMakerVM.cs	Tue Jan 05 15:53:48 2010 +0100
@@ -41,7 +41,7 @@
                 _newAnnotation = new Annotation(((PolemicElement)value).Chapter);
                 Begin = ((PolemicElement)value).TimerIn.TotalMilliseconds;
                 End = ((PolemicElement)value).TimerOut.TotalMilliseconds;
-                BasicRelation = new PolemicLink() { FromElement = ((PolemicElement)value), ToElement = _newAnnotation, Type = PolemicElementType.Basic };
+                BasicRelation = new PolemicLink() { FromElement = ((PolemicElement)value), ToElement = _newAnnotation, Type = null};
                 PolemicRelation = new PolemicLink();
                 PolemicRelation.FromElement = _newAnnotation;
                
@@ -117,31 +117,11 @@
             }
         }
 
-   
-        private PolemicElementType _type;
-        /// <summary>
-        /// Type de l'annotation
-        /// </summary>
-        public PolemicElementType Type 
-        {
-            get
-            {
-                return _type;
-            }
-            set
-            {
-                _type = value;
-                _newAnnotation.Type = value;
-                OnPropertyChanged("Type");
-            }
-        }
-
-        
-        private Rectangle _selectedType;
+        private PolemicTypeDescription _selectedType;
         /// <summary>
         /// Convertion Rectange
         /// </summary>
-        public Rectangle SelectedType
+        public PolemicTypeDescription SelectedType
         {
             get
             {
@@ -150,8 +130,8 @@
             set
             {
                 _selectedType = value;
-               
-                Type = (PolemicElementType)((Rectangle)_selectedType).Resources["PolemicType"];
+                OnPropertyChanged("SelectedType");
+               // Type = (PolemicElementType)((Rectangle)_selectedType).Resources["PolemicType"];
             }
         }
 
@@ -324,7 +304,7 @@
 
         private void OkClickAnnotationMaker_Executed(object sender, ExecutedEventArgs e)
         {
-            String message = "Ok clicked "+Type+" \n";
+            String message = "Ok clicked "+SelectedType.Title+" \n";
             message += _begin + "-->" + _end;
             message += "\n" + Title;
             message += "\n" + Description;
@@ -334,7 +314,7 @@
                     message += "\n|-" + tag;
                 }
 
-                message += "PolemicLink "+PolemicRelation.Type;
+                message += "PolemicLink "+PolemicRelation.Type.Title;
             MessageBox.Show(message);
         }
 
@@ -363,13 +343,23 @@
             _newAnnotation = new Annotation(RefElement.Chapter);
             _begin = RefElement.TimerIn;
             _end = RefElement.TimerOut;
-            _basicRelation = new PolemicLink() { FromElement = RefElement, ToElement = _newAnnotation, Type = PolemicElementType.Basic };
+            _basicRelation = new PolemicLink() { FromElement = RefElement, ToElement = _newAnnotation, Type = null};
             _polemicRelation = new PolemicLink();
             PolemicRelation.FromElement = _newAnnotation;
             InitializeCommands();
         }
 
 
+        public PolemicTypeDescription[] ListAnnotationDescription
+        {
+            get
+            {
+                return FactoryVideoLivre.AnnotationDescriptions;
+            }
+           
+        }
+
+
     }
    
 }