예제 #1
0
 private void hidebrowser(Form form_input)
 {
     PanelMain.Controls.Remove(form_input);
     if (!Properties.Settings.Default.FEnableFA)
     {
         frmface = new frmBrowserFacebook();
         Library.FacebookCefShutdow();
     }
 }
예제 #2
0
        public void changeBrowserControl(int int_inputNumIcon, string str_url)
        {
            switch (int_inputNumIcon)
            {
            case 0:
                Library.int_windows = 0;
                Library.EndFace     = false;
                hidebrowser(frmface);
                Library.str_url = string.Empty;
                frmmes.TopLevel = false;
                frmmes.Dock     = DockStyle.Fill;
                this.Invoke((MethodInvoker) delegate
                {
                    //perform on the UI thread
                    PanelMain.Controls.Add(frmmes);
                });
                frmmes.Show();
                painPanels(0, Color.DarkGray);
                break;

            case 1:
                Library.int_windows = 1;
                hidebrowser(frmmes);
                Library.str_url  = str_url;
                frmface.TopLevel = false;
                frmface.Dock     = DockStyle.Fill;

                if (this.InvokeRequired)
                {
                    this.Invoke((MethodInvoker) delegate
                    {
                        try
                        {
                            PanelMain.Controls.Add(frmface);
                            frmface.Show();
                            if (!string.IsNullOrEmpty(str_url))
                            {
                                Library.ChangeUrlFace(str_url);
                            }
                        }
                        catch
                        {
                            frmface.Close();
                            frmface          = new frmBrowserFacebook();
                            frmface.TopLevel = false;
                            frmface.Dock     = DockStyle.Fill;
                            PanelMain.Controls.Add(frmface);
                            frmface.Show();
                        }
                    });
                }
                else
                {
                    try
                    {
                        PanelMain.Controls.Add(frmface);
                        frmface.Show();
                        if (!string.IsNullOrEmpty(str_url))
                        {
                            Library.ChangeUrlFace(str_url);
                        }
                    }
                    catch
                    {
                        frmface.Close();
                        frmface          = new frmBrowserFacebook();
                        frmface.TopLevel = false;
                        frmface.Dock     = DockStyle.Fill;
                        PanelMain.Controls.Add(frmface);
                        frmface.Show();
                    }
                }
                painPanels(1, Color.DarkGray);
                break;

            default:
                break;
            }
        }