Пример #1
0
        internal string ToJSON()
        {
            Hashtable hashtable = new Hashtable();

            if (this.BackgroundColor != "rgba(255, 255, 255, .85)")
            {
                hashtable.Add("backgroundColor", this.BackgroundColor);
            }
            if (this.BorderColor != "auto")
            {
                hashtable.Add("borderColor", this.BorderColor);
            }
            if (this.BorderRadius != 5)
            {
                hashtable.Add("borderRadius", this.BorderRadius);
            }
            if (this.BorderWidth != 2)
            {
                hashtable.Add("borderWidth", this.BorderWidth);
            }
            if (this.Shared)
            {
                hashtable.Add("shared", true);
            }
            if (!this.Enabled)
            {
                hashtable.Add("enabled", false);
            }
            Hashtable hashtable2 = this.XAxisCrossHair.ToHashtable();
            Hashtable hashtable3 = this.XAxisCrossHair.ToHashtable();

            if (hashtable2.Count > 0 || hashtable3.Count > 0)
            {
                Hashtable[] value = new Hashtable[]
                {
                    hashtable2,
                    hashtable3
                };
                hashtable.Add("crosshairs", value);
            }
            string json = new JavaScriptSerializer().Serialize(hashtable);

            return(JsonUtil.RenderClientSideEvent(json, "formatter", this.Formatter));
        }
Пример #2
0
        public string Process()
        {
            string value = string.IsNullOrEmpty(this._button.Text) ? " " : this._button.Text;

            if (!string.IsNullOrEmpty(this._button.Text))
            {
                this._jsonValues["caption"] = value;
            }
            if (!string.IsNullOrEmpty(this._button.ButtonIcon))
            {
                this._jsonValues["buttonicon"] = this._button.ButtonIcon;
            }
            this._jsonValues["position"] = this._button.Position.ToString().ToLower();
            if (!string.IsNullOrEmpty(this._button.ToolTip))
            {
                this._jsonValues["title"] = this._button.ToolTip;
            }
            string json = new JavaScriptSerializer().Serialize(this._jsonValues);

            return(JsonUtil.RenderClientSideEvent(json, "onClickButton", this._button.OnClick));
        }
Пример #3
0
        public string Process()
        {
            DeleteDialogSettings deleteDialogSettings = this._grid.DeleteDialogSettings;

            if (deleteDialogSettings.TopOffset != 0)
            {
                this._jsonValues["top"] = deleteDialogSettings.TopOffset;
            }
            if (deleteDialogSettings.LeftOffset != 0)
            {
                this._jsonValues["left"] = deleteDialogSettings.LeftOffset;
            }
            if (deleteDialogSettings.Width != 300)
            {
                this._jsonValues["width"] = deleteDialogSettings.Width;
            }
            if (deleteDialogSettings.Height != 300)
            {
                this._jsonValues["height"] = deleteDialogSettings.Height;
            }
            if (deleteDialogSettings.Modal)
            {
                this._jsonValues["modal"] = true;
            }
            if (!deleteDialogSettings.Draggable)
            {
                this._jsonValues["drag"] = false;
            }
            if (!deleteDialogSettings.Resizable)
            {
                this._jsonValues["resize"] = false;
            }
            if (!string.IsNullOrEmpty(deleteDialogSettings.SubmitText))
            {
                this._jsonValues["bSubmit"] = deleteDialogSettings.SubmitText;
            }
            if (!string.IsNullOrEmpty(deleteDialogSettings.CancelText))
            {
                this._jsonValues["bCancel"] = deleteDialogSettings.CancelText;
            }
            if (!string.IsNullOrEmpty(deleteDialogSettings.LoadingMessageText))
            {
                this._jsonValues["processData"] = deleteDialogSettings.LoadingMessageText;
            }
            if (!string.IsNullOrEmpty(deleteDialogSettings.Caption))
            {
                this._jsonValues["caption"] = deleteDialogSettings.Caption;
            }
            if (!string.IsNullOrEmpty(deleteDialogSettings.DeleteMessage))
            {
                this._jsonValues["msg"] = deleteDialogSettings.DeleteMessage;
            }
            if (!deleteDialogSettings.ReloadAfterSubmit)
            {
                this._jsonValues["reloadAfterSubmit"] = false;
            }
            string           json             = new JavaScriptSerializer().Serialize(this._jsonValues);
            ClientSideEvents clientSideEvents = this._grid.ClientSideEvents;

            json = JsonUtil.RenderClientSideEvent(json, "beforeShowForm", clientSideEvents.BeforeDeleteDialogShown);
            json = JsonUtil.RenderClientSideEvent(json, "afterShowForm", clientSideEvents.AfterDeleteDialogShown);
            json = JsonUtil.RenderClientSideEvent(json, "afterComplete", clientSideEvents.AfterDeleteDialogRowDeleted);
            return(JsonUtil.RenderClientSideEvent(json, "errorTextFormat", "function(data) { return 'Error: ' + data.responseText }"));
        }