예제 #1
0
파일: Style.cs 프로젝트: shi5588/shi5588
        internal Style(XlsDocument doc, XF xf)
        {
            _isInitializing = true;

            _doc = doc;
            _xf = xf;

            _isInitializing = false;
        }
예제 #2
0
파일: XFs.cs 프로젝트: shi5588/shi5588
        internal ushort Add(XF xf)
        {
            _workbook.Fonts.Add(xf.Font);
            _workbook.Formats.Add(xf.Format);
            _workbook.Styles.Add(xf.Style);

            //TODO: What happens if they try to re-add a Default (i.e. non-user) XF?
            short xfId = GetId(xf);
            if (xfId == -1)
            {
                xfId = (short)_xfs.Count;
                _xfs.Add((XF)xf.Clone());
            }

            //NOTE: Not documented, but User-defined XFs must have a minimum
            //index of 16 (0-based).

            return (ushort)xfId;
        }
예제 #3
0
 // Token: 0x060001F4 RID: 500 RVA: 0x00009B54 File Offset: 0x00008B54
 internal bool Equals(XF that)
 {
     return(this._horizontalAlignment == that._horizontalAlignment && this._textWrapRight == that._textWrapRight && this._verticalAlignment == that._verticalAlignment && this._rotation == that._rotation && this._indentLevel == that._indentLevel && this._shrinkToCell == that._shrinkToCell && this._textDirection == that._textDirection && this._cellLocked == that._cellLocked && this._formulaHidden == that._formulaHidden && this._isStyleXF == that._isStyleXF && this._useNumber == that._useNumber && this._useFont == that._useFont && this._useMisc == that._useMisc && this._useBorder == that._useBorder && this._useBackground == that._useBackground && this._useProtection == that._useProtection && this._leftLineStyle == that._leftLineStyle && this._rightLineStyle == that._rightLineStyle && this._topLineStyle == that._topLineStyle && this._bottomLineStyle == that._bottomLineStyle && this._leftLineColor.Equals(that._leftLineColor) && this._rightLineColor.Equals(that._rightLineColor) && this._diagonalDescending == that._diagonalDescending && this._diagonalAscending == that._diagonalAscending && this._topLineColor.Equals(that._topLineColor) && this._bottomLineColor.Equals(that._bottomLineColor) && this._diagonalLineColor.Equals(that._diagonalLineColor) && this._diagonalLineStyle == that._diagonalLineStyle && this._pattern == that._pattern && this._patternColor.Equals(that._patternColor) && this._patternBackgroundColor.Equals(that._patternBackgroundColor) && this.Font.Equals(that.Font) && this.Format.Equals(that.Format) && this.Style.Equals(that.Style));
 }
예제 #4
0
파일: XF.cs 프로젝트: shi5588/shi5588
        internal bool Equals(XF that)
        {
            if (_horizontalAlignment != that._horizontalAlignment) return false;
            if (_textWrapRight != that._textWrapRight) return false;
            if (_verticalAlignment != that._verticalAlignment) return false;
            if (_rotation != that._rotation) return false;
            if (_indentLevel != that._indentLevel) return false;
            if (_shrinkToCell != that._shrinkToCell) return false;
            if (_textDirection != that._textDirection) return false;
            if (_cellLocked != that._cellLocked) return false;
            if (_formulaHidden != that._formulaHidden) return false;
            if (_isStyleXF != that._isStyleXF) return false;
            if (_useNumber != that._useNumber) return false;
            if (_useFont != that._useFont) return false;
            if (_useMisc != that._useMisc) return false;
            if (_useBorder != that._useBorder) return false;
            if (_useBackground != that._useBackground) return false;
            if (_useProtection != that._useProtection) return false;
            if (_leftLineStyle != that._leftLineStyle) return false;
            if (_rightLineStyle != that._rightLineStyle) return false;
            if (_topLineStyle != that._topLineStyle) return false;
            if (_bottomLineStyle != that._bottomLineStyle) return false;
            if (!_leftLineColor.Equals(that._leftLineColor)) return false;
            if (!_rightLineColor.Equals(that._rightLineColor)) return false;
            if (_diagonalDescending != that._diagonalDescending) return false;
            if (_diagonalAscending != that._diagonalAscending) return false;
            if (!_topLineColor.Equals(that._topLineColor)) return false;
            if (!_bottomLineColor.Equals(that._bottomLineColor)) return false;
            if (!_diagonalLineColor.Equals(that._diagonalLineColor)) return false;
            if (_diagonalLineStyle != that._diagonalLineStyle) return false;
            if (_pattern != that._pattern) return false;
            if (!_patternColor.Equals(that._patternColor)) return false;
            if (!_patternBackgroundColor.Equals(that._patternBackgroundColor)) return false;

            if (!Font.Equals(that.Font)) return false;
            if (!Format.Equals(that.Format)) return false;
            if (!Style.Equals(that.Style)) return false;

            //if (_targetObject != that._targetObject) return false;

            return true;
        }
