CodeGen/Builders/CodeBuilderBase.cs

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.Common;
using System.IO;

using ComLib.Models;


namespace ComLib.CodeGeneration
{
    /// <summary>
    /// Base class for code builders.
    /// </summary>
    public class CodeBuilderBase
    {        
        /// <summary>
        /// Code ident level.
        /// </summary>
        protected int _indentLevel = 0;


        #region Indentation
        /// <summary>
        /// Gets the indentation level.
        /// </summary>
        /// <returns></returns>
        protected string GetIndent()
        {
            string indent = string.Empty;
            for (int ndx = 0; ndx < _indentLevel; ndx++)
            {
                indent += "\t";
            }
            return indent;
        }


        /// <summary>
        /// Increments the indentation by 1 level of spaces ( 4 ).
        /// </summary>
        protected void IncrementIndent()
        {
            _indentLevel++;
        }


        /// <summary>
        /// Increments the indentation by count number of spaces ( 4 )
        /// </summary>
        /// <param name="count"></param>
        protected void IncrementIndent(int count)
        {
            _indentLevel += count;
        }


        /// <summary>
后面还有 66 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。