예제 #1
0
        static int indexSysteme = 3; //a cause des matrices deja créé


        static void Main(string[] args)
        {
            //On initialise des matrices de départs de différent format de manière de ne pas avoir a les créer a toute les fois pour les tests
            Matrice mat1 = new Matrice(1);
            Matrice mat2 = new Matrice(2);
            Matrice mat3 = new Matrice(3);
            Matrice mat4 = new Matrice(4);
            Matrice mat5 = new Matrice(5);

            //On initialise des systeme dequation de départ
            Systeme sys1 = new Systeme(1);
            Systeme sys2 = new Systeme(2);
            Systeme sys3 = new Systeme(3);

            listeMatrice[0] = mat1;
            listeMatrice[1] = mat2;
            listeMatrice[2] = mat3;
            listeMatrice[3] = mat4;
            listeMatrice[4] = mat5;

            listeSysteme[0] = sys1;
            listeSysteme[1] = sys2;
            listeSysteme[2] = sys3;


            NavigationMenu();
        }
예제 #2
0
 public void LoadDefaultBckForSysteme(Systeme systeme)
 {
     try
     {
         var defaulttheme = Path.Combine(FileJSONService.appSettings.AppSettingsFolder, "themes", "Space", systeme.Shortname);
         Directory.CreateDirectory(defaulttheme);
         if (systeme.Type == SysType.Arcade)
         {
             File.Copy(@"default_BCK.jpg", Path.Combine(defaulttheme, "bck.jpg"), true);
         }
         else if (systeme.Type == SysType.Console)
         {
             File.Copy(@"default_BCK2.jpg", Path.Combine(defaulttheme, "bck.jpg"), true);
         }
         else if (systeme.Type == SysType.ConsolePortable)
         {
             File.Copy(@"default_BCK3.jpg", Path.Combine(defaulttheme, "bck.jpg"), true);
         }
         else if (systeme.Type == SysType.GameStore)
         {
             File.Copy(@"default_BCK4.jpg", Path.Combine(defaulttheme, "bck.jpg"), true);
         }
         else if (systeme.Type == SysType.Collection)
         {
             File.Copy(@"default_BCK5.jpg", Path.Combine(defaulttheme, "bck.jpg"), true);
         }
     }
     catch (Exception ex)
     {
         //throw;
     }
 }
예제 #3
0
 public SystemeViewModel(Systeme systeme)
 {
     if (systeme != null)
     {
         Systeme     = systeme;
         Name        = Systeme.Name;
         Theme       = Systeme.Shortname;
         Screenshoot = Systeme.Screenshoot;
         Video       = Systeme.Video;
         if (System.IO.File.Exists(Video))
         {
             HasVideo = true;
         }
         else
         {
             HasVideo = false;
         }
         Logo = Systeme.Logo;
         if (string.IsNullOrEmpty(Logo))
         {
             HasLogo = false;
         }
         else
         {
             HasLogo = true;
         }
         Emulators = new ObservableCollection <EmulatorViewModel>();
     }
 }
예제 #4
0
        //Ajout d'un système
        protected static void AjouterSysteme()
        {
            Systeme newSysteme;
            int     n;

            //Saisit des paramètre de la matrice
            Console.WriteLine("");
            Console.WriteLine("Veuillez entrer le N du système");
            n = Int32.Parse(Console.ReadLine());

            Matrice newMatriceA = new Matrice(n, n);
            Matrice newMatriceB = new Matrice(n, 1);

            //On remplit les matrices du nouveau système
            newMatriceA.RemplirMatrice(0);
            newMatriceB.RemplirMatrice(1);

            newSysteme = new Systeme(newMatriceA, newMatriceB, n);

            //Ajout du systeme à la liste des Systemes
            listeSysteme[indexSysteme] = newSysteme;
            indexSysteme++;

            Console.Clear();
            Console.WriteLine("Le système #{0} a été créée", indexSysteme);
        }
예제 #5
0
        private string GetJsonSys()
        {
            Systeme sys = new Systeme();

            sys.Name      = Name;
            sys.Shortname = Shortname.ToLower();
            sys.Type      = SysType.Console;
            return(JsonConvert.SerializeObject(sys));
        }
