Exemplo n.º 1
0
        /// <summary>
        /// Refresh all the buttons to display the right items
        /// </summary>
        private void RefreshButtons()
        {
            if (_nbRowDisplayed > 0)
            {
                // for each displayed item of the list
                for (int i = 0; i < _nbRowDisplayed; i++)
                {
                    if (TopIndex + i > _nbItems - 1)
                    {
                        _rows[i].Visible = false;
                    }
                    else
                    {
                        // associate with the item
                        var itemBeingDisplayed = GetItem(TopIndex + i);
                        _rows[i].Tag = itemBeingDisplayed;

                        if (!_rows[i].Visible)
                        {
                            _rows[i].Visible = true;
                        }

                        _rows[i].Height = RowHeight.ClampMax(_listRectangle.Height - i * RowHeight);
                    }

                    // repaint
                    _rows[i].Invalidate();
                }
            }

            Update(); // force to redraw the control immediately
        }
Exemplo n.º 2
0
        private void BuildColumns()
        {
            // Hidden expander column
            TreeViewColumn col = new TreeViewColumn();

            col.Visible = false;
            AppendColumn(col);
            ExpanderColumn = col;

            source_column        = new TreeViewColumn();
            source_column.Sizing = TreeViewColumnSizing.Autosize;

            uint xpad = 2;

            // Special renderer for header rows; hidden for normal source rows
            header_renderer = new CellRendererText()
            {
                Xpad      = xpad,
                Ypad      = 4,
                Ellipsize = Pango.EllipsizeMode.End,
                Weight    = (int)Pango.Weight.Bold,
                Variant   = Pango.Variant.SmallCaps
            };

            // Renderer for source rows; hidden for header rows
            source_renderer      = new SourceRowRenderer();
            source_renderer.Xpad = xpad;

            source_column.PackStart(header_renderer, true);
            source_column.SetCellDataFunc(header_renderer, new Gtk.CellLayoutDataFunc((layout, cell, model, iter) => {
                var type = (SourceModel.EntryType)model.GetValue(iter, (int)SourceModel.Columns.Type);
                header_renderer.Visible = type == SourceModel.EntryType.Group;
                source_renderer.Visible = type == SourceModel.EntryType.Source;
                if (type == SourceModel.EntryType.Group)
                {
                    var source = model.GetValue(iter, (int)SourceModel.Columns.Source) as Source;
                    header_renderer.Visible = true;
                    header_renderer.Text    = source.Name;
                }
                else
                {
                    header_renderer.Visible = false;
                }
            }));

            int width, height;

            Gtk.Icon.SizeLookup(IconSize.Menu, out width, out height);
            source_renderer.RowHeight = RowHeight.Get();
            source_renderer.RowHeight = height;

            source_renderer.Ypad = (uint)RowPadding.Get();
            source_renderer.Ypad = 2;
            source_column.PackStart(source_renderer, true);
            source_column.SetCellDataFunc(source_renderer, new CellLayoutDataFunc(SourceRowRenderer.CellDataHandler));
            AppendColumn(source_column);

            HeadersVisible = false;
        }
