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 AddClass(this ClassLibrary item, Type type, string layout, string text)
 {
     item.AddClass(
         new CmlClass_Entity(type, layout, CmlEntity.DOMify(text))
         );
 }
Exemple #3
0
 static public void AddClassProviders(this ClassLibrary item, params ClassProvider[] to_add)
 {
     item.AddClassProviders((IEnumerable <ClassProvider>)to_add);
 }
Exemple #4
0
 static public void AddClassProviders(this ClassLibrary item, IEnumerable <ClassProvider> to_add)
 {
     to_add.Process(f => item.AddClassProvider(f));
 }
Exemple #5
0
 static public void AddClasses(this ClassLibrary item, params CmlClass[] to_add)
 {
     item.AddClasses((IEnumerable <CmlClass>)to_add);
 }
Exemple #6
0
 static public void AddClasses(this ClassLibrary item, IEnumerable <CmlClass> to_add)
 {
     to_add.Process(c => item.AddClass(c));
 }