Пример #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)));
                }
            }
        }
Пример #2
0
 internal RubyModule(RubyContext context, ClrModuleInfo clrModule)
 {
     _context = context;
     _clrModule = clrModule;
 }
Пример #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;
        }
Пример #4
0
 internal abstract void InitializeConstants(RubyContext context, Dictionary<string, object> constants);
Пример #5
0
 public static void Run()
 {
     var context = new RubyContext();
     context.OnAssemblyLoaded(typeof(object).Assembly);
     context.OnAssemblyLoaded(typeof(Expression).Assembly);
 }
Пример #6
0
 internal abstract void InitializeConstants(RubyContext context, Dictionary <string, object> constants);
Пример #7
0
 internal RubyModule(RubyContext context, ClrModuleInfo clrModule)
 {
     _context   = context;
     _clrModule = clrModule;
 }