/// <summary> /// XNode as Bytes, encoded with UTF8. /// </summary> public XNodeBytes(XNode node) { this.bytes = new ScalarOf <byte[]>(() => { return (new BytesOf( Encoding.UTF8.GetBytes(node.ToString()) ).AsBytes()); }); }
/// <summary> /// A cache which ignores the given items. /// </summary> public IgnoringCache(ICache <TData> origin, IEnumerable <string> ignored) { this.patterns = new ScalarOf <string[]>(() => { var items = new ListOf <string>(ignored); var compiled = new string[items.Count]; for (int i = 0; i < items.Count; i++) { compiled[i] = Regex.Escape(items[i].ToLower()).Replace("\\*", ".*").Replace("\\?", ".") + "$"; } return(compiled); }); this.origin = origin; }
/// <summary> /// A cell which exists physically as a file. /// </summary> private FileCell(IScalar <string> name, ScalarOf <IMnemonic> mem) { this.mem = mem; this.name = name; }
/// <summary> /// A cell whose content is stored in memory. /// </summary> private MemorizedCell(string name, ScalarOf <IMnemonic> mem) { this.name = new Normalized(name); this.mem = mem; }