예제 #1
0
        private void FormControlPropertiesGrid_Refresh()
        {
            Telerik.Web.UI.RadTreeNode activeNode = FormExplorerTree.SelectedNode;

            System.Data.DataTable propertiesTable = new System.Data.DataTable();

            propertiesTable.Columns.Add("Name");

            propertiesTable.Columns.Add("Value");

            propertiesTable.Columns.Add("Type");

            if (activeNode != null)
            {
                Client.Core.Forms.Control selectedControl = EditorForm.FindControlById(new Guid(activeNode.Value));

                if (selectedControl != null)
                {
                    foreach (System.Reflection.PropertyInfo currentPropertyInfo in selectedControl.GetType().GetProperties())
                    {
                        propertiesTable.Rows.Add(

                            currentPropertyInfo.Name,

                            (currentPropertyInfo.CanRead) ?

                            ((currentPropertyInfo.GetValue(selectedControl, null) != null) ?  currentPropertyInfo.GetValue(selectedControl, null).ToString() : "null")

                                : " < complex type >",

                            currentPropertyInfo.PropertyType.ToString()

                            );
                    }
                }
            }

            FormControlPropertiesGrid.DataSource = propertiesTable;

            FormControlPropertiesGrid.AutoGenerateColumns = true;

            Telerik.Web.UI.GridSortExpression propertiesSort = new Telerik.Web.UI.GridSortExpression();

            propertiesSort.FieldName = "Name";

            propertiesSort.SortOrder = Telerik.Web.UI.GridSortOrder.Ascending;

            FormControlPropertiesGrid.MasterTableView.SortExpressions.Clear();

            FormControlPropertiesGrid.MasterTableView.SortExpressions.Add(propertiesSort);

            FormControlPropertiesGrid.Rebind();

            return;
        }
        private void FormServerProcessing_ControlPanelEnable(Client.Core.Forms.Control control, Client.Core.Forms.ServerProcessRequestType requestType)
        {
            Grid controlPanel = (Grid)FindName("FormControl_" + control.ControlId.ToString().Replace("-", "") + "_Panel");

            controlPanel.IsHitTestVisible = true;

            controlPanel.Opacity = 1;

            // ((App) App.Current).WindowManager.Window_OnGlobalProgressBarHide (control, new EventArgs ());

            ((App)App.Current).WindowManager.Window_OnGlobalProgressBarHide(control.ControlId.ToString().Replace("-", "") + requestType.ToString(), new EventArgs());

            return;
        }
예제 #3
0
        private void FormExplorerTree_AddNode(Telerik.Web.UI.RadTreeNode parentNode, Client.Core.Forms.Control formControl)
        {
            Telerik.Web.UI.RadTreeNode currentNode;

            String nodeText = formControl.Name;

            if ((formControl.ReadOnly) || (!formControl.Visible) || (formControl.Required))
            {
                if (formControl.Required)
                {
                    nodeText = nodeText + " { Required }";
                }

                if (formControl.ReadOnly)
                {
                    nodeText = nodeText + " { Read Only }";
                }

                if (!formControl.Visible)
                {
                    nodeText = nodeText + " { Not Visible }";
                }
            }


            currentNode = new Telerik.Web.UI.RadTreeNode();

            currentNode.Text = nodeText;

            currentNode.Value = formControl.ControlId.ToString();

            currentNode.Category = formControl.ControlType.ToString();

            currentNode.ImageUrl = "/Images/Common16/" + formControl.ControlType.ToString() + ".png";

            currentNode.ExpandMode = Telerik.Web.UI.TreeNodeExpandMode.ClientSide;

            parentNode.Nodes.Add(currentNode);

            foreach (Client.Core.Forms.Control currentChildControl in formControl.Controls)
            {
                FormExplorerTree_AddNode(currentNode, currentChildControl);
            }

            return;
        }
예제 #4
0
        public void InsertNewControl(Int32 index, Server.Application.FormControlType forControlType)
        {
            #region Create Appropriate Child Control

            Client.Core.Forms.Control childControl = null;

            switch (forControlType)
            {
            case Server.Application.FormControlType.Address: childControl = new global::Mercury.Client.Core.Forms.Controls.Address(application); break;

            case Server.Application.FormControlType.Button: childControl = new global::Mercury.Client.Core.Forms.Controls.Button(application); break;

            case Server.Application.FormControlType.Collection: childControl = new global::Mercury.Client.Core.Forms.Controls.Collection(application); break;

            case Server.Application.FormControlType.Entity: childControl = new global::Mercury.Client.Core.Forms.Controls.Entity(application); break;

            case Server.Application.FormControlType.Input: childControl = new global::Mercury.Client.Core.Forms.Controls.Input(application); break;

            case Server.Application.FormControlType.Label: childControl = new global::Mercury.Client.Core.Forms.Controls.Label(application); break;

            case Server.Application.FormControlType.Metric: childControl = new global::Mercury.Client.Core.Forms.Controls.Metric(application); break;

            case Server.Application.FormControlType.Section: childControl = new global::Mercury.Client.Core.Forms.Controls.Section(application); break;

            case Server.Application.FormControlType.SectionColumn: childControl = new global::Mercury.Client.Core.Forms.Controls.SectionColumn(application); break;

            case Server.Application.FormControlType.Selection: childControl = new global::Mercury.Client.Core.Forms.Controls.Selection(application); break;

            case Server.Application.FormControlType.Service: childControl = new global::Mercury.Client.Core.Forms.Controls.Service(application); break;

            case Server.Application.FormControlType.Text: childControl = new global::Mercury.Client.Core.Forms.Controls.Text(application); break;
            }

            if ((childControl != null) && (AllowChildControl(forControlType)))
            {
                InsertNewControl(index, childControl);
            }

            #endregion

            return;
        }