📜  获取索引画笔属性 C# 代码示例

📅  最后修改于: 2022-03-11 14:48:39.384000             🧑  作者: Mango

代码示例2
private Brush PickBrush()
{
    Brush result = Brushes.Transparent;

    Random rnd = new Random();

    Type brushesType = typeof(Brushes);

    PropertyInfo[] properties = brushesType.GetProperties();

    int random = rnd.Next(properties.Length);
    result = (Brush)properties[random].GetValue(null, null);

    return result;
}