protected string EncodeError(string error) { Hashtable hashtable = new Hashtable(); hashtable["generalError"] = error; return(this.Encode("/*^^^DX^^^*/" + HtmlConvertor.ToJSON(hashtable))); }
protected void OnHtmlTimeCellPrepared(object sender, ASPxSchedulerTimeCellPreparedEventArgs e) { TimeInterval cellInterval = e.Interval; if (e.View.Type == DevExpress.XtraScheduler.SchedulerViewType.Day) { TimeSpan dinnerStart = new TimeSpan(15, 0, 0); TimeSpan dinnerEnd = new TimeSpan(17, 0, 0); TimeSpan cellStart = cellInterval.Start.TimeOfDay; TimeSpan cellEnd = cellInterval.End.TimeOfDay; if (cellStart >= dinnerStart && cellStart <= dinnerEnd && cellEnd <= dinnerEnd) { e.Cell.BackColor = Color.Red; string valueString = HtmlConvertor.ToHtml(Color.Yellow); e.Cell.Style.Add("border-bottom-color", valueString); e.Cell.Style.Add("text-align", "center"); e.Cell.Controls.Add(new LiteralControl("dinner")); } } if (e.View.Type == SchedulerViewType.Week) { DateTime specialDate = new DateTime(2008, 7, 24); if (cellInterval.Start == specialDate) { e.Cell.BackColor = Color.Green; } } }
protected string EncodeRedirect(string redirectUrl) { Hashtable hashtable = new Hashtable(); hashtable["redirect"] = redirectUrl; return(this.Encode("/*^^^DX^^^*/" + HtmlConvertor.ToJSON(hashtable))); }
void AssignStatusStyle() { statusBack.Style.Add(HtmlTextWriterStyle.BackgroundColor, HtmlConvertor.ToHtml(Items.StatusControl.BackColor)); statusBack.Style.Add(HtmlTextWriterStyle.BorderColor, HtmlConvertor.ToHtml(GetStatusBorderColor())); statusFore.Style.Add(HtmlTextWriterStyle.BackgroundColor, HtmlConvertor.ToHtml(Items.StatusControl.Color)); }
protected override void GetCreateClientObjectScript(StringBuilder stb, string localVarName, string clientName) { base.GetCreateClientObjectScript(stb, localVarName, clientName); stb.AppendFormat("{0}.SetParentGridView({1});\n", localVarName, HtmlConvertor.ToJSON(Page.ToClientID(ParentGridViewID))); stb.AppendFormat("{0}.SetHeaderSearchUndefined({1});\n", localVarName, HtmlConvertor.ToJSON(HtmlEncode(HeaderSearchUndefined))); stb.AppendFormat("{0}.SetHeaderSearchPerformed({1});\n", localVarName, HtmlConvertor.ToJSON(HtmlEncode(HeaderSearchPerformed))); stb.AppendFormat("{0}.SetHeaderSearchCancelled({1});\n", localVarName, HtmlConvertor.ToJSON(HtmlEncode(HeaderSearchCancelled))); }
Color GetStatusBorderColor() { Color borderColor = Items.StatusControl.Color; if (borderColor.IsEmpty || HtmlConvertor.ToHtml(borderColor) == "#FFFFFF") { borderColor = Color.LightGray; } return(borderColor); }
protected override void LoadGridControlState(string pageSelectionResult, string pageKeyValues, string columnResizingResult, string endlessPagingState, string batchEditClientState) { base.LoadGridControlState(pageSelectionResult, pageKeyValues, columnResizingResult, endlessPagingState, batchEditClientState); var arrayList = new ArrayList(); if (pageKeyValues.IsNotEmpty() && pageKeyValues.StartsWith("[")) { arrayList = HtmlConvertor.FromJSON <ArrayList>(pageKeyValues); } PageKeyValuesLoadedState = DataProxy.GetKeyValuesFromScript(arrayList); }
protected void Callback_Callback(object source, CallbackEventArgs e) { e.Result = HtmlConvertor.ToJSON(GetCallbackResult(e.Parameter)); }
void AssignBackgroundColor() { appointmentDiv.Style[HtmlTextWriterStyle.BackgroundColor] = string.Empty; appointmentBackground.Style[HtmlTextWriterStyle.BackgroundColor] = HtmlConvertor.ToHtml(Items.AppointmentStyle.BackColor); }
protected override void GetCreateClientObjectScript(StringBuilder stb, string localVarName, string clientName) { base.GetCreateClientObjectScript(stb, localVarName, clientName); stb.AppendFormat("{0}.SetParentGridView({1});\n", localVarName, HtmlConvertor.ToJSON(Grid.ClientID())); }
public static string ToScript(this object value) { return(HtmlConvertor.ToScript(value)); }