コード例 #1
0
        static void Main()
        {
            CefSharp.WinForms.CefSettings settings = new CefSharp.WinForms.CefSettings();
            settings.CefCommandLineArgs.Add("enable-media-stream", "1");
            settings.CachePath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\CEF";
            settings.DisableGpuAcceleration();


            var _webViewSettings = new CefSettings();

            _webViewSettings.UserAgent = string.Format(
                "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/{0} Mobile Safari/537.36", Cef.ChromiumVersion);
            Cef.Initialize(settings);

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            AppContainer container = new AppContainer();

            container.Tabs.Add(
                new TitleBarTab(container)
            {
                Content = new Main_Tab
                {
                    Text = "New Tab",
                    Icon = new Icon("DefaultIcon.ico")
                }
            }
                );
            container.SelectedTabIndex = 0;
            TitleBarTabsApplicationContext applicationContext = new TitleBarTabsApplicationContext();

            applicationContext.Start(container);
            Application.Run(applicationContext);
        }
コード例 #2
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Form2 testApp = new Form2();



            testApp.Tabs.Add(

                new TitleBarTab(testApp)

            {
                Content = new Form1

                {
                    Text = "New Tab"
                }
            });

            testApp.SelectedTabIndex = 0;



            TitleBarTabsApplicationContext applicationContext = new TitleBarTabsApplicationContext();

            applicationContext.Start(testApp);



            Application.Run(applicationContext);
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: ferhatYeailyurt/ChromeApp
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            AppContainer container = new AppContainer();

            //add init tab
            container.Tabs.Add(
                new TitleBarTab(container)
            {
                Content = new Form1
                {
                    Text = "Yeni Sekme"
                }
            }
                );
            //set intail tab
            container.SelectedTabIndex = 0;



            //create tab

            TitleBarTabsApplicationContext applicaitonContext = new TitleBarTabsApplicationContext();

            applicaitonContext.Start(container);

            Application.Run(applicaitonContext);
        }
コード例 #4
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            NewTab newTab = new NewTab();

            // Thêm Tab ban đầu
            newTab.Tabs.Add(
                // Tab Đầu tiên của chúng tôi được tạo theo mặc định trong Ứng dụng sẽ có nội dung là Form
                new TitleBarTab(newTab)
            {
                Content = new MainBrowser
                {
                    Text = "New Tab"
                }
            }
                );

            // Đặt tab đầu tiên là tab đầu tiên
            newTab.SelectedTabIndex = 0;

            // Tạo tab và khởi động ứng dụng
            TitleBarTabsApplicationContext applicationContext = new TitleBarTabsApplicationContext();

            applicationContext.Start(newTab);
            Application.Run(applicationContext);
            //Application.Run(new NewTab());
        }
コード例 #5
0
        static void Main()
        {
            //Application.EnableVisualStyles();
            //Application.SetCompatibleTextRenderingDefault(false);
            //Application.Run(new AppForm());

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            AppForm appForm = new AppForm();

            appForm.Tabs.Add(
                new TitleBarTab(appForm)
            {
                Content = new SeleniumExcelAddIn.AdvancedWebBrowser.AdvancedWebBrowserForm()
                {
                    Text = "New Tab"
                }
            });

            appForm.SelectedTabIndex = 0;

            TitleBarTabsApplicationContext applicationContext = new TitleBarTabsApplicationContext();

            applicationContext.Start(appForm);

            Application.Run(applicationContext);
        }
コード例 #6
0
ファイル: Program.cs プロジェクト: Akagra-Mish/Swoop-Desktop
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            AppContainer container = new AppContainer();

            // Add the initial Tab
            container.Tabs.Add(
                // Our First Tab created by default in the Application will have as content the Form1
                new TitleBarTab(container)
            {
                Content = new frmBrowser
                {
                    Text = "New Tab"
                }
            }
                );

            // Set initial tab the first one
            container.SelectedTabIndex = 0;

            // Create tabs and start application
            TitleBarTabsApplicationContext applicationContext = new TitleBarTabsApplicationContext();

            applicationContext.Start(container);
            Application.Run(applicationContext);
        }
