Ejemplo n.º 1
0
    public IEnumerable <Instruction> ConvertFromString(string value, ILContext context, BaseNode node)
    {
        var module = context.Body.Method.Module;

        if (!string.IsNullOrEmpty(value))
        {
            value = value.Trim();

            if (value.StartsWith("#", StringComparison.Ordinal))
            {
                var colorConverter = new ColorTypeConverter();
                foreach (var instruction in colorConverter.ConvertFromString(value, context, node))
                {
                    yield return(instruction);
                }

                yield return(Instruction.Create(OpCodes.Newobj, module.ImportCtorReference(("Microsoft.Maui.Controls", "Microsoft.Maui.Controls", "SolidColorBrush"), parameterTypes: new[] {