public DocumentPackageSettings Build()
        {
            DocumentPackageSettings result = new DocumentPackageSettings();

            result.EnableInPerson  = enableInPerson;
            result.EnableOptOut    = enableOptOut;
            result.EnableDecline   = enableDecline;
            result.ExpandLeftMenu  = expandLeftMenu;
            result.HideWatermark   = hideWatermark;
            result.HideCaptureText = hideCaptureText;
            foreach (string declineReason in declineReasons)
            {
                result.DeclineReasons.Add(declineReason);
            }
            foreach (string optOutReason in optOutReasons)
            {
                result.OptOutReasons.Add(optOutReason);
            }
            result.MaxAuthAttempts           = maxAuthAttempts;
            result.ShowDownloadButton        = showDocumentToolbarDownloadButton;
            result.ShowDialogOnComplete      = showDialogOnComplete;
            result.ShowLanguageDropDown      = showLanguageDropDown;
            result.EnableFirstAffidavit      = enableFirstAffidavit;
            result.EnableSecondAffidavit     = enableSecondAffidavit;
            result.ShowOwnerInPersonDropDown = showOwnerInPersonDropDown;
            result.DisableDeclineOther       = disableDeclineOther;
            result.DisableOptOutOther        = disableOptOutOther;
            result.EnforceCaptureSignature   = enforceCaptureSignature;
            result.Ada      = ada;
            result.FontSize = fontSize;
            result.DefaultTimeBasedExpiry = defaultTimeBasedExpiry;
            result.RemainingDays          = remainingDays;
            result.ShowNseHelp            = showNseHelp;
            result.LinkHref           = linkHref;
            result.LinkText           = linkText;
            result.LinkTooltip        = linkTooltip;
            result.LinkAutoRedirect   = linkAutoRedirect;
            result.LinkParameters     = linkParameters;
            result.MaxAttachmentFiles = maxAttachmentFiles;
            result.ShowNseOverview    = showNseOverview;

            result.CeremonyLayoutSettings = ceremonyLayoutSettings;

            return(result);
        }
Ejemplo n.º 2
0
        private OneSpanSign.Sdk.DocumentPackageSettings CreateTypicalSDKDocumentPackageSettings()
        {
            OneSpanSign.Sdk.DocumentPackageSettings sdkDocumentPackageSettings = DocumentPackageSettingsBuilder.NewDocumentPackageSettings()
                                                                                 .WithInPerson()
                                                                                 .WithAda()
                                                                                 .WithFontSize(36)
                                                                                 .WithEnforceCaptureSignature()
                                                                                 .WithoutDecline()
                                                                                 .WithOptOut()
                                                                                 .WithoutWatermark()
                                                                                 .WithoutCaptureText()
                                                                                 .WithoutLeftMenuExpand()
                                                                                 .DisableFirstAffidavit()
                                                                                 .DisableSecondAffidavit()
                                                                                 .HideOwnerInPersonDropDown()
                                                                                 .WithoutLanguageDropDown()
                                                                                 .WithDeclineReason("Decline reason One")
                                                                                 .WithDeclineReason("Decline reason Two")
                                                                                 .WithDeclineReason("Decline reason Three")
                                                                                 .WithoutDeclineOther()
                                                                                 .WithOptOutReason("Reason One")
                                                                                 .WithOptOutReason("Reason Two")
                                                                                 .WithOptOutReason("Reason Three")
                                                                                 .WithoutOptOutOther()
                                                                                 .WithHandOverLinkHref("http://www.google.ca")
                                                                                 .WithHandOverLinkText("click here")
                                                                                 .WithHandOverLinkTooltip("link tooltip")
                                                                                 .WithDialogOnComplete()
                                                                                 .WithDefaultTimeBasedExpiry()
                                                                                 .WithRemainingDays(14)
                                                                                 .WithMaxAttachmentFiles(2)
                                                                                 .WithCeremonyLayoutSettings(CeremonyLayoutSettingsBuilder.NewCeremonyLayoutSettings()
                                                                                                             .WithoutGlobalDownloadButton()
                                                                                                             .WithoutGlobalConfirmButton()
                                                                                                             .WithoutGlobalSaveAsLayoutButton()
                                                                                                             )
                                                                                 .Build();

            return(sdkDocumentPackageSettings);
        }
