Пример #1
0
        internal RdContentNode(RdDocument document) : base(document)
        {
            RdMergeCellsStyle tmpStyle = new RdMergeCellsStyle();

            Utils.CopyStyleRec(ref tmpStyle, document.DefaultStyle);
            this.m_style = tmpStyle;
        }
Пример #2
0
        internal override void Load(XmlNode node)
        {
            RdMergeCellsStyle _curStyle = new RdMergeCellsStyle();

            Utils.StyleRecLoad(node, ref _curStyle, base.Document.DefaultStyle);
            this.LoadEmptyCells(node, _curStyle);
            bool hasChildNodes = node.HasChildNodes;

            if (hasChildNodes)
            {
                for (XmlNode cellNode = node.FirstChild; cellNode != null; cellNode = cellNode.NextSibling)
                {
                    bool flag = cellNode.Name == "Cell";
                    if (flag)
                    {
                        int  _rowNo    = Utils.GetAttrInt(cellNode, "Row", -1);
                        int  _columnNo = Utils.GetAttrInt(cellNode, "Column", -1);
                        bool flag2     = _rowNo > base.Document.Rows.RowCount;
                        if (flag2)
                        {
                            base.Document.Rows.RowCount = _rowNo;
                        }
                        bool flag3 = _columnNo > base.Document.Columns.ColumnCount;
                        if (flag3)
                        {
                            base.Document.Columns.ColumnCount = _columnNo;
                        }
                        RdCell _cell = base.Document.GetCell(_rowNo, _columnNo);
                        bool   flag4 = _cell == null;
                        if (flag4)
                        {
                            break;
                        }
                        bool flag5 = _cell != null;
                        if (flag5)
                        {
                            _cell.Load(cellNode);
                        }
                        bool flag6 = _cell.HiddenBy == null;
                        if (flag6)
                        {
                            RdMergeCellsStyle tmpStyle = new RdMergeCellsStyle();
                            Utils.CopyStyleRec(ref tmpStyle, _curStyle);
                            _cell.Style = tmpStyle;
                        }
                        bool flag7 = _cell.Height > 1 && _rowNo + _cell.Height - 1 > base.Document.Rows.RowCount;
                        if (flag7)
                        {
                            base.Document.Rows.RowCount = _rowNo + _cell.Height - 1;
                        }
                        bool flag8 = _cell.Width > 1 && _columnNo + _cell.Width - 1 > base.Document.Columns.ColumnCount;
                        if (flag8)
                        {
                            base.Document.Columns.ColumnCount = _columnNo + _cell.Width - 1;
                        }
                    }
                }
            }
        }
Пример #3
0
        public void AdjustRowCount(int rowCount, bool copyFromRowHeader)
        {
            int  _curRowCount = this.m_cells.Count - 1;
            bool flag         = rowCount < 0;

            if (!flag)
            {
                bool flag2 = _curRowCount > rowCount;
                if (flag2)
                {
                    for (int i = rowCount + 1; i <= _curRowCount; i++)
                    {
                        bool flag3 = this.m_cells.ContainsKey(i);
                        if (flag3)
                        {
                            this.m_cells.Remove(i);
                        }
                    }
                }
                else
                {
                    for (int j = _curRowCount + 1; j <= rowCount; j++)
                    {
                        RdCell            _cell    = new RdCell(base.Document, j, this.Column);
                        RdMergeCellsStyle tmpStyle = new RdMergeCellsStyle();
                        bool flag4 = j == 0 && this.Column == 0;
                        if (flag4)
                        {
                            Utils.CopyStyleRec(ref tmpStyle, base.Document.DefaultStyle);
                            _cell.Style = tmpStyle;
                        }
                        else
                        {
                            bool flag5 = j == 0 || this.Column == 0;
                            if (flag5)
                            {
                                Utils.CopyStyleRec(ref tmpStyle, base.Document.GetCell(0, 0).Style);
                                _cell.Style = tmpStyle;
                            }
                            else if (copyFromRowHeader)
                            {
                                Utils.CopyStyleRec(ref tmpStyle, base.Document.GetCell(j, 0).Style);
                                _cell.Style = tmpStyle;
                            }
                            else
                            {
                                Utils.CopyStyleRec(ref tmpStyle, base.Document.GetCell(0, this.Column).Style);
                                _cell.Style = tmpStyle;
                            }
                        }
                        this.m_cells.Add(j, _cell);
                    }
                }
            }
        }
Пример #4
0
        internal void CopyNode(ref RdCell node)
        {
            node.Name = base.Name;
            node.Tag  = base.Tag;
            RdMergeCellsStyle tmpStyle = new RdMergeCellsStyle();

            Utils.CopyStyleRec(ref tmpStyle, base.Style);
            node.Style       = tmpStyle;
            node.Width       = this.Width;
            node.Height      = this.Height;
            node.Value       = this.Value;
            node.Result      = this.Result;
            node.GeneratedBy = this.GeneratedBy;
        }
Пример #5
0
        private void LoadEmptyCells(XmlNode node, RdMergeCellsStyle style)
        {
            string _emptyCells = Utils.GetXmlNodeAttribute(node, "EmptyCells");
            bool   flag        = !string.IsNullOrEmpty(_emptyCells);

            if (flag)
            {
                string   rowColumn = string.Empty;
                int      rowNo     = -1;
                int      columnNo  = -1;
                string[] array     = _emptyCells.Split(new char[]
                {
                    ';'
                });
                for (int i = 0; i < array.Length; i++)
                {
                    string value = array[i];
                    bool   flag2 = string.IsNullOrEmpty(value);
                    if (flag2)
                    {
                        break;
                    }
                    rowColumn = value.Replace("(", "").Replace(")", "");
                    rowNo     = Utils.Str2Int(rowColumn.Split(new char[]
                    {
                        ','
                    })[0], rowNo);
                    columnNo = Utils.Str2Int(rowColumn.Split(new char[]
                    {
                        ','
                    })[1], columnNo);
                    bool flag3 = rowNo > base.Document.Rows.RowCount;
                    if (flag3)
                    {
                        base.Document.Rows.RowCount = rowNo;
                    }
                    bool flag4 = columnNo > base.Document.Columns.ColumnCount;
                    if (flag4)
                    {
                        base.Document.Columns.ColumnCount = columnNo;
                    }
                    RdMergeCellsStyle tmpStyle = new RdMergeCellsStyle();
                    Utils.CopyStyleRec(ref tmpStyle, style);
                    base.Document.GetCell(rowNo, columnNo).Style = tmpStyle;
                }
            }
        }
Пример #6
0
 internal override void Load(XmlNode node)
 {
     base.Load(node);
     this.m_style = new RdMergeCellsStyle();
     Utils.StyleRecLoad(node, ref this.m_style, base.Document.DefaultStyle);
 }
Пример #7
0
 private void Init()
 {
     RdMergeCellsStyle _style = base.Document.GetCellStyle(this.Boundary.Top, this.Boundary.Left);
 }