コード例 #1
0
        /// <summary>
        ///     Creates a new CSharpIndentEngine instance from the given prototype.
        /// </summary>
        /// <param name="prototype">
        ///     An CSharpIndentEngine instance.
        /// </param>
        public CSharpIndentEngine(CSharpIndentEngine prototype)
        {
            this.options = prototype.options;

            this.newLineChar              = prototype.newLineChar;
            this.currentState             = prototype.currentState.Clone(this);
            this.conditionalSymbols       = new HashSet <string>(prototype.conditionalSymbols);
            this.customConditionalSymbols = new HashSet <string>(prototype.customConditionalSymbols);

            this.wordToken       = new StringBuilder(prototype.wordToken.ToString());
            this.previousKeyword = string.Copy(prototype.previousKeyword);

            this.offset      = prototype.offset;
            this.line        = prototype.line;
            this.column      = prototype.column;
            this.isLineStart = prototype.isLineStart;
            this.isLineStartBeforeWordToken = prototype.isLineStartBeforeWordToken;
            this.currentChar     = prototype.currentChar;
            this.previousChar    = prototype.previousChar;
            this.previousNewline = prototype.previousNewline;
            this.currentIndent   = new StringBuilder(prototype.CurrentIndent.ToString());
            this.lineBeganInsideMultiLineComment = prototype.lineBeganInsideMultiLineComment;
            this.lineBeganInsideVerbatimString   = prototype.lineBeganInsideVerbatimString;
            this.ifDirectiveEvalResults          = prototype.ifDirectiveEvalResults.Clone();
            this.ifDirectiveIndents = prototype.ifDirectiveIndents.Clone();

            this.EnableCustomIndentLevels = prototype.EnableCustomIndentLevels;
        }
コード例 #2
0
        public CloneableStack <T> Clone()
        {
            CloneableStack <T> result = new CloneableStack <T> ();

            result.count = count;
            result.top   = top;
            return(result);
        }
コード例 #3
0
 Indent(Indent engine)
 {
     this.indentStack  = engine.indentStack.Clone();
     this.options      = engine.options;
     this.curIndent    = engine.curIndent;
     this.extraSpaces  = engine.extraSpaces;
     this.indentString = engine.indentString;
 }
コード例 #4
0
 public bool Equals(CloneableStack <T> other)
 {
     return(ReferenceEquals(top, other.top));
 }