using System; using System.Collections.Generic; using System.Linq; using System.Text; using OfficeOpenXml.FormulaParsing.ExcelUtilities; namespace OfficeOpenXml.FormulaParsing { /// /// Represents a parsing of a single input or workbook addrses. /// public class ParsingScope : IDisposable { private readonly ParsingScopes _parsingScopes; public ParsingScope(ParsingScopes parsingScopes, RangeAddress address) : this(parsingScopes, null, address) { } public ParsingScope(ParsingScopes parsingScopes, ParsingScope parent, RangeAddress address) { _parsingScopes = parsingScopes; Parent = parent; Address = address; ScopeId = Guid.NewGuid(); } /// /// Id of the scope. /// public Guid ScopeId { get; private set; } /// /// The calling scope. /// public ParsingScope Parent { get; private set; } /// /// The address of the cell currently beeing parsed. /// public RangeAddress Address { get; private set; } /// /// True if the current scope is a Subtotal function beeing executed. /// public bool IsSubtotal { get; set; } public void Dispose() { _parsingScopes.KillScope(this); } } }