Esempio n. 1
0
 internal SearchProfileOffsetByProfileId(IReadonlyList <ProfileOffset> profileOffsets)
 {
     _profileOffsets = profileOffsets;
 }
Esempio n. 2
0
 /// <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;
 }
Esempio n. 3
0
 protected override int GetCount(IReadonlyList <Signature> signatures)
 {
     return(signatures.Count);
 }
Esempio n. 4
0
 protected override Signature GetValue(IReadonlyList <Signature> signatures, int index)
 {
     return(signatures[index]);
 }
Esempio n. 5
0
 internal SearchSignatureByNodes(IReadonlyList <Signature> signatures)
 {
     _signatures = signatures;
 }
Esempio n. 6
0
 protected override ProfileOffset GetValue(IReadonlyList <ProfileOffset> profiles, int index)
 {
     return(_profileOffsets[index]);
 }
Esempio n. 7
0
 protected override int GetCount(IReadonlyList <ProfileOffset> profiles)
 {
     return(profiles.Count);
 }
Esempio n. 8
0
        /// <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;
        }
Esempio n. 9
0
 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;
 }