Beispiel #1
0
        static AvaloniaGlobals()
        {
            RuntimePlatform = new StandardRuntimePlatform();

            var runtime = RuntimePlatform.GetRuntimeInfo();

            if (runtime.OperatingSystem == OperatingSystemType.WinNT)
            {
                Win32Platform.Initialize();
                PlatformThreadingInterface = Win32Platform.Instance;
                WindowingInterface         = Win32Platform.Instance;
                StandardCursorFactory      = CursorFactory.Instance;
            }
            else if (runtime.OperatingSystem == OperatingSystemType.Linux)
            {
                var x11 = new AvaloniaX11Platform();
                x11.Initialize(new X11PlatformOptions());

                WindowingInterface         = x11;
                PlatformThreadingInterface = new X11PlatformThreading(x11);
                StandardCursorFactory      = new X11CursorFactory(x11.Display);
            }
            else
            {
                throw new InvalidOperationException("Unrecognized Operating System");
            }
        }
Beispiel #2
0
        private static void InitializeLinux()
        {
            var x11 = new AvaloniaX11Platform();

            x11.Initialize(new X11PlatformOptions());

            WindowingInterface         = x11;
            PlatformThreadingInterface = new X11PlatformThreading(x11);
            StandardCursorFactory      = new X11CursorFactory(x11.Display);
        }
        private static void InitializeLinux()
        {
            var x11 = new AvaloniaX11Platform();

            x11.Initialize(new X11PlatformOptions());

            WindowingInterface         = x11;
            PlatformThreadingInterface = new X11PlatformThreading(x11);
            StandardCursorFactory      = new X11CursorFactory(x11.Display);
            SystemDialogImplementation = new X11.NativeDialogs.GtkSystemDialog();
            ClipboardInterface         = new X11Clipboard(x11);
        }