예제 #1
0
        public App()
        {
            if (config == null)
            {
                config = new Configuration();
                IPlatformInfo platformInfo = DependencyService.Get <IPlatformInfo>();
                CrossLogger.Current.Info("Kala", "Model: " + platformInfo.GetModel());
                CrossLogger.Current.Info("Kala", "Version: " + platformInfo.GetVersion());

                CrossLogger.Current.Debug("Kala", @"URL Settings: '" + Settings.Protocol + "://" + Settings.Server + ":" + Settings.Port.ToString() + "'");
                CrossLogger.Current.Debug("Kala", @"Auth Settings: '" + Settings.Username + " / " + Settings.Password + "'");
                CrossLogger.Current.Debug("Kala", @"Sitemap Settings: '" + Settings.Sitemap + "'");
            }
            ;

            //Initialize FFImageLoading with Authentication
            FFImageLoading.AuthenticatedHttpImageClientHandler.Initialize();

            //TabbedPage setup
            if (tp.Children.Count == 0)
            {
                tp.BackgroundColor    = App.config.BackGroundColor;
                tp.BarBackgroundColor = App.config.BackGroundColor;
                tp.BarTextColor       = App.config.TextColor;

                tp.CurrentPageChanged += (sender, e) =>
                {
                    //Reset screensaver timer
                    App.config.LastActivity = DateTime.Now;
                    CrossLogger.Current.Debug("Kala", "Reset Screensaver timer");
                };

                /**/ //Show a busy signal here as we can't display anything until we have downloaded the sitemap with its items. No async. Pointless..
                sitemaps = Sitemap.GetActiveSitemap(Settings.Sitemap);

                //Selected sitemap was not found, display settings page to make change
                if (sitemaps == null)
                {
                    //Add settings tab
                    MainPage = new Views.Page1();
                }
                else
                {
                    Sitemap sitemap = new Sitemap();
                    sitemap.GetUpdates();
                    sitemap.CreateSitemap(sitemaps);
                    CrossLogger.Current.Debug("Kala", "Got Sitemaps");

                    //Add settings tab last
                    App.tp.Children.Add(new Views.Page1());
                    MainPage = App.tp;
                }
            }
            else
            {
                MainPage = App.tp;
            }
            App.config.Initialized = true;
        }
예제 #2
0
        public Test3Page()
        {
            InitializeComponent();
            IPlatformInfo platformInfo = DependencyService.Get <IPlatformInfo>();

            modelLabel.Text   = platformInfo.GetModel();
            versionLabel.Text = platformInfo.GetVersion();
        }
예제 #3
0
        public MainPage()
        {
            InitializeComponent();

            IPlatformInfo platformInfo = DependencyService.Get <IPlatformInfo>();

            lDeviceModel.Text = platformInfo.GetModel();
            lVersion.Text     = platformInfo.GetVersion();
        }
예제 #4
0
        //CONSTRUCTEUR
        public Page2ViewModel()
        {
            //Recuperation des infos via l'ioc (Inversion of Control)
            Model   = platInfo?.GetModel();
            Version = platInfo?.GetVersion();

            InitCommand();

            //Boucle pour passer des Utilisateurs aux UtilisateursVM
            foreach (Utilisateur item in UtilisateurManager.GetFakeUtilisateurs())
            {
                ListeUsers.Add(new UtilisateurVM()
                {
                    NomUtilisateur = item.NomUtilisateur, Age = DateTime.Now.Year - item.DateDeNaissance.Year
                });
            }
        }
예제 #5
0
 public Page2ViewModel()
 {
     Model   = platInfo?.GetModel();
     Version = platInfo?.GetVersion();
 }
예제 #6
0
파일: App.cs 프로젝트: dragonxu/Kala
        public App()
        {
            if (Config == null)
            {
                Config = new Configuration();
                IPlatformInfo platformInfo = DependencyService.Get <IPlatformInfo>();
                CrossLogger.Current.Info("Kala", "Model: " + platformInfo.GetModel());
                CrossLogger.Current.Info("Kala", "Version: " + platformInfo.GetVersion());
                CrossLogger.Current.Info("Kala", "Wifi MAC address: " + platformInfo.GetWifiMacAddress());

                CrossLogger.Current.Debug("Kala", @"URL Settings: '" + Settings.Protocol + "://" + Settings.Server + ":" + Settings.Port.ToString() + "'");
                CrossLogger.Current.Debug("Kala", @"Auth Settings: '" + Settings.Username + " / " + Settings.Password + "'");
                CrossLogger.Current.Debug("Kala", @"Sitemap Settings: '" + Settings.Sitemap + "'");
            }

            //Initialize FFImageLoading with Authentication
            FFImageLoading.AuthenticatedHttpImageClientHandler.Initialize();

            //TabbedPage setup
            if (Tp.Children.Count == 0)
            {
                Tp.BackgroundColor    = Config.BackGroundColor;
                Tp.BarBackgroundColor = Config.BackGroundColor;
                Tp.BarTextColor       = Config.TextColor;

                Tp.CurrentPageChanged += (sender, e) =>
                {
                    //Reset screensaver timer
                    Config.LastActivity = DateTime.Now;
                    CrossLogger.Current.Debug("Kala", "Reset Screensaver timer");
                };

                //Auto configured sitemap?
                var WifiMac = DependencyService.Get <IPlatformInfo>().GetWifiMacAddress();
                Sitemaps = Sitemap.GetActiveSitemap(WifiMac);

                if (Sitemaps == null)
                {
                    Sitemaps = Sitemap.GetActiveSitemap(Settings.Sitemap);

                    //Selected sitemap was not found, display settings page to make change
                    if (Sitemaps == null)
                    {
                        //Add settings tab with Wifi Mac as default
                        Settings.Sitemap = WifiMac;
                        MainPage         = new Pages.Settings();
                    }
                }

                if (Sitemaps != null)
                {
                    Sitemap sitemap = new Sitemap();
                    sitemap.GetUpdates();
                    sitemap.CreateSitemap(Sitemaps);
                    CrossLogger.Current.Debug("Kala", "Got Sitemaps");

                    if (Config.Settings)
                    {
                        //Add settings tab last
                        Tp.Children.Add(new Pages.Settings());
                    }
                    MainPage = Tp;
                }
            }
            else
            {
                MainPage = Tp;
            }
            Config.Initialized = true;
        }