static string FormatPropertyValue()

in tools/codegen/exe/OutputEffectType.cs [640:705]


        static string FormatPropertyValue(Effects.Property property, string value)
        {
            if (property.Type == "enum")
            {
                if (property.EnumFields.D2DEnum != null)
                {
                    bool valueFound = false;
                    foreach (EnumValue v in property.EnumFields.D2DEnum.Values)
                    {
                        if (v.ValueExpression == value)
                        {
                            value = v.NativeName;
                            valueFound = true;
                            break;
                        }
                    }
                    System.Diagnostics.Debug.Assert(valueFound);
                }
                else if (property.IsHidden)
                {
                    value = property.NativePropertyName.Replace("PROP_", "") + "_" + property.EnumFields.FieldsList[Int32.Parse(value)].Name.ToUpper();
                }
                else
                {
                    value = property.TypeNameCpp + "::" + property.EnumFields.FieldsList[Int32.Parse(value)].Name;
                }
            }
            else if (property.Type.StartsWith("matrix") || property.Type.StartsWith("vector"))
            {
                var values = SplitVectorValue(value);

                if (property.TypeNameCpp == "Color")
                {
                    values = ConvertVectorToColor(values);
                }
                else if (property.TypeNameCpp == "Rect")
                {
                    values = ConvertVectorToRect(values);
                }

                value = property.TypeNameCpp + "{ " + string.Join(", ", values) + " }";
            }
            else if (property.Type == "float")
            {
                if (!value.Contains('.'))
                {
                    value += ".0";
                }

                value += "f";
            }
            else if (property.Type == "bool")
            {
                value = "static_cast<boolean>(" + value + ")";
            }
            else if (property.IsArray)
            {
                value = "{ " + value + " }";
            }
            else if (value == "null")
            {
                value = "static_cast<" + property.TypeNameCpp + ">(nullptr)";
            }

            return value;
        }