示例#1
0
        public App()
        {
            try
            {
                try //Language
                {
                    L10n.SetLocale();
                    var netLanguage = DependencyService.Get <IMethods>().GetCurrent();
                    AppResources.Culture = new CultureInfo(netLanguage);
                }
                catch (Exception ex)
                {
                    var exception = ex.ToString();
                }

                InitializeComponent();

                SQL_Entity.Connect();

                var data = SQL_Commander.Get_Settings();

                if (data == "true")
                {
                    if (Settings.VimeoStyle)
                    {
                        var navigationPage = new NavigationPage(new MainTabbed_Page())
                        {
                        };
                        navigationPage.BarBackgroundColor = Color.FromHex(Settings.MainColor);
                        navigationPage.BarTextColor       = Color.FromHex("#ffff");
                        navigationPage.Title   = Settings.Application_Name;
                        navigationPage.Padding = new Thickness(0, 0, 0, 0);
                        Settings.YoutubeStyle  = false;
                        MainPage = navigationPage;
                    }

                    if (Settings.YoutubeStyle)
                    {
                        MainPage = new NavigationPage(new BottomTabbedPage());
                    }

                    //MainPage = new NavigationPage(new WalkthroughVariantPage());
                }
                else
                {
                    MainPage = new NavigationPage(new WalkthroughVariantPage());
                }
            }
            catch (Exception ex)
            {
                var exception = ex.ToString();
            }
        }
示例#2
0
        public App()
        {
            L10n.SetLocale();
            var netLanguage = DependencyService.Get <ILocale>().GetCurrent();

            AppResources.Culture = new CultureInfo(netLanguage);

            SQL_Entity.Connect();



            //Data.ClearLoginCredentialsList();
            var CredentialStatus = SQL_Commander.GetLoginCredentialsStatus();


            InitializeComponent();


            if (CredentialStatus == "Active")
            {
                var Credential = SQL_Commander.GetLoginCredentials("Active");
                Settings.Session          = Credential.Session;
                Settings.User_id          = Credential.UserID;
                Settings.Username         = Credential.Username;
                Settings.Onesignal_APP_ID = Credential.Onesignal_APP_ID;
                if (Credential.NotificationLedColor != "")
                {
                    Settings.NotificationVibrate      = Credential.NotificationVibrate;
                    Settings.NotificationSound        = Credential.NotificationSound;
                    Settings.NotificationPopup        = Credential.NotificationPopup;
                    Settings.NotificationLedColor     = Credential.NotificationLedColor;
                    Settings.NotificationLedColorName = Credential.NotificationLedColor;
                }
                else
                {
                    Credential.NotificationVibrate      = true;
                    Credential.NotificationLedColor     = Settings.MainColor;
                    Credential.NotificationLedColorName = AppResources.Label_Led_Color;
                    Credential.NotificationSound        = true;
                    Credential.NotificationPopup        = true;
                    SQL_Commander.UpdateLoginCredentials(Credential);
                    Settings.NotificationVibrate      = true;
                    Settings.NotificationSound        = true;
                    Settings.NotificationPopup        = true;
                    Settings.NotificationLedColor     = Settings.MainColor;
                    Settings.NotificationLedColorName = AppResources.Label_Led_Color;
                }


                //Start Onesignal
                OneSignalNotificationController.RegisterNotificationDevice();
                var navigationPage = new NavigationPage(new MasterMain())
                {
                };
                navigationPage.BarBackgroundColor = Color.FromHex(Settings.MainPage_HeaderBackround_Color);
                navigationPage.BarTextColor       = Color.FromHex(Settings.MainPage_HeaderText_Color);
                navigationPage.Title   = Settings.MainPage_HeaderTextLabel;
                navigationPage.Padding = new Thickness(0, 0, 0, 0);
                MainPage = navigationPage;
            }
            else
            {
                if (CredentialStatus == "Registered")
                {
                    var Credential = SQL_Commander.GetLoginCredentials("Registered");
                    Settings.Session  = Credential.Session;
                    Settings.User_id  = Credential.UserID;
                    Settings.Username = Credential.Username;
                    MainPage          = new NavigationPage(new UploudPicPage());
                }
                else
                {
                    MainPage = new NavigationPage(new WelcomePage());
                }
            }
        }