示例#1
0
        public static void Main(string[] args)
        {
            Toolkit opentk = Core.InitOpenTK();

            Platform platform = Platform.Detect;

            platform.Add <GLSurface.IHandler>(() => new MacGLSurfaceHandler());

            Style.Add <View>(
                "hidecursor",
                view =>
            {
                CG.DisplayHideCursor((CGDirectDisplayID)0);
                CG.AssociateMouseAndMouseCursorPosition(false);
            });

            Style.Add <View>(
                "showcursor",
                view =>
            {
                CG.AssociateMouseAndMouseCursorPosition(true);
                CG.DisplayShowCursor((CGDirectDisplayID)0);
            });

            var application = new Application(platform);

            application.UnhandledException += Core.UnhandledExceptionHandler;

            using (opentk)
            {
                application.Run(new MainForm());
            }
        }
示例#2
0
        static void Main()
        {
            Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
            var platform = new Platform();

            platform.Add <SortableGridColumn.IHandler>(() => new SortableGridColumnHandler());
            using (App app = new App(platform))
            {
                app.Run();
            }
        }
示例#3
0
        static void Main()
        {
            var platform = new Platform();

            platform.Add <SortableGridColumn.IHandler>(() => new SortableGridColumnHandler());
            using (App app = new App(platform))
            {
                var handler = (ApplicationHandler)app.Handler;
                handler.AllowClosingMainForm = true;
                app.Run();
            }
        }
示例#4
0
        public static void Main(string[] args)
        {
            Toolkit opentk = Core.InitOpenTK();

            Platform platform = Platform.Detect;

            // This project has references to multiple Eto and Eto.Gl platforms,
            // to eliminate the need for separate test GUIs.
            //
            // To avoid the subsequent hassle of unnecessary and potentially
            // irritating to install dependencies, e.g. GtkSharp2 on Windows,
            // those references are conditional, and vary based on what platform
            // is building the code.
            //
            // That in turn means the various handler types, WinGLSurfaceHandler
            // et. al., aren't all available at compile time, leading to this
            // assembly loading acrobatics routine.
            if (platform.IsMac)
            {
                Assembly.Load("Eto.OpenTK.Mac64");
                Type type = AssemblyUtilities.GetTypeFromName("Eto.OpenTK.Mac.MacGLSurfaceHandler");
                platform.Add(() => (GLSurface.IHandler)Activator.CreateInstance(type));
            }
            else if (platform.IsGtk)
            {
                Assembly.Load("Eto.OpenTK.Gtk2");
                Type type = AssemblyUtilities.GetTypeFromName("Eto.OpenTK.Gtk.GtkGlSurfaceHandler");
                platform.Add(() => (GLSurface.IHandler)Activator.CreateInstance(type));
            }
            else
            {
                Assembly.Load("Eto.OpenTK.WinForms");
                Type type = AssemblyUtilities.GetTypeFromName("Eto.OpenTK.WinForms.WinGLSurfaceHandler");
                platform.Add(() => (GLSurface.IHandler)Activator.CreateInstance(type));
            }

            var application = new Application(platform);

            application.UnhandledException += Core.UnhandledExceptionHandler;

            var form = new MainForm();

            var testMenu = new ButtonMenuItem
            {
                Text  = "Test",
                Items =
                {
                    new ButtonMenuItem
                    {
                        Text             = "Get average refresh time",
                        Command          = Commands.CmdAverageRefreshTime,
                        CommandParameter = form
                    },
                    new ButtonMenuItem
                    {
                        Text             = "Count visible triangles",
                        Command          = Commands.CmdVisibleTriangles,
                        CommandParameter = form
                    }
                }
            };

            form.Menu.Items.Add(testMenu);

            using (opentk)
            {
                application.Run(form);
            }
        }
示例#5
0
 private static void RegisterUIHandlers(Platform platform)
 {
     platform.Add <Notification.IHandler>(() => new Controls.NotificationHandler());
     platform.Add <SyntaxHightlightTextArea.ISyntaxHightlightTextArea>(() => new SyntaxHightlightTextAreaHandler());
 }
示例#6
0
 public void Initialize(Platform platform)
 {
     platform.Add <IEtoAdapterHandler>(() => new EtoAdapterHandler());
 }
示例#7
0
 public void Initialize(Platform platform)
 {
     platform.Add <DsBindComboBoxCell.IHandler>(() => new DsBindComboBoxCellHandler());
 }
示例#8
0
文件: Program.cs 项目: junian/termqtt
 private static void RegisterUIHandlers(Platform platform)
 {
     platform.Add <SyntaxHightlightTextArea.ISyntaxHightlightTextArea>(() => new SyntaxHightlightTextAreaHandler());
 }