Exemplo n.º 3
0
        private void RenderTimes(HtmlTextWriter output)
        {
            output.AddAttribute("width", "25px");
            output.AddAttribute("rowspan", "100");
            output.AddAttribute("valign", "top");
            output.RenderBeginTag("td");

            output.RenderBeginTag("table");
            string hour = "";

            //dummy cell to allow for names on header
            output.RenderBeginTag("tr");
            output.AddAttribute("class", "DiaryEmployeeNameSmall");
            output.AddAttribute("colspan", "2");
            output.AddAttribute("valign", "top");
            output.AddStyleAttribute("height", RowHeight.ToString() + "px");
            output.RenderBeginTag("td");
            output.RenderEndTag(); // td
            output.RenderEndTag(); // tr

            for (DateTime time = GetEarliestStartTime(CurrentDate); time < GetLatestFinishTime(CurrentDate);)
            {
                // create a new row
                output.AddAttribute("Height", RowHeight.ToString());
                output.RenderBeginTag("tr");

                // create a cell in the row for the time
                string ApptTime = time.ToString("HH:mm");

                if (ApptTime.Substring(0, 2) != hour)
                {
                    hour = ApptTime.Substring(0, 2);

                    output.AddAttribute("class", "DiaryTimeHour");
                    output.AddAttribute("rowspan", "4");
                    output.AddAttribute("style", String.Format("width:20px;height:{0}px;", RowHeight));
                    output.AddAttribute("valign", "middle");
                    output.RenderBeginTag("td");
                    output.Write(ApptTime.Substring(0, 2));
                    output.RenderEndTag();//td
                }

                output.AddAttribute("class", "DiaryTimeMinute");
                output.AddAttribute("style", "width:12px");
                output.RenderBeginTag("td");
                output.Write(ApptTime.Substring(3, 2));
                output.RenderEndTag(); //td

                output.RenderEndTag(); // tr
                time = time.AddMinutes(15);
            }

            output.RenderEndTag(); //table
            output.RenderEndTag(); // td
        }
Exemplo n.º 4
0
		/// <summary>
		/// The constructor for the record.
		/// </summary>
		/// <param name="biff">The GenericBiff record that should contain the correct type and data for the ROW record.</param>
		/// <exception cref="InvalidRecordIdException">
		/// An InvalidRecordIdException is thrown if biff contains an invalid type or invalid data.
		/// </exception>
		public RowRecord(GenericBiff biff)
		{
			if(biff.Id == (ushort)RecordType.Row)
			{
				BinaryReader reader = new BinaryReader(biff.GetDataStream());
				_rowNumber = reader.ReadUInt16();
				_firstCol = reader.ReadUInt16();
				_lastCol = reader.ReadUInt16();
				_rowHeight = new RowHeight(reader.ReadUInt16());
				_optimizer = reader.ReadUInt16();
				_options = new RowOptionFlags(reader.ReadUInt16());
				_xf = reader.ReadUInt16();
			}
			else
				throw new InvalidRecordIdException(biff.Id, RecordType.Row);
		}
Exemplo n.º 5
0
 /// <summary>
 /// The constructor for the record.
 /// </summary>
 /// <param name="biff">The GenericBiff record that should contain the correct type and data for the ROW record.</param>
 /// <exception cref="InvalidRecordIdException">
 /// An InvalidRecordIdException is thrown if biff contains an invalid type or invalid data.
 /// </exception>
 public RowRecord(GenericBiff biff)
 {
     if (biff.Id == (ushort)RecordType.Row)
     {
         BinaryReader reader = new BinaryReader(biff.GetDataStream());
         _rowNumber = reader.ReadUInt16();
         _firstCol  = reader.ReadUInt16();
         _lastCol   = reader.ReadUInt16();
         _rowHeight = new RowHeight(reader.ReadUInt16());
         _optimizer = reader.ReadUInt16();
         _options   = new RowOptionFlags(reader.ReadUInt16());
         _xf        = reader.ReadUInt16();
     }
     else
     {
         throw new InvalidRecordIdException(biff.Id, RecordType.Row);
     }
 }
Exemplo n.º 6
0
        private void BuildColumns()
        {
            // Hidden expander column
            TreeViewColumn col = new TreeViewColumn();

            col.Visible = false;
            AppendColumn(col);
            ExpanderColumn = col;

            focus_column       = new TreeViewColumn();
            renderer           = new SourceRowRenderer();
            renderer.RowHeight = RowHeight.Get();
            renderer.Padding   = RowPadding.Get();
            focus_column.PackStart(renderer, true);
            focus_column.SetCellDataFunc(renderer, new CellLayoutDataFunc(SourceRowRenderer.CellDataHandler));
            AppendColumn(focus_column);

            HeadersVisible = false;
        }
