[]
Implementation of OLE IPropertyBag2.
public class PropertyBag : ComObject, IDisposable, IUnknown
Initializes a new instance of the PropertyBag class.
public PropertyBag(IntPtr propertyBagPointer)
propertyBagPointer System.IntPtrThe property bag pointer.
Gets the number of properties.
public int Count { get; }
Gets the keys.
public string[] Keys { get; }
Gets the value of the property with this name.
public object Get(string name)
name stringThe name.
Value of the property
Gets the value of the property by using a PropertyBagKey<T1, T2>
public T1 Get<T1, T2>(PropertyBagKey<T1, T2> propertyKey)
propertyKey PropertyBagKey<T1, T2>The property key.
Value of the property
T1The public type of this property.
T2The marshaling type of this property.
Method called when the NativePointer is updated.
protected override void NativePointerUpdated(IntPtr oldNativePointer)
oldNativePointer System.IntPtrSets the value of the property with this name
public void Set(string name, object value)
name stringThe name.
value objectThe value.
Sets the value of the property by using a PropertyBagKey<T1, T2>
public void Set<T1, T2>(PropertyBagKey<T1, T2> propertyKey, T1 value)
propertyKey PropertyBagKey<T1, T2>The property key.
value T1The value.
T1The public type of this property.
T2The marshaling type of this property.