client/src/Iri.Modernisation.Controls/ViewModel/AnnotationMaker/AnnotationMakerVM.cs
changeset 35 43bb1b8ed555
parent 34 4d9ebc6fbbe8
child 36 b6df6fce6e5d
equal deleted inserted replaced
34:4d9ebc6fbbe8 35:43bb1b8ed555
    14 using Iri.Modernisation.Data.Models;
    14 using Iri.Modernisation.Data.Models;
    15 using System.Collections.Generic;
    15 using System.Collections.Generic;
    16 using System.Linq;
    16 using System.Linq;
    17 using Iri.Modernisation.Controls.View;
    17 using Iri.Modernisation.Controls.View;
    18 using Iri.Modernisation.Data.LDTClass;
    18 using Iri.Modernisation.Data.LDTClass;
       
    19 
    19 namespace Iri.Modernisation.Controls.ViewModel
    20 namespace Iri.Modernisation.Controls.ViewModel
    20 {
    21 {
    21 
    22 
    22     /// <summary>
    23     /// <summary>
    23     /// ViewModel du module d'annotation
    24     /// ViewModel du module d'annotation
   268             Commands.ContextualBinderLayer.BeginBind.Executed += new EventHandler<ExecutedEventArgs>(BeginBind_Executed);
   269             Commands.ContextualBinderLayer.BeginBind.Executed += new EventHandler<ExecutedEventArgs>(BeginBind_Executed);
   269             Commands.ContextualBinderLayer.SelectBind.Executed += new EventHandler<ExecutedEventArgs>(SelectBind_Executed);
   270             Commands.ContextualBinderLayer.SelectBind.Executed += new EventHandler<ExecutedEventArgs>(SelectBind_Executed);
   270             Commands.ContextualBinderLayer.ActiveBind.Executed += new EventHandler<ExecutedEventArgs>(ActiveBind_Executed);
   271             Commands.ContextualBinderLayer.ActiveBind.Executed += new EventHandler<ExecutedEventArgs>(ActiveBind_Executed);
   271             Commands.ContextualBinderLayer.DesactiveBind.Executed += new EventHandler<ExecutedEventArgs>(DesactiveBind_Executed);
   272             Commands.ContextualBinderLayer.DesactiveBind.Executed += new EventHandler<ExecutedEventArgs>(DesactiveBind_Executed);
   272             Commands.AnnotationMaker.OkClick.Executed += new EventHandler<ExecutedEventArgs>(OkClickAnnotationMaker_Executed);
   273             Commands.AnnotationMaker.OkClick.Executed += new EventHandler<ExecutedEventArgs>(OkClickAnnotationMaker_Executed);
       
   274             Commands.EscapeKeyPressed.Executed += new EventHandler<ExecutedEventArgs>(EscapeKeyPressed_Executed);
       
   275         }
       
   276 
       
   277         void EscapeKeyPressed_Executed(object sender, ExecutedEventArgs e)
       
   278         {
       
   279 
       
   280             PolemicRelation = new PolemicLink();
       
   281             PolemicRelation.FromElement = _newAnnotation;
       
   282                 
       
   283             
   273         }
   284         }
   274 
   285 
   275         private void DesactiveBind_Executed(object sender, ExecutedEventArgs e)
   286         private void DesactiveBind_Executed(object sender, ExecutedEventArgs e)
   276         {
   287         {
   277             IsBinderActive = false;
   288             IsBinderActive = false;
   364                     IdElementTo = _polemicRelation.ToElement.Id,
   375                     IdElementTo = _polemicRelation.ToElement.Id,
   365                     Title = _polemicRelation.Title
   376                     Title = _polemicRelation.Title
   366                 };
   377                 };
   367                 newfile.Relations.Add(polemicRelation);
   378                 newfile.Relations.Add(polemicRelation);
   368             }
   379             }
   369             MessageBox.Show(newfile.ToString());
   380             //MessageBox.Show(newfile.ToString());
       
   381            
       
   382             
       
   383             Application app = Application.Current as Application;
       
   384             HttpSender helper = new HttpSender(new Uri("http://mtotet.free.fr/TestHttpSender/index.php"), "POST",
       
   385                 new KeyValuePair<string, string>("authKey", "123456" ),
       
   386                 new KeyValuePair<string, string>("newAnnotation", newfile.ToString()),
       
   387                 new KeyValuePair<string, string>("msg", "303"));
       
   388             helper.ResponseComplete += new HttpResponseCompleteEventHandler(helper_ResponseComplete);
       
   389             helper.Execute();
   370             _refElement = null;
   390             _refElement = null;
   371             OnPropertyChanged("IsControlEnable");
   391             OnPropertyChanged("IsControlEnable");
       
   392             
       
   393         }
       
   394 
       
   395         void helper_ResponseComplete(HttpResponseCompleteEventArgs e)
       
   396         {
       
   397             String resp = e.Response;
       
   398             MessageBox.Show(resp);
       
   399         
   372         }
   400         }
   373 
   401 
   374         /// <summary>
   402         /// <summary>
   375         /// Constructeur par défaut
   403         /// Constructeur par défaut
   376         /// </summary>
   404         /// </summary>