Esempio n. 1
0
        internal override void InitializeConstants(RubyContext context, Dictionary<string, object> constants)
        {
            if (_type != typeof(object)) {
                var typeNesting = ((MetadataRecord)_typeDef).Tables.GetTypeNesting();

                foreach (TypeDef typeDef in typeNesting.GetNestedTypes(_typeDef)) {
                    constants.Add(typeDef.Name.ToString(), new RubyModule(context, new ClrTypeInfo(typeDef)));
                }
            }
        }
Esempio n. 2
0
 internal RubyModule(RubyContext context, ClrModuleInfo clrModule)
 {
     _context = context;
     _clrModule = clrModule;
 }
Esempio n. 3
0
        internal override void InitializeConstants(RubyContext context, Dictionary<string, object> constants)
        {
            foreach (TypeDef typeDef in _namespaceNode.GetTypeDefs()) {
                constants[typeDef.Name.ToString()] = new RubyModule(context, new ClrTypeInfo(typeDef));
            }

            foreach (var ns in _namespaceNode.GetNamespaces()) {
                constants[ns.Name.ToString()] = new RubyModule(context, new ClrNamespaceInfo(ns));
            }

            // TODO: resolve namespace/type conflicts (C# doesn't allow, but there could be some)

            _namespaceNode = null;
        }
Esempio n. 4
0
 internal abstract void InitializeConstants(RubyContext context, Dictionary<string, object> constants);
Esempio n. 5
0
 public static void Run()
 {
     var context = new RubyContext();
     context.OnAssemblyLoaded(typeof(object).Assembly);
     context.OnAssemblyLoaded(typeof(Expression).Assembly);
 }
Esempio n. 6
0
 internal abstract void InitializeConstants(RubyContext context, Dictionary <string, object> constants);
Esempio n. 7
0
 internal RubyModule(RubyContext context, ClrModuleInfo clrModule)
 {
     _context   = context;
     _clrModule = clrModule;
 }