Ejemplo n.º 1
0
        /// <summary>
        /// Adds new library to the script library.
        /// </summary>
        /// <param name="desc">Configuration of script library to be added and reflected later.</param>
        /// <returns>True if library was added, false if the library was not added.</returns>
        private bool AddLibrary(ScriptLibraryConfigurationNode /*!*/ desc)
        {
            Debug.Assert(desc != null);

            if (libraries == null)
            {
                libraries = new List <ScriptLibraryConfigurationNode>();
            }
            else
            {
                // check for duplicity
                if (FindAddedLibrary(desc) >= 0)
                {
                    return(false);
                }
            }

            // add the library configuration to be loaded lazily
            libraries.Add(desc);
            return(true);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Adds new library to the script library.
        /// </summary>
        /// <param name="desc">Configuration of script library to be added and reflected later.</param>
        /// <returns>True if library was added, false if the library was not added.</returns>
        private bool AddLibrary(ScriptLibraryConfigurationNode/*!*/ desc)
        {
            Debug.Assert(desc != null);

            if (libraries == null)
            {
                libraries = new List<ScriptLibraryConfigurationNode>();
            }
            else
            {
                // check for duplicity
                if (FindAddedLibrary(desc) >= 0)
                    return false;
            }

            // add the library configuration to be loaded lazily
            libraries.Add(desc);
            return true;
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Check if the given library was already and returns its index within <see cref="libraries"/>.
 /// </summary>
 private int FindAddedLibrary(ScriptLibraryConfigurationNode /*!*/ desc)
 {
     return(libraries.IndexOf(desc));
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Check if the given library was already and returns its index within <see cref="libraries"/>.
 /// </summary>
 private int FindAddedLibrary(ScriptLibraryConfigurationNode/*!*/ desc)
 {
     return libraries.IndexOf(desc);
 }