コード例 #7
0
        private void btn_login_Click(object sender, EventArgs e)
        {
            projectEntities db         = new projectEntities();
            var             logincheck = db.Users.Where(d => d.Username == textBox1.Text && d.Password == txt_password.Text).SingleOrDefault();

            // if (textBox1.Text == "Admin" && txt_password.Text == "12345")
            if (logincheck != null)

            {
                AppContainer container = new AppContainer();
                // add itiail tab
                container.Tabs.Add(
                    new TitleBarTab(container)
                {
                    Content = new dashboard
                    {
                        Text = "الصفحة الرئيسية"
                    }
                });
                container.SelectedTabIndex = 0;
                TitleBarTabsApplicationContext applicationContext = new TitleBarTabsApplicationContext();
                applicationContext.Start(container);


                container.Show();
            }

            else
            {
                MessageBox.Show("يجب إدخال اسم المستخدم وكلمة المرور بطريقة صحيحية");
            }
        }
コード例 #8
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            //Application.Run(new frmMain());

            BrowserForm container = new BrowserForm();

            //adds tab
            container.Tabs.Add(
                new EasyTabs.TitleBarTab(container)
            {
                Content = new MainForm
                {
                    Text = "New Tab", Icon = Properties.Resources.TabIcon
                }
            });
            container.SelectedTabIndex = 0;
            //TitleBarTabsApplicaionContext applicaionContext = new TitleBarTabsApplicaionContext();

            //applicaionContext.Start(container);
            //Application.Run(applicaionContext);

            TitleBarTabsApplicationContext applicationContext = new TitleBarTabsApplicationContext();

            applicationContext.Start(container);
            Application.Run(applicationContext);
        }
コード例 #9
0
        static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            //Application.Run(new AppForm());

            Log.Logger.Debug("STATR");
            ToolStripManager.Renderer = new CustomToolStripRenderer(SystemColors.Control);

            AppForm appForm = new AppForm();

            appForm.Tabs.Add(
                new TitleBarTab(appForm)
            {
                Content = new AppChildForm()
                {
                    Text = "New Tab"
                }
            });

            appForm.SelectedTabIndex = 0;

            TitleBarTabsApplicationContext applicationContext = new TitleBarTabsApplicationContext();

            applicationContext.Start(appForm);

            Application.Run(applicationContext);
            //           var app = new App();
            //           app.Run(args);
        }
コード例 #10
0
        private void button1_Click_1(object sender, EventArgs e)
        {
            if (txt_username.Text == "Admin" && txt_password.Text == "12345")
            {
                AppContainer container = new AppContainer();
                // add itiail tab
                container.Tabs.Add(
                    new TitleBarTab(container)
                {
                    Content = new Dashboard
                    {
                        Text = "الصفحة الرئيسية"
                    }
                });
                container.SelectedTabIndex = 0;
                TitleBarTabsApplicationContext applicationContext = new TitleBarTabsApplicationContext();
                applicationContext.Start(container);
                //this.Hide();
                //  this.Visible = false;
                //  this.Close();
                this.Hide();

                container.Show();
                //this.Close();
            }

            else
            {
                MessageBox.Show("يجب إدخال اسم المستخدم وكلمة المرور بطريقة صحيحية");
            }
        }
コード例 #11
0
ファイル: EasyConnect.cs プロジェクト: xydoublez/EasyConnect
        private static void Main()
        {
            string[] arguments     = Environment.GetCommandLineArgs();
            string   openHistory   = arguments.FirstOrDefault((string s) => s.StartsWith("/openHistory:"));
            string   openBookmarks = arguments.FirstOrDefault((string s) => s.StartsWith("/openBookmarks:"));
            Guid     historyGuid   = Guid.Empty;

            Guid[] bookmarkGuids = null;

            // If a history GUID was passed in on the command line
            if (openHistory != null)
            {
                historyGuid = new Guid(openHistory.Substring(openHistory.IndexOf(":", StringComparison.Ordinal) + 1));

                List <Process> existingProcesses = new List <Process>(Process.GetProcessesByName("EasyConnect"));

                if (existingProcesses.Count == 0)
                {
                    existingProcesses.AddRange(Process.GetProcessesByName("EasyConnect.vshost"));
                }

                // If a process is already open, call the method in its IPC channel to tell it to open the given history entry and then exit this process
                if (existingProcesses.Count > 1)
                {
                    IpcChannel ipcChannel = new IpcChannel("EasyConnectClient");
                    ChannelServices.RegisterChannel(ipcChannel, false);

                    HistoryMethods historyMethods = (HistoryMethods)Activator.GetObject(typeof(HistoryMethods), "ipc://EasyConnect/HistoryMethods");
                    historyMethods.OpenToHistoryGuid(historyGuid);

                    return;
                }
            }

            // If the user is trying to open bookmarks via the command line
            else if (openBookmarks != null)
            {
                string bookmarks = openBookmarks.Substring(openBookmarks.IndexOf(":", StringComparison.Ordinal) + 1);
                bookmarkGuids = (from bookmark in bookmarks.Split(',')
                                 where !String.IsNullOrEmpty(bookmark)
                                 select new Guid(bookmark)).ToArray();
            }

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            MainForm mainForm = new MainForm(bookmarkGuids)
            {
                OpenToHistory = historyGuid
            };

            TitleBarTabsApplicationContext applicationContext = new TitleBarTabsApplicationContext();

            applicationContext.Start(mainForm);

            Application.Run(applicationContext);
        }
