public static void Main(string[] args) { Application.Init(); //Download icon InitIcon.download_icon(); var app = new Application("org.PARSminexmr.PARSminexmr", GLib.ApplicationFlags.None); Choose_style.PreStartChoose(); app.Register(GLib.Cancellable.Current); var win = new MainWindow(); app.AddWindow(win); win.Show(); Application.Run(); }
public static void Main(string[] args) { GtkApp.Init(); Forms.Init(); var app = new App(); var window = new FormsWindow(); window.LoadApplication(app); window.Show(); GtkApp.Run(); }
/// <summary> /// The main entry point for the application. /// </summary> private static async Task Main(string[] args) { var options = new CLIOptions(); Parser.Default.ParseArguments <CLIOptions>(args) .WithParsed(r => options = r); if (options.RunBatchProcessing) { if (string.IsNullOrEmpty(options.TargetDirectory) || options.ManifestType == EManifestType.Unknown) { Log.Error("Target directory not set, or manifest type not set."); return; } // At this point, the options should be valid. Run batch processing. if (Directory.Exists(options.TargetDirectory)) { Log.Info("Generating manifest..."); var manifestGenerationHandler = new ManifestGenerationHandler(); var progressReporter = new Progress <ManifestGenerationProgressChangedEventArgs> ( e => Log.Info($"Processed file {e.Filepath} : {e.Hash} : {e.Filesize}") ); await manifestGenerationHandler.GenerateManifestAsync ( options.TargetDirectory, options.ManifestType, progressReporter, CancellationToken.None ); Log.Info("Generation finished."); } else { Log.Error("The selected directory did not exist."); } } else if (string.IsNullOrEmpty(options.TargetDirectory) && options.ManifestType == EManifestType.Unknown) { // Run a GTK UI instead of batch processing Application.Init(); SynchronizationContext.SetSynchronizationContext(new GLibSynchronizationContext()); var win = MainWindow.Create(); win.Show(); Application.Run(); } }
/// <summary> /// The entry point. /// </summary> public static void Main() { // Bind any unhandled exceptions in the main thread so that they are logged. AppDomain.CurrentDomain.UnhandledException += OnUnhandledException; // Set correct working directory for compatibility with double-clicking Directory.SetCurrentDirectory(DirectoryHelpers.GetLocalDir()); if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { Environment.SetEnvironmentVariable("GSETTINGS_SCHEMA_DIR", "share\\glib-2.0\\schemas\\"); } log4net.Config.XmlConfigurator.Configure(); Log.Info("----------------"); Log.Info("Initializing Everlook..."); Log.Info("Initializing OpenTK..."); // OpenGL var toolkitOptions = new ToolkitOptions { Backend = PlatformBackend.PreferNative, EnableHighResolution = true }; using (Toolkit.Init(toolkitOptions)) { Log.Info($"OpenTK initialized using the {GetOpenTKBackend()} backend."); Log.Info("Initializing GTK..."); // Bind any unhandled exceptions in the GTK UI so that they are logged. ExceptionManager.UnhandledException += OnGLibUnhandledException; Log.Info("Registering treeview types with the native backend..."); GType nodeType = (GType)typeof(SerializedNode); GType.Register(nodeType, typeof(SerializedNode)); GType referenceType = (GType)typeof(FileReference); GType.Register(referenceType, typeof(FileReference)); // GTK IconManager.LoadEmbeddedIcons(); Application.Init(); MainWindow win = MainWindow.Create(); win.Show(); Application.Run(); } }
private static void Main(string[] args) { Application.Init(); Forms.Init(); var app = new App(); var window = new FormsWindow(); window.LoadApplication(app); window.Title = "Mandelbrot Plotter"; window.Show(); Application.Run(); }
public static void Main(string[] args) { _logger = new Logger <Program>(); AppDomain.CurrentDomain.UnhandledException += (_, e) => OnUnhandledException(e); ExceptionManager.UnhandledException += OnUnhandledException; Application.Init(); SetupProcess(); SetupApplication(); Application.Run(); }
public static void Main(string[] args) { Application.Init(); Forms.Init(); ZXing.Net.Mobile.Forms.GTK.Platform.Init(); var app = new App(); var window = new FormsWindow(); window.LoadApplication(app); window.SetApplicationTitle("GTK example"); window.Show(); Application.Run(); }
private static void Main(string[] args) { Application.Init(); Forms.Init(); var app = new App(); var window = new FormsWindow(); window.LoadApplication(app); window.Title = app.MainPage.Title; window.Show(); Application.Run(); }
public static void Main(string[] args) { Application.Init(); var app = new Application("com.parzivail.ComlinkGtk", ApplicationFlags.None); app.Register(Cancellable.Current); var win = new MainWindow(); app.AddWindow(win); win.Show(); Application.Run(); }
public static void Main(string[] args) { Application.Init(); var app = new Application("net.lomeli.FuseeGUI", ApplicationFlags.None); app.Register(Cancellable.Current); var win = new MainWindow(); app.AddWindow(win); win.Show(); Application.Run(); }
private static void Main() { Application.Init(); var h = new UnhandledExceptionHandler(OnException); ExceptionManager.UnhandledException += h; new MainWindow().Show(); Application.Run(); void OnException(UnhandledExceptionArgs args) { Console.WriteLine("Error in application: " + args.ExceptionObject); args.ExitApplication = false; } }
/// <summary> /// The entry point. /// </summary> public static void Main() { // Bind any unhandled exceptions in the main thread so that they are logged. AppDomain.CurrentDomain.UnhandledException += OnUnhandledException; // Set correct working directory for compatibility with double-clicking Directory.SetCurrentDirectory(DirectoryHelpers.GetLocalDir()); log4net.Config.XmlConfigurator.Configure(); Log.Info("----------------"); Log.Info("Initializing Everlook..."); Log.Info("Initializing OpenTK..."); // OpenGL Toolkit.Init(new ToolkitOptions { Backend = PlatformBackend.PreferNative }); Log.Info($"OpenTK initialized using the {GetOpenTKBackend()} backend."); Log.Info("Initializing GTK..."); // Bind any unhandled exceptions in the GTK UI so that they are logged. ExceptionManager.UnhandledException += OnGLibUnhandledException; Log.Info("Registering treeview types with the native backend..."); GType nodeType = (GType)typeof(FileNode); GType.Register(nodeType, typeof(FileNode)); GType referenceType = (GType)typeof(FileReference); GType.Register(referenceType, typeof(FileReference)); // GTK IconManager.LoadEmbeddedIcons(); Application.Init(); MainWindow win = MainWindow.Create(); win.Show(); Application.Run(); }
public static void Main(string[] args) { var assemblies = typeof(MainClass).Assembly .GetReferencedAssemblies() .Concat(new[] { new AssemblyName("OmniGui.Xaml"), new AssemblyName("OmniGui"), }) .Select(Assembly.Load) .ToList(); Application.Init(); var window = new MainWindow(); var omniGuiWidget = new OmniGuiWidget(assemblies) { Source = "layout.xaml", DataContext = new SampleViewModel(new GtkMessageService(window)) }; window.Add(omniGuiWidget); window.Show(); omniGuiWidget.Show(); Application.Run(); }
/// <summary> /// The main entry point for the application. /// </summary> private static async Task Main(string[] args) { // Set correct working directory for compatibility with double-clicking Directory.SetCurrentDirectory(DirectoryHelpers.GetLocalDir()); if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { Environment.SetEnvironmentVariable("GSETTINGS_SCHEMA_DIR", "share\\glib-2.0\\schemas\\"); } var options = new CLIOptions(); Parser.Default.ParseArguments <CLIOptions>(args) .WithParsed(r => options = r) .WithNotParsed(r => options = null); if (options is null) { // Parsing probably failed, bail out return; } if (options.RunBatchProcessing) { if (string.IsNullOrEmpty(options.TargetDirectory) || options.ManifestType == EManifestType.Unknown) { Log.Error("Target directory not set, or manifest type not set."); return; } // At this point, the options should be valid. Run batch processing. if (Directory.Exists(options.TargetDirectory)) { Log.Info("Generating manifest..."); var manifestGenerationHandler = new ManifestGenerationHandler(); var progressReporter = new Progress <ManifestGenerationProgressChangedEventArgs> ( e => Log.Info($"Processed file {e.Filepath} : {e.Hash} : {e.Filesize}") ); await manifestGenerationHandler.GenerateManifestAsync ( options.TargetDirectory, options.ManifestType, progressReporter, CancellationToken.None ); Log.Info("Generation finished."); } else { Log.Error("The selected directory did not exist."); } } else if (string.IsNullOrEmpty(options.TargetDirectory) && options.ManifestType == EManifestType.Unknown) { // Run a GTK UI instead of batch processing Application.Init(); SynchronizationContext.SetSynchronizationContext(new GLibSynchronizationContext()); var win = MainWindow.Create(); win.Show(); Application.Run(); } }
public static void Main(string[] args) { // if the user is not running a Unix Based OS - set the enviroment var path accordingly if (!ApplicationHelper.IsUnix) { Environment.SetEnvironmentVariable("PATH", Environment.Is64BitOperatingSystem ? @"C:\msys64\mingw64\bin" : @"C:\msys32\mingw32\bin" ); } try { Application.Init(); } catch (DllNotFoundException e) { var str = $"A file required by Projects is missing:\n\n{e.Message}."; if (!ApplicationHelper.IsUnix) { MessageBox.Show(str, "Missing prerequisite", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { Console.WriteLine(str); } Environment.Exit(0); } catch (TypeInitializationException e) { var str = $"An issue occurred while trying to load projects:\n\n{e.Message}\n\nIs Gtk installed?"; if (!ApplicationHelper.IsUnix) { MessageBox.Show(str, "Check Install", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { Console.WriteLine(str); } Environment.Exit(0); } // store system's default font in variable var font = SystemFonts.DefaultFont; // set the font to the default font global::Gtk.Settings.Default.FontName = font.Name + " " + font.SizeInPoints; // force usage of smooth font global::Gtk.Settings.Default.XftAntialias = 1; global::Gtk.Settings.Default.XftRgba = "rgb"; // if arguments have been passed to the program if (args.Length != 0) { // store first argument var file = args[0]; // get the file's extension var extension = Path.GetExtension(file); // if the extension isn't null, the file exists and is of the right extension, and the lock file // does not exist, // load the main application with the argument passed to the program if (extension != null && File.Exists(file) && extension.Equals(".prj") && !File.Exists(file + ".lk")) { new ProjectWindow(file).Show(); } // if the requirements are not met, then proceed with the startup process else { Startup(); } Application.Run(); } // if no arguments have been passed then go to the startup process else { Startup(); } }