----------------------------------------------------------------------------- Sets the selected item in a list by value -----------------------------------------------------------------------------
| 3062 | // Sets the selected item in a list by value |
| 3063 | //----------------------------------------------------------------------------- |
| 3064 | bool Manager::SetValueListSelection |
| 3065 | ( |
| 3066 | ValueID const& _id, |
| 3067 | string const& _selectedItem |
| 3068 | ) |
| 3069 | { |
| 3070 | bool res = false; |
| 3071 | |
| 3072 | if( ValueID::ValueType_List == _id.GetType() ) |
| 3073 | { |
| 3074 | if( Driver* driver = GetDriver( _id.GetHomeId() ) ) |
| 3075 | { |
| 3076 | if( _id.GetNodeId() != driver->GetControllerNodeId() ) |
| 3077 | { |
| 3078 | LockGuard LG(driver->m_nodeMutex); |
| 3079 | if( ValueList* value = static_cast<ValueList*>( driver->GetValue( _id ) ) ) |
| 3080 | { |
| 3081 | res = value->SetByLabel( _selectedItem ); |
| 3082 | value->Release(); |
| 3083 | } else { |
| 3084 | OZW_ERROR(OZWException::OZWEXCEPTION_INVALID_VALUEID, "Invalid ValueID passed to SetValueListSelection"); |
| 3085 | } |
| 3086 | } |
| 3087 | |
| 3088 | } |
| 3089 | } else { |
| 3090 | OZW_ERROR(OZWException::OZWEXCEPTION_CANNOT_CONVERT_VALUEID, "ValueID passed to SetValueListSelection is not a List Value"); |
| 3091 | } |
| 3092 | |
| 3093 | return res; |
| 3094 | } |
| 3095 | |
| 3096 | //----------------------------------------------------------------------------- |
| 3097 | // <Manager::SetValue> |
nothing calls this directly
no test coverage detected