Esempio n. 1
0
        public object Instance(CmlContext context, CmlEntity entity)
        {
            List <CmlParameter> parameters = entity.GetTopicalChildren <CmlEntityInfo>()
                                             .Convert(i => i.CreateParameter(context))
                                             .ToList();

            object representation = InstanceInternal(
                context
                .NewUnitSpace()
                .NewFragmentSpace(parameters)
                );

            context.AddDeferredProcess(delegate() {
                parameters.Narrow(p => p.IsUnused()).Process(p => p.PushToRepresentation(context, representation));
            });

            return(representation);
        }
Esempio n. 2
0
        public object Instance(CmlContext context, CmlEntity entity)
        {
            CmlRepresentationSpace representation_space;
            object representation = Instance(context);

            if (entity.HasId())
            {
                context.GetUnitSpace().AddRepresentation(entity.GetId(), representation);
            }

            context = context.NewRepresentationSpace(representation, out representation_space);

            context.AddDeferredProcess(delegate() {
                context.GetEngine().AssertApplyGeneralModifiers(context, representation);
                entity.GetTopicalChildren <CmlEntityInfo>().Process(i => i.PushToRepresentation(context, representation));

                representation_space.SolidifyInstance(context);
            });

            return(representation);
        }
Esempio n. 3
0
 static public AttemptResult AttemptReadCmlEntity(this StreamSystem item, string path, out CmlEntity entity, long milliseconds = StreamSystem.DEFAULT_WAIT)
 {
     return(item.AttemptReadText <CmlEntity>(path, delegate(string text) {
         return CmlEntity.DOMify(text);
     }, out entity, milliseconds));
 }
Esempio n. 4
0
 static public void AddFragment(this FragmentLibrary item, string name, string text)
 {
     item.AddFragment(
         new CmlFragment_Entity(name, CmlEntity.DOMify(text))
         );
 }
Esempio n. 5
0
 static public void AddClass(this ClassLibrary item, Type type, string layout, string text)
 {
     item.AddClass(
         new CmlClass_Entity(type, layout, CmlEntity.DOMify(text))
         );
 }
Esempio n. 6
0
 public CmlClass GetCmlClass(Type t)
 {
     return(new CmlClass_Entity(t, layout, CmlEntity.DOMify(cml)));
 }
Esempio n. 7
0
 public CmlClass_Entity(Type t, string l, CmlEntity e) : base(t, l)
 {
     entity = e;
 }
Esempio n. 8
0
 public CmlValue_Link_WithEntity(CmlValue_Link l, CmlEntity e)
 {
     link   = l;
     entity = e;
 }
Esempio n. 9
0
 public EffigyClassInfo_Static(CmlEntity e)
 {
     entity = e;
 }
Esempio n. 10
0
 public CmlFragment_Entity(string n, CmlEntity e)
 {
     name   = n;
     entity = e;
 }
Esempio n. 11
0
 public object AssertInstance(CmlContext context, string tag, CmlEntity entity)
 {
     return(GetInstancer(tag).IfNotNull(i => i.Instance(context, entity))
            .AssertNotNull(() => new CmlRuntimeError_InvalidIdException("entity", tag)));
 }
Esempio n. 12
0
 static public AttemptResult AttemptReadCmlEntity(this StreamSystemStream item, out CmlEntity entity, long milliseconds = StreamSystem.DEFAULT_WAIT)
 {
     return(item.GetStreamSystem().AttemptReadCmlEntity(item.GetPath(), out entity, milliseconds));
 }