예제 #5
0
파일: XF.cs 프로젝트: shi5588/shi5588
        /// <summary>
        /// Creates a duplicate instance of this XF objet.
        /// </summary>
        /// <returns>A duplicate instance of this XF object.</returns>
        public object Clone()
        {
            XF clone = new XF(_doc);

            clone.Font = (Font)_font.Clone();
            #if SILVERLIGHT
            clone.Format = new string(_format.ToCharArray());
            #else
            clone.Format = (string) _format.Clone();
            #endif

            if (!IsStyleXF)
                clone.Style = (Style) _style.Clone();

            clone.HorizontalAlignment = HorizontalAlignment;
            clone.TextWrapRight = TextWrapRight;
            clone.VerticalAlignment = VerticalAlignment;
            clone.Rotation = Rotation;
            clone.IndentLevel = IndentLevel;
            clone.ShrinkToCell = ShrinkToCell;
            clone.TextDirection = TextDirection;
            clone.CellLocked = CellLocked;
            clone.FormulaHidden = FormulaHidden;
            clone.IsStyleXF = IsStyleXF;
            clone.UseNumber = UseNumber;
            clone.UseFont = UseFont;
            clone.UseMisc = UseMisc;
            clone.UseBorder = UseBorder;
            clone.UseBackground = UseBackground;
            clone.UseProtection = UseProtection;
            clone.LeftLineStyle = LeftLineStyle;
            clone.RightLineStyle = RightLineStyle;
            clone.TopLineStyle = TopLineStyle;
            clone.BottomLineStyle = BottomLineStyle;
            clone.LeftLineColor = LeftLineColor;
            clone.RightLineColor = RightLineColor;
            clone.DiagonalDescending = DiagonalDescending;
            clone.DiagonalAscending = DiagonalAscending;
            clone.TopLineColor = TopLineColor;
            clone.BottomLineColor = BottomLineColor;
            clone.DiagonalLineColor = DiagonalLineColor;
            clone.DiagonalLineStyle = DiagonalLineStyle;
            clone.Pattern = Pattern;
            clone.PatternColor = PatternColor;
            clone.PatternBackgroundColor = PatternBackgroundColor;

            clone.Target = Target;

            return clone;
        }
예제 #6
0
 internal Font(XlsDocument doc, XF xf) : this(doc)
 {
     _target = xf;
 }
예제 #7
0
파일: Cells.cs 프로젝트: shi5588/shi5588
 /// <summary>
 /// Adds a new Cell to the Cells collection with the given Row, Column, Value
 /// and XF (style).  If a Cell already exists with the given row and column,
 /// it is overwritten.
 /// </summary>
 /// <param name="cellRow">1-based Row of new Cell.</param>
 /// <param name="cellColumn">1-based Column of new Cell.</param>
 /// <param name="cellValue">Value of new Cell.</param>
 /// <param name="xf">An Xf object describing the style of the cell.</param>
 /// <returns>The newly added Cell with the given Row, Column, Value and Style.</returns>
 public Cell Add(int cellRow, int cellColumn, object cellValue, XF xf)
 {
     Util.ValidateUShort(cellRow, "cellRow");
     Util.ValidateUShort(cellColumn, "cellColumn");
     return Add((ushort)cellRow, (ushort)cellColumn, cellValue, xf);
 }
예제 #8
0
파일: Cells.cs 프로젝트: shi5588/shi5588
 /// <summary>
 /// Adds a new Cell to the Cells collection with the given Row, Column, Value
 /// and XF (style).  If a Cell already exists with the given row and column,
 /// it is overwritten.
 /// </summary>
 /// <param name="cellRow">1-based Row of new Cell.</param>
 /// <param name="cellColumn">1-based Column of new Cell.</param>
 /// <param name="cellValue">Value of new Cell.</param>
 /// <param name="xf">An Xf object describing the style of the cell.</param>
 /// <returns>The newly added Cell with the given Row, Column, Value and Style.</returns>
 public Cell Add(ushort cellRow, ushort cellColumn, object cellValue, XF xf)
 {
     Cell cell = Add(cellRow, cellColumn, cellValue);
     cell.ExtendedFormat = xf;
     return cell;
 }
