Наследование: STRuntimeObject
Пример #1
0
 public void Build(Dictionary<string,NSPrototype> prototypes)
 {
     foreach (KeyValuePair<string,NSPrototype> kvp in prototypes) {
         var ns = new STNamespace(kvp.Key, FullName + "." + kvp.Key);
         ns.Build (kvp.Value.Entries);
         Map[STSymbol.Get(kvp.Key)] = ns;
     }
 }
Пример #2
0
        protected object DoesNotUnderstand(STMessage msg)
        {
            if (Map.ContainsKey(msg.Selector))
                return Map[msg.Selector];

            var t = Type.GetType(string.Format("{0}.{1}", FullName, msg.Selector.Name));

            if (t == null) {
                foreach (var asm in AppDomain.CurrentDomain.GetAssemblies()) {
                    t = asm.GetType(string.Format("{0}.{1}", FullName, msg.Selector.Name));
                    if (t != null) break;
                }
            }

            if (t != null) {
                var @class = STClass.GetForCLR(t, t.Name);
                Map[msg.Selector] = @class;
                return @class;
            }

            var ns = new STNamespace(msg.Selector.Name, FullName + "." + msg.Selector.Name);
            Map[msg.Selector] = ns;
            return ns;
            /*
            try {
                return Class.Superclass.RouteMessage(new STMessage(this, STSymbol.Get("doesNotUnderstand:"), msg));
            } catch (MessageNotUnderstood) {
                Console.Error.WriteLine ("No one implements doesNotUnderstand:! Bailing out.");
                return STUndefinedObject.Instance;
            }
            */
        }
Пример #3
0
 public static STNamespace Build(string name, NSPrototype prototype)
 {
     var ns = new STNamespace(name, name);
     ns.Build (prototype.Entries);
     return ns;
 }