コード例 #12
0
ファイル: EasyConnect.cs プロジェクト: WildGenie/EasyConnect
        private static void Main()
        {
            string[] arguments = Environment.GetCommandLineArgs();
            string openHistory = arguments.FirstOrDefault((string s) => s.StartsWith("/openHistory:"));
            string openBookmarks = arguments.FirstOrDefault((string s) => s.StartsWith("/openBookmarks:"));
            Guid historyGuid = Guid.Empty;
            Guid[] bookmarkGuids = null;

            // If a history GUID was passed in on the command line
            if (openHistory != null)
            {
                historyGuid = new Guid(openHistory.Substring(openHistory.IndexOf(":", StringComparison.Ordinal) + 1));

                List<Process> existingProcesses = new List<Process>(Process.GetProcessesByName("EasyConnect"));

                if (existingProcesses.Count == 0)
                    existingProcesses.AddRange(Process.GetProcessesByName("EasyConnect.vshost"));

                // If a process is already open, call the method in its IPC channel to tell it to open the given history entry and then exit this process
                if (existingProcesses.Count > 1)
                {
                    IpcChannel ipcChannel = new IpcChannel("EasyConnectClient");
                    ChannelServices.RegisterChannel(ipcChannel, false);

                    HistoryMethods historyMethods = (HistoryMethods) Activator.GetObject(typeof (HistoryMethods), "ipc://EasyConnect/HistoryMethods");
                    historyMethods.OpenToHistoryGuid(historyGuid);

                    return;
                }
            }

                // If the user is trying to open bookmarks via the command line
            else if (openBookmarks != null)
            {
                string bookmarks = openBookmarks.Substring(openBookmarks.IndexOf(":", StringComparison.Ordinal) + 1);
                bookmarkGuids = (from bookmark in bookmarks.Split(',')
                                 where !String.IsNullOrEmpty(bookmark)
                                 select new Guid(bookmark)).ToArray();
            }

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            MainForm mainForm = new MainForm(bookmarkGuids)
                                    {
                                        OpenToHistory = historyGuid
                                    };

            TitleBarTabsApplicationContext applicationContext = new TitleBarTabsApplicationContext();
            applicationContext.Start(mainForm);

            Application.Run(applicationContext);
        }
コード例 #13
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            TabService tabService = new TabService();

            tabService.InitialTab();

            TitleBarTabsApplicationContext applicationContext = new TitleBarTabsApplicationContext();

            applicationContext.Start(tabService.AppContainer);
            Application.Run(applicationContext);
        }
コード例 #14
0
ファイル: Program.cs プロジェクト: amaitland/EasyTabs
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            TestApp testApp = new TestApp();

            //Display Welcome To EasyTabs in the default browser
            testApp.AddNewTab("data:text/html,%3Ch1%3EWelcome%20to%20EasyTabs!%3C%2Fh1%3E");
            testApp.SelectedTabIndex = 0;

            TitleBarTabsApplicationContext applicationContext = new TitleBarTabsApplicationContext();

            applicationContext.Start(testApp);

            Application.Run(applicationContext);
        }
