IUccProperty.BoolValue Property

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

Gets and sets the Boolean value of the property.

Namespace: Microsoft.Office.Interop.UccApi
Assembly: Microsoft.Office.Interop.UccApi (in microsoft.office.interop.uccapi.dll)

Syntax

'Declaration
Property BoolValue As Boolean
bool BoolValue { get; set; }
property bool BoolValue {
    bool get ();
    void set (bool value);
}
/** @property */
boolean get_BoolValue ()

/** @property */
void set_BoolValue (boolean value)
function get BoolValue () : boolean

function set BoolValue (value : boolean)

Property Value

A value of the VARIANT_BOOL* (bool, for a .NET application) type.

Remarks

An application should verify that a given property is set before accessing the property. An application must enclose a reference to a property BoolValue within a try/catch block to catch the COM exception raised when an un-initialized value property is accessed on the IUccProperty instance.

Win32 COM/C++ Syntax

HRESULT get_BoolValue
(
   VARIANT_BOOL* pbPropertyValue
);
HRESULT put_BoolValue
(
   VARIANT_BOOL pbPropertyValue
);

Note

In a Win32 application, the return value of a method or property is always an HRESULT value indicating the status of the call to the interface member. Any result of the operation is returned as a parameter marked with the [out, retval] attribute. In contrast, in a .NET application the HRESULT value indicating an error condition is returned as a COM exception and the [out, retval] parameter becomes the return value. For the Unified Communications Client API-defined HRESULT values, see Trace and Handle Errors in Unified Communications Client API.

Example

The following example returns a boolean value of true when the boolean property value of interest is initialized and a false value otherwise. The actual boolean value of the property is returned in an out parameter of the example method.

private Boolean GetPropertyBoolValue(
   IUccReadOnlyPropertyCollection pCollection,
   int propertyId, out Boolean propertyValue)
{
   //initialize return value
   Boolean returnValue = false;

   //initialize out value of interested property boolean value
   propertyValue = false;

   //verify interested property was set
   if (pCollection.IsPropertySet(propertyId))
   {
      //get interested property and fill returnValue with string value of property
      IUccProperty property = pCollection.get_Property(propertyId);
      try
      {
         propertyValue = property.BoolValue;
         returnValue = true;
      }
      catch
      {
      }
   }
   return returnValue;
}

Thread Safety

All public static (Shared in Visual Basic) members of this type are thread-safe. Instance members are not guaranteed to be thread-safe.

Platforms

Development Platforms

Windows XP Professional with Service Pack 2 (SP2), Windows Server 2000 with Service Pack 4, Windows Server 2003, Windows Vista Ultimate Edition, Windows Vista Business Edition, Windows Vista Enterprise Edition

Target Platforms

See Also

Reference

IUccProperty Interface
IUccProperty Members
Microsoft.Office.Interop.UccApi Namespace