public static Xl.XlCalculation ToXlCalculation(this ExcelCalculationMode mode) { switch (mode) { case ExcelCalculationMode.Automatic: return(Xl.XlCalculation.xlCalculationAutomatic); case ExcelCalculationMode.Manual: return(Xl.XlCalculation.xlCalculationManual); case ExcelCalculationMode.SemiAutomatic: return(Xl.XlCalculation.xlCalculationSemiautomatic); default: throw new ArgumentException(EnumHelper.UnexpectedEnumerationValueMessage(mode), nameof(mode)); } }
private void Init() { this.Is1904Date = false; this._precisionAsDisplay = true; this._recalculateBeforeSave = true; this.SaveExternalLinks = false; this._calculationMode = ExcelCalculationMode.Automatic; this._maximumIterations = 100; this._isIterataCalculate = false; this._maximumChange = 0.001; this._externWorkbooks = null; this._customOrFunctionNameList = null; this._builtInNameList = null; this._namedCellRanges = null; this._excelCellFormats = null; this._defaultCellFormat = null; this._excelCellFormats = null; this._defaultCellFormat = null; this._styleList = null; this._tableStyles = null; this._operator = null; this._sheets = null; this.FirstDisplayedTabIndex = 0; this.SelectedTabCount = 0; this._activeSheetIndex = 0; this.ActivePaneIndex = 0; this.TabStripPolicy = ExcelTabStripPolicy.Always; this._tabStripRatio = 0.6; this.VerticalScrollBarPolicy = ExcelScrollBarPolicy.AsNeeded; this.HorizontalScrollBarPolicy = ExcelScrollBarPolicy.AsNeeded; this._referenceStyle = ExcelReferenceStyle.A1; this.Locked = false; this.ExcelRect = null; this.IsWindowHidden = false; this.IsWindowDisplayAsIcon = false; if (this.ColorPalette != null) { this.ColorPalette = null; } if (this.DifferentialFormattings != null) { this.DifferentialFormattings = null; } this.Theme = null; }