GetExtensionOfSourceFile() public static méthode

public static GetExtensionOfSourceFile ( string file ) : string
file string
Résultat string
        internal static string GetNamespace(string file)
        {
            if (string.IsNullOrEmpty(file))
            {
                throw new ArgumentException("Invalid file");
            }
            string extensionOfSourceFile = ScriptCompilers.GetExtensionOfSourceFile(file);

            foreach (SupportedLanguage current in ScriptCompilers._supportedLanguages)
            {
                if (current.GetExtensionICanCompile() == extensionOfSourceFile)
                {
                    return(current.GetNamespace(file));
                }
            }
            throw new ApplicationException("Unable to find a suitable compiler");
        }
Exemple #2
0
        internal static string GetNamespace(string file)
        {
            if (string.IsNullOrEmpty(file))
            {
                throw new ArgumentException("Invalid file");
            }
            string extensionOfSourceFile = ScriptCompilers.GetExtensionOfSourceFile(file);

            using (List <SupportedLanguage> .Enumerator enumerator = ScriptCompilers._supportedLanguages.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    SupportedLanguage current = enumerator.Current;
                    if (current.GetExtensionICanCompile() == extensionOfSourceFile)
                    {
                        return(current.GetNamespace(file));
                    }
                }
            }
            throw new ApplicationException("Unable to find a suitable compiler");
        }
Exemple #3
0
 public string GetExtensionOfSourceFiles()
 {
     return((this._files.Length <= 0) ? "NA" : ScriptCompilers.GetExtensionOfSourceFile(this._files[0]));
 }
Exemple #4
0
 public string GetExtensionOfSourceFiles()
 {
     return(_files.Length > 0 ? ScriptCompilers.GetExtensionOfSourceFile(_files[0]) : "NA");
 }