Exemplo n.º 7
0
        public void InitGrid()
        {
            if (this.ScreenWidth == 0 || this.ItemsSource == null || this.ViewSelector == null)
            {
                return;
            }

            if (this.ColumnDefinitions != null || this.RowDefinitions != null)
            {
                this.Children.Clear();
                this.RowDefinitions.Clear();
                this.ColumnDefinitions.Clear();
            }
            this.RowSpacing        = 1;
            this.ColumnSpacing     = 1;
            this.ColumnDefinitions = new ColumnDefinitionCollection();
            this.RowDefinitions    = new RowDefinitionCollection();
            // first decide how many columns we can fit
            int columns   = this.ScreenWidth / this.MinColumnWidth;
            int columnDim = this.ScreenWidth / columns;

            this.ColumnDefinitions = new ColumnDefinitionCollection();
            this.ColumnDefinitions.Add(new ColumnDefinition()
            {
                Width = columnDim
            });
            // now decide how many rows we need
            int rows = this.ItemsSource.Count / columns;

            if (this.ItemsSource.Count % columns > 0)
            {
                rows += 1;
            }
            // now add the rows
            this.RowDefinitions = new RowDefinitionCollection();

            GridLength gl = GridLength.Auto;

            switch (RowHeight.ToLower())
            {
            case "auto": gl = GridLength.Auto; break;

            case "*": gl = new GridLength(1, GridUnitType.Star); break;

            default:
                if (double.TryParse(RowHeight, out double ans))
                {
                    gl = new GridLength(ans);
                }
                break;
            }

            if (this.FillDirection == MultiColumnGridFillDirection.across)
            {
                this.FillAcross(rows, columns, gl);
            }
            else
            {
                this.FillDown(rows, columns, gl);
            }
        }
Exemplo n.º 8
0
        private void BuildColumns()
        {
            // Hidden expander column
            TreeViewColumn col = new TreeViewColumn();

            col.Visible = false;
            AppendColumn(col);
            ExpanderColumn = col;

            source_column        = new TreeViewColumn();
            source_column.Sizing = TreeViewColumnSizing.Autosize;

            uint xpad = 2;

            // Special renderer for header rows; hidden for normal source rows
            header_renderer = new CellRendererText()
            {
                Xpad      = xpad,
                Ypad      = 4,
                Ellipsize = Pango.EllipsizeMode.End,
                Weight    = (int)Pango.Weight.Bold,
                Variant   = Pango.Variant.SmallCaps
            };

            // Renderer for source rows; hidden for header rows
            source_renderer      = new SourceRowRenderer();
            source_renderer.Xpad = xpad;

            source_column.PackStart(header_renderer, true);
            source_column.SetCellDataFunc(header_renderer, new Gtk.CellLayoutDataFunc((layout, cell, model, iter) => {
                if (model == null)
                {
                    throw new ArgumentNullException("model");
                }

                // be paranoid about the values returned from model.GetValue(), they may be null or have unexpected types, see bgo#683359
                var obj_type = model.GetValue(iter, (int)SourceModel.Columns.Type);
                if (obj_type == null || !(obj_type is SourceModel.EntryType))
                {
                    var source      = model.GetValue(iter, (int)SourceModel.Columns.Source) as Source;
                    var source_name = source == null ? "some source" : String.Format("source {0}", source.Name);

                    Log.ErrorFormat(
                        "SourceView of {0} could not render its source column because its type value returned {1} from the iter",
                        source_name, obj_type == null ? "null" : String.Format("an instance of {0}", obj_type.GetType().FullName));

                    header_renderer.Visible = false;
                    source_renderer.Visible = false;

                    return;
                }

                var type = (SourceModel.EntryType)obj_type;
                header_renderer.Visible = type == SourceModel.EntryType.Group;
                source_renderer.Visible = type == SourceModel.EntryType.Source;
                if (type == SourceModel.EntryType.Group)
                {
                    var source = (Source)model.GetValue(iter, (int)SourceModel.Columns.Source);
                    header_renderer.Visible = true;
                    header_renderer.Text    = source.Name;
                }
                else
                {
                    header_renderer.Visible = false;
                }
            }));

            int width, height;

            Gtk.Icon.SizeLookup(IconSize.Menu, out width, out height);
            source_renderer.RowHeight = RowHeight.Get();
            source_renderer.RowHeight = height;

            source_renderer.Ypad = (uint)RowPadding.Get();
            source_renderer.Ypad = 2;
            source_column.PackStart(source_renderer, true);
            source_column.SetCellDataFunc(source_renderer, new CellLayoutDataFunc(SourceRowRenderer.CellDataHandler));
            AppendColumn(source_column);

            HeadersVisible = false;
        }
