Exemple #1
0
 public void OnLoad()
 {
     if (!string.IsNullOrWhiteSpace(Title))
     {
         AppearanceManager.SetWindowTitle(this, this.Title);
     }
     ShiftOS.Engine.AudioManager.PlayStream(Properties.Resources.infobox);
 }
Exemple #2
0
 private void rtbchat_TextChanged(object sender, EventArgs e)
 {
     rtbchat.SelectionStart = rtbchat.Text.Length;
     rtbchat.ScrollToCaret();
     tschatid.Text = ChatID;
     AppearanceManager.SetWindowTitle(this, tschatid.Text + " - SimpleSRC Client");
     tsuserdata.Text = $"{SaveSystem.CurrentUser.Username}@{SaveSystem.CurrentSave.SystemName}";
     RefreshUserInput();
 }
Exemple #3
0
        public void OnSkinLoad()
        {
            if (!string.IsNullOrWhiteSpace(Title))
            {
                AppearanceManager.SetWindowTitle(this, this.Title);
            }

            int top = btnok.Top;

            btnok.CenterParent();
            btnyes.Parent.CenterParent();
            btnok.Top         = top;
            btnyes.Parent.Top = top;
        }
Exemple #4
0
        public void NavigateToUrl(string url)
        {
            txturl.Text = url;
            try
            {
                foreach (var type in Array.FindAll(ReflectMan.Types, t => t.GetInterfaces().Contains(typeof(IShiftnetSite)) && t.BaseType == typeof(UserControl) && Shiftorium.UpgradeAttributesUnlocked(t)))
                {
                    var attribute = type.GetCustomAttributes(false).FirstOrDefault(x => x is ShiftnetSiteAttribute && (x as ShiftnetSiteAttribute).Url == url) as ShiftnetSiteAttribute;
                    if (attribute != null)
                    {
                        var obj = (IShiftnetSite)Activator.CreateInstance(type, null);
                        obj.GoToUrl += (u) =>
                        {
                            History.Push(CurrentUrl);
                            NavigateToUrl(u);
                        };
                        obj.GoBack += () =>
                        {
                            string u = History.Pop();
                            Future.Push(u);
                            NavigateToUrl(u);
                        };
                        CurrentPage = obj;
                        this.pnlcanvas.Controls.Clear();
                        this.pnlcanvas.Controls.Add((UserControl)obj);
                        ((UserControl)obj).Show();
                        ((UserControl)obj).Dock = DockStyle.Fill;
                        obj.OnUpgrade();
                        obj.OnSkinLoad();
                        obj.Setup();
                        AppearanceManager.SetWindowTitle(this, attribute.Name + " - Shiftnet");
                        return;
                    }
                }
            }
            catch (Exception ex)
            {
                pnlcanvas.Controls.Clear();
                var tlbl = new Label();
                tlbl.Text     = "Server error in \"" + url + "\" application.";
                tlbl.Tag      = "header1";
                tlbl.AutoSize = true;
                tlbl.Location = new Point(10, 10);
                tlbl.Dock     = DockStyle.Top;
                pnlcanvas.Controls.Add(tlbl);
                tlbl.Show();

                var crash = new Label();
                crash.Dock     = DockStyle.Fill;
                crash.AutoSize = false;
                crash.Text     = ex.ToString();
                pnlcanvas.Controls.Add(crash);
                crash.Show();
                crash.BringToFront();
                ControlManager.SetupControls(pnlcanvas);
                return;
            }
            pnlcanvas.Controls.Clear();
            var lbl = new Label();

            lbl.Text     = "Page not found!";
            lbl.Tag      = "header1";
            lbl.AutoSize = true;
            lbl.Location = new Point(10, 10);
            pnlcanvas.Controls.Add(lbl);
            lbl.Show();
        }
Exemple #5
0
 private void wbmain_Navigated(object sender, WebBrowserNavigatedEventArgs e)
 {
     txturl.Text = wbmain.Url.ToString();
     AppearanceManager.SetWindowTitle(this, wbmain.DocumentTitle + " - " + NameChangerBackend.GetNameRaw(this.GetType()));
 }