client/src/Iri.Modernisation.Controls/ViewModel/AnnotationMaker/AnnotationMakerVM.cs
changeset 28 2d4ec5ab2a40
parent 25 a9c815025a1b
child 30 644e3cd48034
equal deleted inserted replaced
27:f292db96b050 28:2d4ec5ab2a40
    39                 _refElement = value;
    39                 _refElement = value;
    40 
    40 
    41                 _newAnnotation = new Annotation(((PolemicElement)value).Chapter);
    41                 _newAnnotation = new Annotation(((PolemicElement)value).Chapter);
    42                 Begin = ((PolemicElement)value).TimerIn.TotalMilliseconds;
    42                 Begin = ((PolemicElement)value).TimerIn.TotalMilliseconds;
    43                 End = ((PolemicElement)value).TimerOut.TotalMilliseconds;
    43                 End = ((PolemicElement)value).TimerOut.TotalMilliseconds;
    44                 BasicRelation = new PolemicLink() { FromElement = ((PolemicElement)value), ToElement = _newAnnotation, Type = PolemicElementType.Basic };
    44                 BasicRelation = new PolemicLink() { FromElement = ((PolemicElement)value), ToElement = _newAnnotation, Type = null};
    45                 PolemicRelation = new PolemicLink();
    45                 PolemicRelation = new PolemicLink();
    46                 PolemicRelation.FromElement = _newAnnotation;
    46                 PolemicRelation.FromElement = _newAnnotation;
    47                
    47                
    48                 OnPropertyChanged(String.Empty);
    48                 OnPropertyChanged(String.Empty);
    49                 //OnPropertyChanged("RefElement");
    49                 //OnPropertyChanged("RefElement");
   115                 _newAnnotation.TimerOut = TimeSpan.FromMilliseconds(value);
   115                 _newAnnotation.TimerOut = TimeSpan.FromMilliseconds(value);
   116                 OnPropertyChanged("End");
   116                 OnPropertyChanged("End");
   117             }
   117             }
   118         }
   118         }
   119 
   119 
   120    
   120         private PolemicTypeDescription _selectedType;
   121         private PolemicElementType _type;
       
   122         /// <summary>
       
   123         /// Type de l'annotation
       
   124         /// </summary>
       
   125         public PolemicElementType Type 
       
   126         {
       
   127             get
       
   128             {
       
   129                 return _type;
       
   130             }
       
   131             set
       
   132             {
       
   133                 _type = value;
       
   134                 _newAnnotation.Type = value;
       
   135                 OnPropertyChanged("Type");
       
   136             }
       
   137         }
       
   138 
       
   139         
       
   140         private Rectangle _selectedType;
       
   141         /// <summary>
   121         /// <summary>
   142         /// Convertion Rectange
   122         /// Convertion Rectange
   143         /// </summary>
   123         /// </summary>
   144         public Rectangle SelectedType
   124         public PolemicTypeDescription SelectedType
   145         {
   125         {
   146             get
   126             get
   147             {
   127             {
   148                 return _selectedType;
   128                 return _selectedType;
   149             }
   129             }
   150             set
   130             set
   151             {
   131             {
   152                 _selectedType = value;
   132                 _selectedType = value;
   153                
   133                 OnPropertyChanged("SelectedType");
   154                 Type = (PolemicElementType)((Rectangle)_selectedType).Resources["PolemicType"];
   134                // Type = (PolemicElementType)((Rectangle)_selectedType).Resources["PolemicType"];
   155             }
   135             }
   156         }
   136         }
   157 
   137 
   158         private String _title;
   138         private String _title;
   159         /// <summary>
   139         /// <summary>
   322 
   302 
   323       
   303       
   324 
   304 
   325         private void OkClickAnnotationMaker_Executed(object sender, ExecutedEventArgs e)
   305         private void OkClickAnnotationMaker_Executed(object sender, ExecutedEventArgs e)
   326         {
   306         {
   327             String message = "Ok clicked "+Type+" \n";
   307             String message = "Ok clicked "+SelectedType.Title+" \n";
   328             message += _begin + "-->" + _end;
   308             message += _begin + "-->" + _end;
   329             message += "\n" + Title;
   309             message += "\n" + Title;
   330             message += "\n" + Description;
   310             message += "\n" + Description;
   331             
   311             
   332                 foreach (string tag in _tags)
   312                 foreach (string tag in _tags)
   333                 {
   313                 {
   334                     message += "\n|-" + tag;
   314                     message += "\n|-" + tag;
   335                 }
   315                 }
   336 
   316 
   337                 message += "PolemicLink "+PolemicRelation.Type;
   317                 message += "PolemicLink "+PolemicRelation.Type.Title;
   338             MessageBox.Show(message);
   318             MessageBox.Show(message);
   339         }
   319         }
   340 
   320 
   341         /// <summary>
   321         /// <summary>
   342         /// Constructeur par défaut
   322         /// Constructeur par défaut
   361 
   341 
   362 
   342 
   363             _newAnnotation = new Annotation(RefElement.Chapter);
   343             _newAnnotation = new Annotation(RefElement.Chapter);
   364             _begin = RefElement.TimerIn;
   344             _begin = RefElement.TimerIn;
   365             _end = RefElement.TimerOut;
   345             _end = RefElement.TimerOut;
   366             _basicRelation = new PolemicLink() { FromElement = RefElement, ToElement = _newAnnotation, Type = PolemicElementType.Basic };
   346             _basicRelation = new PolemicLink() { FromElement = RefElement, ToElement = _newAnnotation, Type = null};
   367             _polemicRelation = new PolemicLink();
   347             _polemicRelation = new PolemicLink();
   368             PolemicRelation.FromElement = _newAnnotation;
   348             PolemicRelation.FromElement = _newAnnotation;
   369             InitializeCommands();
   349             InitializeCommands();
   370         }
   350         }
   371 
   351 
   372 
   352 
       
   353         public PolemicTypeDescription[] ListAnnotationDescription
       
   354         {
       
   355             get
       
   356             {
       
   357                 return FactoryVideoLivre.AnnotationDescriptions;
       
   358             }
       
   359            
       
   360         }
       
   361 
       
   362 
   373     }
   363     }
   374    
   364    
   375 }
   365 }