Exemplo n.º 9
0
        public string Get(string propertyName)
        {
            switch (propertyName)
            {
            //ELEMENT
            case nameof(ClassId):
                return(ClassId.ToString());

            case nameof(AutomationId):
                return(AutomationId.ToString());

            case nameof(Id):
                return(Id.ToString());

            case nameof(StyleId):
                return(StyleId.ToString());

            //VISUAL ELEMENT
            case nameof(AnchorX):
                return(AnchorX.ToString());

            case nameof(AnchorY):
                return(AnchorY.ToString());

            case nameof(BackgroundColor):
                return(BackgroundColor.ToHex());

            case nameof(Width):
                return(this.Width.ToString());

            case nameof(Height):
                return(this.Height.ToString());

            case nameof(IsEnabled):
                return(IsEnabled.ToString());

            case nameof(WidthRequest):
                return(this.WidthRequest.ToString());

            case nameof(HeightRequest):
                return(this.HeightRequest.ToString());

            case nameof(IsFocused):
                return(IsFocused.ToString());

            case nameof(IsVisible):
                return(IsVisible.ToString());

            case nameof(InputTransparent):
                return(InputTransparent.ToString());

            case nameof(X):
                return(this.X.ToString());

            case nameof(Y):
                return(this.Y.ToString());

            case nameof(Opacity):
                return(this.Opacity.ToString());

            case nameof(TranslationX):
                return(this.TranslationX.ToString());

            case nameof(TranslationY):
                return(this.TranslationY.ToString());

            case nameof(Rotation):
                return(this.Rotation.ToString());

            case nameof(RotationX):
                return(this.RotationX.ToString());

            case nameof(RotationY):
                return(this.RotationY.ToString());

            case nameof(Scale):
                return(this.Scale.ToString());

            //VIEW
            case nameof(Margin):
                return(this.Margin.ToString());

            case nameof(VerticalOptions):
                return(this.VerticalOptions.ToString());

            case nameof(HorizontalOptions):
                return(this.HorizontalOptions.ToString());

            //ITEMSVIEW
            case nameof(ItemsSource):
                return(ItemsSource.OfType <object>().Select(x => x.ToString()).Aggregate((x, y) => x + "," + y));

            //LISTVIEW
            case nameof(HasUnevenRows):
                return(HasUnevenRows.ToString());

            case nameof(IsGroupingEnabled):
                return(IsGroupingEnabled.ToString());

            case nameof(RowHeight):
                return(RowHeight.ToString());

            case nameof(Footer):
                return(Footer.ToString());

            case nameof(Header):
                return(Header.ToString());

            case nameof(IsPullToRefreshEnabled):
                return(IsPullToRefreshEnabled.ToString());

            case nameof(IsRefreshing):
                return(IsRefreshing.ToString());

            case nameof(SelectedItem):
                return(SelectedItem.ToString());

            case nameof(SeparatorColor):
                return(SeparatorColor.ToHex());

            case nameof(this.SeparatorVisibility):
                return(SeparatorVisibility.ToString());

            default:
                return(string.Empty);
            }
        }
