public NativeTypeRef(IDeclarationContext parent, Type type, bool external = false, Type redirectbase = null) : base(parent, type) { if(null == type) { throw new ArgumentNullException("type"); } if(external) { SetExternal(); } if(type.IsSubclassOf(typeof(Delegate))) { _isdelegate = true; } else if (!type.IsValueType) { var rbase = redirectbase ?? type.BaseType; if (null != rbase) { _lbase = parent.TranslateRType(rbase, TranslateOptions.Add); //_typedependencies.Add(lbase); AddDepdendency(_lbase, DependencyLevel.Constructor); _isdelegate = _lbase.IsDelegate; } } parent.RegisterType(this); }
public Class(IDeclarationContext parent, Type type) : base(parent, type) { // save the underlying runtime type _rtype = type; _thisvar = new Variable(this, "this", this); Parent.RegisterType(this); ExtractBaseType(); ExtractNestedTypes(); if (IsConstructed) { ExtractMembers(); } }
protected ItemBase(IDeclarationContext parent, Type rtype) : this(parent) { _rtype = rtype; _id = rtype.GetRName(); }
protected ItemBase(IDeclarationContext parent, string name) : this(parent) { _id = name; }
private ItemBase(IDeclarationContext parent) { _parent = parent; }
/// <summary> /// Creates a method context. /// </summary> /// <param name="dc">The declaration context on which to base the method context, must be a class.</param> /// <returns>The method context.</returns> public static IMethodContext CreateMethodContext(IDeclarationContext dc) { return new MethodContext(dc); }
public GenericTypeRef(IDeclarationContext parent, ITypeItem generic, Type instance) : base(parent, instance.GetRName()) { _ltype = generic; _rtype = instance; }
public Constant(IDeclarationContext parent, ITypeItem type, object value) : base(parent, value.ToString()) { _ltype = type; }
private CSharpToJScriptRewriter CreateRewriter(DeclarationEmitContext dgc, IDeclarationContext context = null) { return new CSharpToJScriptRewriter(dgc, context ?? _context as IDeclarationContext); }
public NativeTypeRef(IDeclarationContext parent, string typename) : base(parent, typename) { SetExternal(); parent.RegisterType(this); }
public ItemWithType(IDeclarationContext parent, string id, ITypeItem type) : base(parent, id) { _container = parent; _type = type; }
public MethodContext(IDeclarationContext parent) : this() { Runtime.Assert(null != parent); _parent = parent; }
public Method(IDeclarationContext parent, string id, ITypeItem ltype) : base(parent, id, ltype) { }
internal static void AddMethodParameters(IDeclarationContext context, IEnumerable<ParameterSyntax> parameters) { if (null != parameters) { foreach (var par in parameters) { ITypeItem ltype = null; string typename = null; if (null != par.Type) { typename = ResolveLType(par.Type); ltype = context.ResolveLType(typename); } if (null == ltype && null != par.Type) { // TraceTarget.Trace("WARNING: unresolved parameter type '{0}'.", typename); } context.AddVariable(par.Identifier.ToString(), ltype); } } }
public Container(IDeclarationContext parent, string name) : base(parent, name) { _variables = new VariableCollection(this); _types = new ItemsCollection(); }
public CSharpSyntaxRewriter CreateRewriter(IDeclarationContext context = null) { return CreateRewriter(null, context); }
public Container(IDeclarationContext parent, Type rtype) : this(parent, rtype.GetRName()) { }
public Enumeration(IDeclarationContext parent, Type enumtype) : base(parent, enumtype) { parent.RegisterType(this); }
public VariableCollection(IDeclarationContext parent) { _parent = parent; }