Пример #1
0
        private void renderEvents(Day d, HtmlTextWriter output)
        {
            if (d.events.Count == 0)
            {
                output.Write("<div style='height:" + (EventHeight - 1) + "px;position:relative;width:1px;overflow:none;' unselectable='on'><!-- --></div>");
            }
            else
            {
                output.AddStyleAttribute("position", "relative");
                output.AddStyleAttribute("height", (d.MaxColumns() * EventHeight - 1) + "px"); //
                output.AddStyleAttribute("overflow", "none");
                output.AddAttribute("unselectable", "on");
                output.RenderBeginTag("div");

                foreach (Event ep in d.events)
                {
                    renderEvent(d, ep, output);
                }

                // div relative
                output.RenderEndTag();
            }
        }
Пример #2
0
        private void renderRowHeader(HtmlTextWriter output, Day d)
        {
            int height = (d.MaxColumns() * EventHeight - 1);

            output.AddStyleAttribute("width", (RowHeaderWidth - 1) + "px");
            output.AddStyleAttribute("border-right", "1px solid " + ColorTranslator.ToHtml(BorderColor));
            output.AddStyleAttribute("border-left", "1px solid " + ColorTranslator.ToHtml(BorderColor));
            output.AddStyleAttribute("border-bottom", "1px solid " + ColorTranslator.ToHtml(BorderColor));
            output.AddStyleAttribute("background-color", ColorTranslator.ToHtml(HourNameBackColor));
            output.AddStyleAttribute("font-family", HeaderFontFamily);
            output.AddStyleAttribute("font-size", HeaderFontSize);
            output.AddStyleAttribute("color", ColorTranslator.ToHtml(HeaderFontColor));
            output.AddStyleAttribute("cursor", "default");

            output.AddAttribute("unselectable", "on");
            output.AddAttribute("resource", d.Value);
            output.RenderBeginTag("td");

            output.Write("<div unselectable='on' style='margin-left:4px; height:" + height + "px; line-height:" + height + "px; overflow:hidden;'>");
            output.Write(d.Name);
            output.Write("</div>");

            output.RenderEndTag();
        }
Пример #3
0
        private void renderCells(HtmlTextWriter output, Day d)
        {
            int cellsToRender = cellCount;

            for (int i = 0; i < cellsToRender; i++)
            {
                DateTime start = d.Start.AddMinutes(i * CellDuration);

                int thisCellWidth = CellWidth;
                if (i == 0)
                {
                    thisCellWidth = CellWidth - 1;
                }
                string back = getCellColor(start, d.Value);

                if (i == cellsToRender - 1)
                {
                    output.AddStyleAttribute("border-right", "1px solid " + ColorTranslator.ToHtml(BorderColor));
                }
                output.AddStyleAttribute("border-bottom", "1px solid " + ColorTranslator.ToHtml(BorderColor));
                output.AddStyleAttribute("width", thisCellWidth + "px");
                output.AddStyleAttribute("background-color", back);
                output.AddStyleAttribute("cursor", "pointer");

                if (FreeTimeClickHandling == UserActionHandling.PostBack)
                {
                    output.AddAttribute("onclick", "javascript:" + Page.ClientScript.GetPostBackEventReference(this, "TIME:" + start.ToString("s") + d.Value));
                }
                else
                {
                    output.AddAttribute("onclick", "javascript:" + String.Format(FreeTimeClickJavaScript, start.ToString("s"), d.Value));
                }
                output.AddAttribute("onmouseover", "this.style.backgroundColor='" + ColorTranslator.ToHtml(HoverColor) + "';");
                output.AddAttribute("onmouseout", "this.style.backgroundColor='" + back + "';");

                output.RenderBeginTag("td");

                output.Write("<div unselectable='on' style='display:block; width:" + (thisCellWidth - 1) + "px; height:" + (d.MaxColumns() * EventHeight - 1) + "px; border-right: 1px solid " + ColorTranslator.ToHtml(HourBorderColor) + ";' ><!-- --></div>");
                output.RenderEndTag();
            }
        }