Did I find the right examples for you? yes no

All Samples(107)  |  Call(104)  |  Derive(0)  |  Import(3)

src/m/a/main-HEAD/Languages/IronPython/Samples/ClrType/clrtype.py   main(Download)
        if type(t) is type(System.IComparable): # type overloaded on generic arity, eg IComparable and IComparable[T]
            t = t[()] # select non-generic version
        clr_type = clr.GetClrType(t)
        if t == Void: 
            raise TypeError("Void cannot be used in signature")
                    prop_type = item.fset.arg_types[0]
                validate_clr_types(prop_type)
                clr_prop_type = clr.GetClrType(prop_type)
                yield item, item_name, clr_prop_type
 
                typebld.DefineField(
                    fldname, 
                    clr.GetClrType(field_type), 
                    FieldAttributes.Public)
 
                ilgen.Emit(OpCodes.Ldsfld, ClrClass.get_dynamic_operations_field())
                ilgen.Emit(OpCodes.Ldloc, ret_val)
                ilgen.Emit(OpCodes.Ldtoken, clr.GetClrType(function.return_type))
                ilgen.Emit(OpCodes.Call, get_type_from_handle)
                ilgen.Emit(OpCodes.Callvirt, convert_to)
 
            # leave out the PythonType argument
            assert(ctorparams[0].ParameterType == clr.GetClrType(PythonType))
            ctorparams = ctorparams[1:]
 

src/m/a/main-HEAD/Languages/IronPython/Samples/tests/ClrType/test_clrclass.py   main(Download)
from iptest.assert_util import *
from clrtype import ClrInterface, ClrClass, accepts, returns
from clr import GetClrType
import System
from test_clrtype import get_unique_namespace, ClrTypeInterface, ClrTypeClass
 
ct = GetClrType(ClrTypeClass)
def test_base_type_is_honored():
    AreEqual(ct.BaseType, GetClrType(object))
 
def test_can_implement_clrtype_interface():
    class C(ClrTypeInterface): pass

src/m/a/main-HEAD/Runtime/Samples/sympl/python/runtime.py   main(Download)
def ParamsMatchArgs (params, args):
    for a,p in zip(args, params):
        if (p.ParameterType is clr.GetClrType(Type) and #get past py type wrapping
            type(a.Value) is TypeModel): #ok if no value, value = null
                continue
def ConvertArguments (argMOs, pinfos):
    res = []
    for p,a in zip(pinfos, argMOs):
        argExpr = a.Expression
        if type(a.Value) is TypeModel and p.ParameterType is clr.GetClrType(Type):
def EnsureObjectResult (expr):
    if not expr.Type.IsValueType:
        return expr
    if expr.Type is clr.GetClrType(Void):
        return Exprs.Expression.Block(expr, Exprs.Expression.Default(object))

src/m/a/main-HEAD/Languages/IronPython/Samples/tests/ClrType/test_clrtype.py   main(Download)
from iptest.assert_util import *
from clrtype import ClrInterface, ClrClass, accepts, returns
from clr import GetClrType
import System
 
    def ClassMethod(self, s = ""): return  "ClrTypeClass-ClassMethod-" + s
 
ct = GetClrType(ClrTypeClass)
 
# Ensures that the CLR types have unique names
 
        p0 = foo.GetParameters()[0]
        AreEqual(p0.ParameterType, GetClrType(t))
 
        if metaclass is ClrClass:
        foo = GetClrType(T).GetMethod("Foo")
 
        AreEqual(foo.ReturnType, GetClrType(t))
 
        if metaclass is ClrClass:

src/m/a/main-HEAD/Languages/IronPython/Samples/tests/ClrType/test_clrinterface.py   main(Download)
from iptest.assert_util import *
from clrtype import ClrInterface, ClrClass, accepts, returns
from clr import GetClrType
import System
from test_clrtype import get_unique_namespace, ClrTypeInterface, ClrTypeClass
def test_clrtype_interface_can_inherit_clrtype_interface():
    class I(ClrTypeInterface):
        __metaclass__ = ClrInterface
        _clrnamespace = get_unique_namespace()
    AssertContains(GetClrType(I).GetInterfaces(), GetClrType(ClrTypeInterface))

src/m/a/main-HEAD/Languages/IronPython/Samples/ClrType/sample.py   main(Download)
def print_classattribs(p):
    t = clr.GetClrType(p.GetType())
    oa = t.GetCustomAttributes(System.ObsoleteAttribute, True)[0]
    clsc = t.GetCustomAttributes(System.CLSCompliantAttribute, True)[0]
    xmlr = t.GetCustomAttributes(System.Xml.Serialization.XmlRootAttribute, True)[0]

src/m/a/main-HEAD/Languages/IronPython/Public/Tools/Scripts/pyc.py   main(Download)
 
        # we currently do no error checking on what is passed in to the assemblyresolve event handler
        assemblyResolveMethod = tb.DefineMethod("AssemblyResolve", MethodAttributes.Public | MethodAttributes.Static, clr.GetClrType(Assembly), (clr.GetClrType(System.Object), clr.GetClrType(System.ResolveEventArgs)))
        gen = assemblyResolveMethod.GetILGenerator()
        s = gen.DeclareLocal(clr.GetClrType(System.IO.Stream)) # resource stream
        gen.Emit(OpCodes.Ldnull)
        gen.Emit(OpCodes.Stloc, s)
        d = gen.DeclareLocal(clr.GetClrType(System.Array[System.Byte])) # data buffer

src/p/y/pycon2010-HEAD/clrtype.py   pycon2010(Download)
        if type(t) is type(System.IComparable): # type overloaded on generic arity, eg IComparable and IComparable[T]
            t = t[()] # select non-generic version
        clr_type = clr.GetClrType(t)
        if t == Void: 
            raise TypeError("Void cannot be used in signature")
                    prop_type = item.fset.arg_types[0]
                validate_clr_types(prop_type)
                clr_prop_type = clr.GetClrType(prop_type)
                yield item, item_name, clr_prop_type
 
                typebld.DefineField(
                    fldname, 
                    clr.GetClrType(field_type), 
                    FieldAttributes.Public)
 
                ilgen.Emit(OpCodes.Ldsfld, ClrClass.get_dynamic_operations_field())
                ilgen.Emit(OpCodes.Ldloc, ret_val)
                ilgen.Emit(OpCodes.Ldtoken, clr.GetClrType(function.return_type))
                ilgen.Emit(OpCodes.Call, get_type_from_handle)
                ilgen.Emit(OpCodes.Callvirt, convert_to)
 
            # leave out the PythonType argument
            assert(ctorparams[0].ParameterType == clr.GetClrType(PythonType))
            ctorparams = ctorparams[1:]
 

src/m/a/main-HEAD/Languages/IronPython/Scripts/generate_AssemblyTypeNames.py   main(Download)
        # We ignore nested types. They will be loaded when the containing type is loaded
        # t.DeclaringType is failing on Silverlight (DDB 76340)
        t = clr.GetClrType(t)
        if t.DeclaringType:
            continue

src/i/r/ironpython3-HEAD/Src/Scripts/generate_AssemblyTypeNames.py   ironpython3(Download)
        # We ignore nested types. They will be loaded when the containing type is loaded
        # t.DeclaringType is failing on Silverlight (DDB 76340)
        t = clr.GetClrType(t)
        if t.DeclaringType:
            continue

  1 | 2 | 3  Next