예제 #6
0
 public static void StartServer()
 {
     clients      = new List <UserThread>();
     regexMessage = CreateRegexXmlMessage(new string[] { RequestAndRegexConstants.selectPattern, RequestAndRegexConstants.insertPattern, RequestAndRegexConstants.updatePattern, RequestAndRegexConstants.createPattern, RequestAndRegexConstants.deletePattern, RequestAndRegexConstants.dropPattern, RequestAndRegexConstants.createDatabasePattern, RequestAndRegexConstants.dropDatabasePattern, RequestAndRegexConstants.deleteUser, RequestAndRegexConstants.createUser, RequestAndRegexConstants.grantDatabasePrivilege, RequestAndRegexConstants.grantTablePrivilege, RequestAndRegexConstants.revokeTablePrivilege, RequestAndRegexConstants.revokeDatabasePrivilege, RequestAndRegexConstants.createSecurityProfile, RequestAndRegexConstants.dropSecurityProfile, RequestAndRegexConstants.login, RequestAndRegexConstants.exit });
     InitializeSysteme();
     QueryFactory.GetQueryFactory().SetSysteme(Systeme.GetSystem());
     InitialiceListener(ServerCredentialsFunctions.AskServerIP().ToString(), ServerCredentialsFunctions.AskServerPort());
     RunServer();
 }
예제 #7
0
        public Emulator CreateEmulateur(Systeme platform, string Name, string Command, string Extension)
        {
            Emulator emu = new Emulator();

            emu.Name        = Name;
            emu.Command     = Command;
            emu.Extension   = Extension;
            emu.IsDuplicate = false;
            return(emu);
        }
예제 #8
0
        public string showImgPickerForPlateformeDialog(Systeme title, string themename, ScraperType scraperType)
        {
            ModalWindow modalWindow = new ModalWindow();
            var         vm          = new GetPictureForSystemViewModel(title, themename, scraperType);

            modalWindow.DataContext = vm;
            if (modalWindow.ShowDialog().Value)
            {
                return(vm.ResultPath);
            }
            return(null);
        }
예제 #9
0
        public Systeme ShowSystemeDetail(Systeme sys)
        {
            ModalWindow modalWindow = new ModalWindow();
            var         vm          = new SystemeDetailViewModel(sys);

            modalWindow.DataContext = vm;
            if (modalWindow.ShowDialog().Value)
            {
                return(vm.Sys);
            }
            return(null);
        }
예제 #10
0
        public Emulator AddExplorer(Systeme systeme)
        {
            Emulator emuexe = new Emulator();

            emuexe.Name        = $"{systeme.Name} Explorer.exe";
            emuexe.Chemin      = @"C:\Windows\explorer.exe";
            emuexe.Command     = "%ROMPATH% --fullscreen";
            emuexe.SystemeID   = systeme.SystemeID;
            emuexe.Extension   = ".exe .EXE .lnk .url";
            emuexe.IsDuplicate = false;
            return(emuexe);
        }
예제 #11
0
 public void LoadBckForSysteme(Systeme systeme, string themename, string imgpath)
 {
     try
     {
         var defaulttheme = Path.Combine(FileJSONService.appSettings.AppSettingsFolder, "themes", themename, systeme.Shortname);
         Directory.CreateDirectory(defaulttheme);
         File.Copy(imgpath, Path.Combine(defaulttheme, "bck.jpg"), true);
     }
     catch (Exception ex)
     {
         //throw;
     }
 }
        public GetPictureForSystemViewModel(Systeme title, string themename, ScraperType scraperType)
        {
            Title         = $"Rechercher de {scraperType.ToString()} pour {title.Name}";
            ScraperType   = scraperType;
            dialogService = App.ServiceProvider.GetRequiredService <IDialogService>();
            themeService  = App.ServiceProvider.GetRequiredService <IThemeService>();
            var img = themeService.GetBckForTheme(title.Shortname, themename);

            if (img != null)
            {
                ImgPath = img;
            }
        }
예제 #13
0
 private void InversionMatricielle_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         Matrice matriceA = CreerMatriceA(Convert.ToInt32(LignesA.Text), Convert.ToInt32(ColonnesA.Text));
         Matrice matriceB = CreerMatriceB(Convert.ToInt32(LignesB.Text), Convert.ToInt32(ColonnesB.Text));
         Systeme systemeA = new Systeme(matriceA, matriceB);
         Matrice systemeX = systemeA.TrouverXParInversionMatricielle();
         AfficheSysteme(systemeX, "Méthode d'inversion matricielle : ");
     }
     catch (Exception)
     {
         resultatsTxt.Text = "";
         MessageBox.Show("Impossible d'utiliser cette méthode car la matrice A a un déterminant de 0");
     }
 }
