Пример #1
0
	public void ConnectFunc (Builder builder, GLib.Object objekt, string signal_name, string handler_name, GLib.Object connect_object, GLib.ConnectFlags flags)
	{
		/* search for the event to connect */
		System.Reflection.MemberInfo[] evnts = objekt.GetType ().
			FindMembers (System.Reflection.MemberTypes.Event,
			     System.Reflection.BindingFlags.Instance
			     | System.Reflection.BindingFlags.Static
			     | System.Reflection.BindingFlags.Public
			     | System.Reflection.BindingFlags.NonPublic,
			     new System.Reflection.MemberFilter (SignalFilter), signal_name);
		foreach (System.Reflection.EventInfo ei in evnts) {
			bool connected = false;
			System.Reflection.MethodInfo add = ei.GetAddMethod ();
			System.Reflection.ParameterInfo[] addpi = add.GetParameters ();
			if (addpi.Length == 1) { /* this should be always true, unless there's something broken */
				Type delegate_type = addpi[0].ParameterType;

				/* look for an instance method */
				if (connect_object != null || handler != null)
					try {
						Delegate d = Delegate.CreateDelegate (delegate_type, connect_object != null ? connect_object : handler, handler_name);
						add.Invoke (objekt, new object[] { d } );
						connected = true;
					} catch (ArgumentException) { /* ignore if there is not such instance method */
					}

				/* look for a static method if no instance method has been found */
				if (!connected && handler_type != null)
					try  {
						Delegate d = Delegate.CreateDelegate (delegate_type, handler_type, handler_name);
						add.Invoke (objekt, new object[] { d } );
						connected = true;
					} catch (ArgumentException) { /* ignore if there is not such static method */
					}

				if (!connected) {
					string msg = ExplainError (ei.Name, delegate_type, handler_type, handler_name);
					throw new HandlerNotFoundException (msg, handler_name, signal_name, ei, delegate_type);
				}
			}
		}
	}
Пример #2
0
 protected BuilderWindow(Builder builder, string widgetName)
     : base(builder.GetRawObject (widgetName))
 {
     builder.Autoconnect (this);
 }
Пример #3
0
	public SignalConnector (Builder builder, Type handler_type)
	{
		this.builder = builder;
		this.handler = null;
		this.handler_type = handler_type;		
	}
Пример #4
0
	public SignalConnector (Builder builder, object handler)
	{
		this.builder = builder;
		this.handler = handler;
		handler_type = handler.GetType ();
	}
        public void Run(SupportedService service, IBrowsableCollection selection, bool display_tags)
        {
            this.selection = selection;
            this.current_service = FlickrRemote.Service.FromSupported (service);

            var view = new TrayView (selection);
            view.DisplayTags = display_tags;
            view.DisplayDates = false;

            builder = new GtkBeans.Builder (null, "flickr_export.ui", null);
            builder.Autoconnect (this);

            Dialog.Modal = false;
            Dialog.TransientFor = null;

            thumb_scrolledwindow.Add (view);
            HandleSizeActive (null, null);

            public_radio.Toggled += HandlePublicChanged;
            tag_check.Toggled += HandleTagChanged;
            hierarchy_check.Toggled += HandleHierarchyChanged;
            HandleTagChanged (null, null);
            HandleHierarchyChanged (null, null);

            Dialog.ShowAll ();
            Dialog.Response += HandleResponse;
            auth_flickr.Clicked += HandleClicked;
            auth_text = string.Format (auth_label.Text, current_service.Name);
            auth_label.Text = auth_text;
            used_bandwidth.Visible = false;

            LoadPreference (SCALE_KEY);
            LoadPreference (SIZE_KEY);
            LoadPreference (BROWSER_KEY);
            LoadPreference (TAGS_KEY);
            LoadPreference (TAG_HIERARCHY_KEY);
            LoadPreference (IGNORE_TOP_LEVEL_KEY);
            LoadPreference (PUBLIC_KEY);
            LoadPreference (FAMILY_KEY);
            LoadPreference (FRIENDS_KEY);
            LoadPreference (current_service.PreferencePath);

            do_export_flickr.Sensitive = false;
            fr = new FlickrRemote (token, current_service);
            if (token != null && token.Length > 0) {
                StartAuth ();
            }
        }
Пример #6
0
 protected BuilderDialog(Builder builder, string dialogName)
     : base(builder.GetRawObject (dialogName))
 {
     builder.Autoconnect (this);
 }
 public override Widget ConfigurationWidget()
 {
     builder = new GtkBeans.Builder (null, "color_editor_prefs_window.ui", null);
     builder.Autoconnect (this);
     AttachInterface ();
     return new VBox (builder.GetRawObject ("color_editor_prefs"));
 }