Exemplo n.º 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> >();
        }
Exemplo n.º 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))
         );
 }
Exemplo n.º 3
0
 static public void AddClassProviders(this ClassLibrary item, params ClassProvider[] to_add)
 {
     item.AddClassProviders((IEnumerable <ClassProvider>)to_add);
 }
Exemplo n.º 4
0
 static public void AddClassProviders(this ClassLibrary item, IEnumerable <ClassProvider> to_add)
 {
     to_add.Process(f => item.AddClassProvider(f));
 }
Exemplo n.º 5
0
 static public void AddClasses(this ClassLibrary item, params CmlClass[] to_add)
 {
     item.AddClasses((IEnumerable <CmlClass>)to_add);
 }
Exemplo n.º 6
0
 static public void AddClasses(this ClassLibrary item, IEnumerable <CmlClass> to_add)
 {
     to_add.Process(c => item.AddClass(c));
 }