Example #1
0
        /// <summary>
        /// Changed ields.
        /// </summary>
        /// <returns></returns>
        public Dictionary <string, UPEditFieldContext> ChangedFields()
        {
            Dictionary <string, UPEditFieldContext> changedFields = null;

            foreach (UPPageModelController modelController in this.PageModelControllers)
            {
                EditSettingsPageModelController editModelController = modelController as EditSettingsPageModelController;

                Dictionary <string, UPEditFieldContext> changedFieldsOnPage = editModelController?.ChangedFields();
                if (changedFieldsOnPage != null)
                {
                    if (changedFields == null)
                    {
                        changedFields = changedFieldsOnPage;
                    }
                    else
                    {
                        foreach (UPEditFieldContext context in changedFieldsOnPage.Values)
                        {
                            changedFields[context.Key] = context;
                        }
                    }
                }
            }

            if (changedFields == null || changedFields.Count == 0)
            {
                return(null);
            }

            return(changedFields);
        }
Example #2
0
        /// <summary>
        /// Builds the pages from view reference.
        /// </summary>
        public override void BuildPagesFromViewReference()
        {
            UPMOrganizer detailOrganizer = new UPMOrganizer(StringIdentifier.IdentifierWithStringId("Details"));

            this.TopLevelElement = detailOrganizer;
            IConfigurationUnitStore configStore = ConfigurationUnitStore.DefaultStore;

            this.ConfigName = this.ViewReference.ContextValueForKey("LayoutName");
            WebConfigLayout layout = configStore.WebConfigLayoutByName(this.ConfigName);

            if (layout == null)
            {
                return;
            }

            string organizerColorKey = this.ViewReference.ContextValueForKey("OrganizerColor");

            if (!string.IsNullOrEmpty(organizerColorKey))
            {
                this.Organizer.OrganizerColor = AureaColor.ColorWithString(organizerColorKey);
            }

            string         headerName = this.ViewReference.ContextValueForKey("HeaderName");
            UPConfigHeader header     = null;

            if (!string.IsNullOrEmpty(headerName))
            {
                header = configStore.HeaderByName(headerName);
            }

            detailOrganizer.TitleText = header != null ? header.Label : LocalizedString.TextSettings;

            EditSettingsPageModelController detailPageModelController = new EditSettingsPageModelController(this.ViewReference);
            Page overviewPage = detailPageModelController.Page;

            this.AddPageModelController(detailPageModelController);
            detailOrganizer.AddPage(overviewPage);
            this.AddOrganizerActions();
            detailOrganizer.ExpandFound = true;
        }