Beispiel #1
0
        private static IEnumerable <string> GetSubsets(LSLLibraryBaseData libraryBaseData,
                                                       LSLLibraryDataAdditions dataAdditions)
        {
            yield return(libraryBaseData.ToSubsetName());

            foreach (var name in dataAdditions.ToSubsetNames())
            {
                yield return(name);
            }
        }
Beispiel #2
0
        /// <summary>
        ///     Converts <see cref="LSLLibraryBaseData"/>to the corresponding subset string.
        /// </summary>
        /// <param name="baseDataOption">The base data option.</param>
        /// <returns>a string representation of the subset</returns>
        public static string ToSubsetName(this LSLLibraryBaseData baseDataOption)
        {
            switch (baseDataOption)
            {
            case LSLLibraryBaseData.StandardLsl:
                return("lsl");

            case LSLLibraryBaseData.OpensimLsl:
                return("os-lsl");

            default:
                throw new ArgumentOutOfRangeException("baseDataOption", baseDataOption, null);
            }
        }
Beispiel #3
0
 /// <summary>
 ///     Constructs an <see cref="LSLEmbeddedLibraryDataProvider"/> using the library data embedded in LibLSLCC's assembly.
 /// </summary>
 /// <param name="liveFiltering">
 ///     If this is set to true, all subsets will be loaded into memory. And when you change the active subsets query
 ///     results will change.  Otherwise if this is false, only subsets present upon construction will be loaded.
 /// </param>
 /// <param name="libraryBaseData">The base library data to use.</param>
 /// <param name="dataAdditions">Addititional library data to import (flags).</param>
 /// <param name="loadOptions">
 ///     Optionally specifies what type's of library definitions will be loaded, defaults to
 ///     <see cref="LSLLibraryDataLoadOptions.All" />
 /// </param>
 /// <exception cref="InvalidOperationException">
 ///     If the embedded library data could not be loaded from the assembly
 ///     manifest.
 /// </exception>
 public LSLEmbeddedLibraryDataProvider(LSLLibraryBaseData libraryBaseData,
                                       LSLLibraryDataAdditions dataAdditions, bool liveFiltering,
                                       LSLLibraryDataLoadOptions loadOptions = LSLLibraryDataLoadOptions.All)
     : this(GetSubsets(libraryBaseData, dataAdditions), liveFiltering, loadOptions)
 {
 }