using static Vanara.PInvoke.Ole32; namespace Vanara.Windows.Shell { /// Encapsulates an instance. public class PropertyBag { /// The IPropertyBag instance. protected readonly IPropertyBag ibag; /// Initializes a new instance of the class. /// The ps. public PropertyBag(IPropertyBag ppb) => ibag = ppb; /// Gets or sets the with the specified property name. /// The . /// Name of the property. /// The property value. public object this[string propertyName] { get { object o = null; ibag.Read(propertyName, ref o, null); return o; } set => ibag.Write(propertyName, value); } } }