示例#1
0
        protected override void DeleteResourceTyped(Guid key)
        {
            var element = TypedPool.Get <Model>(key);

            element.Name = null;
            TypedPool.Post(key, element);
        }
示例#2
0
        protected override void WriteResourceTyped(Guid key, ModelDeriver resource)
        {
            var element = TypedPool.Get <Model>(key);

            element.Name = resource.Name;
            TypedPool.Post(key, element);
        }
示例#3
0
 protected override ElementDeriver GetItemTyped(Guid id)
 {
     if (TypedPool.Get <Element>(id) == null)
     {
         return(null);
     }
     return(new ElementDeriver {
         Name = TypedPool.Get <Element>(id).Name
     });
 }
示例#4
0
 protected override ModelDeriver GetItemTyped(Guid id)
 {
     if (TypedPool.Get <Model>(id) == null)
     {
         return(null);
     }
     return(new ModelDeriver {
         Name = TypedPool.Get <Model>(id).Name
     });
 }
示例#5
0
        public IEnumerable <Guid> ByModel(Guid element)
        {
            var el = TypedPool.Get <Element>(element);

            if (el == null)
            {
                return(DefaultValue);
            }

            return(new[] { el.Model });
        }
示例#6
0
        /// <summary> Get a routine from the pool. If yield is false routine will resume immediately from await. </summary>
        public static T Get <T>(bool yield) where T : RoutineBase, new()
        {
            var current = Current;

            if (current != null && current.IsDead)
            {
                throw new Exception("Routine is dead!");
            }
            var routine = pool.Get <T>();

            routine.Setup(yield, current);
            return(routine);
        }
        public IEnumerable <Guid> ByElInModel(Guid elementsInModel)
        {
            var el = TypedPool.Get <ElementsInModel>(elementsInModel);

            return(el.Elements);
        }
示例#8
0
 /// <summary> Get a resumer from the pool. </summary>
 public static IResumer GetResumer()
 {
     return(resumerPool.Get <Resumer>());
 }
示例#9
0
 public IEnumerable <Guid> GetSingleByAttribute(Guid attribute)
 {
     return(new[] { TypedPool.Get <Attribute>(attribute).ElementId });
 }
示例#10
0
 public IEnumerable <Guid> GetSingleByValue(Guid value)
 {
     return(new[] { TypedPool.Get <Value>(value).AttributeId });
 }