Free cookie consent management tool by TermsFeed Policy Generator

source: branches/2913_MatlabScriptProblemInstanceProvider/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/4.0.3/EPPlus-4.0.3/FormulaParsing/ParsingContext.cs @ 18242

Last change on this file since 18242 was 12074, checked in by sraggl, 10 years ago

#2341: Added EPPlus-4.0.3 to ExtLibs

File size: 2.3 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using OfficeOpenXml.FormulaParsing.LexicalAnalysis;
6using OfficeOpenXml.FormulaParsing.ExpressionGraph;
7using OfficeOpenXml.FormulaParsing.ExcelUtilities;
8using OfficeOpenXml.FormulaParsing;
9using OfficeOpenXml.FormulaParsing.Logging;
10
11namespace OfficeOpenXml.FormulaParsing
12{
13    /// <summary>
14    /// Parsing context
15    /// </summary>
16    public class ParsingContext : IParsingLifetimeEventHandler
17    {
18        private ParsingContext() { }
19
20        /// <summary>
21        /// The <see cref="FormulaParser"/> of the current context.
22        /// </summary>
23        public FormulaParser Parser { get; set; }
24
25        /// <summary>
26        /// The <see cref="ExcelDataProvider"/> is an abstraction on top of
27        /// Excel, in this case EPPlus.
28        /// </summary>
29        public ExcelDataProvider ExcelDataProvider { get; set; }
30
31        /// <summary>
32        /// Utility for handling addresses
33        /// </summary>
34        public RangeAddressFactory RangeAddressFactory { get; set; }
35
36        /// <summary>
37        /// <see cref="INameValueProvider"/> of the current context
38        /// </summary>
39        public INameValueProvider NameValueProvider { get; set; }
40
41        /// <summary>
42        /// Configuration
43        /// </summary>
44        public ParsingConfiguration Configuration { get; set; }
45
46        /// <summary>
47        /// Scopes, a scope represents the parsing of a cell or a value.
48        /// </summary>
49        public ParsingScopes Scopes { get; private set; }
50
51        /// <summary>
52        /// Returns true if a <see cref="IFormulaParserLogger"/> is attached to the parser.
53        /// </summary>
54        public bool Debug
55        {
56            get { return Configuration.Logger != null; }
57        }
58
59        /// <summary>
60        /// Factory method.
61        /// </summary>
62        /// <returns></returns>
63        public static ParsingContext Create()
64        {
65            var context = new ParsingContext();
66            context.Configuration = ParsingConfiguration.Create();
67            context.Scopes = new ParsingScopes(context);
68            return context;
69        }
70
71        void IParsingLifetimeEventHandler.ParsingCompleted()
72        {
73           
74        }
75    }
76}
Note: See TracBrowser for help on using the repository browser.