override public void BaseConstructor(Mercury.Client.Core.Forms.Control parentControl, Server.Application.FormControl serverControl)
        {
            base.BaseConstructor(parentControl, serverControl);

            Server.Application.FormControlMetric serverMetric = (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;
        }
Beispiel #2
0
        virtual public void LocalControlToServer(Server.Application.FormControl parentControl, Server.Application.FormControl serverControl)
        {
            Int32 controlIndex = 0;

            LocalControlToServer(serverControl);

            serverControl.Controls = new System.Collections.ObjectModel.ObservableCollection <Server.Application.FormControl> ();

            foreach (Control currentLocalControl in Controls)
            {
                switch (currentLocalControl.ControlType)
                {
                case Server.Application.FormControlType.Section:

                    Server.Application.FormControlSection serverSection = new Server.Application.FormControlSection();

                    ((Mercury.Client.Core.Forms.Controls.Section)currentLocalControl).LocalControlToServer(serverControl, serverSection);

                    serverControl.Controls.Insert(controlIndex, serverSection);

                    controlIndex = controlIndex + 1;

                    break;

                case Server.Application.FormControlType.SectionColumn:

                    Server.Application.FormControlSectionColumn serverSectionColumn = new Server.Application.FormControlSectionColumn();

                    ((Mercury.Client.Core.Forms.Controls.SectionColumn)currentLocalControl).LocalControlToServer(serverControl, serverSectionColumn);

                    serverControl.Controls.Insert(controlIndex, serverSectionColumn);

                    controlIndex = controlIndex + 1;

                    break;

                case Server.Application.FormControlType.Label:

                    Server.Application.FormControlLabel serverLabel = new Server.Application.FormControlLabel();

                    ((Mercury.Client.Core.Forms.Controls.Label)currentLocalControl).LocalControlToServer(serverControl, serverLabel);

                    serverControl.Controls.Insert(controlIndex, serverLabel);

                    controlIndex = controlIndex + 1;

                    break;

                case Server.Application.FormControlType.Text:

                    Server.Application.FormControlText serverText = new Server.Application.FormControlText();

                    ((Mercury.Client.Core.Forms.Controls.Text)currentLocalControl).LocalControlToServer(serverControl, serverText);

                    serverControl.Controls.Insert(controlIndex, serverText);

                    controlIndex = controlIndex + 1;

                    break;

                case Server.Application.FormControlType.Input:

                    Server.Application.FormControlInput serverInput = new Server.Application.FormControlInput();

                    ((Mercury.Client.Core.Forms.Controls.Input)currentLocalControl).LocalControlToServer(serverControl, serverInput);

                    serverControl.Controls.Insert(controlIndex, serverInput);

                    controlIndex = controlIndex + 1;

                    break;

                case Server.Application.FormControlType.Selection:

                    Server.Application.FormControlSelection serverSelection = new Server.Application.FormControlSelection();

                    ((Mercury.Client.Core.Forms.Controls.Selection)currentLocalControl).LocalControlToServer(serverControl, serverSelection);

                    serverControl.Controls.Insert(controlIndex, serverSelection);

                    controlIndex = controlIndex + 1;

                    break;

                case Server.Application.FormControlType.Button:

                    Server.Application.FormControlButton serverButton = new Server.Application.FormControlButton();

                    ((Mercury.Client.Core.Forms.Controls.Button)currentLocalControl).LocalControlToServer(serverControl, serverButton);

                    serverControl.Controls.Insert(controlIndex, serverButton);

                    controlIndex = controlIndex + 1;

                    break;

                case Server.Application.FormControlType.Entity:

                    Server.Application.FormControlEntity serverEntity = new Server.Application.FormControlEntity();

                    ((Mercury.Client.Core.Forms.Controls.Entity)currentLocalControl).LocalControlToServer(serverControl, serverEntity);

                    serverControl.Controls.Insert(controlIndex, serverEntity);

                    controlIndex = controlIndex + 1;

                    break;

                case Server.Application.FormControlType.Collection:

                    Server.Application.FormControlCollection serverCollection = new Server.Application.FormControlCollection();

                    ((Mercury.Client.Core.Forms.Controls.Collection)currentLocalControl).LocalControlToServer(serverControl, serverCollection);

                    serverControl.Controls.Insert(controlIndex, serverCollection);

                    controlIndex = controlIndex + 1;

                    break;

                case Server.Application.FormControlType.Address:

                    Server.Application.FormControlAddress serverAddress = new Server.Application.FormControlAddress();

                    ((Mercury.Client.Core.Forms.Controls.Address)currentLocalControl).LocalControlToServer(serverControl, serverAddress);

                    serverControl.Controls.Insert(controlIndex, serverAddress);

                    controlIndex = controlIndex + 1;

                    break;

                case Server.Application.FormControlType.Service:

                    Server.Application.FormControlService serverService = new Server.Application.FormControlService();

                    ((Mercury.Client.Core.Forms.Controls.Service)currentLocalControl).LocalControlToServer(serverControl, serverService);

                    serverControl.Controls.Insert(controlIndex, serverService);

                    controlIndex = controlIndex + 1;

                    break;

                case Server.Application.FormControlType.Metric:

                    Server.Application.FormControlMetric serverMetric = new Server.Application.FormControlMetric();

                    ((Mercury.Client.Core.Forms.Controls.Metric)currentLocalControl).LocalControlToServer(serverControl, serverMetric);

                    serverControl.Controls.Insert(controlIndex, serverMetric);

                    controlIndex = controlIndex + 1;

                    break;

                default:

                    System.Diagnostics.Debug.WriteLine("Unable to process Local to Server: " + currentLocalControl.controlType.ToString());

                    throw new Exception("Local Control to Server. Unable to process Local to Server: " + currentLocalControl.controlType.ToString());
                } // switch
            }     // foreach

            return;
        }
        public Metric(Application applicationReference, Mercury.Client.Core.Forms.Control parentControl, Server.Application.FormControlMetric serverMetric)
        {
            InitializeControl(applicationReference);

            BaseConstructor(parentControl, serverMetric);

            ChildServerControlsToLocal(this, serverMetric);

            return;
        }