internal IEnumerable <EntityInstance> Find(ITemplateName name) { if (!this.dict.TryGetValue(name.Name, out List <List <EntityInstance> > list) || name.Arity >= list.Count) { return(Enumerable.Empty <EntityInstance>()); } return(list[name.Arity]); }
/*internal void RemoveLast(ILocalBindable bindable) * { * if (string.IsNullOrEmpty(bindable.Name.Name)) * return; * this.bag.RemoveLast(bindable.Name, new LocalInfo(bindable)); * }*/ internal bool TryGet <T>(ITemplateName name, out T value) where T : class, IBindable { LocalInfo info; if (!this.bag.TryGetValue(name, out info)) { value = null; return(false); } value = info.Bindable as T; bool result = value != null; if (result) { info.Used = true; if ((name.Owner as Assignment)?.Lhs != name) { info.Read = true; } } return(result); }
public TemplateNamePresenter(ITemplateName _view) { view = _view; }