| 1339 | } |
| 1340 | |
| 1341 | static void ValueGetter(Local<String> property, |
| 1342 | const Nan::PropertyCallbackInfo<v8::Value>& info) { |
| 1343 | HandleScope scope; |
| 1344 | if (!NodeRT::Utils::IsWinRtWrapperOf< |
| 1345 | ::Windows::Foundation::Collections::IKeyValuePair<K, V> ^>( |
| 1346 | info.This())) { |
| 1347 | return; |
| 1348 | } |
| 1349 | |
| 1350 | KeyValuePairWrapper<K, V>* wrapper = |
| 1351 | KeyValuePairWrapper<K, V>::Unwrap<KeyValuePairWrapper<K, V>>( |
| 1352 | info.This()); |
| 1353 | |
| 1354 | try { |
| 1355 | info.GetReturnValue().Set( |
| 1356 | wrapper->_valueGetterFunc(wrapper->_instance->Value)); |
| 1357 | } catch (Platform::Exception ^ exception) { |
| 1358 | NodeRT::Utils::ThrowWinRtExceptionInJs(exception); |
| 1359 | return; |
| 1360 | } |
| 1361 | } |
| 1362 | |
| 1363 | private: |
| 1364 | ::Windows::Foundation::Collections::IKeyValuePair<K, V> ^ _instance; |