示例#1
0
 public static bool changeAppearance(ThemeAppearance newAppearance)
 {
     return(loadTheme(activeTheme, newAppearance));
 }
示例#2
0
 public ThemeAppearance GetRequestTheme(RequestContext controllerContext)
 {
     return(ThemeAppearance.New("Channel", "Default", "Default", string.Empty, string.Empty));
 }
示例#3
0
        private void onNavigating(object sender, WebNavigatingEventArgs e)
        {
            string current_url = HttpUtility.UrlDecode(e.Url);

            if (onNavigatingGlobal(current_url))
            {
                e.Cancel = true;
                return;
            }

            if (current_url.Equals("ixian:onload", StringComparison.Ordinal))
            {
                onLoad();
            }
            else if (current_url.Equals("ixian:back", StringComparison.Ordinal))
            {
                OnBackButtonPressed();
            }
            else if (current_url.Equals("ixian:error", StringComparison.Ordinal))
            {
                displaySpixiAlert(SpixiLocalization._SL("settings-emptynick-title"), SpixiLocalization._SL("settings-emptynick-text"), SpixiLocalization._SL("global-dialog-ok"));
            }
            else if (current_url.Equals("ixian:delete", StringComparison.Ordinal))
            {
                var lockPage = new LockPage(true);
                lockPage.authSucceeded += onDeleteWallet;
                Navigation.PushModalAsync(lockPage);
            }
            else if (current_url.Equals("ixian:deletea", StringComparison.Ordinal))
            {
                var lockPage = new LockPage(true);
                lockPage.authSucceeded += onDeleteAccount;
                Navigation.PushModalAsync(lockPage);
            }
            else if (current_url.Equals("ixian:deleteh", StringComparison.Ordinal))
            {
                onDeleteHistory();
            }
            else if (current_url.Equals("ixian:deleted", StringComparison.Ordinal))
            {
                onDeleteDownloads();
            }
            else if (current_url.Equals("ixian:backup", StringComparison.Ordinal))
            {
                Navigation.PushAsync(new BackupPage(), Config.defaultXamarinAnimations);
            }
            else if (current_url.Contains("ixian:save:"))
            {
                string[] split = current_url.Split(new string[] { "ixian:save:" }, StringSplitOptions.None);
                string   nick  = split[1];
                onSaveSettings(nick);
            }
            else if (current_url.Equals("ixian:avatar", StringComparison.Ordinal))
            {
#pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
                onChangeAvatarAsync(sender, e);
#pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
            }
            else if (current_url.Equals("ixian:remove", StringComparison.Ordinal))
            {
                onRemoveAvatar();
            }
            else if (current_url.StartsWith("ixian:language:", StringComparison.Ordinal))
            {
                string lang = current_url.Substring("ixian:language:".Length);
                if (SpixiLocalization.loadLanguage(lang))
                {
                    selectedLanguage = lang;
                    loadPage(webView, "settings.html");
                }
                else
                {
                    selectedLanguage = null;
                }
            }
            else if (current_url.StartsWith("ixian:lock:", StringComparison.Ordinal))
            {
                string status = current_url.Substring("ixian:lock:".Length);
                if (status.Equals("on", StringComparison.Ordinal))
                {
                    // Turn on lock
                    lockEnabled = true;
                }
                else
                {
                    // Turn off lock
                    // Show authentication screen
                    var lockPage = new LockPage(true);
                    lockPage.authSucceeded += HandleAuthSucceeded;
                    Navigation.PushModalAsync(lockPage);
                }
            }
            else if (current_url.StartsWith("ixian:appearance:", StringComparison.Ordinal))
            {
                string appearanceString = current_url.Substring("ixian:appearance:".Length);
                selectedAppearance = (ThemeAppearance)Convert.ToInt32(appearanceString);
            }
            else
            {
                // Otherwise it's just normal navigation
                e.Cancel = false;
                return;
            }
            e.Cancel = true;
        }