예제 #14
0
 private void Cramer_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         Matrice matriceA = CreerMatriceA(Convert.ToInt32(LignesA.Text), Convert.ToInt32(ColonnesA.Text));
         Matrice matriceB = CreerMatriceB(Convert.ToInt32(LignesB.Text), Convert.ToInt32(ColonnesB.Text));
         Systeme systemeA = new Systeme(matriceA, matriceB);
         Matrice systemeX = systemeA.TrouverXParCramer();
         AfficheSysteme(systemeX, "Méthode de Cramer : ");
     }
     catch (Exception ex)
     {
         resultatsTxt.Text = "";
         MessageBox.Show(ex.Message);
     }
 }
예제 #15
0
        private static void InitializeSysteme()
        {
            Systeme systeme = Systeme.GetSystem();
            SystemeDatabaseContainerModule  databaseContainerModule  = SystemeDatabaseContainerModule.GetSystemeDatabaseContainerModule();
            SystemeDataInicializationModule dataInicializationModule = SystemeDataInicializationModule.GetSystemeDataInicializationModule();
            SystemePrivilegeModule          privilegeModule          = SystemePrivilegeModule.GetSystemePrivilegeModule();

            databaseContainerModule.SetSysteme(systeme);
            dataInicializationModule.SetSysteme(systeme);
            privilegeModule.SetSysteme(systeme);
            systeme.SetActiveModule(databaseContainerModule);
            systeme.SetActiveModule(privilegeModule);
            systeme.SetSystemeModule(dataInicializationModule);
            databaseContainerModule.AcoplateTheModule();
            dataInicializationModule.AcoplateTheModule();
            privilegeModule.AcoplateTheModule();
        }
예제 #16
0
 private void Jacobi_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         Matrice matriceA = CreerMatriceA(Convert.ToInt32(LignesA.Text), Convert.ToInt32(ColonnesA.Text));
         Matrice matriceB = CreerMatriceB(Convert.ToInt32(LignesB.Text), Convert.ToInt32(ColonnesB.Text));
         Systeme systemeA = new Systeme(matriceA, matriceB);
         systemeA.DominanteDiag();
         Matrice systemeX = systemeA.TrouverXParJacobi(double.Parse(Epsilon.Text, System.Globalization.CultureInfo.InvariantCulture));
         AfficheSysteme(systemeX, "Méthode de Jacobi : ");
     }
     catch (Exception)
     {
         resultatsTxt.Text = "";
         MessageBox.Show("La matrice A n'est pas diagonalement dominante");
     }
 }
예제 #17
0
 private void AddAllGames()
 {
     if (_fileJSONService.appSettings.ShowAll == true)
     {
         var newsys = new Systeme();
         newsys.Name      = "Tous les Jeux";
         newsys.Shortname = "all";
         newsys.Type      = SysType.Collection;
         SystemeViewModel sysvm = new SystemeViewModel(newsys);
         sysvm.Bck = _themeService.GetBckForTheme(newsys.Shortname, _fileJSONService.GetCurrentTheme());
         var logopath = _themeService.GetLogoForTheme(newsys.Shortname);
         if (File.Exists(logopath))
         {
             sysvm.Logo    = logopath;
             sysvm.HasLogo = true;
         }
         Systemes.Insert(0, sysvm);
     }
 }