コード例 #15
0
        private void lblLoaded_TextChanged(object sender, EventArgs e)
        {
            tabbedApp.Tabs.Add(new TitleBarTab(tabbedApp)
            {
                Content = new CcBibleSearch
                {
                    Text = "Bible Search"
                }
            });
            tabbedApp.SelectedTabIndex = 0;

            TitleBarTabsApplicationContext applicationContext = new TitleBarTabsApplicationContext();

            applicationContext.Start(tabbedApp);

            this.Hide();
        }
コード例 #16
0
        private void Button1_Click(object sender, EventArgs e)
        {
            tabbedApp.Tabs.Add(new TitleBarTab(tabbedApp)
            {
                Content = new Form1
                {
                    Text = "New Tab"
                }
            });
            tabbedApp.SelectedTabIndex = 0;

            TitleBarTabsApplicationContext applicationContext = new TitleBarTabsApplicationContext();

            applicationContext.Start(tabbedApp);

            this.Hide();
        }
コード例 #17
0
ファイル: Login.cs プロジェクト: ahmetcanaydemir/Herbarium
        private void DoLogin()
        {
            if (!(cboxKadi.SelectedItem is user))
            {
                return;
            }
            user user = (user)cboxKadi.SelectedItem;

            if (user == null)
            {
                throw new Exception("Kullanıcı bulunamadı");
            }

            var sifre = user.password;

            if (sifre != txtSifre.Text)
            {
                ShowMessage.Warning("Şifre yanlış.");
                Log.Warning("[Yanlış Şifre]: " + user.name, $"{user.name} isimli kullanıcı {DateTime.Now.ToString()} tarihinde yanlış şifre ile giriş yapmaya çalıştı.");

                return;
            }
            user.lastlogin = DateTime.Now;
            new UserBLL().Guncelle(user);
            UserBLL.ActiveUser = user;

            MainForm ana = new MainForm
            {
                Text = "Yönetim Paneli"
            };

            tabbedApp.Tabs.Add(new TitleBarTab(tabbedApp)
            {
                Content         = ana,
                ShowCloseButton = false
            });
            tabbedApp.SelectedTabIndex = 0;
            Forms.Container.MainForm   = ana;

            ApplicationContext = new TitleBarTabsApplicationContext();
            ApplicationContext.Start(tabbedApp);

            this.Hide();
            //ana.Show();
            txtSifre.Text = string.Empty;
        }
コード例 #18
0
ファイル: Program.cs プロジェクト: xmuyulab/DiaNN
        static void Main()
        {
            var culture = System.Globalization.CultureInfo.CreateSpecificCulture("en-US");

            System.Globalization.CultureInfo.DefaultThreadCurrentCulture   = culture;
            System.Globalization.CultureInfo.DefaultThreadCurrentUICulture = culture;
            System.Threading.Thread.CurrentThread.CurrentCulture           = culture;
            System.Threading.Thread.CurrentThread.CurrentUICulture         = culture;

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            AppContainer container = new AppContainer();

            string[] args = Environment.GetCommandLineArgs();
            if (args.Length > 1)
            {
                if (args[1].Contains(".pipeline"))
                {
                    pipeline_to_open = args[1];
                }
            }

            // Add the initial Tab
            container.Tabs.Add(
                // Our First Tab created by default in the Application will have as content the Form1
                new TitleBarTab(container)
            {
                Content = new Form1 {
                }
            }
                );
            pipeline_to_open = "";

            // Set initial tab the first one
            container.SelectedTabIndex = 0;

            // Create tabs and start application
            TitleBarTabsApplicationContext applicationContext = new TitleBarTabsApplicationContext();

            applicationContext.Start(container);

            Application.Run(applicationContext);
        }
コード例 #19
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            //Application.Run(new Frm_Main());
            Config.container = new AppContainer();
            AppContainer container = Config.container;
            TitleBarTab  tb        = new TitleBarTab(container);

            tb.Content         = new FrmBrowser(tb, string.Empty);
            tb.Content.Text    = "首页";
            tb.ShowCloseButton = false;//禁止关闭首页
            container.Tabs.Add(tb);
            container.SelectedTabIndex = 0;
            TitleBarTabsApplicationContext applicationContext = new TitleBarTabsApplicationContext();

            applicationContext.Start(container);
            Application.Run(applicationContext);
        }
