Beispiel #1
0
        public AppointmentBase(string p_Title, DateTime p_DateTimeStart, DateTime p_DateTimeEnd)
        {
            m_Title         = p_Title;
            m_DateTimeEnd   = p_DateTimeEnd;
            m_DateTimeStart = p_DateTimeStart;

            m_View = new Cells.Views.Cell();
        }
Beispiel #2
0
        public AppointmentBase(string title, DateTime dateTimeStart, DateTime dateTimeEnd)
        {
            m_Title         = title;
            m_DateTimeEnd   = dateTimeEnd;
            m_DateTimeStart = dateTimeStart;

            m_View        = new Cells.Views.Cell();
            m_View.Border = DevAge.Drawing.RectangleBorder.RectangleBlack1Width;
        }
Beispiel #3
0
        /// <summary>
        /// Export the specified cell to HTML
        /// </summary>
        /// <param name="context"></param>
        /// <param name="writer"></param>
        protected virtual void ExportHTMLCell(CellContext context, System.Xml.XmlTextWriter writer)
        {
            if (context.Cell == null)
            {
                //start element td
                writer.WriteStartElement("td");
                writer.WriteRaw("&nbsp;");
            }
            else
            {
                #region TD style
                Range rangeCell = context.Grid.PositionToCellRange(context.Position);
                if (rangeCell.Start != context.Position)
                {
                    return;
                }

                //start element td
                writer.WriteStartElement("td");

                //check for rowspan and colspan
                if (rangeCell.ColumnsCount > 1 || rangeCell.RowsCount > 1)
                {
                    //colspan, rowspan
                    writer.WriteAttributeString("colspan", rangeCell.ColumnsCount.ToString());
                    writer.WriteAttributeString("rowspan", rangeCell.RowsCount.ToString());
                }

                if (context.Cell.View is Cells.Views.Cell)
                {
                    Cells.Views.Cell viewCell = (Cells.Views.Cell)context.Cell.View;

                    //write backcolor
                    if ((Mode & ExportHTMLMode.CellBackColor) == ExportHTMLMode.CellBackColor)
                    {
                        writer.WriteAttributeString("bgcolor", ColorToHTML(context.Cell.View.BackColor));
                    }

                    string l_Style = "";

                    //border
                    l_Style = BorderToHTMLStyle(viewCell.Border);

                    //style
                    writer.WriteAttributeString("style", l_Style);

                    //alignment
                    writer.WriteAttributeString("align", DevAge.Windows.Forms.Utilities.ContentToHorizontalAlignment(viewCell.TextAlignment).ToString().ToLower());
                    if (DevAge.Drawing.Utilities.IsBottom(viewCell.TextAlignment))
                    {
                        writer.WriteAttributeString("valign", "bottom");
                    }
                    else if (DevAge.Drawing.Utilities.IsTop(viewCell.TextAlignment))
                    {
                        writer.WriteAttributeString("valign", "top");
                    }
                    else if (DevAge.Drawing.Utilities.IsMiddle(viewCell.TextAlignment))
                    {
                        writer.WriteAttributeString("valign", "middle");
                    }
                }
                #endregion

                if (context.Cell.View is Cells.Views.CheckBox)
                {
                    Cells.Models.ICheckBox      checkModel = (Cells.Models.ICheckBox)context.Cell.Model.FindModel(typeof(Cells.Models.ICheckBox));
                    Cells.Models.CheckBoxStatus status     = checkModel.GetCheckBoxStatus(context);
                    if (status.Checked == true)
                    {
                        writer.WriteRaw("<input type=\"checkbox\" checked>");
                    }
                    else
                    {
                        writer.WriteRaw("<input type=\"checkbox\">");
                    }
                }

                #region Font
                if (context.Cell.View is Cells.Views.Cell)
                {
                    //Read the image
                    System.Drawing.Image img      = null;
                    Cells.Models.IImage  imgModel = (Cells.Models.IImage)context.Cell.Model.FindModel(typeof(Cells.Models.IImage));
                    if (imgModel != null)
                    {
                        img = imgModel.GetImage(context);
                    }


                    Cells.Views.Cell viewCell = (Cells.Views.Cell)context.Cell.View;

                    if (img != null)
                    {
                        writer.WriteStartElement("img");

                        writer.WriteAttributeString("align", DevAge.Windows.Forms.Utilities.ContentToHorizontalAlignment(viewCell.ImageAlignment).ToString().ToLower());
                        writer.WriteAttributeString("src", ExportImage(img));

                        //img
                        writer.WriteEndElement();
                    }

                    writer.WriteStartElement("font");

                    writer.WriteAttributeString("color", ColorToHTML(viewCell.ForeColor));

                    ExportHTMLCellContent(context, writer);

                    //font
                    writer.WriteEndElement();
                }
                else
                {
                    ExportHTMLCellContent(context, writer);
                }
                #endregion

                //td
                writer.WriteEndElement();
            }
        }