예제 #18
0
 private void AddLastPlayed()
 {
     if (_fileJSONService.appSettings.ShowLastPlayed == true)
     {
         var newsys = new Systeme();
         newsys.Name      = "Derniers jeux joués";
         newsys.Shortname = "last";
         newsys.Type      = SysType.Collection;
         SystemeViewModel sysvm = new SystemeViewModel(newsys);
         sysvm.Bck = _themeService.GetBckForTheme(newsys.Shortname, _fileJSONService.GetCurrentTheme());
         var logopath = _themeService.GetLogoForTheme(newsys.Shortname);
         if (File.Exists(logopath))
         {
             sysvm.Logo    = logopath;
             sysvm.HasLogo = true;
         }
         Systemes.Insert(0, sysvm);
     }
 }
        //private ICommand _previousthemeCommand;
        //private ICommand _nextthemeCommand;
        //public ICommand PreviousthemeCommand
        //{
        //    get
        //    {
        //        return _previousthemeCommand ?? (_previousthemeCommand = new RelayCommand(Previoustheme));
        //    }
        //}

        //public ICommand NextthemeCommand
        //{
        //    get
        //    {
        //        return _nextthemeCommand ?? (_nextthemeCommand = new RelayCommand(Nexttheme));
        //    }
        //}

        //private void Nexttheme()
        //{
        //    try
        //    {
        //        CurrentTheme = Themes[SelectedThemeIndex++];
        //        ChangeImg();
        //    }
        //    catch (Exception ex)
        //    {
        //        SelectedThemeIndex = 0;
        //        CurrentTheme = Themes[SelectedThemeIndex];
        //        ChangeImg();
        //    }
        //}
        //private void Previoustheme()
        //{
        //    try
        //    {
        //        CurrentTheme = Themes[SelectedThemeIndex--];
        //        ChangeImg();
        //    }
        //    catch (Exception ex)
        //    {
        //        SelectedThemeIndex = Themes.Count-1;
        //        CurrentTheme = Themes[SelectedThemeIndex];
        //        ChangeImg();
        //    }
        //}
        public SystemeDetailViewModel(Systeme sys)
        {
            Sys           = sys;
            Name          = sys.Name;
            ShortName     = sys.Shortname;
            Screenshoot   = sys.Screenshoot;
            Video         = sys.Video;
            Logo          = sys.Logo;
            _themeService = App.ServiceProvider.GetRequiredService <IThemeService>();
            dialogService = App.ServiceProvider.GetRequiredService <IDialogService>();
            Themes        = new ObservableCollection <ThemePlateformeViewModel>();
            foreach (var th in _themeService.GetInstalledTheme())
            {
                ThemePlateformeViewModel thvm = new ThemePlateformeViewModel(ShortName, th);
                thvm.Bck = ChargeBck(th.FolderName);
                Themes.Add(thvm);
            }
            SelectedThemeIndex = 0;
            //CurrentTheme = Themes[SelectedThemeIndex];
            //ChangeImg();
        }
                public Categorie(string nomCategorie, int docNumber, Systeme lePapa)
                    : base(lePapa._UCDoc)
                {
                    categorieName = nomCategorie;
                    num = docNumber;
                    _Systeme = lePapa;
                    _Systeme.num += num;
                    _Systeme._Section.num += num;
                    tviTypeDoc = null;
                    lePapa.listeDesCategories.Add(this);

                    ((TagObject)_Systeme.GetTreeViewItem().Tag).nbDoc += num;
                    ((TagObject)_Systeme._Section.GetTreeViewItem().Tag).nbDoc += num;
                }
            private void BW_Menu_ProgressChanged(object sender, ProgressChangedEventArgs e)
            {
                string[] workerResult = e.UserState as string[];
                int indexSection = this.hasSection(workerResult[0]);
                if (indexSection != -1)
                {
                    int indexSysteme = this.listeDesSections[indexSection].hasSysteme(workerResult[1]);
                    if (indexSysteme != -1)
                    {
                        int indexCategorie = this.listeDesSections[indexSection].listeDesSystemes[indexSysteme].hasCategorie(workerResult[2]);
                        if (indexCategorie == -1)
                        {
                            //on ajoute simplement la categorie
                            Categorie aNewCategorie = new Categorie(workerResult[2], int.Parse(workerResult[3]), this.listeDesSections[indexSection].listeDesSystemes[indexSysteme]);

                            this.listeDesSections[indexSection].listeDesSystemes[indexSysteme].GetTreeViewItem().Items.Add(aNewCategorie.GetTreeViewItem());
                        }
                    }
                    else
                    {
                        //On ajoute systeme et la catégorie
                        Systeme aNewSysteme = new Systeme(workerResult[1], 0, this.listeDesSections[indexSection]);
                        Categorie aNewCategorie = new Categorie(workerResult[2], int.Parse(workerResult[3]), aNewSysteme);

                        this.listeDesSections[indexSection].GetTreeViewItem().Items.Add(aNewSysteme.GetTreeViewItem());
                        aNewSysteme.GetTreeViewItem().Items.Add(aNewCategorie.GetTreeViewItem());
                    }
                }
                else
                {
                    //On ajoute tout

                    Section aNewSection = new Section(workerResult[0], 0, this);
                    Systeme aNewSysteme = new Systeme(workerResult[1], 0, aNewSection);
                    Categorie aNewCategorie = new Categorie(workerResult[2], int.Parse(workerResult[3]), aNewSysteme);

                    _UCDoc.AddItemToMenu(aNewSection.GetTreeViewItem());
                    aNewSection.GetTreeViewItem().Items.Add(aNewSysteme.GetTreeViewItem());
                    aNewSysteme.GetTreeViewItem().Items.Add(aNewCategorie.GetTreeViewItem());
                }
            }
예제 #22
0
 public void SaveShit()
 {
     ((ISystemeDatabaseModule)Systeme.GetSystem().GetSystemeModule(SystemeConstants.SystemeDatabaseModule)).SaveAll();
 }
예제 #23
0
 private FakeServer()
 {
     this.SetSystemeModules();
     QueryFactory.GetQueryFactory().SetSysteme(Systeme.GetSystem());
     this.username = SystemeConstants.AnonimousUser;
 }