Ejemplo n.º 3
0
        public void ConvertSDKToAPI()
        {
            sdkPackageSettings1 = CreateTypicalSDKDocumentPackageSettings();
            apiPackageSettings1 = new DocumentPackageSettingsConverter(sdkPackageSettings1).toAPIPackageSettings();

            Assert.IsNotNull(apiPackageSettings1);
            Assert.AreEqual(apiPackageSettings1.Ceremony.InPerson, sdkPackageSettings1.EnableInPerson);
            Assert.AreEqual(apiPackageSettings1.Ceremony.Ada, sdkPackageSettings1.Ada);
            Assert.AreEqual(apiPackageSettings1.Ceremony.FontSize, sdkPackageSettings1.FontSize);
            Assert.AreEqual(apiPackageSettings1.Ceremony.EnforceCaptureSignature, sdkPackageSettings1.EnforceCaptureSignature);
            Assert.AreEqual(apiPackageSettings1.Ceremony.DeclineButton, sdkPackageSettings1.EnableDecline);
            Assert.AreEqual(apiPackageSettings1.Ceremony.LeftMenuExpand, sdkPackageSettings1.ExpandLeftMenu);
            Assert.AreEqual(apiPackageSettings1.Ceremony.OptOutButton, sdkPackageSettings1.EnableOptOut);
            Assert.AreEqual(apiPackageSettings1.Ceremony.DeclineReasons[0], sdkPackageSettings1.DeclineReasons[0]);
            Assert.AreEqual(apiPackageSettings1.Ceremony.DeclineReasons[1], sdkPackageSettings1.DeclineReasons[1]);
            Assert.AreEqual(apiPackageSettings1.Ceremony.DeclineReasons[2], sdkPackageSettings1.DeclineReasons[2]);
            Assert.AreEqual(apiPackageSettings1.Ceremony.DisableDeclineOther, sdkPackageSettings1.DisableDeclineOther);
            Assert.AreEqual(apiPackageSettings1.Ceremony.OptOutReasons[0], sdkPackageSettings1.OptOutReasons[0]);
            Assert.AreEqual(apiPackageSettings1.Ceremony.OptOutReasons[1], sdkPackageSettings1.OptOutReasons[1]);
            Assert.AreEqual(apiPackageSettings1.Ceremony.OptOutReasons[2], sdkPackageSettings1.OptOutReasons[2]);
            Assert.AreEqual(apiPackageSettings1.Ceremony.DisableOptOutOther, sdkPackageSettings1.DisableOptOutOther);
            Assert.AreEqual(apiPackageSettings1.Ceremony.HandOver.Href, sdkPackageSettings1.LinkHref);
            Assert.AreEqual(apiPackageSettings1.Ceremony.HandOver.Text, sdkPackageSettings1.LinkText);
            Assert.AreEqual(apiPackageSettings1.Ceremony.HandOver.Title, sdkPackageSettings1.LinkTooltip);
            Assert.AreEqual(apiPackageSettings1.Ceremony.HideCaptureText, sdkPackageSettings1.HideCaptureText);
            Assert.AreEqual(apiPackageSettings1.Ceremony.HideWatermark, sdkPackageSettings1.HideWatermark);
            Assert.AreEqual(apiPackageSettings1.Ceremony.MaxAuthFailsAllowed, sdkPackageSettings1.MaxAuthAttempts);
            Assert.AreEqual(apiPackageSettings1.Ceremony.Layout.Header.GlobalActions.Download, sdkPackageSettings1.CeremonyLayoutSettings.ShowGlobalDownloadButton);
            Assert.AreEqual(apiPackageSettings1.Ceremony.Layout.Header.GlobalActions.Confirm, sdkPackageSettings1.CeremonyLayoutSettings.ShowGlobalConfirmButton);
            Assert.AreEqual(apiPackageSettings1.Ceremony.Layout.Header.GlobalActions.SaveAsLayout, sdkPackageSettings1.CeremonyLayoutSettings.ShowGlobalSaveAsLayoutButton);
            Assert.AreEqual(apiPackageSettings1.Ceremony.HideLanguageDropdown, !sdkPackageSettings1.ShowLanguageDropDown);
            Assert.AreEqual(apiPackageSettings1.Ceremony.HidePackageOwnerInPerson, !sdkPackageSettings1.ShowOwnerInPersonDropDown);
            Assert.AreEqual(apiPackageSettings1.Ceremony.DisableFirstInPersonAffidavit, !sdkPackageSettings1.EnableFirstAffidavit);
            Assert.AreEqual(apiPackageSettings1.Ceremony.DisableSecondInPersonAffidavit, !sdkPackageSettings1.EnableSecondAffidavit);
            Assert.AreEqual(apiPackageSettings1.Ceremony.DefaultTimeBasedExpiry, sdkPackageSettings1.DefaultTimeBasedExpiry);
            Assert.AreEqual(apiPackageSettings1.Ceremony.RemainingDays, sdkPackageSettings1.RemainingDays);
            Assert.AreEqual(apiPackageSettings1.Ceremony.MaxAttachmentFiles, sdkPackageSettings1.MaxAttachmentFiles);
        }
Ejemplo n.º 4
0
 public void ConvertNullSDKToAPI()
 {
     sdkPackageSettings1 = null;
     converter           = new DocumentPackageSettingsConverter(sdkPackageSettings1);
     Assert.IsNull(converter.toAPIPackageSettings());
 }
 public DocumentPackageSettingsConverter(DocumentPackageSettings settings)
 {
     sdkSettings = settings;
 }