Exemple #1
0
        /// <summary>
        /// Utility function for creating a VB-style manifest name from
        /// a resource name.
        /// </summary>
        /// <param name="fileName">The file name of the dependent (usually a .resx)</param>
        /// <param name="linkFileName">The file name of the dependent (usually a .resx)</param>
        /// <param name="rootNamespace">The root namespace (usually from the project file). May be null</param>
        /// <param name="dependentUponFileName">The file name of the parent of this dependency (usually a .vb file). May be null</param>
        /// <param name="binaryStream">File contents binary stream, may be null</param>
        /// <returns>Returns the manifest name</returns>
        override protected string CreateManifestName
        (
            string fileName,
            string linkFileName,
            string rootNamespace,         // May be null
            string dependentUponFileName, // May be null
            Stream binaryStream           // File contents binary stream, may be null
        )
        {
            ITaskItem item    = null;
            string    culture = null;

            if (fileName != null && itemSpecToTaskitem.TryGetValue(fileName, out item))
            {
                culture = item.GetMetadata("Culture");
            }

            /*
             *  Actual implementation is in a static method called CreateManifestNameImpl.
             *  The reason is that CreateManifestName can't be static because it is an
             *  override of a method declared in the base class, but its convenient
             *  to expose a static version anyway for unittesting purposes.
             */
            return(CreateVisualBasicManifestResourceName.CreateManifestNameImpl
                   (
                       fileName,
                       linkFileName,
                       PrependCultureAsDirectory,
                       rootNamespace,
                       dependentUponFileName,
                       culture,
                       binaryStream,
                       this.Log
                   ));
        }