示例#1
0
        internal LayoutOptions toAPILayoutOptions()
        {
            TitleBarOptions titleBarOptions = new TitleBarOptions();

            if (showTitle != null)
            {
                titleBarOptions.Title = showTitle.Value;
            }
            if (progressBar != null)
            {
                titleBarOptions.ProgressBar = progressBar.Value;
            }

            HeaderOptions headerOptions = new HeaderOptions();

            if (breadCrumbs != null)
            {
                headerOptions.Breadcrumbs = breadCrumbs.Value;
            }
            if (sessionBar != null)
            {
                headerOptions.SessionBar = sessionBar.Value;
            }
            if (globalNavigation != null)
            {
                headerOptions.GlobalNavigation = globalNavigation.Value;
            }
            if (titleBarOptions != null)
            {
                headerOptions.TitleBar = titleBarOptions;
            }

            BrandingBarOptions brandingBarOptions = null;

            if (logoImageLink != null || logoImageSource != null)
            {
                brandingBarOptions = new BrandingBarOptions();
                Image logo = new Image();
                logo.Link = logoImageLink;
                logo.Src  = logoImageSource;
                brandingBarOptions.Logo = logo;
            }

            LayoutOptions result = new LayoutOptions();

            if (iFrame != null)
            {
                result.Iframe = iFrame.Value;
            }
            if (navigator != null)
            {
                result.Navigator = navigator.Value;
            }
            result.Footer      = new FooterOptions();
            result.Header      = headerOptions;
            result.BrandingBar = brandingBarOptions;

            return(result);
        }
示例#2
0
        public OneSpanSign.API.LayoutOptions ToAPILayoutOptions()
        {
            if (sdkCeremonyLayoutSettings == null)
            {
                return(apiLayoutOptions);
            }

            HeaderOptions headerOptions = new HeaderOptions();

            if (sdkCeremonyLayoutSettings.ShowTitle != null || sdkCeremonyLayoutSettings.ProgressBar != null)
            {
                TitleBarOptions titleBarOptions = new TitleBarOptions();
                if (sdkCeremonyLayoutSettings.ShowTitle != null)
                {
                    titleBarOptions.Title = sdkCeremonyLayoutSettings.ShowTitle.Value;
                }
                if (sdkCeremonyLayoutSettings.ProgressBar != null)
                {
                    titleBarOptions.ProgressBar = sdkCeremonyLayoutSettings.ProgressBar.Value;
                }
                headerOptions.TitleBar = titleBarOptions;
            }

            if (sdkCeremonyLayoutSettings.BreadCrumbs != null)
            {
                headerOptions.Breadcrumbs = sdkCeremonyLayoutSettings.BreadCrumbs.Value;
            }
            if (sdkCeremonyLayoutSettings.SessionBar != null)
            {
                headerOptions.SessionBar = sdkCeremonyLayoutSettings.SessionBar.Value;
            }
            if (sdkCeremonyLayoutSettings.GlobalNavigation != null)
            {
                headerOptions.GlobalNavigation = sdkCeremonyLayoutSettings.GlobalNavigation.Value;
            }
            GlobalActionsOptions globalActionsOptions = new GlobalActionsOptions();

            if (sdkCeremonyLayoutSettings.ShowGlobalConfirmButton != null)
            {
                globalActionsOptions.Confirm = sdkCeremonyLayoutSettings.ShowGlobalConfirmButton.Value;
            }
            if (sdkCeremonyLayoutSettings.ShowGlobalDownloadButton != null)
            {
                globalActionsOptions.Download = sdkCeremonyLayoutSettings.ShowGlobalDownloadButton.Value;
            }
            if (sdkCeremonyLayoutSettings.ShowGlobalSaveAsLayoutButton != null)
            {
                globalActionsOptions.SaveAsLayout = sdkCeremonyLayoutSettings.ShowGlobalSaveAsLayoutButton.Value;
            }
            headerOptions.GlobalActions = globalActionsOptions;

            BrandingBarOptions brandingBarOptions = null;

            if (sdkCeremonyLayoutSettings.LogoImageLink != null || sdkCeremonyLayoutSettings.LogoImageSource != null)
            {
                brandingBarOptions = new BrandingBarOptions();
                Image logo = new Image();
                logo.Link = sdkCeremonyLayoutSettings.LogoImageLink;
                logo.Src  = sdkCeremonyLayoutSettings.LogoImageSource;
                brandingBarOptions.Logo = logo;
            }

            LayoutOptions result = new LayoutOptions();

            if (sdkCeremonyLayoutSettings.IFrame != null)
            {
                result.Iframe = sdkCeremonyLayoutSettings.IFrame.Value;
            }
            if (sdkCeremonyLayoutSettings.Navigator != null)
            {
                result.Navigator = sdkCeremonyLayoutSettings.Navigator.Value;
            }
            result.Header      = headerOptions;
            result.BrandingBar = brandingBarOptions;

            return(result);
        }