[System] Fix a few type members on WatchOS
[mono.git] / mcs / class / Microsoft.Build.Tasks / Microsoft.Build.Tasks / CreateVisualBasicManifestResourceName.cs
index 6b7fb55534a573c3eedc5d32f01dafa1093acb81..1437990b39db9b23c126ea1800d0bd7b72331aee 100644 (file)
@@ -25,7 +25,6 @@
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
-#if NET_2_0
 
 using System;
 using System.IO;
@@ -45,9 +44,10 @@ namespace Microsoft.Build.Tasks {
                                                              string dependentUponFileName,
                                                              Stream binaryStream)
                {
+                       string filename_to_use = String.IsNullOrEmpty (linkFileName) ? fileName : linkFileName;
                        if (String.IsNullOrEmpty (dependentUponFileName) || binaryStream == null)
                                return GetResourceIdFromFileName
-                                       (Path.GetFileName (fileName), rootNamespace);
+                                       (Path.GetFileName (filename_to_use), rootNamespace);
 
                        string ns = null;
                        string classname = null;
@@ -77,10 +77,10 @@ namespace Microsoft.Build.Tasks {
                                }
 
                                if (classname == null)
-                                       return GetResourceIdFromFileName (fileName, rootNamespace);
+                                       return GetResourceIdFromFileName (filename_to_use, rootNamespace);
 
                                string culture, extn, only_filename;
-                               if (AssignCulture.TrySplitResourceName (fileName, out only_filename, out culture, out extn))
+                               if (AssignCulture.TrySplitResourceName (filename_to_use, out only_filename, out culture, out extn))
                                        extn = "." + culture;
                                else
                                        extn = String.Empty;
@@ -100,7 +100,7 @@ namespace Microsoft.Build.Tasks {
 
                protected override bool IsSourceFile (string fileName)
                {
-                       return Path.GetExtension (fileName).ToLower () == ".vb";
+                       return string.Equals (Path.GetExtension (fileName), ".vb", StringComparison.OrdinalIgnoreCase);
                }
 
                /* Special parser for VB.NET files
@@ -175,4 +175,3 @@ namespace Microsoft.Build.Tasks {
        }
 }
 
-#endif