示例#1
0
 internal CeremonyLayoutSettingsBuilder(CeremonySettings ceremonySettings)
 {
     iFrame           = ceremonySettings.Layout.Iframe;
     breadCrumbs      = ceremonySettings.Layout.Header.Breadcrumbs;
     sessionBar       = ceremonySettings.Layout.Header.SessionBar;
     globalNavigation = ceremonySettings.Layout.Header.GlobalNavigation;
     progressBar      = ceremonySettings.Layout.Header.TitleBar.ProgressBar;
     showTitle        = ceremonySettings.Layout.Header.TitleBar.Title;
     navigator        = ceremonySettings.Layout.Navigator;
     logoImageSource  = ceremonySettings.Layout.BrandingBar.Logo.Src;
     logoImageLink    = ceremonySettings.Layout.BrandingBar.Logo.Link;
 }
示例#2
0
 internal CeremonyLayoutSettingsBuilder(CeremonySettings ceremonySettings)
 {
     iFrame                       = ceremonySettings.Layout.Iframe;
     breadCrumbs                  = ceremonySettings.Layout.Header.Breadcrumbs;
     sessionBar                   = ceremonySettings.Layout.Header.SessionBar;
     globalNavigation             = ceremonySettings.Layout.Header.GlobalNavigation;
     progressBar                  = ceremonySettings.Layout.Header.TitleBar.ProgressBar;
     showTitle                    = ceremonySettings.Layout.Header.TitleBar.Title;
     navigator                    = ceremonySettings.Layout.Navigator;
     showGlobalConfirmButton      = ceremonySettings.Layout.Header.GlobalActions.Confirm;
     showGlobalDownloadButton     = ceremonySettings.Layout.Header.GlobalActions.Download;
     showGlobalSaveAsLayoutButton = ceremonySettings.Layout.Header.GlobalActions.SaveAsLayout;
     logoImageSource              = ceremonySettings.Layout.BrandingBar.Logo.Src;
     logoImageLink                = ceremonySettings.Layout.BrandingBar.Logo.Link;
 }
