protected override void DeleteResourceTyped(Guid key) { var element = TypedPool.Get <Model>(key); element.Name = null; TypedPool.Post(key, element); }
protected override void WriteResourceTyped(Guid key, ModelDeriver resource) { var element = TypedPool.Get <Model>(key); element.Name = resource.Name; TypedPool.Post(key, element); }
protected override ElementDeriver GetItemTyped(Guid id) { if (TypedPool.Get <Element>(id) == null) { return(null); } return(new ElementDeriver { Name = TypedPool.Get <Element>(id).Name }); }
protected override ModelDeriver GetItemTyped(Guid id) { if (TypedPool.Get <Model>(id) == null) { return(null); } return(new ModelDeriver { Name = TypedPool.Get <Model>(id).Name }); }
public IEnumerable <Guid> ByModel(Guid element) { var el = TypedPool.Get <Element>(element); if (el == null) { return(DefaultValue); } return(new[] { el.Model }); }
/// <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); }
/// <summary> Get a resumer from the pool. </summary> public static IResumer GetResumer() { return(resumerPool.Get <Resumer>()); }
public IEnumerable <Guid> GetSingleByAttribute(Guid attribute) { return(new[] { TypedPool.Get <Attribute>(attribute).ElementId }); }
public IEnumerable <Guid> GetSingleByValue(Guid value) { return(new[] { TypedPool.Get <Value>(value).AttributeId }); }