Exemple #1
0
        public static int GetPropertyIndex(this ID2D1Properties properties, string name)
        {
            if (properties == null)
            {
                throw new ArgumentNullException(nameof(properties));
            }

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

            return(properties.GetPropertyIndex(name));
        }
        public static bool TryGetProperty(this ID2D1Properties properties, string name, out object value)
        {
            if (properties == null)
            {
                value = null;
                return(false);
            }

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

            var index = properties.GetPropertyIndex(name);

            if (index == uint.MaxValue)
            {
                value = null;
                return(false);
            }
            return(TryGetProperty(properties, index, out value));
        }
Exemple #3
0
        public static bool TryGetValue(this ID2D1Properties properties, string name, out D2D1_PROPERTY_TYPE type, out byte[] data)
        {
            if (properties == null)
            {
                throw new ArgumentNullException(nameof(properties));
            }

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

            var index = properties.GetPropertyIndex(name);

            if (index < 0)
            {
                data = null;
                type = D2D1_PROPERTY_TYPE.D2D1_PROPERTY_TYPE_UNKNOWN;
                return(false);
            }

            return(TryGetValue(properties, index, out type, out data));
        }