示例#3
0
        internal PackageSettings toAPIPackageSettings()
        {
            CeremonySettings ceremonySettings = new CeremonySettings();

            if (enableInPerson != null)
            {
                ceremonySettings.InPerson = enableInPerson.Value;
            }

            if (enableOptOut != null)
            {
                ceremonySettings.OptOutButton = enableOptOut.Value;
            }

            if (enableDecline != null)
            {
                ceremonySettings.DeclineButton = enableDecline.Value;
            }

            if (expandLeftMenu != null)
            {
                ceremonySettings.LeftMenuExpand = expandLeftMenu.Value;
            }

            if (disableOptOutOther != null)
            {
                ceremonySettings.DisableOptOutOther = disableOptOutOther.Value;
            }

            if (disableDeclineOther != null)
            {
                ceremonySettings.DisableDeclineOther = disableDeclineOther.Value;
            }

            if (hideWatermark != null)
            {
                ceremonySettings.HideWatermark = hideWatermark.Value;
            }

            if (hideCaptureText != null)
            {
                ceremonySettings.HideCaptureText = hideCaptureText.Value;
            }

            if (enableFirstAffidavit != null)
            {
                ceremonySettings.DisableFirstInPersonAffidavit = !enableFirstAffidavit.Value;
            }

            if (enableSecondAffidavit != null)
            {
                ceremonySettings.DisableSecondInPersonAffidavit = !enableSecondAffidavit.Value;
            }

            if (showOwnerInPersonDropDown != null)
            {
                ceremonySettings.HidePackageOwnerInPerson = !showOwnerInPersonDropDown.Value;
            }

            if (showLanguageDropDown != null)
            {
                ceremonySettings.HideLanguageDropdown = !showLanguageDropDown.Value;
            }

            if (enforceCaptureSignature != null)
            {
                ceremonySettings.EnforceCaptureSignature = enforceCaptureSignature.Value;
            }

            if (ada != null)
            {
                ceremonySettings.Ada = ada.Value;
            }

            if (fontSize != null)
            {
                ceremonySettings.FontSize = fontSize.Value;
            }

            if (defaultTimeBasedExpiry != null)
            {
                ceremonySettings.DefaultTimeBasedExpiry = defaultTimeBasedExpiry.Value;
            }

            if (remainingDays != null)
            {
                ceremonySettings.RemainingDays = remainingDays.Value;
            }

            if (showNseHelp != null)
            {
                ceremonySettings.ShowNseHelp = showNseHelp.Value;
            }

            if (showNseOverview != null)
            {
                ceremonySettings.ShowNseOverview = showNseOverview.Value;
            }

            foreach (string declineReason in declineReasons)
            {
                ceremonySettings.DeclineReasons.Add(declineReason);
            }

            foreach (string optOutReason in optOutReasons)
            {
                ceremonySettings.OptOutReasons.Add(optOutReason);
            }

            if (maxAuthAttempts != null)
            {
                ceremonySettings.MaxAuthFailsAllowed = maxAuthAttempts.Value;
            }

            if (maxAttachmentFiles != null)
            {
                ceremonySettings.MaxAttachmentFiles = maxAttachmentFiles.Value;
            }

            if (linkHref != null)
            {
                Link link = new Link();
                link.Href  = linkHref;
                link.Text  = (linkText == null ? linkHref : linkText);
                link.Title = (linkTooltip == null ? linkHref : linkTooltip);
                ceremonySettings.HandOver = link;
            }

            if (showDialogOnComplete != null)
            {
                CeremonyEvents        ceremonyEvents        = new CeremonyEvents();
                CeremonyEventComplete ceremonyEventComplete = new CeremonyEventComplete();
                if (showDialogOnComplete != null)
                {
                    ceremonyEventComplete.Dialog = showDialogOnComplete.Value;
                }

                ceremonyEvents.Complete = ceremonyEventComplete;
                ceremonySettings.Events = ceremonyEvents;
            }

            if (showDownloadButton != null)
            {
                DocumentToolbarOptions documentToolbarOptions = new DocumentToolbarOptions();
                if (showDownloadButton != null)
                {
                    documentToolbarOptions.DownloadButton = showDownloadButton.Value;
                }
                ceremonySettings.DocumentToolbarOptions = documentToolbarOptions;
            }

            if (ceremonyLayoutSettings != null)
            {
                ceremonySettings.Layout = new CeremonyLayoutSettingsConverter(ceremonyLayoutSettings).ToAPILayoutOptions();
            }

            PackageSettings result = new PackageSettings();

            result.Ceremony = ceremonySettings;

            return(result);
        }
        public PackageSettings toAPIPackageSettings()
        {
            if (sdkSettings == null)
            {
                return(apiSettings);
            }

            CeremonySettings ceremonySettings = new CeremonySettings();

            ceremonySettings.InPerson                = sdkSettings.EnableInPerson;
            ceremonySettings.OptOutButton            = sdkSettings.EnableOptOut;
            ceremonySettings.DeclineButton           = sdkSettings.EnableDecline;
            ceremonySettings.HideWatermark           = sdkSettings.HideWatermark;
            ceremonySettings.HideCaptureText         = sdkSettings.HideCaptureText;
            ceremonySettings.DeclineReasons          = sdkSettings.DeclineReasons;
            ceremonySettings.OptOutReasons           = sdkSettings.OptOutReasons;
            ceremonySettings.MaxAuthFailsAllowed     = sdkSettings.MaxAuthAttempts;
            ceremonySettings.DisableDeclineOther     = sdkSettings.DisableDeclineOther;
            ceremonySettings.DisableOptOutOther      = sdkSettings.DisableOptOutOther;
            ceremonySettings.EnforceCaptureSignature = sdkSettings.EnforceCaptureSignature;
            ceremonySettings.Ada = sdkSettings.Ada;

            if (sdkSettings.EnableFirstAffidavit.HasValue)
            {
                ceremonySettings.DisableFirstInPersonAffidavit = !sdkSettings.EnableFirstAffidavit;
            }

            if (sdkSettings.EnableSecondAffidavit.HasValue)
            {
                ceremonySettings.DisableSecondInPersonAffidavit = !sdkSettings.EnableSecondAffidavit;
            }

            if (sdkSettings.ShowLanguageDropDown.HasValue)
            {
                ceremonySettings.HideLanguageDropdown = !sdkSettings.ShowLanguageDropDown;
            }

            if (sdkSettings.ShowOwnerInPersonDropDown.HasValue)
            {
                ceremonySettings.HidePackageOwnerInPerson = !sdkSettings.ShowOwnerInPersonDropDown;
            }

            if (sdkSettings.LinkHref != null)
            {
                Link link = new Link();
                link.Href  = sdkSettings.LinkHref;
                link.Text  = sdkSettings.LinkText == null ? sdkSettings.LinkHref : sdkSettings.LinkText;
                link.Title = sdkSettings.LinkTooltip == null ? sdkSettings.LinkHref : sdkSettings.LinkTooltip;
                ceremonySettings.HandOver = link;
            }

            if (sdkSettings.ShowDialogOnComplete.HasValue)
            {
                CeremonyEvents        ceremonyEvents        = new CeremonyEvents();
                CeremonyEventComplete ceremonyEventComplete = new CeremonyEventComplete();
                ceremonyEventComplete.Dialog = sdkSettings.ShowDialogOnComplete;
                ceremonyEvents.Complete      = ceremonyEventComplete;
                ceremonySettings.Events      = ceremonyEvents;
            }

            if (sdkSettings.ShowDownloadButton.HasValue)
            {
                DocumentToolbarOptions documentToolbarOptions = new DocumentToolbarOptions();
                documentToolbarOptions.DownloadButton   = sdkSettings.ShowDownloadButton;
                ceremonySettings.DocumentToolbarOptions = documentToolbarOptions;
            }

            if (sdkSettings.CeremonyLayoutSettings != null)
            {
                ceremonySettings.Layout = new CeremonyLayoutSettingsConverter(sdkSettings.CeremonyLayoutSettings).ToAPILayoutOptions();
            }

            PackageSettings result = new PackageSettings();

            result.Ceremony = ceremonySettings;

            return(result);
        }
