public static void InitializeInputFileProperties( this PropertyCollection properties, string inputFilePathPropertyName, string authenticationTypePropertyName, string passwordPropertyName, string certificateSourcePropertyName, string certificateFilePathPropertyName, string certificateFilePasswordPropertyName, string certificatePropertyName, bool supportCertificateAuthentication, ref int propertyOrder, VisibleDependency visibleDependency) { var certVisibleDependency = new VisibleDependency(() => visibleDependency.Visible && properties.PropertyValueEquals(authenticationTypePropertyName, AuthenticationType.Certificate)); Action <bool> applyVisibility = (isVisible) => { AuthenticationType authenticationTypeValue = properties[authenticationTypePropertyName].GetValue <AuthenticationType>(); properties[inputFilePathPropertyName].IsVisible = isVisible; properties[authenticationTypePropertyName].IsVisible = isVisible; properties[passwordPropertyName].IsVisible = (isVisible && authenticationTypeValue == AuthenticationType.Password); }; EventHandler updateVisibility = (sender, args) => { applyVisibility(visibleDependency.Visible); certVisibleDependency.Refresh(); }; visibleDependency.VisibleChanged += (visible) => { applyVisibility(visible); certVisibleDependency.Refresh(); }; Property pdfFilePath = properties.AddOrRetrieve(inputFilePathPropertyName, typeof(string), ValueUseOption.RuntimeRead, string.Empty); pdfFilePath.Order = propertyOrder++; pdfFilePath.Description = "Path to the PDF file."; pdfFilePath.Editor = typeof(FilePathEditor); pdfFilePath.Validations.Add(new RequiredValidator()); Property authenticationType = properties.AddOrRetrieve(authenticationTypePropertyName, typeof(AuthenticationType), ValueUseOption.DesignTime, AuthenticationType.None); authenticationType.Order = propertyOrder++; authenticationType.Description = "Authentication type required to open the PDF file."; if (!supportCertificateAuthentication) { authenticationType.Validations.Add(new CertificateAuthenticationValidator()); } authenticationType.ValueChanged += updateVisibility; Property pdfPassword = properties.AddOrRetrieve(passwordPropertyName, typeof(string), ValueUseOption.RuntimeRead, string.Empty); pdfPassword.Order = propertyOrder++; pdfPassword.Description = "Password required to access the PDF file."; pdfPassword.Validations.Add(new RequiredValidator()); properties.InitializeCertificateProperties( certificateSourcePropertyName, certificateFilePathPropertyName, certificateFilePasswordPropertyName, certificatePropertyName, ref propertyOrder, certVisibleDependency); applyVisibility(visibleDependency.Visible); }