client/src/Iri.Modernisation.Controls/ViewModel/AnnotationMaker/AnnotationMakerVM.cs
changeset 35 43bb1b8ed555
parent 34 4d9ebc6fbbe8
child 36 b6df6fce6e5d
--- a/client/src/Iri.Modernisation.Controls/ViewModel/AnnotationMaker/AnnotationMakerVM.cs	Tue Jan 19 09:49:56 2010 +0100
+++ b/client/src/Iri.Modernisation.Controls/ViewModel/AnnotationMaker/AnnotationMakerVM.cs	Mon Jan 25 09:30:22 2010 +0100
@@ -16,6 +16,7 @@
 using System.Linq;
 using Iri.Modernisation.Controls.View;
 using Iri.Modernisation.Data.LDTClass;
+
 namespace Iri.Modernisation.Controls.ViewModel
 {
 
@@ -270,6 +271,16 @@
             Commands.ContextualBinderLayer.ActiveBind.Executed += new EventHandler<ExecutedEventArgs>(ActiveBind_Executed);
             Commands.ContextualBinderLayer.DesactiveBind.Executed += new EventHandler<ExecutedEventArgs>(DesactiveBind_Executed);
             Commands.AnnotationMaker.OkClick.Executed += new EventHandler<ExecutedEventArgs>(OkClickAnnotationMaker_Executed);
+            Commands.EscapeKeyPressed.Executed += new EventHandler<ExecutedEventArgs>(EscapeKeyPressed_Executed);
+        }
+
+        void EscapeKeyPressed_Executed(object sender, ExecutedEventArgs e)
+        {
+
+            PolemicRelation = new PolemicLink();
+            PolemicRelation.FromElement = _newAnnotation;
+                
+            
         }
 
         private void DesactiveBind_Executed(object sender, ExecutedEventArgs e)
@@ -366,9 +377,26 @@
                 };
                 newfile.Relations.Add(polemicRelation);
             }
-            MessageBox.Show(newfile.ToString());
+            //MessageBox.Show(newfile.ToString());
+           
+            
+            Application app = Application.Current as Application;
+            HttpSender helper = new HttpSender(new Uri("http://mtotet.free.fr/TestHttpSender/index.php"), "POST",
+                new KeyValuePair<string, string>("authKey", "123456" ),
+                new KeyValuePair<string, string>("newAnnotation", newfile.ToString()),
+                new KeyValuePair<string, string>("msg", "303"));
+            helper.ResponseComplete += new HttpResponseCompleteEventHandler(helper_ResponseComplete);
+            helper.Execute();
             _refElement = null;
             OnPropertyChanged("IsControlEnable");
+            
+        }
+
+        void helper_ResponseComplete(HttpResponseCompleteEventArgs e)
+        {
+            String resp = e.Response;
+            MessageBox.Show(resp);
+        
         }
 
         /// <summary>