Ejemplo n.º 1
0
    public static string GetSubMaskString(IDictType dictType, string typeStr, bool getter)
    {
        LoquiType keyLoquiType   = dictType.KeyTypeGen as LoquiType;
        LoquiType valueLoquiType = dictType.ValueTypeGen as LoquiType;

        switch (dictType.Mode)
        {
        case DictMode.KeyValue:
            if (valueLoquiType != null)
            {
                return($"{(valueLoquiType == null ? $"({dictType.KeyTypeGen.TypeName(getter)} Key, {typeStr} Value)" : $"MaskItemIndexed<{dictType.KeyTypeGen.TypeName(getter)}, {typeStr}, {valueLoquiType.GetMaskString(typeStr)}?>")}");
            }
            else
            {
                string keyStr   = $"{(keyLoquiType == null ? dictType.KeyTypeGen.TypeName(getter: true) : $"MaskItem<{typeStr}, {keyLoquiType.GetMaskString(typeStr)}?>")}";
                string valueStr = $"{(valueLoquiType == null ? typeStr : $"MaskItem<{typeStr}, {valueLoquiType.GetMaskString(typeStr)}?>")}";
                return($"KeyValuePair<{keyStr}, {valueStr}>");
            }