Esempio n. 1
0
        public override Xwt.Toolkit LoadNativeToolkit()
        {
            var path = Path.GetDirectoryName(GetType().Assembly.Location);

            System.Reflection.Assembly.LoadFrom(Path.Combine(path, "Xwt.WPF.dll"));
            return(WPFToolkit = Xwt.Toolkit.Load(Xwt.ToolkitType.Wpf));
        }
Esempio n. 2
0
        internal static Xwt.Toolkit LoadCocoa()
        {
            if (toolkit != null)
            {
                return(toolkit);
            }

            var path = Path.GetDirectoryName(typeof(IdeTheme).Assembly.Location);

            System.Reflection.Assembly.LoadFrom(Path.Combine(path, "Xwt.XamMac.dll"));
            toolkit = Xwt.Toolkit.Load(Xwt.ToolkitType.XamMac);

            NSNotificationCenter.DefaultCenter.AddObserver(NSApplication.DidFinishLaunchingNotification, (note) => {
                if (note.UserInfo.TryGetValue(NSApplication.LaunchIsDefaultLaunchKey, out var val))
                {
                    if (val is NSNumber num)
                    {
                        IdeApp.LaunchReason = num.BoolValue ? IdeApp.LaunchType.Normal : IdeApp.LaunchType.LaunchedFromFileManager;
                        LoggingService.LogDebug($"Startup was {IdeApp.LaunchReason}");
                    }
                }
            });

            return(toolkit);
        }
Esempio n. 3
0
        public static Xwt.Drawing.Font ToXwtFont(this FontDescription font, Xwt.Toolkit withToolkit)
        {
            var toolkit = withToolkit ?? Xwt.Toolkit.CurrentEngine;

            Xwt.Drawing.Font xwtFont = null;
            toolkit.Invoke(() => xwtFont = Xwt.Drawing.Font.FromName(font.ToString()));
            return(xwtFont);
        }
Esempio n. 4
0
        public override Xwt.Toolkit LoadNativeToolkit()
        {
            var path = Path.GetDirectoryName(GetType().Assembly.Location);

            System.Reflection.Assembly.LoadFrom(Path.Combine(path, "Xwt.WPF.dll"));
            WPFToolkit = Xwt.Toolkit.Load(Xwt.ToolkitType.Wpf);

            WPFToolkit.RegisterBackend <Xwt.Backends.IDialogBackend, ThemedWpfDialogBackend> ();
            WPFToolkit.RegisterBackend <Xwt.Backends.IWindowBackend, ThemedWpfWindowBackend> ();

            return(WPFToolkit);
        }
Esempio n. 5
0
        public static Xwt.Drawing.Font ToXwtFont(this FontDescription font, Xwt.Toolkit withToolkit)
        {
            var toolkit = withToolkit ?? Xwt.Toolkit.CurrentEngine;

            Xwt.Drawing.Font xwtFont = null;
            toolkit.Invoke(() => {
                xwtFont = Xwt.Drawing.Font.FromName(font.Family + " " + (int)(font.Size / Pango.Scale.PangoScale))
                          .WithWeight((Xwt.Drawing.FontWeight)font.Weight)
                          .WithStyle((Xwt.Drawing.FontStyle)font.Style)
                          .WithStretch((Xwt.Drawing.FontStretch)font.Stretch);
            });
            return(xwtFont);
        }
		public override Xwt.Toolkit LoadNativeToolkit ()
		{
			var path = Path.GetDirectoryName (GetType ().Assembly.Location);
			System.Reflection.Assembly.LoadFrom (Path.Combine (path, "Xwt.WPF.dll"));
			return WPFToolkit = Xwt.Toolkit.Load (Xwt.ToolkitType.Wpf);
		}
Esempio n. 7
0
		public override Xwt.Toolkit LoadNativeToolkit ()
		{
			var path = Path.GetDirectoryName (GetType ().Assembly.Location);
			System.Reflection.Assembly.LoadFrom (Path.Combine (path, "Xwt.WPF.dll"));
			WPFToolkit = Xwt.Toolkit.Load (Xwt.ToolkitType.Wpf);

			WPFToolkit.RegisterBackend<Xwt.Backends.IDialogBackend, ThemedWpfDialogBackend> ();
			WPFToolkit.RegisterBackend<Xwt.Backends.IWindowBackend, ThemedWpfWindowBackend> ();

			return WPFToolkit;
		}