GetExtensionOfSourceFile() public static method

public static GetExtensionOfSourceFile ( string file ) : string
file string
return string
コード例 #1
0
        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");
        }
コード例 #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");
        }
コード例 #3
0
ファイル: MonoIsland.cs プロジェクト: wensincai/Unity5.4
 public string GetExtensionOfSourceFiles()
 {
     return((this._files.Length <= 0) ? "NA" : ScriptCompilers.GetExtensionOfSourceFile(this._files[0]));
 }
コード例 #4
0
 public string GetExtensionOfSourceFiles()
 {
     return(_files.Length > 0 ? ScriptCompilers.GetExtensionOfSourceFile(_files[0]) : "NA");
 }