예제 #1
0
        public static ScripterBase CreateScripter(string languageSuffix)
        {
            if (_scripters == null)
            {
                _scripters = new Hashtable();
            }

            ScripterBase scripter = (ScripterBase)_scripters[languageSuffix];

            //can only have one instance of each scripter
            //TODO: any reason to allow multiple instances?
            if (scripter != null)
            {
                return(scripter);
            }

            //TODO: use reflection to find available scripters
            if (languageSuffix == "boo")
            {
                scripter = new ScripterBoo();
            }
            else if (languageSuffix == "cs")
            {
                scripter = new ScripterCSharp();
            }

            scripter.FileExtension = languageSuffix;
            return(scripter);
        }
예제 #2
0
        public static ScripterBase CreateScripter(string languageSuffix)
        {
            if (_scripters == null)
                _scripters = new Hashtable();

            ScripterBase scripter = (ScripterBase)_scripters[languageSuffix];

            //can only have one instance of each scripter
            //TODO: any reason to allow multiple instances?
            if (scripter!=null)
                return scripter;

            //TODO: use reflection to find available scripters
            if (languageSuffix == "boo")
                scripter = new ScripterBoo();
            else if (languageSuffix == "cs")
                scripter = new ScripterCSharp();

            scripter.FileExtension = languageSuffix;
            return scripter;
        }