コード例 #20
0
ファイル: Program.cs プロジェクト: raymond-1227/BasicBrowse
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            // Application.Run(new Main());
            AppContainer container = new AppContainer();

            container.Tabs.Add(new EasyTabs.TitleBarTab(container)
            {
                Content = new Main
                {
                    Text = "BasicBrowse"
                }
            });

            container.SelectedTabIndex = 0;
            TitleBarTabsApplicationContext applicationContext = new TitleBarTabsApplicationContext();

            applicationContext.Start(container);
            Application.Run(applicationContext);
        }
コード例 #21
0
ファイル: Program.cs プロジェクト: Foreverably/FireFox-Like
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            FireFox container = new FireFox();

            container.Tabs.Add(new EasyTabs.TitleBarTab(container)
            {
                Content = new Form1
                {
                    Text = "New Tab"
                }
            });

            container.SelectedTabIndex = 0;
            TitleBarTabsApplicationContext applicationContext = new TitleBarTabsApplicationContext();

            applicationContext.Start(container);
            Application.Run(applicationContext);
        }
コード例 #22
0
ファイル: Program.cs プロジェクト: KaziBora/Kivinjari
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            BbMainWindow kivinjari = new BbMainWindow();

            kivinjari.Tabs.Add(new TitleBarTab(kivinjari)
            {
                Content = new CcTabWindow("")
                {
                    Text = "New Tab"
                }
            });
            kivinjari.SelectedTabIndex = 0;

            TitleBarTabsApplicationContext applicationContext = new TitleBarTabsApplicationContext();

            applicationContext.Start(kivinjari);

            Application.Run(applicationContext);
        }
コード例 #23
0
ファイル: Program.cs プロジェクト: rajeshwarn/EasyTabs
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            TestApp testApp = new TestApp();

            testApp.Tabs.Add(
                new TitleBarTab(testApp)
                    {
                        Content = new TabWindow
                                      {
                                          Text = "New Tab"
                                      }
                    });
            testApp.SelectedTabIndex = 0;

            TitleBarTabsApplicationContext applicationContext = new TitleBarTabsApplicationContext();
            applicationContext.Start(testApp);

            Application.Run(applicationContext);
        }
コード例 #24
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            tabbedApp = new AppTabs();
            tabbedApp.Tabs.Add(new TitleBarTab(tabbedApp)
            {
                Content = new AaSongBook {
                    Text = "vSongBook Search"
                }
            });

            tabbedApp.SelectedTabIndex = 0;

            TitleBarTabsApplicationContext applicationContext = new TitleBarTabsApplicationContext();

            applicationContext.Start(tabbedApp);

            Application.Run(applicationContext);

            //Application.Run(new EeSettings());
        }
コード例 #25
0
ファイル: AppStart.cs プロジェクト: Ryggs/vSongBook-Windows
        private void lblLoaded_TextChanged(object sender, EventArgs e)
        {
            /*if (settings.ShowHelpFirst)
             * {
             *  tabbedApp.Tabs.Add(new TitleBarTab(tabbedApp)
             *  {
             *      Content = new BbTutorial { Text = "Welcome to vSongBook" }
             *  });
             * }*/
            tabbedApp.Tabs.Add(new TitleBarTab(tabbedApp)
            {
                Content = new CcSongView {
                    Text = "Song Search 1"
                }
            });
            tabbedApp.SelectedTabIndex = 0;

            TitleBarTabsApplicationContext applicationContext = new TitleBarTabsApplicationContext();

            applicationContext.Start(tabbedApp);
            tmrTabs.Enabled = true;
            this.Hide();
        }
コード例 #26
0
ファイル: Program.cs プロジェクト: HaseebUllahAbbasi/C_Sharp
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            //Application.Run(new App_Container());

            App_Container container = new App_Container();

            container.Tabs.Add(
                new TitleBarTab(container)
            {
                Content = new check_browser
                {
                    Text = "New Tab"
                }
            }
                );

            TitleBarTabsApplicationContext applicationContext = new TitleBarTabsApplicationContext();

            applicationContext.Start(container);
            Application.Run(applicationContext);
        }
