static void Main() { using (var appDuplicateChecker = new AppDuplicateChecker("CliboDone-c6839605-a231-4230-9bc8-48204cb13698")) { if (!appDuplicateChecker.Check()) { // 二重起動しているため終了 return; } FMain mainForm = null; try { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); mainForm = new FMain(); Application.Run(mainForm); } catch (Exception) { throw; } finally { // 正常終了または例外発生時に念のためフォームの破棄処理を実行する // ※フォーム内にアンマネージドリソースがあるため(クリップボードビューアの利用など)、確実に破棄を実施したい if (mainForm != null) { mainForm.Destroy(); } } } }
private void MainWindow_OnLoaded(object sender, RoutedEventArgs e) { _main = new Main(); _settings = new Settings(); _game = new Game(); _gameParams = new GameParams(); _main.GameParams = _gameParams; _main.Settings = _settings; _main.NewGameClick += ChangePage; _main.SettingsClick += ChangePage; _main.ExitClick += ExitClick; _settings.Main = _main; _settings.BackClick += ChangePage; _game.Main = _main; _game.ExitClick += ChangePage; _gameParams.Game = _game; _gameParams.Main = _main; _gameParams.ExitClick += ChangePage; _gameParams.StartClick += ChangePage; FMain.Navigate(_main); }
static void Main() { using (var appDuplicateChecker = new AppDuplicateChecker("GitHubAutoUpdater-c6839605-a231-4230-9bc8-48204cb13698")) { if (!appDuplicateChecker.Check()) { // 二重起動しているため終了 return; } FMain mainForm = null; try { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); mainForm = new FMain(); Application.Run(mainForm); } catch (Exception) { throw; } finally { // 正常終了または例外発生時に念のためフォームの破棄処理を実行する if (mainForm != null) { mainForm.Destroy(); } } } }
private void subpanels_MouseUp(object sender, MouseEventArgs e) { Panel This = (Panel)sender; if ((e.X < 0) || (e.X > This.Width) || (e.Y < 0) || (e.Y > This.Height)) { This.Tag = ""; This.Refresh(); } else { This.Tag = "Entered"; This.Refresh(); //Take Some Action now if (This.Name == "subPanel1") { System.Threading.Thread.CurrentThread.Name = "CXPClient UI"; //MSR.LST.ConferenceXP.FMain.arguments = ""; FMain frmVirtualClassroom = new FMain(); FMain.InvokeSettingsArguments(); frmVirtualClassroom.Show(); } } }
/// <summary> /// Constructor /// </summary> /// <param name="archiver"></param> public frmArchiveConf(IArchiveServer archiver, FMain refFMain) { InitializeComponent(); this.archiver = archiver; this.refFMain = refFMain; PopulateConferences(); }
public frmRecord(FMain refFMain) { // // Required for Windows Form Designer support // InitializeComponent(); this.refFMain = refFMain; }
Gui() { // These must happen before the first Form class Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Program.OnProgramEnd += Program_OnProgramEnd; winMain = new FMain(); dlgAbout = new FDlgAbout(); dlgAddHook = new FDlgAddHook(); dlgBrowsePID = new FDlgBrowsePID(); }
/// <summary>Constructs a new MyForm object with default attributes.</summary> public MyForm(FMain mainForm) : base() { this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.ControlBox = false; this.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.ForeColor = MyGUIs.Text.Normal.Color; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.drawFormAccent = true; this.mainForm = mainForm; }
private void ButSave_Click(object sender, EventArgs e) { if (receivedJetski == null) { Jetski jetski = new Jetski(); jetski.TypeName = TypeNames.jetski; EditJetski(jetski); FMain.AddVehicle(jetski); } else { EditJetski(receivedJetski); } Close(); }
private void ButSave_Click(object sender, EventArgs e) { if (receivedTruck == null) { Truck truck = new Truck(); truck.TypeName = TypeNames.truck; EditTruck(truck); FMain.AddVehicle(truck); } else { EditTruck(receivedTruck); } Close(); }
private void ButSave_Click(object sender, EventArgs e) { if (receivedAuto == null) { Auto auto = new Auto(); auto.TypeName = TypeNames.auto; EditAuto(auto); FMain.AddVehicle(auto); } else { EditAuto(receivedAuto); } Close(); }
private void ButSave_Click(object sender, EventArgs e) { if (receivedAirship == null) { Airship airship = new Airship(); airship.TypeName = TypeNames.airship; EditAirship(airship); FMain.AddVehicle(airship); } else { EditAirship(receivedAirship); } Close(); }
private void ButSave_Click(object sender, EventArgs e) { if (receivedYacht == null) { Yacht yacht = new Yacht(); yacht.TypeName = TypeNames.yacht; EditYacht(yacht); FMain.AddVehicle(yacht); } else { EditYacht(receivedYacht); } Close(); }
private void ButSave_Click(object sender, EventArgs e) { if (receivedPlane == null) { Plane plane = new Plane(); plane.TypeName = TypeNames.plane; EditPlane(plane); FMain.AddVehicle(plane); } else { EditPlane(receivedPlane); } Close(); }
public static void ZRunApplication() { var f = new FMain(); #if TRACE ATimer.After(1, _ => APerf.NW('P')); #endif if (!Program.Settings.runHidden || CommandLine.StartVisible) { Application.Run(f); } else { Application.Run(); } }
public frmArchiveClient(IArchiveServer archiver, ArchiveService.Conference conference, int[] streams, FMain refFMain, frmArchiveConf refFrmArchiveConf) { InitializeComponent(); // Duration of the current conference totalDuration = conference.End - conference.Start; sliderRange = tbPlayBack.Maximum - tbPlayBack.Minimum; ratioTickBySlider = totalDuration.Ticks / sliderRange; Streams = streams; this.archiver = archiver; this.conference = conference; this.refFMain = refFMain; this.refFrmArchiveConf = refFrmArchiveConf; }
public FAttributs(DataSet dsToDisplay, String tableName, FMain parent, bool canEdit) { // required for Windows Form Designer support InitializeComponent(); // the dataset allow adding value, and this functionality cannot be invalidated. // As we don't want to add value, but just modify the existing one, we create a dataset // to wrap around the selected table _dsView = new DataView(dsToDisplay.Tables[tableName]); _dsView.AllowDelete = false; _dsView.AllowNew = false; _dsView.AllowEdit = canEdit; _canEdit = canEdit; dgAttributs.DataSource = _dsView; dataGridTableStyleAttributs.MappingName = tableName; // event to handle the flag that indicate a change in the data _dsView.ListChanged += new System.ComponentModel.ListChangedEventHandler(OnListChanged); _parent = parent; }
static void Main() { if (ProcIsRunning()) { Application.Exit(); } var cultureInfo = System.Globalization.CultureInfo.CurrentCulture; var found = false; foreach (var lng in languages) { if (lng == cultureInfo.TwoLetterISOLanguageName) { found = true; lang = lng; res = new System.Resources.ResourceManager("OBSMidiRemote.lang." + cultureInfo.TwoLetterISOLanguageName, System.Reflection.Assembly.GetExecutingAssembly()); } } if (!found) { lang = "en"; res = new System.Resources.ResourceManager("OBSMidiRemote.lang.en", System.Reflection.Assembly.GetExecutingAssembly()); } string path = System.Reflection.Assembly.GetExecutingAssembly().Location; deviceMapDir = Path.Combine(Application.StartupPath, "devicemaps"); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); AppDomain.CurrentDomain.ProcessExit += new EventHandler(OnProcessExit); PrepareTray(); mainForm = new FMain(); Application.Run(mainForm); }
private void LoginAdmin() { DataTable read = cn.getDataTable("SELECT * FROM nhanvien WHERE username = '******' and passwordHash = '" + PublicFunction.EncodePassword(txtPassword.Text) + "' and active = 'true'"); if (read.Rows.Count > 0) { Session.idUser = int.Parse(read.Rows[0][0].ToString()); Session.ten = read.Rows[0][1].ToString(); Session.ngaysinh = read.Rows[0][2].ToString(); Session.sdt = read.Rows[0][3].ToString(); Session.quequan = read.Rows[0][5].ToString(); Session.username = read.Rows[0][6].ToString(); Session.quyen = read.Rows[0][9].ToString(); this.Hide(); FMain fMain = new FMain(); fMain.ShowDialog(); } else { lbLoginFailed.Text = "Tài khoản hoặc mật khẩu không đúng !"; } }
static void _Main(string[] args) { //Test(); return; //Process.GetCurrentProcess().ProcessorAffinity = (IntPtr)1; //test how works with 1 CPU //Task.Run(() => { while(true) { Thread.Sleep(1000); GC.Collect(); } }); if (CommandLine.OnProgramStarted(args)) { return; } OutputServer.NoNewline = true; OutputServer.Start(); Api.SetErrorMode(Api.GetErrorMode() | Api.SEM_FAILCRITICALERRORS); //disable some error message boxes, eg when removable media not found; MSDN recommends too. Api.SetSearchPathMode(Api.BASE_SEARCH_PATH_ENABLE_SAFE_SEARCHMODE); //let SearchPath search in current directory after system directories //Application.SetHighDpiMode(HighDpiMode.SystemAware); //no, we have manifest //Application.EnableVisualStyles(); //no, we have manifest Application.SetCompatibleTextRenderingDefault(false); Settings = ProgramSettings.Load(); UserGuid = Settings.user; if (UserGuid == null) { Settings.user = UserGuid = Guid.NewGuid().ToString(); } ATimer.Every(1000, t => _TimerProc(t)); //note: timer can make Process Hacker/Explorer show CPU usage, even if we do nothing. Eg 0.02 if 250, 0.01 if 500, <0.01 if 1000. //Timer1s += () => AOutput.Write("1 s"); //Timer1sOr025s += () => AOutput.Write("0.25 s"); FMain.ZRunApplication(); OutputServer.Stop(); }
private void iconButton4_Click(object sender, EventArgs e) { FMain fm = new FMain(); fm.button7_Click(this, EventArgs.Empty); }
static void Main(string[] args) { traceFile = Environment.GetFolderPath( Environment.SpecialFolder.DesktopDirectory) + traceFile; Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); Application.ThreadException += new ThreadExceptionEventHandler(Application_ThreadException); //Application.DoEvents(); try { string filename = null; foreach (string s in args) { switch (s.ToLower()) { case "debug": { Trace.WriteLine("Debug was entered from command-line."); if (System.IO.File.Exists(traceFile)) { System.IO.File.Delete(traceFile); } Trace.WriteLine("Creating file listener."); listener = new TextWriterTraceListener(traceFile); Debug.Listeners.Add(listener); Debug.AutoFlush = true; Trace.AutoFlush = true; Trace.WriteLine("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"); Trace.WriteLine(""); Trace.WriteLine("Allberg WinShooter started on " + System.DateTime.Now); System.Version ver = Assembly.GetExecutingAssembly().GetName().Version; Trace.Write("Version: " + ver.Major.ToString() + "." + ver.Minor.ToString() + "." + ver.Build.ToString() + "." + ver.Revision.ToString()); #if DEBUG Trace.WriteLine(" Beta"); #else Trace.WriteLine(""); #endif Trace.WriteLine("Thread: " + Thread.CurrentThread.ManagedThreadId.ToString()); System.OperatingSystem os = Environment.OSVersion; Trace.WriteLine("OS Platform: " + os.Platform.ToString()); Trace.WriteLine("OS Version: " + os.Version.ToString()); Trace.WriteLine(""); Trace.WriteLine("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"); Trace.WriteLine("Done."); break; } default: { if (s.ToLower().StartsWith("/u=")) { string guid = s.Split('=')[1]; string path = Environment.GetFolderPath(System.Environment.SpecialFolder.System); string str = path + "\\msiexec.exe"; ProcessStartInfo pi = new ProcessStartInfo(str); pi.Arguments = "/i " + guid; pi.UseShellExecute = false; Process.Start(pi); return; } else if (System.IO.File.Exists(s)) { filename = s; } else { Trace.WriteLine("Unknown argument: \"" + s + "\""); } break; } } } // Start application app = new FMain(filename); Application.Run(app); } catch (System.ObjectDisposedException) { // This occurs when disposing self } catch (Exception exc) { handleUnhandledException(exc); } }
private void ChangePage(object sender, MyArgs myArgs) => FMain.Navigate(myArgs.IsUri ? myArgs.Uri : myArgs.Root);
internal SDCommunication([NotNull] FMain mainForm) { _server = new SDEditorServer(this); _client = new SDEditorClient(this); _mainForm = mainForm; }
private static void OnAppIdle(object sender, EventArgs e) { if (applicationContext.MainForm == null) { Application.Idle -= new EventHandler(OnAppIdle); // 初始化ApplicationService.Current Service.ApplicationService.Current(); System.Threading.Thread threadDb = new System.Threading.Thread( new System.Threading.ThreadStart(TryConnectDB)); threadDb.Start(); try { if (System.Configuration.ConfigurationSettings.AppSettings["NTier"] != null && System.Configuration.ConfigurationSettings.AppSettings["NTier"] == "1") { RemotingConfiguration.Configure("BenQGuru.eMES.Client.exe.config"); } } catch (Exception ex) { string errorInfo = System.DateTime.Now.ToString("yyyy/MM/dd hh:mm:ss") //error date & time + "\t" + ex.Message //error message + "\t" + ex.Source //error object name; + "\r\n" + ex.StackTrace; UserControl.FileLog.FileLogOut("Client.log", errorInfo); } System.Diagnostics.Process pr = null; //RunningInstance(); if (pr == null) { FMain mainForm = new FMain(); applicationContext.MainForm = mainForm; Service.ApplicationService.Current().MainWindows = mainForm; Application.DoEvents(); mainForm.Show(); if (appArguments != null && appArguments.Length > 0) { if (appArguments[0].ToUpper() == "AUTOLOGIN" && appArguments.Length >= 4) { FLogin flogin = new FLogin(); flogin.MdiParent = mainForm; flogin.ucLEUserCode.Value = appArguments[1]; flogin.ucLEPassword.Text = appArguments[2]; flogin.ucLEResourceCode.Value = appArguments[3]; flogin.ucBtnLogin_Click(null, EventArgs.Empty); if (appArguments.Length >= 5) { FAutoTestConfig fautotest = new FAutoTestConfig(); fautotest.CheckAutoLaunchTest(); } } else if (appArguments[0].ToUpper() == "AUTOCOLLECT") { FAutoTestConfig fautotest = new FAutoTestConfig(); fautotest.LoadAutoCollectConfig(); } } } else { HandleRunningInstance(pr); } splashForm.Close(); splashForm = null; } }