Exemplo n.º 1
0
        public static void SetValue(this ID2D1Properties properties, int index, string value)
        {
            if (properties == null)
            {
                throw new ArgumentNullException(nameof(properties));
            }

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

            properties.SetValue((uint)index, D2D1_PROPERTY_TYPE.D2D1_PROPERTY_TYPE_UNKNOWN, bytes, (bytes?.Length).GetValueOrDefault()).ThrowOnError();
        }
Exemplo n.º 2
0
        public static void SetValue(this ID2D1Properties properties, int index, byte[] value, D2D1_PROPERTY_TYPE type = D2D1_PROPERTY_TYPE.D2D1_PROPERTY_TYPE_UNKNOWN)
        {
            if (properties == null)
            {
                throw new ArgumentNullException(nameof(properties));
            }

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

            properties.SetValue((uint)index, type, value, value.Length).ThrowOnError();
        }