Exemplo n.º 10
0
        public string Get(string propertyName)
        {
            switch (propertyName)
            {
            //ELEMENT
            case nameof(ClassId):
                return(ClassId.ToString());

            case nameof(AutomationId):
                return(AutomationId.ToString());

            case nameof(Id):
                return(Id.ToString());

            case nameof(StyleId):
                return(StyleId.ToString());

            //VISUAL ELEMENT
            case nameof(AnchorX):
                return(AnchorX.ToString());

            case nameof(AnchorY):
                return(AnchorY.ToString());

            case nameof(BackgroundColor):
                return(BackgroundColor.ToHex());

            case nameof(Width):
                return(this.Width.ToString());

            case nameof(Height):
                return(this.Height.ToString());

            case nameof(IsEnabled):
                return(IsEnabled.ToString());

            case nameof(WidthRequest):
                return(this.WidthRequest.ToString());

            case nameof(HeightRequest):
                return(this.HeightRequest.ToString());

            case nameof(IsFocused):
                return(IsFocused.ToString());

            case nameof(IsVisible):
                return(IsVisible.ToString());

            case nameof(InputTransparent):
                return(InputTransparent.ToString());

            case nameof(X):
                return(this.X.ToString());

            case nameof(Y):
                return(this.Y.ToString());

            case nameof(Opacity):
                return(this.Opacity.ToString());

            case nameof(TranslationX):
                return(this.TranslationX.ToString());

            case nameof(TranslationY):
                return(this.TranslationY.ToString());

            case nameof(Rotation):
                return(this.Rotation.ToString());

            case nameof(RotationX):
                return(this.RotationX.ToString());

            case nameof(RotationY):
                return(this.RotationY.ToString());

            case nameof(Scale):
                return(this.Scale.ToString());

            //VIEW
            case nameof(Margin):
                return(this.Margin.ToString());

            case nameof(VerticalOptions):
                return(this.VerticalOptions.ToString());

            case nameof(HorizontalOptions):
                return(this.HorizontalOptions.ToString());

            //TABLEVIEW
            case nameof(HasUnevenRows):
                return(HasUnevenRows.ToString());

            case nameof(Intent):
                return(Intent.ToString());

            case nameof(RowHeight):
                return(RowHeight.ToString());

            case nameof(Model):
                return(Model.ToString());

            default:
                return(string.Empty);
            }
        }
