示例#1
0
        public WebGui(GestionnaireSynchros gestionnaireSynchros)
        {
            _gestionnaireSynchros = gestionnaireSynchros;

                        #if DEBUG
            _webServer = new Server(C.PREFIXE);
                        #else
            _webServer = new Server();
                        #endif

            _webServer.AddAssembly(Assembly.GetExecutingAssembly(), "Gui.Web");

            _webServer.ajouteAction(CJS.ACTION__LISTE_DOSSIERS, this.getDossiers);
            _webServer.ajouteAction(CJS.ACTION__C_JS, this.getConstantes);
            _webServer.ajouteAction(CJS.ACTION__CHEMINS_DRIVES, this.getDrivesPaths);
            _webServer.ajouteAction(CJS.ACTION__SET_DOSSIER_TAMPON, this.setDossierTampon);
            _webServer.ajouteAction(CJS.ACTION__LISTE_SYNCHROS, this.getSynchros);
            _webServer.ajouteAction(CJS.ACTION__ETAT_INITIALISATION, this.etatInitialisation);
            _webServer.ajouteAction(CJS.ACTION__GET_NOM_MACHINE, this.getNomMachine);
            _webServer.ajouteAction(CJS.ACTION__CHANGE_NOM_CLIENT, this.changeNomClient);
            _webServer.ajouteAction(CJS.ACTION__GET_LISTE_CLIENTS, this.getListeClients);
            _webServer.ajouteAction(CJS.ACTION__NOUVELLE_SYNCHRO, this.nouvelleSynchro);
            _webServer.ajouteAction(CJS.ACTION__JOINDRE_SYNCHRO, this.joindreSynchro);
            _webServer.ajouteAction(CJS.ACTION__SUPPRIME_SYNCHRO, this.supprimeSynchro);
            _webServer.ajouteAction(CJS.ACTION__SUPPRIME_CLIENT_SYNCHRO, this.supprimeClientSynchro);
            _webServer.ajouteAction(CJS.ACTION__CREATION_DOSSIER, this.creerDossier);


            _threadWebServer = _webServer.start();

            File.WriteAllText(C.FICHIER_PREFIXE_WEB, _webServer.Prefixes[0]);
        }
示例#2
0
        /*public static void test()
         * {
         *      DateTime retval = DateTime.MinValue;
         *      string retour = "";
         *      Stopwatch sw = new Stopwatch();
         *
         *      sw.Start();
         *
         *      foreach (FileData f in FastDirectoryEnumerator.EnumerateFiles(@"D:\_perso\musique", "*.*", SearchOption.AllDirectories))
         *  {
         *
         *      if (f.LastWriteTime > retval)
         *      {
         *          retval = f.LastWriteTime;
         *          retour = f.Path;
         *      }
         *  }
         *
         *      sw.Stop();
         *
         *      Logger.Log(sw.ElapsedMilliseconds.ToString());
         *
         *      Logger.Log(retour);
         * }*/

        public Program()
        {
            /*long  debut   = 0;
             * int  noPart  = 0;
             * do {
             *      debut = U.ExtractFilePart(@"D:\Temp\test.jpg", @"D:\Temp\test.jpg.part" + noPart, debut, 3);
             *      noPart += 1;
             * } while (debut != 0);
             *
             * string[] parts = { @"D:\Temp\test.jpg.part0", @"D:\Temp\test.jpg.part1", @"D:\Temp\test.jpg.part2", @"D:\Temp\test.jpg.part3", @"D:\Temp\test.jpg.part4", @"D:\Temp\test.jpg.part5" };
             *
             * U.AssembleFileParts(parts, @"D:\Temp\test.final.jpg");*/

            //Logger.Log(U.ExtractFilePart(@"D:\Temp\test.jpg", @"D:\Temp\test.jpg.part1", 0, 20).ToString());

            //Logger.Log(File.Exists(@"D:\Users\vanhyftea\Google Drive\.saw\TestGrosFichier\3BC5632A6925E045DBCB151FA4B694D6.125829120.1.rep").ToString());

            Conf conf = Conf.getConf(C.FICHIER_CONF);
            var  gestionnaireSynchros = new GestionnaireSynchros(conf);
            var  webGui = new WebGui(gestionnaireSynchros);

            webGui.ThreadWebServer.Join();
        }