Class Property<T, K>
- Namespace
- GObject
- Assembly
- GObject-2.0.dll
Describes a GProperty.
public sealed class Property<T, K> : PropertyDefinition<T>
Type Parameters
T
The type of the value this property will store.
K
The type of the class / interface implementing this property.
- Inheritance
-
Property<T, K>
- Implements
- Inherited Members
Constructors
Property(string, string)
Initializes a new instance of Property<T, K>.
public Property(string unmanagedName, string managedName)
Parameters
unmanagedName
stringThe GObject/C name of this property.
managedName
stringThe dotnet name of this property.
Properties
ManagedName
The name of the property in dotnet.
public string ManagedName { get; }
Property Value
UnmanagedName
The name of the property in GObject/C.
public string UnmanagedName { get; }
Property Value
Methods
Get(K)
Get the value of this property in the given object.
public T Get(K obj)
Parameters
obj
K
Returns
- T
Exceptions
- ArgumentException
If obj is not a GObject.Object.
Notify(K, SignalHandler<Object, NotifySignalArgs>, bool)
Registers a signal handler to get notified if the property is changed.
public void Notify(K sender, SignalHandler<Object, Object.NotifySignalArgs> signalHandler, bool after = false)
Parameters
sender
KThe instance providing the property which should be listened to.
signalHandler
SignalHandler<Object, Object.NotifySignalArgs>The handler which should be invoked if the property changes.
after
boolDefine if the signal handler action must be called before or after the default handler.
Exceptions
- ArgumentException
If the sender is not a GObject.Object.
Set(K, T)
Set the value of this property in the given object using the given value.
public void Set(K obj, T value)
Parameters
obj
Kvalue
T
Exceptions
- ArgumentException
If obj is not a GObject.Object.
Unnotify(K, SignalHandler<Object, NotifySignalArgs>)
Deregisters a signal handler.
public void Unnotify(K sender, SignalHandler<Object, Object.NotifySignalArgs> signalHandler)
Parameters
sender
KThe instance providing the property which should be deregistered.
signalHandler
SignalHandler<Object, Object.NotifySignalArgs>The signal handler which should be deregistered.
Exceptions
- ArgumentException
If the sender is not a GObject.Object.