Exemplo n.º 11
0
        protected override IAsyncResult BeginExecute(AsyncCodeActivityContext context, AsyncCallback callback, object state)
        {
            PropertyDescriptor property = context.DataContext.GetProperties()[ExcelCreate.GetExcelAppTag];
            Excel::Application excelApp = property.GetValue(context.DataContext) as Excel::Application;

            try
            {
                string cellName_Begin   = CellName_Begin.Get(context);
                string cellName_End     = CellName_End.Get(context);
                int    cellRow_Begin    = CellRow_Begin.Get(context);
                int    cellColumn_Begin = CellColumn_Begin.Get(context);
                int    cellRow_End      = CellRow_End.Get(context);
                int    cellColumn_End   = CellColumn_End.Get(context);
                double rowHeight        = RowHeight.Get(context);
                double colWidth         = ColWidth.Get(context);
                Int32  fontSize         = FontSize.Get(context);
                string sheetName        = SheetName.Get(context);

                Excel::_Worksheet sheet = null;
                if (sheetName == null)
                {
                    sheet = excelApp.ActiveSheet;
                }
                else
                {
                    sheet = excelApp.ActiveWorkbook.Sheets[sheetName];
                }

                Excel::Range range1, range2;
                range1 = cellName_Begin == null ? sheet.Cells[cellRow_Begin, cellColumn_Begin] : sheet.Range[cellName_Begin];
                range2 = cellName_End == null ? sheet.Cells[cellRow_End, cellColumn_End] : sheet.Range[cellName_End];
                Excel::Range range = sheet.Range[range1, range2];

                /*对齐设置*/
                if ((int)_AlignStyle != 0)
                {
                    range.HorizontalAlignment = (AlignEnum)_AlignStyle;
                }

                /*字体*/
                range.Font.Bold      = isBold;
                range.Font.Italic    = isItalic;
                range.Font.Underline = isUnderLine;
                if (Font != 0)
                {
                    range.Font.Name = ConvertFont(Font.ToString());
                }
                range.Font.Size = fontSize;

                if ((int)_FontColor != 0)
                {
                    range.Font.ColorIndex = (int)_FontColor;
                }

                /*填充色*/
                if ((int)_CellColor != 0)
                {
                    range.Interior.ColorIndex = (int)_CellColor;
                }

                /*行列宽度*/
                range.RowHeight   = rowHeight;
                range.ColumnWidth = colWidth;

                /*边框*/
                if ((int)_BorderStyle != 0)
                {
                    switch ((int)_BorderType)
                    {
                    case 0:
                    {
                        range.Borders.LineStyle = (int)_BorderStyle;
                        break;
                    }

                    case 1:
                    {
                        range.Borders[Excel.XlBordersIndex.xlEdgeLeft].LineStyle = (int)_BorderStyle;
                        break;
                    }

                    case 2:
                    {
                        range.Borders[Excel.XlBordersIndex.xlEdgeRight].LineStyle = (int)_BorderStyle;
                        break;
                    }

                    case 3:
                    {
                        range.Borders[Excel.XlBordersIndex.xlEdgeTop].LineStyle = (int)_BorderStyle;
                        break;
                    }

                    case 4:
                    {
                        range.Borders[Excel.XlBordersIndex.xlEdgeBottom].LineStyle = (int)_BorderStyle;
                        break;
                    }

                    default:
                        break;
                    }
                }
                System.Runtime.InteropServices.Marshal.ReleaseComObject(sheet);
                System.Runtime.InteropServices.Marshal.ReleaseComObject(range);
                sheet = null;
                range = null;
                GC.Collect();
            }
            catch (Exception e)
            {
                SharedObject.Instance.Output(SharedObject.enOutputType.Error, "EXCEL区域设置执行过程出错", e.Message);
                new CommonVariable().realaseProcessExit(excelApp);
            }
            m_Delegate = new runDelegate(Run);
            return(m_Delegate.BeginInvoke(callback, state));
        }
Exemplo n.º 12
0
        /// <summary>
        /// This method just add the number of buttons required to display the list
        /// </summary>
        protected virtual void DrawButtons()
        {
            // we already display the right number of items?
            if ((_nbRowDisplayed - 1) * RowHeight <= _listRectangle.Height && _listRectangle.Height <= _nbRowDisplayed * RowHeight)
            {
                return;
            }

            // how many items should be displayed?
            _nbRowDisplayed = _nbItems.ClampMax(_listRectangle.Height / RowHeight + 1);

            // for each displayed item of the list
            for (int i = 0; i < _nbRowDisplayed; i++)
            {
                // need to add button?
                if (i >= _rows.Count)
                {
                    _rows.Add(new YamuiListRow {
                        Anchor     = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top,
                        Name       = i.ToString(),
                        TabStop    = i == 0,
                        OnRowPaint = OnRowPaint
                    });

                    _rows[i].KeyDown       += (sender, args) => { OnKeyDown(args); };
                    _rows[i].ButtonPressed += OnRowClick;
                    _rows[i].DoubleClick   += OnRowClick;
                    _rows[i].MouseEnter    += OnRowMouseEnter;
                    _rows[i].MouseLeave    += OnRowMouseLeave;
                    _rows[i].Enter         += OnRowEnter;
                    _rows[i].Leave         += OnRowLeave;
                    _rows[i].MouseMove     += OnRowMouseMove;
                }

                _rows[i].Location   = new Point(_listRectangle.Left, _listRectangle.Top + i * RowHeight);
                _rows[i].Size       = new Size(_listRectangle.Width - (HasScrolls ? ScrollWidth : 0), RowHeight.ClampMax(_listRectangle.Height - i * RowHeight));
                _rows[i].IsSelected = i == SelectedRowIndex;

                // add it to the visible controls
                if (!Controls.Contains(_rows[i]))
                {
                    Controls.Add(_rows[i]);
                }
            }

            for (int i = _nbRowDisplayed; i < _rows.Count; i++)
            {
                if (Controls.Contains(_rows[i]))
                {
                    Controls.Remove(_rows[i]);
                }
            }
        }