예제 #9
0
파일: XlsText.cs 프로젝트: radtek/shi5588
 public FormattingRun(XF xf, ushort startOffset)
 {
     _xfId        = xf.Id;
     _startOffset = startOffset;
 }
예제 #10
0
파일: XFs.cs 프로젝트: shi5588/shi5588
        //        private void AddDefaultFormattedStyleXFs()
        //        {
        //            
        //        }
        private short GetId(XF xf)
        {
            for (short i = 0; i < _xfs.Count; i++)
                if (_xfs[i].Equals(xf))
                    return i;

            return -1;
        }
예제 #11
0
파일: XFs.cs 프로젝트: shi5588/shi5588
        private void AddDefaultUserXF()
        {
            XF xf = new XF(_doc);
            xf.CellLocked = true;

            Add(xf);

            _defaultUserXf = xf;
        }
예제 #12
0
파일: XFs.cs 프로젝트: shi5588/shi5588
        private void AddDefaultStyleXFs()
        {
            XF xf = new XF(_doc);
            xf.IsStyleXF = true;
            xf.CellLocked = true; //TODO: Is this correct?  Default Style XF is CellLocked?  what's the origin of this line?
            _xfs.Add(xf);

            xf = (XF) xf.Clone();
            xf.UseBackground = false;
            xf.UseBorder = false;
            xf.UseFont = true;
            xf.UseMisc = false;
            xf.UseNumber = false;
            xf.UseProtection = false;

            //Gotta have a 16th (index 15) XF for the Default Cell Format...
            //See excelfileformat.pdf Sec. 4.6.2: The default cell format is always present
            //in an Excel file, described by the XF record with the fixed index 15 (0-based).
            //By default, it uses the worksheet/workbook default cell style, described by
            //the very first XF record (index 0);
            //Apparently Excel 2003 was okay without it, but 2007 chokes if it's not there.
            for (int i = 0; i < 15; i++)
                _xfs.Add((XF) xf.Clone());
        }
예제 #13
0
 /// <summary>
 /// Gets whether the given XF exists in the collection and will be written to the XlsDocument.
 /// </summary>
 /// <param name="xf">The XF object to check whether it will be written to the XlsDocument.</param>
 /// <returns>true if the given XF object will be written to the XlsDocument, false otherwise.</returns>
 public bool IsWritten(XF xf)
 {
     return(GetId(xf) > -1);
 }
예제 #14
0
        private void AddDefaultUserXF()
        {
            XF xf = _doc.NewXF();

            Add(xf);
        }
예제 #15
0
        /// <summary>
        /// Adds a new Cell to the Cells collection with the given Row, Column, Value
        /// and XF (style).  If a Cell already exists with the given row and column,
        /// it is overwritten.
        /// </summary>
        /// <param name="cellRow">1-based Row of new Cell.</param>
        /// <param name="cellColumn">1-based Column of new Cell.</param>
        /// <param name="cellValue">Value of new Cell.</param>
        /// <param name="xf">An Xf object describing the style of the cell.</param>
        /// <returns>The newly added Cell with the given Row, Column, Value and Style.</returns>
        public Cell AddValueCellXF(ushort cellRow, ushort cellColumn, object cellValue, XF xf)
        {
            Cell cell = AddValueCell(cellRow, cellColumn, cellValue);

            cell.XFIndex = xf.Id;
            return(cell);
        }
