Ejemplo n.º 1
0
        /// <summary>
        /// A lancer en premier dans le démarrage de l'application
        /// </summary>
        /// <param name="full">true si l'application est lancé en mode complet ou mode arrière plan</param>
        /// <param name="fichier">le fichier à ouvrir si différent de celui présent dans roaming</param>
        /// <returns></returns>
        public static async Task Initialize(bool full, StorageFile fichier)
        {
            if (full)
            {
                ChargerIcones();
                await IconeBusiness.Load();

                IconeBusiness.AddIconToIconAppli();
                DossierMere = new Dossier {
                    Titre = ResourceLoader.GetForCurrentView().GetString("phraseRacine")
                };
                ImageUnlockBusiness.Init();
            }
            else
            {
                DossierMere = new Dossier {
                    Titre = "Root"
                };
            }

            if (fichier != null)
            {
                if (StringUtils.GetExtension(fichier.Name) != ContexteStatic.Extension)
                {
                    fichier = null;
                }
            }
            IsFichierRoamingOuvert = fichier == null;
            PasswordBusiness.Init(fichier);
            ParamBusiness.Init();
            await ParamBusiness.Load(full);

            CortanaBusiness.Init();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// init
        /// </summary>
        /// <returns></returns>
        public sealed override async Task InitializeAsync()
        {
            _paramBusiness = new ParamBusiness();
            await _paramBusiness.Initialization;

            ListeLangues = new ObservableCollection <ListeLangues.LanguesStruct>(SimplyMovieWin10Shared.Strings.ListeLangues.GetListesLangues());
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Change la couleur de l'application
        /// </summary>
        /// <param name="solidColor">la nouvelle couleur</param>
        /// <returns>la task</returns>
        public async Task ChangeCouleur(SolidColorBrush solidColor)
        {
            var color =
                (uint)
                ((solidColor.Color.A << 24) | (solidColor.Color.R << 16) | (solidColor.Color.G << 8) |
                 (solidColor.Color.B << 0));

            ContexteAppli.IdCouleurTheme = ContexteStatic.ListeCouleur.IndexOf(color);
            await ParamBusiness.Save();
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Efface le fichier de mot de passe
        /// </summary>
        /// <returns></returns>
        public static async Task <bool> ReinitAppli()
        {
            //efface le fichier des mots de passes
            if (await PasswordBusiness.Delete() && await ParamBusiness.Delete() && await CortanaBusiness.DeletePassword())
            {
                await IconeBusiness.DeletelAll();

                await ImageUnlockBusiness.DeleteFile();

                await CortanaBusiness.UpdateCortana();
                await Initialize(true, null);

                return(true);
            }
            return(false);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Modifie l'activité de cortana (si activé, enregistre le mot de passe en le chiffrant, si déasctivé, supprime le mot de passe)
        /// </summary>
        public async Task ChangeCortana(bool value)
        {
            if (!_isPageStarting)
            {
                //changement du paramètre
                ContexteAppli.IsCortanaActive = value;
                await ParamBusiness.Save();

                if (ContexteAppli.IsCortanaActive)
                {
                    await CortanaBusiness.SavePassword();
                }
                else
                {
                    await CortanaBusiness.DeletePassword();
                }
            }
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Invoked when the application is launched normally by the end user.  Other entry points
        /// will be used such as when the application is launched to open a specific file.
        /// </summary>
        /// <param name="e">Details about the launch request and process.</param>
        protected override async void OnLaunched(LaunchActivatedEventArgs e)
        {
#if DEBUG
            if (System.Diagnostics.Debugger.IsAttached)
            {
                DebugSettings.EnableFrameRateCounter = true;
            }
#endif

            var rootFrame = Window.Current.Content as Frame;


            await ContexteAppli.Init(false);

            //chargement de la page d'acceuil
            rootFrame = new Frame();
            Window.Current.Content      = rootFrame;
            rootFrame.NavigationFailed += OnNavigationFailed;
            rootFrame.Navigated        += OnNavigated;

            SystemNavigationManager.GetForCurrentView().BackRequested += OnBackRequested;

            SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility =
                rootFrame.CanGoBack ?
                AppViewBackButtonVisibility.Visible :
                AppViewBackButtonVisibility.Collapsed;

            var paramBusiness = new ParamBusiness();
            await paramBusiness.Initialization;
            if (await paramBusiness.NeedUpdate())
            {
                rootFrame.Navigate(typeof(UpdateVersion));
                Window.Current.Activate();
            }
            else
            {
                OpenAppli();
            }
        }
Ejemplo n.º 7
0
 public UpdateVersion()
 {
     InitializeComponent();
     _paramBusiness = new ParamBusiness();
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Change la langue de l'application
 /// </summary>
 public async Task ChangeLangueApplication()
 {
     ListeLangues.ChangeLangueAppli(SelectedLangue);
     await ParamBusiness.Save();
 }