コード例 #27
0
ファイル: Program.cs プロジェクト: cygnus-project/DenebStudio
 static void Main()
 {
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     Application.Run(new ProjectSelector());
     //Application.Run(new ProjectCreator());
     container = new AppContainer();
     if (launch)
     {
         container.Tabs.Add(new EasyTabs.TitleBarTab(container)
         {
             Content = new DenebStudio
             {
                 Text = "Deneb Studio",
                 Icon = Icon.FromHandle(Properties.Resources.EditIcon.GetHicon())
             }
         });
         container.SelectedTabIndex = 0;
         TitleBarTabsApplicationContext applicationContext = new TitleBarTabsApplicationContext();
         applicationContext.Start(container);
         Application.Run(applicationContext);
     }
 }
コード例 #28
0
ファイル: Program.cs プロジェクト: Valinwolf/Sibor
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            Sibor Sibor = new Sibor();

            Sibor.Tabs.Add(
                new TitleBarTab(Sibor)
            {
                Content = new TabWindow
                {
                    Text = "New Tab"
                }
            });
            Sibor.SelectedTabIndex = 0;

            TitleBarTabsApplicationContext applicationContext = new TitleBarTabsApplicationContext();

            applicationContext.Start(Sibor);

            Application.Run(applicationContext);
        }
コード例 #29
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            AppContanier contanier = new AppContanier();

            contanier.Tabs.Add(
                new TitleBarTab(contanier)
            {
                Content = new Form1
                {
                }
            });
            //set initial tab first one
            contanier.SelectedTabIndex = 0;

            //Create tabs and start aplication
            TitleBarTabsApplicationContext applicationContext = new TitleBarTabsApplicationContext();

            applicationContext.Start(contanier);
            Application.Run(applicationContext);
        }
コード例 #30
0
        static void Main(string[] args)
        {
            Application.EnableVisualStyles();

            if (args.Length > 0)
            {
                container.Tabs.Add(
                    new TitleBarTab(container)
                {
                    Content = new Main(args[0])
                    {
                        Text = "SSH Instance"
                    }
                }
                    );
            }
            else
            {
                container.Tabs.Add(
                    new TitleBarTab(container)
                {
                    Content = new Main {
                        Text = "SSH Instance"
                    }
                }
                    );
            }

            // Set initial tab the first one
            container.SelectedTabIndex = 0;

            // Create tabs and start application
            TitleBarTabsApplicationContext applicationContext = new TitleBarTabsApplicationContext();

            applicationContext.Start(container);
            Application.Run(applicationContext);
        }
コード例 #31
0
        private void btn_lgn_Click(object sender, EventArgs e)
        {
            var blusr = context.login_checks.FirstOrDefault();

            if (blusr != null)
            {
                bool checkus_required  = check_required(txt_usrname);
                bool check_pa_required = check_required(txt_password);
                if (checkus_required == false || check_pa_required == false)
                {
                    validation_library_cls_check = new validation_library_cls();
                    string msg = validation_library_cls_check.ErrorMessage(10);
                    span_required_filed.Text    = msg;
                    span_required_filed.Visible = true;
                }
                else
                {
                    span_required_filed.Visible = false;
                    span_required_filed.Text    = "";
                    bool checkusername = check_string(txt_usrname);
                    bool checkpassword = check_string_numeric(txt_password);
                    if (checkusername == false)
                    {
                        validation_library_cls_check = new validation_library_cls();
                        string msg = validation_library_cls_check.ErrorMessage(1);
                        span_us.Text    = msg;
                        span_us.Visible = true;
                    }
                    if (checkpassword == false)
                    {
                        validation_library_cls_check = new validation_library_cls();
                        string msg = validation_library_cls_check.ErrorMessage(11);
                        span_pa.Text    = msg;
                        span_pa.Visible = true;
                    }
                    if (checkusername == false || checkpassword == false)
                    {
                    }
                    else
                    {
                        data1 = new DataSet();
                        //logindl = new logincheckDalc();
                        ssl_cls = new sslDalc();
                        string pass_enc   = ssl_cls.Encrypt(txt_password.Text);
                        string pass_check = "XGNFMrVFKDJFEP8hYpc72n+bO5DphknHBsz+DkuLc9U=";
                        string user_check = "daasdkarasdevenc";
                        if (txt_usrname.Text == user_check && pass_enc == pass_check)
                        {
                            span_required_filed.Visible = false;
                            span_required_filed.Text    = "تم الدخول بنجاح";
                            span_required_filed.Visible = true;
                            Main ms = new Main();
                            ms.Show();
                        }
                        else
                        {
                            span_required_filed.Visible = false;
                            //logindl = new logincheckDalc();
                            var datas = context.login_checks.Where(lg => lg.logincheck_username == txt_usrname.Text && lg.logincheck_password == pass_enc).FirstOrDefault();
                            //data1 = logindl.getByusernameandpass(txt_usrname.Text, pass_enc);

                            if (datas == null)
                            {
                                span_required_filed.Visible = false;
                                span_required_filed.Text    = "لا يوجد أسم مستخدم أو كلمة مرور بهذا الأسم";
                                span_required_filed.Visible = true;
                                txt_usrname.Text            = "";
                                txt_password.Text           = "";
                            }
                            else
                            {
                                span_required_filed.Visible = false;
                                span_required_filed.Text    = "تم الدخول بنجاح";
                                span_required_filed.Visible = true;
                                this.Hide();


                                #region asd
                                AppContainer container = new AppContainer();

                                // Add the initial Tab
                                container.Tabs.Add(
                                    // Our First Tab created by default in the Application will have as content the Form1
                                    new TitleBarTab(container)
                                {
                                    Content = new Main
                                    {
                                        Text = "الرئيسية"
                                    }
                                }
                                    );

                                // Set initial tab the first one
                                container.SelectedTabIndex = 0;

                                // Create tabs and start application
                                TitleBarTabsApplicationContext applicationContext = new TitleBarTabsApplicationContext();

                                #endregion
                                //Main pp = new Main();
                                //pp.get_string_username = txt_usrname.Text;
                                //pp.get_action = 0;
                                // pp.ShowDialog();

                                //pp.Activate();
                                container.ShowDialog();
                                container.Activate();
                                this.Dispose();
                                this.Close();
                                //ms.Visible = true;
                            }
                        }
                    }
                }
            }
            else
            {
                addUsers user = new addUsers();
                user.ShowDialog();
                context = new ERBContext();
            }
        }
