Ejemplo n.º 1
0
        public static void SetValueByName(this ID2D1Properties properties, string name, byte[] value, D2D1_PROPERTY_TYPE type = D2D1_PROPERTY_TYPE.D2D1_PROPERTY_TYPE_UNKNOWN)
        {
            if (properties == null)
            {
                throw new ArgumentNullException(nameof(properties));
            }

            if (name == null)
            {
                throw new ArgumentNullException(nameof(name));
            }

            properties.SetValueByName(name, type, value, value.Length).ThrowOnError();
        }
Ejemplo n.º 2
0
        public static void SetValueByName(this ID2D1Properties properties, string name, string value)
        {
            if (properties == null)
            {
                throw new ArgumentNullException(nameof(properties));
            }

            if (name == null)
            {
                throw new ArgumentNullException(nameof(name));
            }

            var bytes = value != null?Encoding.Unicode.GetBytes(value) : null;

            properties.SetValueByName(name, D2D1_PROPERTY_TYPE.D2D1_PROPERTY_TYPE_UNKNOWN, bytes, (bytes?.Length).GetValueOrDefault()).ThrowOnError();
        }