[Kde-bindings] Qyoto: SIGNALS/SLOTS
Arno Rehn
arno at arnorehn.de
Mon Dec 12 20:05:22 UTC 2005
Am Montag, 12. Dezember 2005 18:01 schrieb Richard Dale:
> // Which reflection method can be used to get the parent interface
> // of IQApplicationSignals, so it doesn't need to be hard coded
> // as IQObjectSignals like here?
> miSignal = typeof(IQObjectSignals).GetMethod("Destroyed");
> attributes = miSignal.GetCustomAttributes(typeof(Q_SIGNAL), false);
> if (attributes.Length > 0) {
> Q_SIGNAL signalAttr = (Q_SIGNAL) attributes[0];
> Console.WriteLine( "Q_SIGNAL signature: {0}", signalAttr.Signature );
> }
Try this:
miSignal =
typeof(IQApplicationSignals).BaseType.GetMethod("Destroyed"); //with
'BaseType' you get the first type that the current type is derived from
attributes = miSignal.GetCustomAttributes(typeof(Q_SIGNAL), false);
if (attributes.Length > 0) {
Q_SIGNAL signalAttr = (Q_SIGNAL) attributes[0];
Console.WriteLine( "Q_SIGNAL signature: {0}", signalAttr.Signature );
}
--
MfG
Arno Rehn
arno at arnorehn.de
More information about the Kde-bindings
mailing list