Example #1
0
        private Silanis.ESL.API.PackageSettings CreateTypicalAPIPackageSettings()
        {
            Silanis.ESL.API.CeremonySettings apiCeremonySettings = new Silanis.ESL.API.CeremonySettings();

            apiCeremonySettings.InPerson      = false;
            apiCeremonySettings.Ada           = true;
            apiCeremonySettings.DeclineButton = true;
            apiCeremonySettings.OptOutButton  = true;

            apiCeremonySettings.AddDeclineReason("Decline reason one");
            apiCeremonySettings.AddDeclineReason("Decline reason two");
            apiCeremonySettings.AddDeclineReason("Decline reason three");

            apiCeremonySettings.AddOptOutReason("Opt out reason one");
            apiCeremonySettings.AddOptOutReason("Opt out reason two");
            apiCeremonySettings.AddOptOutReason("Opt out reason three");

            Silanis.ESL.API.Link link = new Silanis.ESL.API.Link();
            link.Href = "http://www.google.ca";
            link.Text = "click here";
            apiCeremonySettings.HandOver = link;

            apiCeremonySettings.HideCaptureText     = true;
            apiCeremonySettings.HideWatermark       = true;
            apiCeremonySettings.MaxAuthFailsAllowed = 3;

            apiCeremonySettings.DisableFirstInPersonAffidavit  = true;
            apiCeremonySettings.DisableSecondInPersonAffidavit = true;
            apiCeremonySettings.HideLanguageDropdown           = true;
            apiCeremonySettings.HidePackageOwnerInPerson       = true;

            Style style = new Style();

            style.BackgroundColor = "white";
            style.Color           = "blue";

            LayoutStyle layoutStyle = new LayoutStyle();

            layoutStyle.Dialog = style;

            apiCeremonySettings.Style = layoutStyle;

            LayoutOptions layoutOptions = new LayoutOptions();

            layoutOptions.Iframe       = false;
            apiCeremonySettings.Layout = layoutOptions;


            HeaderOptions headerOptions = new HeaderOptions();

            headerOptions.Breadcrumbs = true;
            headerOptions.Feedback    = true;

            GlobalActionsOptions globalActionsOptions = new GlobalActionsOptions();

            globalActionsOptions.Confirm      = true;
            globalActionsOptions.Download     = true;
            globalActionsOptions.SaveAsLayout = true;

            headerOptions.GlobalActions = globalActionsOptions;
            layoutOptions.Header        = headerOptions;

            Silanis.ESL.API.PackageSettings apiPackageSettings = new Silanis.ESL.API.PackageSettings();
            apiPackageSettings.Ceremony = apiCeremonySettings;

            return(apiPackageSettings);
        }
Example #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);
        }
Example #3
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;
            }
            GlobalActionsOptions globalActionsOptions = new GlobalActionsOptions();

            if (showGlobalConfirmButton != null)
            {
                globalActionsOptions.Confirm = showGlobalConfirmButton.Value;
            }
            if (showGlobalDownloadButton != null)
            {
                globalActionsOptions.Download = showGlobalDownloadButton.Value;
            }
            if (ShowGlobalSaveAsLayoutButton != null)
            {
                globalActionsOptions.SaveAsLayout = showGlobalSaveAsLayoutButton.Value;
            }
            headerOptions.GlobalActions = globalActionsOptions;

            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);
        }