Exemple #1
0
        public void Installer()
        {
            if (FileLoded && !string.IsNullOrWhiteSpace(ModulePath))
            {
                try
                {
                    FrameworkManager.InstallPlugin(ModulePath, _safeFileName, FrameworkManager.InstallMode.Zip);
                    var _doRestart = _windowManager.ShowMessageBox(_("Veuillez relancer l'application pour activer le module"), _("Relancer"), System.Windows.MessageBoxButton.OK);

                    //if (_doRestart == System.Windows.MessageBoxResult.Yes)
                    //{
                    //    System.Windows.Forms.Application.Restart();
                    //    System.Windows.Application.Current.Shutdown();
                    //}
                }
                catch (Exception s)
                {
                    _windowManager.ShowMessageBox(s.Message);
                    return;
                }
            }
            else
            {
                _windowManager.ShowMessageBox(_("Charger un module '.zip' pour l'installer"));
                return;
            }
        }
Exemple #2
0
 public static void AddModules()
 {
     try
     {
         OpenFileDialog add = new OpenFileDialog();
         var            res = add.ShowDialog();
         add.DefaultExt = "dll";
         if (res == true)
         {
             var fullpath = Path.GetFullPath(add.FileName);
             FrameworkManager.InstallPlugin(fullpath, add.SafeFileName, FrameworkManager.InstallMode.Path);
         }
     }
     catch (Exception s)
     {
         DataHelpers.ShowMessage(s.Message);
         return;
     }
 }