Exemplo n.º 13
0
        private void RenderEmptyCells(HtmlTextWriter output)
        {
            for (DateTime time = GetEarliestStartTime(CurrentDate); time < GetLatestFinishTime(CurrentDate);)
            {
                // create a new row
                output.AddAttribute("Height", RowHeight.ToString());
                output.RenderBeginTag("tr");

                if (DiaryType == CalendarType.DayView)
                {
                    TeamViewCountEventArgs args = new TeamViewCountEventArgs(1);
                    RaiseMultiCount(args);

                    // add a column for each staff member
                    for (int i = 0; i < args.Count; i++)
                    {
                        TeamViewGetEventArgs headerArgs = new TeamViewGetEventArgs(i);
                        RaiseMultiCountHeader(headerArgs);

                        output.AddAttribute("class", "DiaryEmpteCellTD");
                        output.AddStyleAttribute("width", String.Format("{0}px", ColumnWidth));
                        output.AddAttribute("colspan", "1");
                        output.RenderBeginTag("td");

                        if (true) //appts.Options.AllowCreateAppointment(CurrentDate, t))
                        {
                            output.AddAttribute("class", "DiaryAppointmentFree");
                            output.AddAttribute("onclick", "javascript:" + Page.ClientScript.GetPostBackEventReference(this, String.Format("EC:{0} {1}", time.ToString("HH:mm"), i)));
                        }
                        //else
                        //{
                        //    output.AddAttribute("class", "DiaryNotWorking");
                        //}

                        output.AddStyleAttribute("width", String.Format("{0}px", ColumnWidth - 2));
                        output.AddStyleAttribute("height", String.Format("{0}px", RowHeight - 2));
                        output.RenderBeginTag("div");
                        output.RenderEndTag(); //div

                        output.RenderEndTag(); //td
                    }
                }
                else
                {
                    DateTime currentDate = CurrentDate;

                    for (int i = 1; i <= ColumnCount; i++)
                    {
                        output.AddAttribute("class", "DiaryEmpteCellTD");
                        output.AddStyleAttribute("width", String.Format("{0}px", ColumnWidth));
                        output.AddAttribute("colspan", "1");
                        output.RenderBeginTag("td");

                        if (true) //therapist != null && therapist.AllowCreateAppointment(currentDate, t))
                        {
                            output.AddAttribute("class", "DiaryAppointmentFree");
                            output.AddAttribute("onclick", "javascript:" + Page.ClientScript.GetPostBackEventReference(this, String.Format("WVEC:{0} {1}", currentDate.ToShortDateString(), time.ToString("HH:mm"))));
                        }
                        //else
                        //{
                        //    output.AddAttribute("class", "DiaryNotWorking");
                        //}

                        output.AddStyleAttribute("width", String.Format("{0}px", ColumnWidth - 2));
                        output.AddStyleAttribute("height", String.Format("{0}px", RowHeight - 2));
                        output.RenderBeginTag("div");
                        output.RenderEndTag(); //div

                        output.RenderEndTag(); //td

                        currentDate = currentDate.AddDays(1);
                    }
                }

                output.RenderEndTag(); // tr

                time = time.AddMinutes(15);
            }
        }
        public int Save()
        {
            int reportColumnRowIndex = ReportColumnRowIndex;

            #region 保存行数列数等信息。
            report.MainReportSetting.HeaderSetting.TopSetting.RowCount    = TopRowCount;
            report.MainReportSetting.HeaderSetting.BottomSetting.RowCount = BottomRowCount;
            report.MainReportSetting.HeaderSetting.ColumnCount            = sheetMain.Columns.Count;
            #endregion
            #region 保存行高信息。
            #region 保存报表列的行高。
            report.MainReportSetting.HeaderSetting.ReportColumnHeight = sheetMain.Rows[reportColumnRowIndex].Height;
            #endregion
            report.MainReportSetting.HeaderSetting.TopSetting.RowHeightList = new List <RowHeight>();
            for (int i = 0; i < reportColumnRowIndex; i++)
            {
                RowHeight rowHeight = new RowHeight();
                rowHeight.Row    = i;
                rowHeight.Height = sheetMain.Rows[i].Height;
                report.MainReportSetting.HeaderSetting.TopSetting.RowHeightList.Add(rowHeight);
            }
            report.MainReportSetting.HeaderSetting.BottomSetting.RowHeightList = new List <RowHeight>();
            for (int i = reportColumnRowIndex + 1; i < sheetMain.Rows.Count; i++)
            {
                RowHeight rowHeight = new RowHeight();
                //需要减少报表行序号。
                rowHeight.Row    = i - reportColumnRowIndex - 1;
                rowHeight.Height = sheetMain.Rows[i].Height;
                report.MainReportSetting.HeaderSetting.BottomSetting.RowHeightList.Add(rowHeight);
            }
            #endregion
            #region 保存列宽信息。
            report.MainReportSetting.HeaderSetting.ColumnWidthList = new List <ColumnWidth>();
            for (int i = 0; i < sheetMain.Columns.Count; i++)
            {
                ColumnWidth columnWidth = new ColumnWidth();
                columnWidth.Column = i;
                columnWidth.Width  = sheetMain.Columns[i].Width;
                report.MainReportSetting.HeaderSetting.ColumnWidthList.Add(columnWidth);
            }
            #endregion
            #region 保存斜线列表。
            report.MainReportSetting.HeaderSetting.TopSetting.BevelLineList    = new List <BevelLine>();
            report.MainReportSetting.HeaderSetting.BottomSetting.BevelLineList = new List <BevelLine>();
            //对于在报表列下方的斜线,统一将Row减少报表列的序号。
            foreach (BevelLine bevelLine in bevelLineList)
            {
                //表首斜线列表。
                if (bevelLine.StartCellRow < reportColumnRowIndex)
                {
                    report.MainReportSetting.HeaderSetting.TopSetting.BevelLineList.Add(bevelLine);
                }
                //表尾斜线列表。
                else
                {
                    #region 将斜线的行序号减少报表列序号。
                    BevelLine bevelLineTemp = bevelLine.Clone();
                    bevelLineTemp.StartCellRow -= reportColumnRowIndex + 1;
                    bevelLineTemp.EndCellRow   -= reportColumnRowIndex + 1;
                    #endregion
                    report.MainReportSetting.HeaderSetting.BottomSetting.BevelLineList.Add(bevelLineTemp);
                }
            }
            #endregion
            #region 保存Cell信息。
            report.MainReportSetting.HeaderSetting.TopSetting.CellInfoList    = GetVisibleCellInfo(0, reportColumnRowIndex - 1);
            report.MainReportSetting.HeaderSetting.BottomSetting.CellInfoList = GetVisibleCellInfo(reportColumnRowIndex + 1, sheetMain.Rows.Count - 1);
            //将行序号减少报表列序号。
            foreach (CellInfo cellInfo in report.MainReportSetting.HeaderSetting.BottomSetting.CellInfoList)
            {
                cellInfo.Row -= reportColumnRowIndex + 1;
            }
            #endregion
            return(1);
        }