Esempio n. 1
0
 public void Dispose()
 {
     _data.Clear();
     _data     = null;
     _semirow  = null;
     _minorrow = null;
     _reader   = null;
 }
Esempio n. 2
0
 public GroupHeaderRow(SectionLine sl, SemiRow semirow, Graphics gg)
     : base(sl, semirow, gg)
 {
     if ((sl.Section as IGroupHeader).bAloneLine)
     {
         _baloneline = true;
     }
 }
Esempio n. 3
0
 public Row(SectionLine sl, SemiRow semirow, string baseid, Graphics g) : this(g)
 {
     if (baseid != null && semirow.Contains(baseid))
     {
         _baseid = Convert.ToInt32(semirow[baseid]);
     }
     _bminorlevel = semirow.bMinorLevel;
     _sectionline = sl;
     _level       = semirow.Level;
     _area        = sl.Section.Type;
     _bfirst      = sl.Index == 0;
     AddCells(semirow);
 }
Esempio n. 4
0
 private void AppendFrom(Section section, SemiRow semirow, ShowStyle showstyle, string baseid, System.Drawing.Graphics g)
 {
     if (section == null || (_nogroupheader && section.Type == "GroupHeader"))
     {
         return;
     }
     foreach (SectionLine sl in section.SectionLines)
     {
         if (sl.Cells.Count > 0)
         {
             if (section is GroupHeader)
             {
                 GroupHeaderRow row = new GroupHeaderRow(sl, semirow, g);
                 SetRowState(showstyle, row);
                 _parentrows.Add(row.Level.ToString(), row);
                 if (row.Level > 1)
                 {
                     row.ParentRow = _parentrows[Convert.ToString(row.Level - 1)] as GroupHeaderRow;
                 }
                 Add(row);
             }
             else if (section is GroupSummary)
             {
                 GroupRow row = new GroupRow(sl, semirow, g);
                 SetRowState(showstyle, row);
                 row.ParentRow = _parentrows[Convert.ToString(row.Level)] as GroupHeaderRow;
                 Add(row);
             }
             else
             {
                 Row row = new Row(sl, semirow, baseid, g);
                 SetRowState(showstyle, row);
                 row.ParentRow = _parentrows[Convert.ToString(row.Level - 1)] as GroupHeaderRow;
                 Add(row);
             }
         }
     }
 }
Esempio n. 5
0
        private void AddCells(SemiRow semirow)
        {
            ArrayList superlabels = new ArrayList();
            Graphics  g           = null;

            try
            {
                if (_g == null)
                {
                    g = CreateGraphics();
                }
                foreach (Cell ctmp in _sectionline.Cells)
                {
                    Cell cell = ctmp.Clone() as Cell;

                    #region handler alternative style
                    if (_sectionline.Section is IAlternativeStyle)
                    {
                        IAlternativeStyle ias = _sectionline.Section as IAlternativeStyle;
                        if (ias.bApplyAlternative && ias.bApplySecondStyle)
                        {
                            //if (cell is CommonLabel && (cell as CommonLabel).LabelType != LabelType.SummaryLabel)
                            //    continue;
                            //if (cell is Label)
                            //    continue;
                            if (//!(cell is CommonLabel && (cell as CommonLabel).LabelType != LabelType.SummaryLabel) &&
                                cell.Type != "Label" && cell.Type != "SuperLabel")
                            {
                                if (!(cell is IApplyColorStyle) || (cell as IApplyColorStyle).bApplyColorStyle)
                                {
                                    cell.SetAlternativeStyle(ias);
                                }
                            }
                        }
                    }
                    #endregion

                    if (semirow != null && semirow.Contains(cell.Name))
                    {
                        if (cell is IImage)
                        {
                            (cell as IImage).ImageString = semirow[cell.Name].ToString();
                        }
                        else
                        {
                            cell.Caption = semirow[cell.Name].ToString();

                            try
                            {
                                if (!string.IsNullOrEmpty(cell.Caption) && (cell.VisiblePosition != -1 || cell is Indicator || cell is CalculateIndicator || cell is CalculatorIndicator) && cell is IDecimal && cell is IFormat && !string.IsNullOrEmpty((cell as IFormat).FormatString))
                                {
                                    cell.Caption = Convert.ToDouble(cell.Caption).ToString((cell as IFormat).FormatString);
                                }
                            }
                            catch
                            {
                            }
                        }
                    }

                    if (semirow != null)
                    {
                        if (semirow.BackColorContains(cell.Name))
                        {
                            cell.BackColor = semirow.BackColors(cell.Name);
                        }
                        if (semirow.ForeColorContains(cell.Name))
                        {
                            cell.ForeColor = semirow.ForeColors(cell.Name);
                        }
                        if (semirow.VisibleContains(cell.Name))
                        {
                            cell.Visible = semirow.Visibles(cell.Name);
                        }
                        if (semirow.XContains(cell.Name))
                        {
                            cell.X = semirow.Xs(cell.Name);
                        }
                        if (semirow.WidthContains(cell.Name))
                        {
                            cell.Width = semirow.Widths(cell.Name);
                        }
                        if (cell is IIndicator)
                        {
                            if (semirow.CompareValue1Contains(cell.Name))
                            {
                                (cell as IIndicator).CompareValue.Expression1 = semirow.CompareValue1s(cell.Name).ToString();
                            }
                            if (semirow.CompareValue2Contains(cell.Name))
                            {
                                (cell as IIndicator).CompareValue.Expression2 = semirow.CompareValue2s(cell.Name).ToString();
                            }
                        }
                    }
                    if (cell.Visible)
                    {
                        cell.SetRuntimeHeight(_g == null ? g : _g, cell.Caption);
                        _cells.CalcRuntimeHeight(cell);
                    }

                    if ((cell is ICenterAlign) && (cell as ICenterAlign).CenterAlign)
                    {
                        if (_containerwidth != -1)
                        {
                            if (_containerwidth > cell.Width)
                            {
                                cell.X = (_containerwidth - cell.Width) / 2;
                            }
                            else
                            {
                                cell.X = 0;
                            }
                            ctmp.X = cell.X;
                        }
                    }

                    _cells.AddByVisiblePosition(cell);

                    if (cell.Visible)
                    {
                        if (_sectionline.Section is IAutoSequence && (_sectionline.Section as IAutoSequence).bAutoSequence)
                        {
                            if (cell is SuperLabel)
                            {
                                cell.Width = (cell as SuperLabel).CalcWidth();
                                if (cell.Width == 0)
                                {
                                    cell.Visible = false;
                                }
                                else
                                {
                                    superlabels.Add(cell);
                                }
                            }
                        }
                        else if (cell is SuperLabel)// && cell.Visible)
                        {
                            cell.Width = (cell as SuperLabel).CalcWidth();
                            superlabels.Add(cell);
                        }
                    }
                }
            }
            finally
            {
                if (g != null)
                {
                    g.Dispose();
                }
            }
            _x            = _cells.X;
            _ybase        = _cells.Y;
            _expandheight = _cells.ExpandHeight;
            _metaheight   = _cells.MetaHeight;

            _cells.AutoLayOut();

            foreach (Cell sp in superlabels)
            {
                HandleSuperLabel(sp);
            }
        }
Esempio n. 6
0
 public GroupRow(SectionLine sl, SemiRow semirow, Graphics gg)
     : base(sl, semirow, null, gg)
 {
 }
Esempio n. 7
0
 public void Add(SemiRow semirow)
 {
     this.InnerList.Add(semirow);
 }