System.Xml.Xsl.IlGen.GenerateHelper.CallValueAs C# (CSharp) Method

CallValueAs() public method

public CallValueAs ( Type clrType ) : void
clrType System.Type
return void
        public void CallValueAs(Type clrType)
        {
            MethodInfo meth;

            meth = XmlILMethods.StorageMethods[clrType].ValueAs;
            if (meth == null)
            {
                // Call (Type) item.ValueAs(Type, null)
                LoadType(clrType);
                Emit(OpCodes.Ldnull);
                Call(XmlILMethods.ValueAsAny);

                // Unbox or down-cast
                TreatAs(typeof(object), clrType);
            }
            else
            {
                // Call strongly typed ValueAs method
                Call(meth);
            }
        }