本文整理汇总了C#中Mono.CSharp.TypeContainer类的典型用法代码示例。如果您正苦于以下问题:C# TypeContainer类的具体用法?C# TypeContainer怎么用?C# TypeContainer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TypeContainer类属于Mono.CSharp命名空间,在下文中一共展示了TypeContainer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HoistedStoreyClass
public HoistedStoreyClass (TypeContainer parent, MemberName name, TypeParameter[] tparams, Modifiers mod)
: base (parent, name, mod | Modifiers.PRIVATE)
{
if (tparams != null) {
type_params = new TypeParameter[tparams.Length];
var src = new TypeParameterSpec[tparams.Length];
var dst = new TypeParameterSpec[tparams.Length];
for (int i = 0; i < type_params.Length; ++i) {
type_params[i] = tparams[i].CreateHoistedCopy (this, spec);
src[i] = tparams[i].Type;
dst[i] = type_params[i].Type;
}
// A copy is not enough, inflate any type parameter constraints
// using a new type parameters
var inflator = new TypeParameterInflator (this, null, src, dst);
for (int i = 0; i < type_params.Length; ++i) {
src[i].InflateConstraints (inflator, dst[i]);
}
mutator = new TypeParameterMutator (tparams, type_params);
}
}
示例2: PendingImplementation
PendingImplementation(TypeContainer container, MissingInterfacesInfo[] missing_ifaces, IList<MethodSpec> abstract_methods, int total)
{
var type_builder = container.Definition;
this.container = container;
pending_implementations = new TypeAndMethods [total];
int i = 0;
if (abstract_methods != null) {
int count = abstract_methods.Count;
pending_implementations [i].methods = new MethodSpec [count];
pending_implementations [i].need_proxy = new MethodSpec [count];
pending_implementations [i].methods = abstract_methods;
pending_implementations [i].found = new MethodData [count];
pending_implementations [i].type = type_builder;
++i;
}
foreach (MissingInterfacesInfo missing in missing_ifaces) {
var iface = missing.Type;
var mi = MemberCache.GetInterfaceMembers (iface);
int count = mi.Count;
pending_implementations [i].type = iface;
pending_implementations [i].optional = missing.Optional;
pending_implementations [i].methods = mi;
pending_implementations [i].found = new MethodData [count];
pending_implementations [i].need_proxy = new MethodSpec [count];
i++;
}
}
示例3: Class
public Class(TypeContainer parent, MemberName name, Modifiers mod, Attributes attrs)
: base(parent, name, attrs, MemberKind.Class)
{
var accmods = IsTopLevel ? Modifiers.INTERNAL : Modifiers.PRIVATE;
this.ModFlags = ModifiersExtensions.Check (AllowedModifiers, mod, accmods, Location, Report);
spec = new TypeSpec (Kind, null, this, null, ModFlags);
}
示例4: Enum
public Enum(TypeContainer parent, FullNamedExpression type, Modifiers mod_flags, MemberName name, Attributes attrs)
: base(parent, name, attrs, MemberKind.Enum)
{
underlying_type_expr = type;
var accmods = IsTopLevel ? Modifiers.INTERNAL : Modifiers.PRIVATE;
ModFlags = ModifiersExtensions.Check (AllowedModifiers, mod_flags, accmods, Location, Report);
spec = new EnumSpec (null, this, null, null, ModFlags);
}
示例5: CompilerGeneratedContainer
protected CompilerGeneratedContainer (TypeContainer parent, MemberName name, Modifiers mod, MemberKind kind)
: base (parent, name, null, kind)
{
Debug.Assert ((mod & Modifiers.AccessibilityMask) != 0);
ModFlags = mod | Modifiers.COMPILER_GENERATED | Modifiers.SEALED;
spec = new TypeSpec (Kind, null, this, null, ModFlags);
}
示例6: Iterator
//
// Our constructor
//
public Iterator(ParametersBlock block, IMethodData method, TypeContainer host, TypeSpec iterator_type, bool is_enumerable)
: base(block, TypeManager.bool_type, block.StartLocation)
{
this.OriginalMethod = method;
this.OriginalIteratorType = iterator_type;
this.IsEnumerable = is_enumerable;
this.Host = host;
this.type = method.ReturnType;
}
示例7: TypeContainer
public TypeContainer (TypeContainer parent, MemberName name, Attributes attrs, MemberKind kind)
: base (parent, name, attrs)
{
this.Kind = kind;
if (name != null)
this.Basename = name.Basename;
defined_names = new Dictionary<string, MemberCore> ();
}
示例8: Delegate
public Delegate(TypeContainer parent, FullNamedExpression type, Modifiers mod_flags, MemberName name, ParametersCompiled param_list,
Attributes attrs)
: base(parent, name, attrs, MemberKind.Delegate)
{
this.ReturnType = type;
ModFlags = ModifiersExtensions.Check (AllowedModifiers, mod_flags,
IsTopLevel ? Modifiers.INTERNAL :
Modifiers.PRIVATE, name.Location, Report);
parameters = param_list;
spec = new TypeSpec (Kind, null, this, null, ModFlags | Modifiers.SEALED);
}
示例9: Iterator
//
// Our constructor
//
private Iterator(CompilerContext ctx, IMethodData method, TypeContainer host, TypeSpec iterator_type, bool is_enumerable)
: base(new ToplevelBlock (ctx, method.Block, ParametersCompiled.EmptyReadOnlyParameters, method.Block.StartLocation),
TypeManager.bool_type,
method.Location)
{
this.OriginalMethod = method;
this.OriginalIteratorType = iterator_type;
this.IsEnumerable = is_enumerable;
this.Host = host;
this.type = method.ReturnType;
IteratorHost = Block.ChangeToIterator (this, method.Block);
}
示例10: GenerateTypeDocComment
// TypeContainer
//
// Generates xml doc comments (if any), and if required,
// handle warning report.
//
internal static void GenerateTypeDocComment (TypeContainer t,
DeclSpace ds, Report Report)
{
GenerateDocComment (t, ds, Report);
if (t.DefaultStaticConstructor != null)
t.DefaultStaticConstructor.GenerateDocComment (t);
if (t.InstanceConstructors != null)
foreach (Constructor c in t.InstanceConstructors)
c.GenerateDocComment (t);
if (t.Types != null)
foreach (TypeContainer tc in t.Types)
tc.GenerateDocComment (t);
if (t.Delegates != null)
foreach (Delegate de in t.Delegates)
de.GenerateDocComment (t);
if (t.Constants != null)
foreach (Const c in t.Constants)
c.GenerateDocComment (t);
if (t.Fields != null)
foreach (FieldBase f in t.Fields)
f.GenerateDocComment (t);
if (t.Events != null)
foreach (Event e in t.Events)
e.GenerateDocComment (t);
if (t.Indexers != null)
foreach (Indexer ix in t.Indexers)
ix.GenerateDocComment (t);
if (t.Properties != null)
foreach (Property p in t.Properties)
p.GenerateDocComment (t);
if (t.Methods != null)
foreach (MethodOrOperator m in t.Methods)
m.GenerateDocComment (t);
if (t.Operators != null)
foreach (Operator o in t.Operators)
o.GenerateDocComment (t);
}
示例11: FindDynamicClasses
public static void FindDynamicClasses(TypeContainer container, List<Class> classes)
{
foreach (var cont in container.Containers) {
if (cont is Class) {
// Is class marked as dynamic?
var cl = cont as Class;
if (cl.IsAsDynamicClass && !(cl.BaseType != null && cl.BaseType.IsAsDynamicClass)) {
classes.Add ((Class)cont);
}
}
// Recursively find more classes
if (cont.Containers != null)
FindDynamicClasses(cont, classes);
}
}
示例12: RemoveContainer
public virtual void RemoveContainer (TypeContainer cont)
{
if (containers != null)
containers.Remove (cont);
var tc = Parent == Module ? Module : this;
tc.defined_names.Remove (cont.Basename);
}
示例13: BaseContext
public BaseContext (TypeContainer tc)
{
this.tc = tc;
}
示例14: AddTypeContainer
public virtual void AddTypeContainer (TypeContainer tc)
{
containers.Add (tc);
var tparams = tc.MemberName.TypeParameters;
if (tparams != null && tc.PartialContainer != null) {
var td = (TypeDefinition) tc;
for (int i = 0; i < tparams.Count; ++i) {
var tp = tparams[i];
if (tp.MemberName == null)
continue;
td.AddNameToContainer (tp, tp.Name);
}
}
}
示例15: ClassOrStruct
public ClassOrStruct (TypeContainer parent, MemberName name, Attributes attrs, MemberKind kind)
: base (parent, name, attrs, kind)
{
}