コード例 #32
0
ファイル: browser_application.cs プロジェクト: PlumpMath/surf
        static void Main(string[] args)
        {
            // subscribe to our wonderful exception handler
            AppDomain currentDomain = AppDomain.CurrentDomain;

            currentDomain.UnhandledException += new UnhandledExceptionEventHandler(MyHandler);

            // perform the directory check
            Surf.app.app_directory_checker.directoryCheck();

            // load the user settings
            app.user_settings.loadUserSettings();

            // enable Windows visual styles
            Application.EnableVisualStyles();

            // This is used for pre .Net 1.x controls, none of which we use.
            // If enabled, it forces the app to draw using GDI+.
            // GDI+ is the old way, GDI is the new way.
            // PERMANENT: False
            Application.SetCompatibleTextRenderingDefault(false);

            // prepare the new CefSharp settings

            var settings = new CefSettings
            {
                UserAgent             = app.product.userAgent,
                CachePath             = app.product.dirCache,
                BrowserSubprocessPath = "surf.exe",
            };

            // Not really sure if we need this, it seems
            // that CefSettings.CachePath also sets for
            // the cookies path.
            Cef.SetCookiePath(app.product.dirCache, true);

            // initialize CEF
            Cef.Initialize(settings);

            // prepare the new browser window
            Surf.browser.browser_main browserwindow = new Surf.browser.browser_main();

            // add a new tab to the browser window
            browserwindow.Tabs.Add(
                new TitleBarTab(browserwindow)
            {
                Content = new Surf.browser.tab_frame
                {
                    Text = "New Tab"
                }
            });
            browserwindow.SelectedTabIndex = 0;

            // get the size from our settings.
            browserwindow.Size     = new System.Drawing.Size(app.user_settings.window_width, app.user_settings.window_height);
            browserwindow.Location = new System.Drawing.Point(user_settings.window_left, user_settings.window_top);

            // Checks if we should maximize the window or not.
            // How was it set in the settings?
            if (app.user_settings.window_maximized == true)
            {
                browserwindow.WindowState = FormWindowState.Maximized;
            }
            else
            {
                browserwindow.WindowState = FormWindowState.Normal;
            }

            // prepare the TabRenderer
            TitleBarTabsApplicationContext applicationContext = new TitleBarTabsApplicationContext();

            applicationContext.Start(browserwindow);

            // start the browser!
            Application.Run(applicationContext);
        } //void Main