insert method

bool insert(
  1. K key,
  2. V value
)

Inserts or replaces an item in the map.

Implementation

bool insert(K key, V value) {
  if (isSameType<K, Guid>()) {
    if (isSubtypeOfInspectable<V>()) {
      return _insert_Guid_Object(key as Guid, (value as IInspectable).ptr);
    }

    return _insert_Guid_Object(key as Guid, boxValue(value));
  }

  if (isSameType<K, int>()) {
    return _insert_Uint32_COMObject(key as int, (value as IInspectable).ptr);
  }

  if (isSameType<K, PedometerStepKind>()) {
    return insertByPedometerStepKind(
        key as PedometerStepKind, (value as IInspectable).ptr);
  }

  if (isSameType<K, String>()) {
    if (isSameType<V, String>()) {
      return _insert_String_String(key as String, value as String);
    }

    if (isSubtypeOfInspectable<V>()) {
      return _insert_String_Object(
          key as String, (value as IInspectable).ptr);
    }

    if (isSubtypeOfWinRTEnum<V>()) {
      return _insert_String_enum(key as String, value as WinRTEnum);
    }

    return _insert_String_Object(key as String, boxValue(value));
  }

  return _insert_Object_Object(key as IInspectable, boxValue(value));
}