コード例 #1
0
        static Delegate TryBindGtkInternals(WindowTransparencyDecorator instance)
        {
            if (internalBindingTried)
            {
                if (!internalBindingWorks)
                {
                    return(null);
                }
            }
            else
            {
                internalBindingTried = true;
            }

            try {
                Type delType = typeof(Gtk.Widget).Assembly.GetType("GtkSharp.KeySnoopFuncNative");
                System.Reflection.MethodInfo met = typeof(WindowTransparencyDecorator).GetMethod("TransparencyKeySnooper",
                                                                                                 System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic);
                Delegate ret = Delegate.CreateDelegate(delType, instance, met);
                if (ret != null)
                {
                    return(ret);
                }
            } catch {}

            internalBindingWorks = false;
            //MonoDevelop.Core.LoggingService.LogWarning ("GTK# API has changed, and control-transparency will not be available for popups");
            return(null);
        }
コード例 #2
0
		static Delegate TryBindGtkInternals (WindowTransparencyDecorator instance)
		{
			if (internalBindingTried) {
				if (!internalBindingWorks)
					return null;
			} else {
				internalBindingTried = true;
			}
			
			try {
				Type delType = typeof(Gtk.Widget).Assembly.GetType ("GtkSharp.KeySnoopFuncNative");
				System.Reflection.MethodInfo met = typeof (WindowTransparencyDecorator).GetMethod ("TransparencyKeySnooper", 
				    System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic);
				Delegate ret = Delegate.CreateDelegate (delType, instance, met);
				if (ret != null)
					return ret;
			} catch {}
			
			internalBindingWorks = false;
			//MonoDevelop.Core.LoggingService.LogWarning ("GTK# API has changed, and control-transparency will not be available for popups");
			return null;
		}