public void InstantiateIn (Control container)
			{
				Table table = new Table ();
				table.ControlStyle.Width = Unit.Percentage (100);
				table.ControlStyle.Height = Unit.Percentage (100);

				// Row #0
				table.Controls.Add (
					CreateRow (new LiteralControl (_cPassword.SuccessTitleText), _cPassword.TitleTextStyle, HorizontalAlign.Center));

				// Row #1
				table.Controls.Add (
					CreateRow (new LiteralControl (_cPassword.SuccessText), _cPassword.SuccessTextStyle, HorizontalAlign.Center));

				// Row #3
				WebControl ContinueButton = null;
				switch (_cPassword.ChangePasswordButtonType) {
					case ButtonType.Button:
						ContinueButton = new Button ();
						break;
					case ButtonType.Image:
						ContinueButton = new ImageButton ();
						break;
					case ButtonType.Link:
						ContinueButton = new LinkButton ();
						break;
				}

				ContinueButton.ID = "ContinueButton";
				ContinueButton.ApplyStyle (_cPassword.ContinueButtonStyle);
				((IButtonControl) ContinueButton).CommandName = ChangePassword.ContinueButtonCommandName;
				((IButtonControl) ContinueButton).Text = _cPassword.ContinueButtonText;
				((IButtonControl) ContinueButton).CausesValidation = false;

				table.Controls.Add (
					CreateRow (ContinueButton, null, HorizontalAlign.Right));

				container.Controls.Add (table);
			}
			public void InstantiateIn (Control container)
			{
				Table table = new Table ();
				table.CellPadding = 0;

				// Row #0
				table.Controls.Add (
					CreateRow (new LiteralControl (_owner.ChangePasswordTitleText),
					null, null, _owner.TitleTextStyle, null));

				// Row #1
				if (_owner.InstructionText.Length > 0) {
					table.Controls.Add (
						CreateRow (new LiteralControl (_owner.InstructionText),
						null, null, _owner.InstructionTextStyle, null));
				}

				// Row #2
				if (_owner.DisplayUserName) {
					TextBox UserName = new TextBox ();
					UserName.ID = "UserName";
					UserName.Text = _owner.UserName;
					UserName.ApplyStyle (_owner.TextBoxStyle);

					Label UserNameLabel = new Label ();
					UserNameLabel.ID = "UserNameLabel";
					UserNameLabel.AssociatedControlID = "UserName";
					UserNameLabel.Text = _owner.UserNameLabelText;

					RequiredFieldValidator UserNameRequired = new RequiredFieldValidator ();
					UserNameRequired.ID = "UserNameRequired";
					UserNameRequired.ControlToValidate = "UserName";
					UserNameRequired.ErrorMessage = _owner.UserNameRequiredErrorMessage;
					UserNameRequired.ToolTip = _owner.UserNameRequiredErrorMessage;
					UserNameRequired.Text = "*";
					UserNameRequired.ValidationGroup = _owner.ID;
					UserNameRequired.ApplyStyle (_owner.ValidatorTextStyle);

					table.Controls.Add (CreateRow (UserNameLabel, UserName, UserNameRequired, _owner.LabelStyle, null));
				}

				// Row #3
				TextBox CurrentPassword = new TextBox ();
				CurrentPassword.ID = "CurrentPassword";
				CurrentPassword.TextMode = TextBoxMode.Password;
				CurrentPassword.ApplyStyle (_owner.TextBoxStyle);

				Label CurrentPasswordLabel = new Label ();
				CurrentPasswordLabel.ID = "CurrentPasswordLabel";
				CurrentPasswordLabel.AssociatedControlID = "CurrentPasswordLabel";
				CurrentPasswordLabel.Text = _owner.PasswordLabelText;

				RequiredFieldValidator CurrentPasswordRequired = new RequiredFieldValidator ();
				CurrentPasswordRequired.ID = "CurrentPasswordRequired";
				CurrentPasswordRequired.ControlToValidate = "CurrentPassword";
				CurrentPasswordRequired.ErrorMessage = _owner.PasswordRequiredErrorMessage;
				CurrentPasswordRequired.ToolTip = _owner.PasswordRequiredErrorMessage;
				CurrentPasswordRequired.Text = "*";
				CurrentPasswordRequired.ValidationGroup = _owner.ID;
				CurrentPasswordRequired.ApplyStyle (_owner.ValidatorTextStyle);

				table.Controls.Add (CreateRow (CurrentPasswordLabel, CurrentPassword, CurrentPasswordRequired, _owner.LabelStyle, null));

				// Row #4
				TextBox NewPassword = new TextBox ();
				NewPassword.ID = "NewPassword";
				NewPassword.TextMode = TextBoxMode.Password;
				NewPassword.ApplyStyle (_owner.TextBoxStyle);

				Label NewPasswordLabel = new Label ();
				NewPasswordLabel.ID = "NewPasswordLabel";
				NewPasswordLabel.AssociatedControlID = "NewPassword";
				NewPasswordLabel.Text = _owner.NewPasswordLabelText;

				RequiredFieldValidator NewPasswordRequired = new RequiredFieldValidator ();
				NewPasswordRequired.ID = "NewPasswordRequired";
				NewPasswordRequired.ControlToValidate = "NewPassword";
				NewPasswordRequired.ErrorMessage = _owner.PasswordRequiredErrorMessage;
				NewPasswordRequired.ToolTip = _owner.PasswordRequiredErrorMessage;
				NewPasswordRequired.Text = "*";
				NewPasswordRequired.ValidationGroup = _owner.ID;
				NewPasswordRequired.ApplyStyle (_owner.ValidatorTextStyle);

				table.Controls.Add (CreateRow (NewPasswordLabel, NewPassword, NewPasswordRequired, _owner.LabelStyle, null));

				// Row #5
				if (_owner.PasswordHintText.Length > 0) {
					table.Controls.Add (
						CreateRow (new LiteralControl (""),
							new LiteralControl (_owner.PasswordHintText),
							new LiteralControl (""),
							null, _owner.PasswordHintStyle));
				}

				// Row #6
				TextBox ConfirmNewPassword = new TextBox ();
				ConfirmNewPassword.ID = "ConfirmNewPassword";
				ConfirmNewPassword.TextMode = TextBoxMode.Password;
				ConfirmNewPassword.ApplyStyle (_owner.TextBoxStyle);

				Label ConfirmNewPasswordLabel = new Label ();
				ConfirmNewPasswordLabel.ID = "ConfirmNewPasswordLabel";
				ConfirmNewPasswordLabel.AssociatedControlID = "ConfirmNewPasswordLabel";
				ConfirmNewPasswordLabel.Text = _owner.ConfirmNewPasswordLabelText;

				RequiredFieldValidator ConfirmNewPasswordRequired = new RequiredFieldValidator ();
				ConfirmNewPasswordRequired.ID = "ConfirmNewPasswordRequired";
				ConfirmNewPasswordRequired.ControlToValidate = "ConfirmNewPassword";
				ConfirmNewPasswordRequired.ErrorMessage = _owner.PasswordRequiredErrorMessage;
				ConfirmNewPasswordRequired.ToolTip = _owner.PasswordRequiredErrorMessage;
				ConfirmNewPasswordRequired.Text = "*";
				ConfirmNewPasswordRequired.ValidationGroup = _owner.ID;
				ConfirmNewPasswordRequired.ApplyStyle (_owner.ValidatorTextStyle);

				table.Controls.Add (CreateRow (ConfirmNewPasswordLabel, ConfirmNewPassword, ConfirmNewPasswordRequired, _owner.LabelStyle, null));

				// Row #7
				CompareValidator NewPasswordCompare = new CompareValidator ();
				NewPasswordCompare.ID = "NewPasswordCompare";
				NewPasswordCompare.ControlToCompare = "NewPassword";
				NewPasswordCompare.ControlToValidate = "ConfirmNewPassword";
				NewPasswordCompare.Display = ValidatorDisplay.Dynamic;
				NewPasswordCompare.ErrorMessage = _owner.ConfirmPasswordCompareErrorMessage;
				NewPasswordCompare.ValidationGroup = _owner.ID;

				table.Controls.Add (CreateRow (NewPasswordCompare, null, null, null, null));

				// Row #8
				Literal FailureTextLiteral = new Literal ();
				FailureTextLiteral.ID = "FailureText";
				FailureTextLiteral.EnableViewState = false;

				if (_owner.FailureTextStyle.ForeColor.IsEmpty)
					_owner.FailureTextStyle.ForeColor = System.Drawing.Color.Red;

				table.Controls.Add (CreateRow (FailureTextLiteral, null, null, _owner.FailureTextStyle, null));

				// Row #9
				WebControl ChangePasswordButton = null;
				switch (_owner.ChangePasswordButtonType) {
					case ButtonType.Button:
						ChangePasswordButton = new Button ();
						break;
					case ButtonType.Image:
						ChangePasswordButton = new ImageButton ();
						break;
					case ButtonType.Link:
						ChangePasswordButton = new LinkButton ();
						break;
				}

				ChangePasswordButton.ID = "ChangePasswordPushButton";
				ChangePasswordButton.ApplyStyle (_owner.ChangePasswordButtonStyle);
				((IButtonControl) ChangePasswordButton).CommandName = ChangePassword.ChangePasswordButtonCommandName;
				((IButtonControl) ChangePasswordButton).Text = _owner.ChangePasswordButtonText;
				((IButtonControl) ChangePasswordButton).ValidationGroup = _owner.ID;

				WebControl CancelButton = null;
				switch (_owner.CancelButtonType) {
					case ButtonType.Button:
						CancelButton = new Button ();
						break;
					case ButtonType.Image:
						CancelButton = new ImageButton ();
						break;
					case ButtonType.Link:
						CancelButton = new LinkButton ();
						break;
				}

				CancelButton.ID = "CancelPushButton";
				CancelButton.ApplyStyle (_owner.CancelButtonStyle);
				((IButtonControl) CancelButton).CommandName = ChangePassword.CancelButtonCommandName;
				((IButtonControl) CancelButton).Text = _owner.CancelButtonText;
				((IButtonControl) CancelButton).CausesValidation = false;

				table.Controls.Add (CreateRow (ChangePasswordButton, CancelButton, new LiteralControl (""), null, null));

				// Row #10
				TableRow linksRow = new TableRow ();
				TableCell linksCell = new TableCell ();
				linksCell.ColumnSpan = 2;
				linksCell.ControlStyle.CopyFrom (_owner.HyperLinkStyle);

				linksRow.Cells.Add (linksCell);

				if (AddLink (_owner.HelpPageUrl, _owner.HelpPageText, _owner.HelpPageIconUrl, linksCell))
					linksCell.Controls.Add (new LiteralControl ("<br/>"));

				if (AddLink (_owner.CreateUserUrl, _owner.CreateUserText, _owner.CreateUserIconUrl, linksCell))
					linksCell.Controls.Add (new LiteralControl ("<br/>"));

				if (AddLink (_owner.PasswordRecoveryUrl, _owner.PasswordRecoveryText, _owner.PasswordRecoveryIconUrl, linksCell))
					linksCell.Controls.Add (new LiteralControl ("<br/>"));

				AddLink (_owner.EditProfileUrl, _owner.EditProfileText, _owner.EditProfileIconUrl, linksCell);

				table.Controls.Add (linksRow);

				container.Controls.Add (table);
			}
        protected override void CreateChildControls()
        {
            LinkButton lnkPrevMon = new LinkButton();
            lnkPrevMon.ID = "lnkPrevMon";
            lnkPrevMon.Text = this.PrevMonthText;
            lnkPrevMon.Click += new EventHandler(this.lnkPrevMon_OnClick);
            this._lnkPrevMon = lnkPrevMon;

            LinkButton lnkNextMon = new LinkButton();
            lnkNextMon.ID = "lnkNextMon";
            lnkNextMon.Text = this.NextMonthText;
            lnkNextMon.Click += new EventHandler(this.lnkNextMon_OnClick);
            this._lnkNextMon = lnkNextMon;

            Style hdrTextStyle = new System.Web.UI.WebControls.Style();
            hdrTextStyle.MergeWith(this._dayHdrStyle);
            hdrTextStyle.BorderStyle = BorderStyle.None;

            LinkButton lnkHdrSun = new LinkButton();
            lnkHdrSun.ID = "lnkHdrSun";
            lnkHdrSun.Text = this.GetDayName(DayOfWeek.Sunday);
            lnkHdrSun.ApplyStyle(hdrTextStyle);
            lnkHdrSun.CommandName = "ShowDay";
            lnkHdrSun.CommandArgument = DayOfWeek.Sunday.ToString();
            lnkHdrSun.Command += new CommandEventHandler(this.lnkHdr_OnCommand);
            this._lnkHdrSun = lnkHdrSun;

            LinkButton lnkHdrMon = new LinkButton();
            lnkHdrMon.ID = "lnkHdrMon";
            lnkHdrMon.Text = this.GetDayName(DayOfWeek.Monday);
            lnkHdrMon.ApplyStyle(hdrTextStyle);
            lnkHdrMon.CommandName = "ShowDay";
            lnkHdrMon.CommandArgument = DayOfWeek.Monday.ToString();
            lnkHdrMon.Command += new CommandEventHandler(this.lnkHdr_OnCommand);
            this._lnkHdrMon = lnkHdrMon;

            LinkButton lnkHdrTue = new LinkButton();
            lnkHdrTue.ID = "lnkHdrTue";
            lnkHdrTue.Text = this.GetDayName(DayOfWeek.Tuesday);
            lnkHdrTue.ApplyStyle(hdrTextStyle);
            lnkHdrTue.CommandName = "ShowDay";
            lnkHdrTue.CommandArgument = DayOfWeek.Tuesday.ToString();
            lnkHdrTue.Command += new CommandEventHandler(this.lnkHdr_OnCommand);
            this._lnkHdrTue = lnkHdrTue;

            LinkButton lnkHdrWed = new LinkButton();
            lnkHdrWed.ID = "lnkHdrWed";
            lnkHdrWed.Text = this.GetDayName(DayOfWeek.Wednesday);
            lnkHdrWed.ApplyStyle(hdrTextStyle);
            lnkHdrWed.CommandName = "ShowDay";
            lnkHdrWed.CommandArgument = DayOfWeek.Wednesday.ToString();
            lnkHdrWed.Command += new CommandEventHandler(this.lnkHdr_OnCommand);
            this._lnkHdrWed = lnkHdrWed;

            LinkButton lnkHdrThu = new LinkButton();
            lnkHdrThu.ID = "lnkHdrThu";
            lnkHdrThu.Text = this.GetDayName(DayOfWeek.Thursday);
            lnkHdrThu.ApplyStyle(hdrTextStyle);
            lnkHdrThu.CommandName = "ShowDay";
            lnkHdrThu.CommandArgument = DayOfWeek.Thursday.ToString();
            lnkHdrThu.Command += new CommandEventHandler(this.lnkHdr_OnCommand);
            this._lnkHdrThu = lnkHdrThu;

            LinkButton lnkHdrFri = new LinkButton();
            lnkHdrFri.ID = "lnkHdrFri";
            lnkHdrFri.Text = this.GetDayName(DayOfWeek.Friday);
            lnkHdrFri.ApplyStyle(hdrTextStyle);
            lnkHdrFri.CommandName = "ShowDay";
            lnkHdrFri.CommandArgument = DayOfWeek.Friday.ToString();
            lnkHdrFri.Command += new CommandEventHandler(this.lnkHdr_OnCommand);
            this._lnkHdrFri = lnkHdrFri;

            LinkButton lnkHdrSat = new LinkButton();
            lnkHdrSat.ID = "lnkHdrSat";
            lnkHdrSat.Text = this.GetDayName(DayOfWeek.Saturday);
            lnkHdrSat.ApplyStyle(hdrTextStyle);
            lnkHdrSat.CommandName = "ShowDay";
            lnkHdrSat.CommandArgument = DayOfWeek.Saturday.ToString();
            lnkHdrSat.Command += new CommandEventHandler(this.lnkHdr_OnCommand);
            this._lnkHdrSat = lnkHdrSat;

            // Create all link buttons for the days we're going to display.
            if (this._lnkDates != null)
                this._lnkDates.Clear();
            this._lnkDates = new Collections.WebControlCollection();
            DateTime curWkStart = this.GetCalFirstDay();
            while (curWkStart.Date < this.dtCurMon.AddMonths(1))
            {
                DateTime curDay = curWkStart;
                for (int i = 0; i < 7; i++)
                {
                    LinkButton lnkDate = new LinkButton();
                    lnkDate.ID = "lnkDate_" + curDay.ToString("yyyyMMdd");
                    lnkDate.Text = curDay.Day.ToString();
                    lnkDate.CssClass = "date";
                    lnkDate.CommandName = "ShowDay";
                    lnkDate.CommandArgument = curDay.ToString("yyyyMMdd");
                    lnkDate.Command += new CommandEventHandler(this.lnkDate_OnCommand);
                    lnkDate.ApplyStyle((curDay.Month == this.dtCurMon.Month) ? this._curMonDateStyle : this._othMonDateStyle);
                    this._lnkDates.Add(lnkDate, curDay.ToString("yyyMMdd"));

                    curDay = curDay.AddDays(1);
                }
                curWkStart = curDay;
            }

            base.CreateChildControls();

            this.Controls.Add(this._lnkPrevMon);
            this.Controls.Add(this._lnkNextMon);
            this.Controls.Add(this._lnkHdrSun);
            this.Controls.Add(this._lnkHdrMon);
            this.Controls.Add(this._lnkHdrTue);
            this.Controls.Add(this._lnkHdrWed);
            this.Controls.Add(this._lnkHdrThu);
            this.Controls.Add(this._lnkHdrFri);
            this.Controls.Add(this._lnkHdrSat);

            for (int i = 0; i < this._lnkDates.Count; i++)
                this.Controls.Add(this._lnkDates[i]);
        }
