Esempio n. 1
0
        public CanCauseError Apply(string[] parameters, IDirectivePreprocessor host)
        {
            string file = IOHelpers.FindFile(host.Input.CurrentFile, parameters [0]);

            if (file.Length <= 0)
            {
                if (!host.IncludeListener.AllowsMissingFiles())
                {
                    return(CanCauseError.Error("File " + parameters [0] + " not found."));
                }

                file = IOHelpers.GetPrefferedFileName(host.Input.CurrentFile, parameters [0]);
            }
            else
            {
                host.Input.OpenSourceFile(file);
            }

            host.IncludeListener.IncludeTextFile(file);
            return(CanCauseError.NoError);
        }