virtual public Mercury.Client.Core.Forms.Control FindControlById(Guid forControlId) { Mercury.Client.Core.Forms.Control control = null; if (controlId == forControlId) { return(this); } foreach (Mercury.Client.Core.Forms.Control currentControl in controls) { if (currentControl.ControlId == forControlId) { control = currentControl; break; } else { control = currentControl.FindControlById(forControlId); if (control != null) { break; } } } return(control); }
override public void BaseConstructor(Mercury.Client.Core.Forms.Control parentControl, Server.Application.FormControl serverControl) { base.BaseConstructor(parentControl, serverControl); Server.Application.FormControlAddress serverAddress = (Server.Application.FormControlAddress)serverControl; EntityAddressId = serverAddress.EntityAddressId; AddressType = serverAddress.AddressType; EffectiveDate = serverAddress.EffectiveDate; TerminationDate = serverAddress.TerminationDate; Line1 = serverAddress.Line1; Line2 = serverAddress.Line2; City = serverAddress.City; State = serverAddress.State; ZipCode = serverAddress.ZipCode; ZipPlus4 = serverAddress.ZipPlus4; PostalCode = serverAddress.PostalCode; label = new Label(Application, this, serverAddress.Label); return; }
public void InsertNewControl(Int32 index, Mercury.Client.Core.Forms.Control control) { String controlPrefix = control.controlType.ToString(); Int32 controlSuffix = 1; control.parent = this; if (index == -1) { index = controls.Count; } while (Form.FindControlByName(controlPrefix + controlSuffix.ToString()) != null) { controlSuffix = controlSuffix + 1; } control.Name = controlPrefix + controlSuffix.ToString(); if (index > controls.Count) { index = controls.Count; } controls.Insert(index, control); return; }
override public void BaseConstructor(Mercury.Client.Core.Forms.Control parentControl, Server.Application.FormControl serverControl) { base.BaseConstructor(parentControl, serverControl); Server.Application.FormControlService serverService = (Server.Application.FormControlService)serverControl; memberId = serverService.MemberId; memberServiceId = serverService.MemberServiceId; serviceId = serverService.ServiceId; serviceName = serverService.ServiceName; serviceDate = serverService.ServiceDate; serviceDateVisible = serverService.ServiceDateVisible; mostRecentMemberServiceId = serverService.MostRecentMemberServiceId; mostRecentMemberServiceDate = serverService.MostRecentMemberServiceDate; mostRecentMemberServiceDateVisible = serverService.MostRecentMemberServiceDateVisible; label = new Label(Application, this, serverService.Label); return; }
override public void BaseConstructor(Application applicationReference, Mercury.Client.Core.Forms.Control parentControl, Mercury.Server.Application.FormControl serverControl) { base.BaseConstructor(applicationReference, parentControl, serverControl); Mercury.Server.Application.FormControlMetric serverMetric = (Mercury.Server.Application.FormControlMetric)serverControl; memberId = serverMetric.MemberId; memberMetricId = serverMetric.MemberMetricId; metricId = serverMetric.MetricId; metricName = serverMetric.MetricName; metricDate = serverMetric.MetricDate; metricValue = serverMetric.MetricValue; label = new Label(Application, this, serverMetric.Label); return; }
public Input(Application applicationReference, Mercury.Client.Core.Forms.Control parentControl, Server.Application.FormControlInput serverInput) { InitializeControl(applicationReference); BaseConstructor(parentControl, serverInput); ChildServerControlsToLocal(this, serverInput); }
public Address(Application applicationReference, Mercury.Client.Core.Forms.Control parentControl, Mercury.Server.Application.FormControlAddress serverAddress) { InitializeControl(applicationReference); BaseConstructor(applicationReference, parentControl, serverAddress); ChildServerControlsToLocal(this, serverAddress); }
public Label(Application applicationReference, Mercury.Client.Core.Forms.Control parentControl, Server.Application.FormControlLabel serverLabel) { InitializeControl(applicationReference); BaseConstructor(parentControl, serverLabel); text = serverLabel.Text; return; }
public SectionColumn(Application applicationReference, Mercury.Client.Core.Forms.Control parentControl, Mercury.Server.Application.FormControlSectionColumn serverControl) { BaseConstructor(applicationReference, parentControl, serverControl); InitializeControl(applicationReference); ChildServerControlsToLocal(this, serverControl); return; }
public Section(Application applicationReference, Mercury.Client.Core.Forms.Control parentControl) { InitializeControl(applicationReference); parent = parentControl; InsertNewControl(0, new SectionColumn(Application)); return; }
public Selection(Application applicationReference, Mercury.Client.Core.Forms.Control parentControl, Server.Application.FormControlSelection serverSelection) { InitializeControl(applicationReference); BaseConstructor(parentControl, serverSelection); ChildServerControlsToLocal(this, serverSelection); return; }
public Entity(Application applicationReference, Mercury.Client.Core.Forms.Control parentControl, Mercury.Server.Application.FormControlEntity serverControl) { InitializeControl(applicationReference); BaseConstructor(applicationReference, parentControl, serverControl); ChildServerControlsToLocal(this, serverControl); return; }
override public void BaseConstructor(Mercury.Client.Core.Forms.Control parentControl, Server.Application.FormControl serverControl) { base.BaseConstructor(parentControl, serverControl); Server.Application.FormControlInput serverInput = (Server.Application.FormControlInput)serverControl; inputType = serverInput.InputType; text = serverInput.Text; textMode = serverInput.TextMode; columns = serverInput.Columns; rows = serverInput.Rows; wrap = serverInput.Wrap; maxLength = serverInput.MaxLength; emptyMessage = serverInput.EmptyMessage; validation = serverInput.Validation; readOnly = serverInput.ReadOnly; selectionOnFocus = serverInput.SelectionOnFocus; mask = serverInput.Mask; numericType = serverInput.NumericType; minValue = serverInput.MinValue; maxValue = serverInput.MaxValue; showSpinButtons = serverInput.ShowSpinButtons; buttonPosition = serverInput.ButtonPosition; dateFormat = serverInput.DateFormat; displayDateFormat = serverInput.DisplayDateFormat; minDate = serverInput.MinDate; maxDate = serverInput.MaxDate; label = new Label(Application, this, serverInput.Label); return; }
public Text(Application applicationReference, Mercury.Client.Core.Forms.Control parentControl, Mercury.Server.Application.FormControlText serverText) { InitializeControl(applicationReference); BaseConstructor(applicationReference, parentControl, serverText); text = serverText.Text; ChildServerControlsToLocal(this, serverText); return; }
override public void BaseConstructor(Application applicationReference, Mercury.Client.Core.Forms.Control parentControl, Mercury.Server.Application.FormControl serverControl) { base.BaseConstructor(applicationReference, parentControl, serverControl); Mercury.Server.Application.FormControlSelection serverSelection = (Mercury.Server.Application.FormControlSelection)serverControl; selectionType = serverSelection.SelectionType; columns = serverSelection.Columns; rows = serverSelection.Rows; direction = serverSelection.Direction; wrap = serverSelection.Wrap; maxLength = serverSelection.MaxLength; readOnly = serverSelection.ReadOnly; selectionMode = serverSelection.SelectionMode; dataSource = serverSelection.DataSource; referenceSource = serverSelection.ReferenceSource; allowCustomText = serverSelection.AllowCustomText; customText = serverSelection.CustomText; items = new List <Mercury.Client.Core.Forms.Structures.SelectionItem> (); foreach (Mercury.Server.Application.FormControlSelectionItem currentServerItem in serverSelection.Items) { Structures.SelectionItem selectionItem = new Mercury.Client.Core.Forms.Structures.SelectionItem(currentServerItem); items.Add(selectionItem); } //items = new List<Mercury.Server.Application.FormControlSelectionItem> (); //items.AddRange (serverSelection.Items); label = new Label(Application, this, serverSelection.Label); return; }
public Section(Application applicationReference, Mercury.Client.Core.Forms.Control parentControl, Mercury.Server.Application.FormControlSection serverSection) { BaseConstructor(applicationReference, parentControl, serverSection); InitializeControl(applicationReference); pageBreakAfterSection = serverSection.PageBreakAfterSection; ChildServerControlsToLocal(this, serverSection); return; }
protected void Save(Object sender, EventArgs eventArgs) { String sourceCode = String.Empty; Mercury.Client.Core.Forms.Form designerForm = DesignerForm; Mercury.Client.Core.Forms.Control eventControl = designerForm.FindControlById(new Guid(DocumentControlId.Text)); if (eventControl != null) { sourceCode = FormatSourceCode(ScriptEditor.Text); Mercury.Server.Application.FormControlEventHandler eventHandler = eventControl.GetEventHandler(EventName.Text); if (eventHandler != null) { if (ScriptEditor.Content == String.Empty) { eventControl.EventHandlers.Remove(eventHandler); } else { eventHandler.MethodSource = sourceCode; eventHandler.ExecuteClientSide = ((Telerik.Web.UI.RadToolBarButton)EditorToolbar.Items[0]).Checked; eventHandler.SmartEvent = ((Telerik.Web.UI.RadToolBarButton)EditorToolbar.Items[2]).Checked; } } else { eventHandler = new Mercury.Server.Application.FormControlEventHandler(); eventHandler.EventName = EventName.Text; eventHandler.MethodSource = sourceCode; eventHandler.ExecuteClientSide = ((Telerik.Web.UI.RadToolBarButton)EditorToolbar.Items[0]).Checked; eventHandler.SmartEvent = ((Telerik.Web.UI.RadToolBarButton)EditorToolbar.Items[2]).Checked; eventControl.EventHandlers.Add(eventHandler); } } // if (eventControl != null) { DesignerForm = designerForm; return; }
public void InsertControl(Int32 index, Mercury.Client.Core.Forms.Control control) { if (index == -1) { index = controls.Count; } control.Parent = this; controls.Insert(index, control); return; }
virtual public void BaseConstructor(Mercury.Client.Core.Forms.Control parentControl, Server.Application.FormControl serverControl) { base.BaseConstructor(application, serverControl); controlId = serverControl.ControlId; controlType = serverControl.ControlType; tabIndex = serverControl.TabIndex; enabled = serverControl.Enabled; visible = serverControl.Visible; readOnly = serverControl.ReadOnly; required = serverControl.Required; position = serverControl.Position; capabilities = serverControl.Capabilities; eventHandlers = serverControl.EventHandlers; if (eventHandlers == null) { eventHandlers = new ObservableCollection <Mercury.Server.Application.FormControlEventHandler> (); } if (serverControl.Style != null) { style = new Mercury.Client.Core.Forms.Structures.Style(this, serverControl.Style); } else if (style == null) { style = new Mercury.Client.Core.Forms.Structures.Style(this); } dataBindings = serverControl.DataBindings; parent = parentControl; return; }
override public void BaseConstructor(Mercury.Client.Core.Forms.Control parentControl, Server.Application.FormControl serverControl) { base.BaseConstructor(parentControl, serverControl); Server.Application.FormControlCollection serverCollection = (Server.Application.FormControlCollection)serverControl; collectionType = serverCollection.CollectionType; label = new Label(Application, this, serverCollection.Label); items.Clear(); items.AddRange(serverCollection.Items); SelectedItem = serverCollection.SelectedItem; return; }
virtual public Mercury.Client.Core.Forms.Control FindControlByName(String forControlName) { Mercury.Client.Core.Forms.Control control = null; if (Name == forControlName) { return(this); } foreach (Mercury.Client.Core.Forms.Control currentControl in controls) { control = currentControl.FindControlByName(forControlName); if (control != null) { break; } } return(control); }
override public void BaseConstructor(Application applicationReference, Mercury.Client.Core.Forms.Control parentControl, Mercury.Server.Application.FormControl serverControl) { base.BaseConstructor(applicationReference, parentControl, serverControl); Mercury.Server.Application.FormControlEntity serverEntity = (Mercury.Server.Application.FormControlEntity)serverControl; entityType = serverEntity.EntityType; entityObjectId = serverEntity.EntityObjectId; displayAgeFormat = serverEntity.DisplayAgeFormat; displayStyle = serverEntity.DisplayStyle; allowCustomEntityName = serverEntity.AllowCustomEntityName; entityName = serverEntity.EntityName; label = new Label(Application, this, serverEntity.Label); return; }
protected void EditorToolbar_OnButtonClick(Object sender, Telerik.Web.UI.RadToolBarEventArgs eventArgs) { switch (eventArgs.Item.Text) { case "Compile": Mercury.Client.Core.Forms.Form designerForm = DesignerForm; Mercury.Client.Core.Forms.Control eventControl = designerForm.FindControlById(new Guid(DocumentControlId.Text)); Mercury.Server.Application.FormControlEventHandler eventHandler = eventControl.GetEventHandler(EventName.Text); if (eventHandler == null) { eventHandler = new Mercury.Server.Application.FormControlEventHandler(); eventControl.EventHandlers.Add(eventHandler); } eventHandler.EventName = EventName.Text; eventHandler.ExecuteClientSide = ((Telerik.Web.UI.RadToolBarButton)EditorToolbar.Items[0]).Checked; eventHandler.SmartEvent = ((Telerik.Web.UI.RadToolBarButton)EditorToolbar.Items[2]).Checked; eventHandler.MethodSource = FormatSourceCode(ScriptEditor.Text); List <Mercury.Server.Application.FormCompileMessage> compileMessages; compileMessages = eventControl.EventHandler_Compile(EventName.Text); EditorToolbar.Items[5].Text = "Errors (" + compileMessages.Count.ToString() + ")"; System.Data.DataTable errorListTable = new System.Data.DataTable(); errorListTable.Columns.Add("ErrorLine"); errorListTable.Columns.Add("ErrorColumn"); errorListTable.Columns.Add("ErrorText"); foreach (Mercury.Server.Application.FormCompileMessage currentMessage in compileMessages) { errorListTable.Rows.Add(currentMessage.Line, currentMessage.Column, currentMessage.Description); } ErrorListGrid.DataSource = errorListTable; ErrorListGrid.DataBind(); break; case "Save": Save(sender, new EventArgs()); break; case "Save and Close": Save(sender, new EventArgs()); TelerikAjaxManager.ResponseScripts.Add("CloseWindow ();"); break; } return; }
public void ChildServerControlsToLocal(Mercury.Client.Core.Forms.Control parentControl, Server.Application.FormControl serverControl) { foreach (Server.Application.FormControl currentControl in serverControl.Controls) { switch (currentControl.ControlType) { case Server.Application.FormControlType.Section: Mercury.Client.Core.Forms.Controls.Section sectionControl; sectionControl = new Mercury.Client.Core.Forms.Controls.Section(Application, this, (Server.Application.FormControlSection)currentControl); Controls.Insert(Controls.Count, sectionControl); break; case Server.Application.FormControlType.SectionColumn: Mercury.Client.Core.Forms.Controls.SectionColumn sectionColumnControl; sectionColumnControl = new Mercury.Client.Core.Forms.Controls.SectionColumn(Application, this, (Server.Application.FormControlSectionColumn)currentControl); Controls.Insert(Controls.Count, sectionColumnControl); break; case Server.Application.FormControlType.Label: Mercury.Client.Core.Forms.Controls.Label labelControl; labelControl = new Mercury.Client.Core.Forms.Controls.Label(Application, this, (Server.Application.FormControlLabel)currentControl); Controls.Insert(Controls.Count, labelControl); break; case Server.Application.FormControlType.Text: Mercury.Client.Core.Forms.Controls.Text textControl; textControl = new Mercury.Client.Core.Forms.Controls.Text(Application, this, (Server.Application.FormControlText)currentControl); Controls.Insert(Controls.Count, textControl); break; case Server.Application.FormControlType.Input: Mercury.Client.Core.Forms.Controls.Input inputControl; inputControl = new Mercury.Client.Core.Forms.Controls.Input(Application, this, (Server.Application.FormControlInput)currentControl); Controls.Insert(Controls.Count, inputControl); break; case Server.Application.FormControlType.Selection: Mercury.Client.Core.Forms.Controls.Selection selectionControl; selectionControl = new Mercury.Client.Core.Forms.Controls.Selection(Application, this, (Server.Application.FormControlSelection)currentControl); Controls.Insert(Controls.Count, selectionControl); break; case Server.Application.FormControlType.Button: Mercury.Client.Core.Forms.Controls.Button buttonControl; buttonControl = new Mercury.Client.Core.Forms.Controls.Button(Application, this, (Server.Application.FormControlButton)currentControl); Controls.Insert(Controls.Count, buttonControl); break; case Server.Application.FormControlType.Entity: Mercury.Client.Core.Forms.Controls.Entity entityControl; entityControl = new Mercury.Client.Core.Forms.Controls.Entity(Application, this, (Server.Application.FormControlEntity)currentControl); Controls.Insert(Controls.Count, entityControl); break; case Server.Application.FormControlType.Collection: Mercury.Client.Core.Forms.Controls.Collection collectionControl; collectionControl = new Mercury.Client.Core.Forms.Controls.Collection(Application, this, (Server.Application.FormControlCollection)currentControl); Controls.Insert(Controls.Count, collectionControl); break; case Server.Application.FormControlType.Address: Mercury.Client.Core.Forms.Controls.Address addressControl; addressControl = new Mercury.Client.Core.Forms.Controls.Address(Application, this, (Server.Application.FormControlAddress)currentControl); Controls.Insert(Controls.Count, addressControl); break; case Server.Application.FormControlType.Service: Mercury.Client.Core.Forms.Controls.Service serviceControl; serviceControl = new Mercury.Client.Core.Forms.Controls.Service(Application, this, (Server.Application.FormControlService)currentControl); Controls.Insert(Controls.Count, serviceControl); break; case Server.Application.FormControlType.Metric: Mercury.Client.Core.Forms.Controls.Metric metricControl; metricControl = new Mercury.Client.Core.Forms.Controls.Metric(Application, this, (Server.Application.FormControlMetric)currentControl); Controls.Insert(Controls.Count, metricControl); break; default: System.Diagnostics.Debug.WriteLine("Unable to map Server control to Local control for " + currentControl.ControlType.ToString() + "."); throw new Exception("Unable to map Server control to Local control for " + currentControl.ControlType.ToString() + "."); } // switch } // foreach }