示例#5
0
        internal PackageSettings toAPIPackageSettings()
        {
            CeremonySettings ceremonySettings = new CeremonySettings();

            if (enableInPerson != null)
            {
                ceremonySettings.InPerson = enableInPerson.Value;
            }

            if (enableOptOut != null)
            {
                ceremonySettings.OptOutButton = enableOptOut.Value;
            }

            if (enableDecline != null)
            {
                ceremonySettings.DeclineButton = enableDecline.Value;
            }

            if (hideWatermark != null)
            {
                ceremonySettings.HideWatermark = hideWatermark.Value;
            }

            if (hideCaptureText != null)
            {
                ceremonySettings.HideCaptureText = hideCaptureText.Value;
            }

            foreach (string reason in optOutReasons)
            {
                ceremonySettings.OptOutReasons.Add(reason);
            }

            if (maxAuthAttempts != null)
            {
                ceremonySettings.MaxAuthFailsAllowed = maxAuthAttempts.Value;
            }

            if (linkHref != null)
            {
                Link link = new Link();
                link.Href  = linkHref;
                link.Text  = (linkText == null ? linkHref : linkText);
                link.Title = (linkTooltip == null ? linkHref : linkTooltip);
                ceremonySettings.HandOver = link;
            }

            if (showDialogOnComplete != null)
            {
                CeremonyEvents        ceremonyEvents        = new CeremonyEvents();
                CeremonyEventComplete ceremonyEventComplete = new CeremonyEventComplete();
                if (showDialogOnComplete != null)
                {
                    ceremonyEventComplete.Dialog = showDialogOnComplete.Value;
                }

                ceremonyEvents.Complete = ceremonyEventComplete;
                ceremonySettings.Events = ceremonyEvents;
            }

            if (showDownloadButton != null)
            {
                DocumentToolbarOptions documentToolbarOptions = new DocumentToolbarOptions();
                if (showDownloadButton != null)
                {
                    documentToolbarOptions.DownloadButton = showDownloadButton.Value;
                }
                ceremonySettings.DocumentToolbarOptions = documentToolbarOptions;
            }

            if (ceremonyLayoutSettings != null)
            {
                ceremonySettings.Layout = ceremonyLayoutSettings.toAPILayoutOptions();
            }

            PackageSettings result = new PackageSettings();

            result.Ceremony = ceremonySettings;

            return(result);
        }
        public PackageSettings toAPIPackageSettings()
        {
            if (sdkSettings == null)
            {
                return(apiSettings);
            }

            CeremonySettings ceremonySettings = new CeremonySettings();

            ceremonySettings.InPerson                = sdkSettings.EnableInPerson;
            ceremonySettings.OptOutButton            = sdkSettings.EnableOptOut;
            ceremonySettings.DeclineButton           = sdkSettings.EnableDecline;
            ceremonySettings.HideWatermark           = sdkSettings.HideWatermark;
            ceremonySettings.HideCaptureText         = sdkSettings.HideCaptureText;
            ceremonySettings.DeclineReasons          = sdkSettings.DeclineReasons;
            ceremonySettings.OptOutReasons           = sdkSettings.OptOutReasons;
            ceremonySettings.MaxAuthFailsAllowed     = sdkSettings.MaxAuthAttempts;
            ceremonySettings.DisableDeclineOther     = sdkSettings.DisableDeclineOther;
            ceremonySettings.DisableOptOutOther      = sdkSettings.DisableOptOutOther;
            ceremonySettings.EnforceCaptureSignature = sdkSettings.EnforceCaptureSignature;
            ceremonySettings.Ada      = sdkSettings.Ada;
            ceremonySettings.FontSize = sdkSettings.FontSize;
            ceremonySettings.DefaultTimeBasedExpiry = sdkSettings.DefaultTimeBasedExpiry;
            ceremonySettings.RemainingDays          = sdkSettings.RemainingDays;
            ceremonySettings.ShowNseHelp            = sdkSettings.ShowNseHelp;
            ceremonySettings.LeftMenuExpand         = sdkSettings.ExpandLeftMenu;
            ceremonySettings.MaxAttachmentFiles     = sdkSettings.MaxAttachmentFiles;
            ceremonySettings.ShowNseOverview        = sdkSettings.ShowNseOverview;

            if (sdkSettings.EnableFirstAffidavit.HasValue)
            {
                ceremonySettings.DisableFirstInPersonAffidavit = !sdkSettings.EnableFirstAffidavit;
            }

            if (sdkSettings.EnableSecondAffidavit.HasValue)
            {
                ceremonySettings.DisableSecondInPersonAffidavit = !sdkSettings.EnableSecondAffidavit;
            }

            if (sdkSettings.ShowLanguageDropDown.HasValue)
            {
                ceremonySettings.HideLanguageDropdown = !sdkSettings.ShowLanguageDropDown;
            }

            if (sdkSettings.ShowOwnerInPersonDropDown.HasValue)
            {
                ceremonySettings.HidePackageOwnerInPerson = !sdkSettings.ShowOwnerInPersonDropDown;
            }

            if (sdkSettings.LinkHref != null)
            {
                OneSpanSign.API.Link link = new OneSpanSign.API.Link();
                link.Href                 = sdkSettings.LinkHref;
                link.Text                 = sdkSettings.LinkText == null ? sdkSettings.LinkHref : sdkSettings.LinkText;
                link.Title                = sdkSettings.LinkTooltip == null ? sdkSettings.LinkHref : sdkSettings.LinkTooltip;
                link.AutoRedirect         = sdkSettings.LinkAutoRedirect == null ? false : sdkSettings.LinkAutoRedirect;
                link.Parameters           = sdkSettings.LinkParameters;
                ceremonySettings.HandOver = link;
            }

            if (sdkSettings.ShowDialogOnComplete.HasValue)
            {
                CeremonyEvents        ceremonyEvents        = new CeremonyEvents();
                CeremonyEventComplete ceremonyEventComplete = new CeremonyEventComplete();
                ceremonyEventComplete.Dialog = sdkSettings.ShowDialogOnComplete;
                ceremonyEvents.Complete      = ceremonyEventComplete;
                ceremonySettings.Events      = ceremonyEvents;
            }

            if (sdkSettings.ShowDownloadButton.HasValue)
            {
                DocumentToolbarOptions documentToolbarOptions = new DocumentToolbarOptions();
                documentToolbarOptions.DownloadButton   = sdkSettings.ShowDownloadButton;
                ceremonySettings.DocumentToolbarOptions = documentToolbarOptions;
            }

            if (sdkSettings.CeremonyLayoutSettings != null)
            {
                ceremonySettings.Layout = new CeremonyLayoutSettingsConverter(sdkSettings.CeremonyLayoutSettings).ToAPILayoutOptions();
            }

            PackageSettings result = new PackageSettings();

            result.Ceremony = ceremonySettings;

            return(result);
        }
        internal PackageSettings toAPIPackageSettings()
        {
            CeremonySettings ceremonySettings = new CeremonySettings();

            if (enableInPerson != null)
            {
                ceremonySettings.InPerson = enableInPerson.Value;
            }

            if (enableOptOut != null)
            {
                ceremonySettings.OptOutButton = enableOptOut.Value;
            }

            if (enableDecline != null)
            {
                ceremonySettings.DeclineButton = enableDecline.Value;
            }

            if (disableOptOutOther != null)
            {
                ceremonySettings.DisableOptOutOther = disableOptOutOther.Value;
            }

            if (disableDeclineOther != null)
            {
                ceremonySettings.DisableDeclineOther = disableDeclineOther.Value;
            }

            if (hideWatermark != null)
            {
                ceremonySettings.HideWatermark = hideWatermark.Value;
            }

            if (hideCaptureText != null)
            {
                ceremonySettings.HideCaptureText = hideCaptureText.Value;
            }

            if (enableFirstAffidavit != null)
            {
                ceremonySettings.DisableFirstInPersonAffidavit = !enableFirstAffidavit.Value;
            }

            if (enableSecondAffidavit != null)
            {
                ceremonySettings.DisableSecondInPersonAffidavit = !enableSecondAffidavit.Value;
            }

            if (showOwnerInPersonDropDown != null)
            {
                ceremonySettings.HidePackageOwnerInPerson = !showOwnerInPersonDropDown.Value;
            }

            if (showLanguageDropDown != null)
            {
                ceremonySettings.HideLanguageDropdown = !showLanguageDropDown.Value;
            }

            foreach (string declineReason in declineReasons)
            {
                ceremonySettings.DeclineReasons.Add(declineReason);
            }

            foreach (string optOutReason in optOutReasons)
            {
                ceremonySettings.OptOutReasons.Add(optOutReason);
            }

            if (maxAuthAttempts != null)
            {
                ceremonySettings.MaxAuthFailsAllowed = maxAuthAttempts.Value;
            }

            if (linkHref != null)
            {
                Link link = new Link();
                link.Href  = linkHref;
                link.Text  = (linkText == null ? linkHref : linkText);
                link.Title = (linkTooltip == null ? linkHref : linkTooltip);
                ceremonySettings.HandOver = link;
            }

            if (showDialogOnComplete != null)
            {
                CeremonyEvents        ceremonyEvents        = new CeremonyEvents();
                CeremonyEventComplete ceremonyEventComplete = new CeremonyEventComplete();
                if (showDialogOnComplete != null)
                {
                    ceremonyEventComplete.Dialog = showDialogOnComplete.Value;
                }

                ceremonyEvents.Complete = ceremonyEventComplete;
                ceremonySettings.Events = ceremonyEvents;
            }

            if (showDownloadButton != null)
            {
                DocumentToolbarOptions documentToolbarOptions = new DocumentToolbarOptions();
                if (showDownloadButton != null)
                {
                    documentToolbarOptions.DownloadButton = showDownloadButton.Value;
                }
                ceremonySettings.DocumentToolbarOptions = documentToolbarOptions;
            }

            if (ceremonyLayoutSettings != null)
            {
                ceremonySettings.Layout = new CeremonyLayoutSettingsConverter(ceremonyLayoutSettings).ToAPILayoutOptions();
            }

            PackageSettings result = new PackageSettings();

            result.Ceremony = ceremonySettings;

            return(result);
        }