Beispiel #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);
        }
Beispiel #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);
        }
Beispiel #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));
 }
Beispiel #4
0
 static public void AddFragment(this FragmentLibrary item, string name, string text)
 {
     item.AddFragment(
         new CmlFragment_Entity(name, CmlEntity.DOMify(text))
         );
 }
Beispiel #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))
         );
 }
Beispiel #6
0
 public CmlClass GetCmlClass(Type t)
 {
     return(new CmlClass_Entity(t, layout, CmlEntity.DOMify(cml)));
 }
Beispiel #7
0
 public CmlClass_Entity(Type t, string l, CmlEntity e) : base(t, l)
 {
     entity = e;
 }
Beispiel #8
0
 public CmlValue_Link_WithEntity(CmlValue_Link l, CmlEntity e)
 {
     link   = l;
     entity = e;
 }
Beispiel #9
0
 public EffigyClassInfo_Static(CmlEntity e)
 {
     entity = e;
 }
Beispiel #10
0
 public CmlFragment_Entity(string n, CmlEntity e)
 {
     name   = n;
     entity = e;
 }
Beispiel #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)));
 }
Beispiel #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));
 }