/// <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; }
public CloneableStack <T> Clone() { CloneableStack <T> result = new CloneableStack <T> (); result.count = count; result.top = top; return(result); }
Indent(Indent engine) { this.indentStack = engine.indentStack.Clone(); this.options = engine.options; this.curIndent = engine.curIndent; this.extraSpaces = engine.extraSpaces; this.indentString = engine.indentString; }
public bool Equals(CloneableStack <T> other) { return(ReferenceEquals(top, other.top)); }