diff -r beb938b4fb76 -r bd33267300aa client/src/Iri.Modernisation.Controls/ViewModel/AnnotationMaker/AnnotationMakerVM.cs --- a/client/src/Iri.Modernisation.Controls/ViewModel/AnnotationMaker/AnnotationMakerVM.cs Wed Jan 27 10:55:59 2010 +0100 +++ b/client/src/Iri.Modernisation.Controls/ViewModel/AnnotationMaker/AnnotationMakerVM.cs Thu Feb 04 16:38:04 2010 +0100 @@ -311,8 +311,7 @@ { PolemicRelation.Type = ((ContextualLinkBinder)e.Parameter).PolemicType; PolemicRelation.ToElement = null; - OnPropertyChanged("PolemicRelation"); - + OnPropertyChanged("PolemicRelation"); } } @@ -321,15 +320,18 @@ private void OkClickAnnotationMaker_Executed(object sender, ExecutedEventArgs e) { - LDTElement newAnnotation = new LDTElement(); + _newAnnotation.Type = _selectedType ; + _basicRelation.ToElement = _newAnnotation; + LDTElement newAnnotation = new LDTElement(_newAnnotation); + + /* newAnnotation.Title = Title; newAnnotation.Abstract = Description; newAnnotation.Begin = Begin; newAnnotation.Dur = End - Begin; - newAnnotation.Tags = _tags; - + newAnnotation.Tags = _tags; newAnnotation.Color = int.Parse(_selectedType.Color.A.ToString() + _selectedType.Color.R.ToString() + _selectedType.Color.G.ToString() + _selectedType.Color.B.ToString()); - + */ LDTFile newfile = new LDTFile() { @@ -379,24 +381,43 @@ } //MessageBox.Show(newfile.ToString()); - - Application app = Application.Current as Application; + /** HttpSend For Web Mode **/ + /* Application app = Application.Current as Application; HttpSender helper = new HttpSender(new Uri("http://mtotet.free.fr/TestHttpSender/index.php"), "POST", new KeyValuePair("authKey", "123456" ), new KeyValuePair("newAnnotation", newfile.ToString()), new KeyValuePair("msg", "303")); helper.ResponseComplete += new HttpResponseCompleteEventHandler(helper_ResponseComplete); - // helper.Execute(); - MessageBox.Show(newfile.ToString()); + helper.Execute();*/ + + /** Local Mode **/ + Commands.AnnotationMaker.NewAnnotationFinished.Execute(_newAnnotation,_refElement); + + /********/ + + _refElement = null; OnPropertyChanged("IsControlEnable"); - + } + private String _sendAnnotationResponse; + public String SendAnnotationResponse + { + get + { + return _sendAnnotationResponse; + } + set + { + _sendAnnotationResponse = value; + OnPropertyChanged("SendAnnotationResponse"); + } + } void helper_ResponseComplete(HttpResponseCompleteEventArgs e) { - String resp = e.Response; - MessageBox.Show(resp); + SendAnnotationResponse = e.Response; + Commands.HttpSenderResponse.Execute(e.Response); }