/// <summary>
        /// Compileaza fisierul cu cod sursa
        /// </summary>
        /// <param name="fileName">Numele fisierului</param>
        /// <param name="compiler">Compilatorul folosit</param>
        /// <returns></returns>
        public bool CompileFile(string fileName, CompilerData compiler)
        {
            if (!compiler.HasValidPath)
            {
                Messages.ShowMessageBox(Messages.COMPILER_EXE_NOT_FOUND, "");
                return false;
            }

            try
            {
                // sterge si copiaza noul cod sursa
                if (File.Exists(compiler.WorkingPath + fileName))
                    File.Delete(compiler.WorkingPath + fileName);
                File.Copy(Path.GetTempPath() + fileName, compiler.WorkingPath + fileName);

                string exeFileName = Path.GetFileNameWithoutExtension(fileName) + ".exe";
                // sterge programul compilat anterior, daca exista
                //if (File.Exists(Path.Combine(compiler.WorkingPath,exeFileName)))
                //    File.Delete(Path.Combine(compiler.WorkingPath,exeFileName));

                // adauga ghilimele in cazul ca path-ul are spatii (eg: Program Files devine: "Program Files" )
                //compiler.FullPath = "\"" + compiler.FullPath + "\"";
                //compiler.WorkingPath = compiler.WorkingPath;

                Process proces = CreateProcess(compiler.FullPath, compiler.WorkingPath,
                    compiler.GetArguments(fileName, exeFileName));
                proces.Start();
                proces.WaitForExit(5000);
                if (!proces.HasExited)
                    proces.Kill();

                LastOutput = proces.StandardOutput.ReadToEnd();
                LastError = proces.StandardError.ReadToEnd();
                return true;
            }
            catch (Exception e)
            {
                ExceptionsHandler.Instance.AddException(e, Messages.ERROR_COMPILE);
                return false;
            }
        }