Example #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");
            }
        }
        static AvaloniaGlobals()
        {
            RuntimePlatform = new StandardRuntimePlatform();

            var runtime = RuntimePlatform.GetRuntimeInfo();

            if (runtime.OperatingSystem == OperatingSystemType.WinNT)
            {
                InitializeWindows();
            }
            else if (runtime.OperatingSystem == OperatingSystemType.Linux)
            {
                InitializeLinux();
            }
            else if (runtime.OperatingSystem == OperatingSystemType.OSX)
            {
                InitializeOSX();
            }
            else
            {
                throw new InvalidOperationException("Unrecognized Operating System");
            }
        }