Example #4
0
			public void InstantiateIn (Control container)
			{
				Table table = new Table ();
				table.CellPadding = 0;

				bool twoCells = _owner.TextLayout == LoginTextLayout.TextOnLeft;

				// row 0
				table.Rows.Add (
					TemplateUtils.CreateRow (new LiteralControl (_owner.QuestionTitleText), null, _owner.TitleTextStyle, null, twoCells));

				// row 1
				table.Rows.Add (
					TemplateUtils.CreateRow (new LiteralControl (_owner.QuestionInstructionText), null, _owner.InstructionTextStyle, null, twoCells));

				// row 2
				Literal UserNameLiteral = new Literal ();
				UserNameLiteral.ID = "UserName";

				table.Rows.Add (
					TemplateUtils.CreateRow (new LiteralControl (_owner.UserNameLabelText), UserNameLiteral, _owner.LabelStyle, _owner.LabelStyle, twoCells));

				// row 3
				Literal QuestionLiteral = new Literal ();
				QuestionLiteral.ID = "Question";

				table.Rows.Add (
					TemplateUtils.CreateRow (new LiteralControl (_owner.QuestionLabelText), QuestionLiteral, _owner.LabelStyle, _owner.LabelStyle, twoCells));

				// row 5
				TextBox AnswerTextBox = new TextBox ();
				AnswerTextBox.ID = "Answer";
				AnswerTextBox.ApplyStyle (_owner.TextBoxStyle);

				Label AnswerLabel = new Label ();
				AnswerLabel.ID = "AnswerLabel";
				AnswerLabel.AssociatedControlID = "Answer";
				AnswerLabel.Text = _owner.AnswerLabelText;
				AnswerLabel.ApplyStyle (_owner.LabelStyle);

				RequiredFieldValidator AnswerRequired = new RequiredFieldValidator ();
				AnswerRequired.ID = "AnswerRequired";
				AnswerRequired.ControlToValidate = "Answer";
				AnswerRequired.ErrorMessage = _owner.AnswerRequiredErrorMessage;
				AnswerRequired.ToolTip = _owner.AnswerRequiredErrorMessage;
				AnswerRequired.Text = "*";
				AnswerRequired.ValidationGroup = _owner.ID;
				AnswerRequired.ApplyStyle (_owner.ValidatorTextStyle);

				if (twoCells) {
					TableRow row = TemplateUtils.CreateRow (AnswerLabel, AnswerTextBox, null, null, twoCells);
					row.Cells [1].Controls.Add (AnswerRequired);
					table.Rows.Add (row);
				}
				else {
					table.Rows.Add (TemplateUtils.CreateRow (AnswerLabel, null, null, null, twoCells));
					TableRow row = TemplateUtils.CreateRow (AnswerTextBox, null, null, null, twoCells);
					row.Cells [0].Controls.Add (AnswerRequired);
					table.Rows.Add (row);
				}

				// row 6
				Literal FailureText = new Literal ();
				FailureText.ID = "FailureText";
				if (_owner.FailureTextStyle.ForeColor.IsEmpty)
					_owner.FailureTextStyle.ForeColor = System.Drawing.Color.Red;
				table.Rows.Add (TemplateUtils.CreateRow (FailureText, null, _owner.FailureTextStyle, null, twoCells));

				// row 7
				WebControl SubmitButton = null;
				switch (_owner.SubmitButtonType) {
					case ButtonType.Button:
						SubmitButton = new Button ();
						break;
					case ButtonType.Image:
						SubmitButton = new ImageButton ();
						break;
					case ButtonType.Link:
						SubmitButton = new LinkButton ();
						break;
				}

				SubmitButton.ID = "SubmitButton";
				SubmitButton.ApplyStyle (_owner.SubmitButtonStyle);
				((IButtonControl) SubmitButton).CommandName = PasswordRecovery.SubmitButtonCommandName;
				((IButtonControl) SubmitButton).Text = _owner.SubmitButtonText;
				((IButtonControl) SubmitButton).ValidationGroup = _owner.ID;

				TableRow buttonRow = TemplateUtils.CreateRow (SubmitButton, null, null, null, twoCells);
				buttonRow.Cells [0].HorizontalAlign = HorizontalAlign.Right;
				table.Rows.Add (buttonRow);

				// row 8
				table.Rows.Add (
					TemplateUtils.CreateHelpRow (
					_owner.HelpPageUrl, _owner.HelpPageText, _owner.HelpPageIconUrl, _owner.HyperLinkStyle, twoCells));

				container.Controls.Add (table);
			}
        protected void RenderEventRow(HtmlTextWriter writer, DateTime rowStart)
        {
            DateTime rowEnd = rowStart.Date.AddDays(6);

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "events");
            writer.RenderBeginTag(HtmlTextWriterTag.Tr);

            CalendarEvent[] events = this._provider.GetEvents(this.DisplayUserKey, rowStart.Date, rowEnd.Date);
            if (events.Length == 0)
            {
                for (int i = 0; i < 7; i++)
                    this.RenderEmptyEvent(writer);
            }
            else
            {
                Style eventTextStyle = new Style();
                eventTextStyle.MergeWith(this._eventStyle);
                eventTextStyle.BorderStyle = BorderStyle.None;

                List<CalendarEvent> unrenderedEvents = new List<CalendarEvent>(events);
                DateTime curDay = rowStart;
                while (unrenderedEvents.Count > 0)
                {
                    // Doing the event this way, lets us put multiple events on the same
                    //   row, so long as they don't "interfere" with each other.
                    CalendarEvent curEv = null;
                    if (curDay.Date == rowStart.Date)
                        // Make sure that we only allow events to occured before the
                        //   "current" date if we're on the first cell in the row.
                        curEv = unrenderedEvents.Where(e => e.EventStartDate.Date <= curDay.Date).FirstOrDefault();
                    else
                        curEv = unrenderedEvents.Where(e => e.EventStartDate.Date == curDay.Date).FirstOrDefault();

                    while (curEv == null && curDay.Date <= rowEnd.Date)
                    {
                        this.RenderEmptyEvent(writer);
                        curDay = curDay.AddDays(1);
                        curEv = unrenderedEvents.Where(e => e.EventStartDate.Date == curDay.Date).FirstOrDefault();
                    }

                    if (curEv == null)
                    {
                        // If we still have no current event at this point, end this row,
                        //   start a new one, and let the search start over.
                        curDay = rowStart;
                        writer.RenderEndTag(); // TR (event row)
                        writer.AddAttribute(HtmlTextWriterAttribute.Class, "events");
                        writer.RenderBeginTag(HtmlTextWriterTag.Tr);
                    }
                    else
                    {
                        // Now, we write the actual event.
                        int eventDays = curEv.EventEndDate.Date <= rowEnd.Date
                            ? (int)System.Math.Ceiling(curEv.EventEndDate.Subtract(curDay).TotalDays)
                            : (int)System.Math.Ceiling(rowEnd.Subtract(curDay).TotalDays) + 1;
                        if (eventDays > 1)
                            writer.AddAttribute(HtmlTextWriterAttribute.Colspan, eventDays.ToString());
                        if (curEv.EventStartDate < rowStart && curEv.EventEndDate > rowEnd)
                            writer.AddAttribute(HtmlTextWriterAttribute.Class, "evMid");
                        else if (curEv.EventStartDate < rowStart)
                            writer.AddAttribute(HtmlTextWriterAttribute.Class, "evEnd");
                        else if (curEv.EventEndDate > rowEnd)
                            writer.AddAttribute(HtmlTextWriterAttribute.Class, "evStart");
                        else
                            writer.AddAttribute(HtmlTextWriterAttribute.Class, "evFull");
                        if (this.ControlStyle != null)
                        {
                            System.Web.UI.WebControls.Style tdStyle = new Style();
                            tdStyle.BorderStyle = this.ControlStyle.BorderStyle;
                            tdStyle.BorderColor = this.ControlStyle.BorderColor;
                            tdStyle.BorderWidth = this.ControlStyle.BorderWidth;
                            tdStyle.ForeColor = this.ControlStyle.ForeColor;
                            tdStyle.BackColor = this.ControlStyle.BackColor;
                            tdStyle.AddAttributesToRender(writer);
                        }
                        writer.RenderBeginTag(HtmlTextWriterTag.Td);

                        //if (curEv.EventStartDate < rowStart && curEv.EventEndDate > rowEnd)
                        //    writer.AddAttribute(HtmlTextWriterAttribute.Class, "evMid");
                        //else if (curEv.EventStartDate < rowStart)
                        //    writer.AddAttribute(HtmlTextWriterAttribute.Class, "evEnd");
                        //else if (curEv.EventEndDate > rowEnd)
                        //    writer.AddAttribute(HtmlTextWriterAttribute.Class, "evStart");
                        //else
                        //    writer.AddAttribute(HtmlTextWriterAttribute.Class, "evFull");
                        this._eventStyle.AddAttributesToRender(writer);
                        writer.RenderBeginTag(HtmlTextWriterTag.Div);

                        LinkButton lnkEvent = new LinkButton();
                        lnkEvent.ID = "lnkEvent_" + curEv.ProviderEventKey + "_" + curDay.ToString("yyyyMMdd");
                        lnkEvent.Text = (curEv.EventStartDate.Date == curDay.Date)
                            ? string.Format("{0} {1}", curEv.EventStartDate.ToString(System.Globalization.DateTimeFormatInfo.CurrentInfo.ShortTimePattern), curEv.Subject)
                            : string.Format("<< {0}", curEv.Subject);
                        lnkEvent.ApplyStyle(eventTextStyle);
                        lnkEvent.CommandName = "ShowEvent";
                        lnkEvent.CommandArgument = curEv.ProviderEventKey.ToString();
                        lnkEvent.Command += new CommandEventHandler(this.lnkEvent_Command);

                        this.Controls.Add(lnkEvent);
                        lnkEvent.RenderControl(writer);

                        writer.RenderEndTag(); // DIV
                        writer.RenderEndTag(); // TD

                        unrenderedEvents.Remove(curEv);
                        curDay = curEv.EventEndDate.AddDays(1);
                    }
                }
                while (curDay.Date <= rowEnd.Date)
                {
                    // "Fill" any remaining days on this row.
                    this.RenderEmptyEvent(writer);
                    curDay = curDay.AddDays(1);
                }
            }

            writer.RenderEndTag(); // TR (event row)
        }