예제 #16
0
파일: XF.cs 프로젝트: radtek/shi5588
        internal bool Equals(XF that)
        {
            if (_horizontalAlignment != that._horizontalAlignment)
            {
                return(false);
            }
            if (_textWrapRight != that._textWrapRight)
            {
                return(false);
            }
            if (_verticalAlignment != that._verticalAlignment)
            {
                return(false);
            }
            if (_rotation != that._rotation)
            {
                return(false);
            }
            if (_indentLevel != that._indentLevel)
            {
                return(false);
            }
            if (_shrinkToCell != that._shrinkToCell)
            {
                return(false);
            }
            if (_textDirection != that._textDirection)
            {
                return(false);
            }
            if (_cellLocked != that._cellLocked)
            {
                return(false);
            }
            if (_formulaHidden != that._formulaHidden)
            {
                return(false);
            }
            if (_isStyleXF != that._isStyleXF)
            {
                return(false);
            }
            if (_useNumber != that._useNumber)
            {
                return(false);
            }
            if (_useFont != that._useFont)
            {
                return(false);
            }
            if (_useMisc != that._useMisc)
            {
                return(false);
            }
            if (_useBorder != that._useBorder)
            {
                return(false);
            }
            if (_useBackground != that._useBackground)
            {
                return(false);
            }
            if (_useProtection != that._useProtection)
            {
                return(false);
            }
            if (_leftLineStyle != that._leftLineStyle)
            {
                return(false);
            }
            if (_rightLineStyle != that._rightLineStyle)
            {
                return(false);
            }
            if (_topLineStyle != that._topLineStyle)
            {
                return(false);
            }
            if (_bottomLineStyle != that._bottomLineStyle)
            {
                return(false);
            }
            if (!_leftLineColor.Equals(that._leftLineColor))
            {
                return(false);
            }
            if (!_rightLineColor.Equals(that._rightLineColor))
            {
                return(false);
            }
            if (_diagonalDescending != that._diagonalDescending)
            {
                return(false);
            }
            if (_diagonalAscending != that._diagonalAscending)
            {
                return(false);
            }
            if (!_topLineColor.Equals(that._topLineColor))
            {
                return(false);
            }
            if (!_bottomLineColor.Equals(that._bottomLineColor))
            {
                return(false);
            }
            if (!_diagonalLineColor.Equals(that._diagonalLineColor))
            {
                return(false);
            }
            if (_diagonalLineStyle != that._diagonalLineStyle)
            {
                return(false);
            }
            if (_pattern != that._pattern)
            {
                return(false);
            }
            if (!_patternColor.Equals(that._patternColor))
            {
                return(false);
            }
            if (!_patternBackgroundColor.Equals(that._patternBackgroundColor))
            {
                return(false);
            }

            if (!Font.Equals(that.Font))
            {
                return(false);
            }
            if (!Format.Equals(that.Format))
            {
                return(false);
            }
            if (!Style.Equals(that.Style))
            {
                return(false);
            }

            //if (_targetObject != that._targetObject) return false;

            return(true);
        }
예제 #17
0
 /// <summary>
 /// Adds a new Cell to the Cells collection with the given Row, Column, Value
 /// and XF (style).  If a Cell already exists with the given row and column,
 /// it is overwritten.
 /// </summary>
 /// <param name="cellRow">1-based Row of new Cell.</param>
 /// <param name="cellColumn">1-based Column of new Cell.</param>
 /// <param name="cellValue">Value of new Cell.</param>
 /// <param name="xf">An Xf object describing the style of the cell.</param>
 /// <returns>The newly added Cell with the given Row, Column, Value and Style.</returns>
 public Cell Add(int cellRow, int cellColumn, object cellValue, XF xf)
 {
     Util.ValidateUShort(cellRow, "cellRow");
     Util.ValidateUShort(cellColumn, "cellColumn");
     return(Add((ushort)cellRow, (ushort)cellColumn, cellValue, xf));
 }
예제 #18
0
 ///<summary>
 /// (For internal use only) - Updates this Cell's XF id from the provided XF.
 ///</summary>
 ///<param name="fromXF">The XF from which to calculate this Cell's XF id.</param>
 public void UpdateId(XF fromXF)
 {
     _xfIdx = fromXF.Id;
 }
예제 #19
0
 public Cell AddValueCellXF(ushort cellRow, ushort cellColumn, object cellValue, XF xf)
 {
     return(Add(cellRow, cellColumn, cellValue, xf));
 }
예제 #20
0
파일: Cells.cs 프로젝트: shi5588/shi5588
 public Cell AddValueCellXF(ushort cellRow, ushort cellColumn, object cellValue, XF xf)
 {
     return Add(cellRow, cellColumn, cellValue, xf);
 }
예제 #21
0
파일: Cell.cs 프로젝트: shi5588/shi5588
 ///<summary>
 /// (For internal use only) - Updates this Cell's XF id from the provided XF.
 ///</summary>
 ///<param name="fromXF">The XF from which to calculate this Cell's XF id.</param>
 public void UpdateId(XF fromXF)
 {
     _xfIdx = fromXF.Id;
 }
예제 #22
0
파일: Font.cs 프로젝트: shi5588/shi5588
 internal Font(XlsDocument doc, XF xf)
     : this(doc)
 {
     _target = xf;
 }
예제 #23
0
파일: XlsText.cs 프로젝트: shi5588/shi5588
 public FormattingRun(XF xf, ushort startOffset)
 {
     _xfId = xf.Id;
     _startOffset = startOffset;
 }