/// <summary>
        /// Builds the page.
        /// </summary>
        public override void BuildPage()
        {
            string layoutName = this.ViewReference.ContextValueForKey("LayoutName");
            IConfigurationUnitStore configStore = ConfigurationUnitStore.DefaultStore;
            WebConfigLayout         layout      = configStore.WebConfigLayoutByName(layoutName);

            if (layout == null)
            {
                return;
            }

            MDetailPage page = new MDetailPage(StringIdentifier.IdentifierWithStringId("Configuration"));

            page.LabelText       = LocalizedString.TextTabOverview;
            page.Invalid         = true;
            this.TopLevelElement = page;
            int tabCount = layout.TabCount;

            for (int i = 0; i < tabCount; i++)
            {
                UPGroupModelController groupModelController = UPGroupModelController.SettingsGroupModelController(layout, i);
                if (groupModelController != null)
                {
                    this.GroupModelControllerArray.Add(groupModelController);
                }
            }
        }
        /// <summary>
        /// Builds the detail organizer pages.
        /// </summary>
        public void BuildDetailOrganizerPages()
        {
            UPMOrganizer detailOrganizer = new UPMOrganizer(StringIdentifier.IdentifierWithStringId("Details"));

            this.TopLevelElement        = detailOrganizer;
            detailOrganizer.ExpandFound = true;
            IConfigurationUnitStore configStore = ConfigurationUnitStore.DefaultStore;
            string          configName          = this.ViewReference.ContextValueForKey("LayoutName");
            WebConfigLayout layout = configStore.WebConfigLayoutByName(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);
            }

            if (header == null)
            {
                headerName = "SYSTEMINFO.Expand";
                header     = configStore.HeaderByName(headerName);
            }

            if (header != null)
            {
                detailOrganizer.SubtitleText = header.Label;
                this.AddActionButtonsFromHeaderRecordIdentification(header, null);
            }
            else
            {
                detailOrganizer.SubtitleText = LocalizedString.TextSettings;
                UPMOrganizerAction action = new UPMOrganizerAction(StringIdentifier.IdentifierWithStringId("action.edit"));
                action.SetTargetAction(this, this.SwitchToEdit);
                action.LabelText = LocalizedString.TextEdit;
                action.IconName  = "Button:Edit";
                this.AddOrganizerHeaderActionItem(action);
            }

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

            this.AddPageModelController(detailPageModelController);
            detailOrganizer.AddPage(overviewPage);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="SettingsViewGroupModelController"/> class.
        /// </summary>
        /// <param name="layout">The layout.</param>
        /// <param name="tabIndex">Index of the tab.</param>
        /// <exception cref="Exception">Layout Tab is null</exception>
        public SettingsViewGroupModelController(WebConfigLayout layout, int tabIndex)
            : base(null)
        {
            this.Layout    = layout;
            this.TabIndex  = tabIndex;
            this.LayoutTab = this.Layout.TabAtIndex(tabIndex);

            if (this.LayoutTab == null)
            {
                throw new Exception("Layout Tab is null");
            }
        }
Esempio n. 4
0
        /// <summary>
        /// Instantiates the page.
        /// </summary>
        /// <returns></returns>
        public override Page InstantiatePage()
        {
            if (this.Page != null)
            {
                return(new EditPage(this.Page.Identifier));
            }

            string layoutName = this.ViewReference.ContextValueForKey("LayoutName");
            IConfigurationUnitStore configStore = ConfigurationUnitStore.DefaultStore;
            WebConfigLayout         layout      = configStore.WebConfigLayoutByName(layoutName);

            return(new EditPage(StringIdentifier.IdentifierWithStringId(layout.UnitName)));
        }
Esempio n. 5
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;
        }
Esempio n. 6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SettingsEditViewGroupModelController"/> class.
 /// </summary>
 /// <param name="layout">The layout.</param>
 /// <param name="tabIndex">Index of the tab.</param>
 public SettingsEditViewGroupModelController(WebConfigLayout layout, int tabIndex)
     : base(layout, tabIndex)
 {
 }
 /// <summary>
 /// Settingses the edit group model controller.
 /// </summary>
 /// <param name="layout">The layout.</param>
 /// <param name="tabIndex">Index of the tab.</param>
 /// <returns></returns>
 public static UPGroupModelController SettingsEditGroupModelController(WebConfigLayout layout, int tabIndex)
 {
     return(new SettingsEditViewGroupModelController(layout, tabIndex));
 }