コード例 #1
0
        internal LanguageCodeFileLine(LanguageCodeFile parentFile, int lineNumber, int firstCharPos, int charCount)
        {
            ParentCodeFileUnit = parentFile;

            LineNumber = lineNumber;

            FirstCharacterPosition = firstCharPos;

            CharactersCount = charCount;
        }
コード例 #2
0
ファイル: LanguageCodeProject.cs プロジェクト: phreed/GMac
        /// <summary>
        /// Add a new source code file to the list of source code files in the project. The file must exist inside
        /// the folder of the project or inside one of its sub-folders. The file must have an allowed extension as
        /// determined by the GetSourceFilesExtensions() mathod. The file must not be already added to the project
        /// </summary>
        /// <param name="filePath">The absolute full path of the file to be added to the project</param>
        /// <param name="fileEncoding">The encoding of the text in the file</param>
        /// <returns></returns>
        public LanguageCodeFile AddSourceFile(string filePath, Encoding fileEncoding)
        {
            if (CanAddSourceFile(filePath) == false)
            {
                return(null);
            }

            var fileRelativePath = filePath.Substring(ProjectFolderPath.Length);

            var sourceFile = new LanguageCodeFile(this, fileRelativePath, fileEncoding);

            SourceCodeFiles.Add(sourceFile);

            return(sourceFile);
        }