internal SearchProfileOffsetByProfileId(IReadonlyList <ProfileOffset> profileOffsets) { _profileOffsets = profileOffsets; }
/// <summary> /// Constructs a new instance of <see cref="SearchReadonlyList{T, K}"/>. /// </summary> /// <param name="source"> /// The list of complex values to use with the index. /// </param> internal SearchReadonlyList(IReadonlyList <T> source) { _source = source; }
protected override int GetCount(IReadonlyList <Signature> signatures) { return(signatures.Count); }
protected override Signature GetValue(IReadonlyList <Signature> signatures, int index) { return(signatures[index]); }
internal SearchSignatureByNodes(IReadonlyList <Signature> signatures) { _signatures = signatures; }
protected override ProfileOffset GetValue(IReadonlyList <ProfileOffset> profiles, int index) { return(_profileOffsets[index]); }
protected override int GetCount(IReadonlyList <ProfileOffset> profiles) { return(profiles.Count); }
/// <summary> /// Called after the entire data set has been loaded to ensure /// any further initialisation steps that require other items in /// the data set can be completed. /// </summary> internal void Init() { // Set the string values of the data set. _name = Strings[NameOffset].ToString(); _format = Strings[FormatOffset].ToString(); _copyright = Strings[CopyrightOffset].ToString(); // Initialise any objects that can be pre referenced to speed up // initial matching. foreach (var entity in Components) entity.Init(); foreach (var entity in Properties) entity.Init(); foreach (var entity in Values) entity.Init(); foreach (var entity in Profiles) entity.Init(); foreach (var entity in Nodes) entity.Init(); foreach (var entity in Signatures) entity.Init(); // We no longer need the strings data structure as all dependent // data has been taken from it. Strings = null; }
public static string GetPreparationString(IReadonlyList<string> preparation) { if (preparation == null) return null; string prep = preparation.Aggregate ( new StringBuilder (), (buf, item) => { buf.Append (item); buf.Append (", "); return buf; }, buf => { if (buf.Length > 0) buf.Length -= 2; return buf.ToString (); }); return prep; }