예제 #1
0
        public XClass(ClassDefinition definition, XSystemDictionary smalltalk)
        {
            if ((definition == null) || (smalltalk == null))
                throw new ArgumentNullException();

            this.Name = definition.Name.Value;
            if (!String.IsNullOrWhiteSpace(definition.SuperclassName.Value) && (definition.SuperclassName.Value != "nil"))
                this._superclass = smalltalk.GetOrCreateBinding(definition.SuperclassName.Value);
            this.InstanceState = definition.InstanceState.Value;

            this.ClassVariables = new ClassVariablesPool(definition.ClassVariableNames);
            this.ClassInstanceVariables = new ClassInstanceVariablesPool(this, definition.ClassInstanceVariableNames);
            this.ImportedPools = new ImportedPoolsPool(smalltalk, definition.ImportedPoolNames);
            this.InstanceVariableNames = definition.InstanceVariableNames.Select(sr => sr.Value).ToArray();
        }
예제 #2
0
 public ImportedPoolsPool(XSystemDictionary smalltalk, IEnumerable<Installer.SourceReference<string>> items)
 {
     if ((items == null) || (smalltalk == null))
         throw new ArgumentNullException();
     foreach (var item in items)
     {
         XBinding binding = smalltalk.GetOrCreateBinding(item.Value);
         this.Bindings.Add(binding.Key, binding);
     }
 }