System.Type.GetInterface C# (CSharp) Method

GetInterface() private method

private GetInterface ( int index ) : Type
index int
return Type
        internal Type GetInterface(int index)
        {
            return _GetTypeFromTypeFunc(interfaces[index]);
        }

Usage Example

Ejemplo n.º 1
1
        public static object ConvertToFromVector4(ITypeDescriptorContext context, CultureInfo culture, Vector4 value, Type destinationType)
        {
            if (destinationType == typeof(float))
            {
                return value.X;
            }
            if (destinationType == typeof(Vector2))
            {
                return new Vector2(value.X, value.Y);
            }
            if (destinationType == typeof(Vector3))
            {
                return new Vector3(value.X, value.Y, value.Z);
            }
            if (destinationType == typeof(Vector4))
            {
                return new Vector4(value.X, value.Y, value.Z, value.W);
            }
            if (destinationType.GetInterface("IPackedVector") != null)
            {
                IPackedVector packedVec = (IPackedVector) Activator.CreateInstance(destinationType);
                packedVec.PackFromVector4(value);
                return packedVec;
            }

            return null;
        }
All Usage Examples Of System.Type::GetInterface