MOTMaster.Controller.compileFromFile C# (CSharp) Method

compileFromFile() private method

/// - Once the user has selected a particular implementation of MOTMasterScript, MOTMaster will compile it. Note: the dll is currently stored in a temp folder somewhere. Its pathToPattern can be found in the CompilerResults.PathToAssembly). This newly formed dll contain methods named GetDigitalPattern and GetAnalogPattern. - These are called by the script's "GetSequence". GetSequence always returns a "MOTMasterSequence", which comprises a PatternBuilder32 and an AnalogPatternBuilder.
private compileFromFile ( string scriptPath ) : CompilerResults
scriptPath string
return System.CodeDom.Compiler.CompilerResults
        private CompilerResults compileFromFile(string scriptPath)
        {
            CompilerParameters options = new CompilerParameters();

            options.ReferencedAssemblies.Add(motMasterPath);
            options.ReferencedAssemblies.Add(daqPath);

            TempFileCollection tempFiles = new TempFileCollection();
            tempFiles.KeepFiles = true;
            CompilerResults results = new CompilerResults(tempFiles);
            options.GenerateExecutable = false;                         //Creates .dll instead of .exe.
            CodeDomProvider codeProvider = new CSharpCodeProvider();
            options.TempFiles = tempFiles;
            try
            {
                results = codeProvider.CompileAssemblyFromFile(options, scriptPath);
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message);
                return null;
            }
            //controllerWindow.WriteToScriptPath(results.PathToAssembly);
            return results;
        }