Exemple #1
0
        public RepresentationEngine()
        {
            global_library   = new GlobalLibrary();
            class_library    = new ClassLibrary();
            fragment_library = new FragmentLibrary();

            instancers   = new Dictionary <string, RepresentationInstancer>();
            constructors = new Dictionary <string, List <RepresentationConstructor> >();

            constructor_cache = new OperationCache <RepresentationConstructor, string, ContentsEnumerable <Type> >("constructor_cache", delegate(string name, ContentsEnumerable <Type> parameter_types) {
                return(constructors.GetValues(name)
                       .FindFirst(c => c.GetParameterTypes().AreElements(parameter_types, (p1, p2) => p1.CanHold(p2))));
            });

            infos = new Dictionary <string, TypeDictionary <RepresentationInfo> >();

            info_sets         = new Dictionary <Type, List <RepresentationInfoSet> >();
            general_modifiers = new Dictionary <Type, List <RepresentationModifier_General> >();
        }
Exemple #2
0
 static public void AddGlobals(this GlobalLibrary item, params Global[] to_add)
 {
     item.AddGlobals((IEnumerable <Global>)to_add);
 }
Exemple #3
0
 static public void AddGlobals(this GlobalLibrary item, IEnumerable <Global> to_add)
 {
     to_add.Process(g => item.AddGlobal(g));
 }