Exemple #1
0
        public void Execute()
        {
            layoutIO.WriteR3eLayout(placeholders.Items);
            layoutIO.DispatchSaveStatus();

            if (selectedProfile.Selection != null)
            {
                database.SaveLastProfilePref(selectedProfile.Selection.Id);
            }
        }
        public void Execute()
        {
            ProfileModel profile  = profileCollection.Get(args.Value);
            String       filePath = Path.Combine(location.LocalDirectoryProfiles, profile.FileName);

            if (profileSelection.Selection == profile)
            {
                profileSelection.SelectNone();
            }

            profileCollection.Remove(profile);
            database.DeleteProfile(profile);
            File.Delete(filePath);
            layoutIO.ProfileDeleted(profile);
            layoutIO.DispatchSaveStatus();
        }
        public void Execute()
        {
            if (profileSelection.Selection == null)
            {
                return;
            }

            ProfileModel    profile    = profileSelection.Selection;
            string          filePath   = Path.Combine(location.LocalDirectoryProfiles, profile.FileName);
            BackgroundModel background = screen.Background;

            profile.BackgroundId = background.Id;
            profile.MotecId      = assetFactory.SelectedMotec.Id;
            database.UpdateProfile(profile);
            layoutIO.WriteProfileLayout(profile, placeholderCollection.Items);
            layoutIO.DispatchSaveStatus();

            DispatchEvent(new ProfileEventArgs(EVENT_PROFILE_CHANGES_SAVED, profile));
        }
        public void Execute()
        {
            string fileName = ToFileName(args.Value);
            string filePath = Path.Combine(location.LocalDirectoryProfiles, fileName); // TODO tester les noms de fichier

            File.Copy(location.HudTemplateFile, filePath);

            BackgroundModel background = screen.Background;

            ProfileModel newProfile = ProfileFactory.NewProfileModel(args.Value, background.Id, fileName, assetsFactory.SelectedMotec.Id);

            layoutIO.WriteProfileLayout(newProfile, placeholderCollection.Items);

            database.AddProfile(newProfile);
            profileCollection.Add(newProfile);

            selectedProfile.SelectProfile(newProfile);
            layoutIO.DispatchSaveStatus();
        }
        public void Execute()
        {
            ProfileModel            profile      = profileCollection.Get(args.ItemId);
            List <PlaceholderModel> placeholders = layoutIO.LoadProfileLayout(profile);

            if (placeholders == null)
            {
                return;
            }
            // TODO gestion des erreurs, chargemetn de fichiers, bitmaps...
            BackgroundModel background = backgroundCollection.Get(profile.BackgroundId);

            selectionModel.Unselect();
            screen.SetBackground(background);
            placeholderCollection.Clear();
            placeholderCollection.AddRange(placeholders);
            assetFactory.SetMotec(motecCollection.Get(profile.MotecId));
            selectedProfile.SelectProfile(profile);
            layoutIO.DispatchSaveStatus();
        }
        public void Execute()
        {
            List <PlaceholderModel> placeholders = null;

            try
            {
                placeholders = layoutIO.LoadDefaultR3eLayout();
            }
            catch (Exception e)
            {
                MessageBox.Show("Error while parsing HUD xml file, application will exit.\n" + e.Message, "Error");
                Environment.Exit(0);
            }

            if (placeholders != null)
            {
                selectionModel.Unselect();
                selectedProfile.SelectNone();
                placeHolderCollection.Clear();
                placeHolderCollection.AddRange(placeholders);
                layoutIO.DispatchSaveStatus();
            }
        }