コード例 #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
ファイル: TooltipWindow.cs プロジェクト: noah1510/dotdevelop
 protected override void OnDestroyed()
 {
     base.OnDestroyed();
     if (decorator !=  null)
     {
           {
             decorator.Detach();
             decorator =  null;
         }
     }
 }
コード例 #3
0
ファイル: TooltipWindow.cs プロジェクト: zenek-y/monodevelop
		protected override void OnDestroyed ()
		{
			base.OnDestroyed ();
			if (decorator != null) {
				decorator.Detach ();
				decorator = null;
			}
		}
		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;
		}