Esempio n. 1
0
         /// <summary>
         /// Valide l'édition en cours et retourne à l'écran principal
         /// </summary>
         /// <param name="notUsed"></param>
         protected virtual void ExecuteViewDocumentCommand(DocumentMetadataDataContract param)
         {
             try
             {
                 var leDocument = param.NomDocument;

                 string savedFile = System.IO.Path.Combine(System.IO.Path.GetTempPath(), leDocument);
                 if (!File.Exists(savedFile))
                 {
                     _dispatcher.Invoke(
                            System.Windows.Threading.DispatcherPriority.Normal,
                            new Action(
                              delegate()
                              {
                                  GestionSharepoint gSP = new GestionSharepoint();
                                  string extension = string.Empty;
                                  var document = gSP.GetFile(leDocument, "ICOMI_BPH", out extension);
                                  File.WriteAllBytes(savedFile, document);
                              }
                          ));
                 }
                 System.Diagnostics.Process.Start(savedFile);
             }
             catch
             {

             }
             
         }
Esempio n. 2
0
 private void Worker_DoWork(object sender, DoWorkEventArgs e)
 {
     try
     {                
             var leDocument = e.Argument as string;
             if (leDocument != null)
             {
                 string savedFile = System.IO.Path.Combine(System.IO.Path.GetTempPath(), leDocument);
                 if (!File.Exists(savedFile))
                 {
                     Dispatcher.Invoke(
                            System.Windows.Threading.DispatcherPriority.Normal,
                            new Action(
                              delegate()
                              {
                                GestionSharepoint gSP = new GestionSharepoint();
                             string extension = string.Empty;
                             this._document = gSP.GetFile(leDocument, "ICOMI_BPH", out extension);
                             File.WriteAllBytes(savedFile, this._document);  
                              }
                          ));                            
                 }
                 e.Result = savedFile;
             }                  
     }            
     catch
     {
         e.Result = null;
     }
 }