├── .editorconfig ├── .gitignore ├── .hgignore ├── Core ├── AppTools.cs ├── BaseUrl.cs ├── Caching │ ├── AppMemoryCache.cs │ ├── DateAndTimeVersionedCache.cs │ └── PeriodicEvictionCompositeCacheEntry.cs ├── Clock.cs ├── Collections │ ├── Cache.cs │ ├── ListSet.cs │ └── OneToOneMap.cs ├── Configuration │ ├── ConfigurationStatics.cs │ ├── DefaultCookieAttributes.cs │ ├── Installation Standard.xsd │ ├── InstallationConfiguration.cs │ ├── InstallationType.cs │ ├── Machine.xsd │ ├── Machine │ │ └── MachineConfiguration.cs │ ├── System Development.xsd │ ├── System General.xsd │ ├── SystemDevelopment │ │ ├── QueryPostSelectFromClause.cs │ │ └── SystemDevelopmentConfiguration.cs │ ├── SystemGeneral │ │ └── WindowsService.cs │ └── WebApplication.cs ├── Core.csproj ├── Core.csproj.DotSettings ├── DataAccess │ ├── AutomaticDatabaseConnectionManager.cs │ ├── AutomaticTransactionDisablingProvider.cs │ ├── BlobStorage │ │ ├── BlobFile.cs │ │ ├── BlobStorageStatics.cs │ │ └── SystemBlobStorageProvider.cs │ ├── CommandWriting │ │ ├── Commands │ │ │ ├── InlineDelete.cs │ │ │ ├── InlineInsert.cs │ │ │ ├── InlineInsertWithSelect.cs │ │ │ ├── InlineSelect.cs │ │ │ ├── InlineUpdate.cs │ │ │ └── SprocExecution.cs │ │ ├── DbCommandParameter.cs │ │ ├── DbParameterValue.cs │ │ ├── InlineConditionAbstraction │ │ │ ├── Conditions │ │ │ │ ├── EqualityCondition.cs │ │ │ │ ├── InCondition.cs │ │ │ │ ├── InequalityCondition.cs │ │ │ │ └── LikeCondition.cs │ │ │ ├── InlineDbCommandCondition.cs │ │ │ └── InlineDbCommandWithConditions.cs │ │ ├── InlineDbCommandColumnValue.cs │ │ └── InlineDbModificationCommand.cs │ ├── DataAccessMethods.cs │ ├── DataAccessState.cs │ ├── DataAccessStatics.cs │ ├── DatabaseConnection.cs │ ├── DbCommandTimeoutException.cs │ ├── DbConcurrencyException.cs │ ├── DbConnectionFailureException.cs │ ├── DoNotCommitException.cs │ ├── Ranking │ │ ├── RankingMethods.cs │ │ └── RankingProvider.cs │ ├── RetrievalCaching │ │ ├── ParameterlessQueryCache.cs │ │ ├── QueryRetrievalQueryCache.cs │ │ ├── RowModificationCountTableCache.cs │ │ ├── TableRetrievalQueryCache.cs │ │ └── VersionedRowDataCache.cs │ ├── RevisionHistory │ │ ├── EventId.cs │ │ ├── Revision.cs │ │ ├── RevisionDelta.cs │ │ ├── RevisionHistoryProvider.cs │ │ ├── RevisionHistoryStatics.cs │ │ ├── RevisionId.cs │ │ ├── RevisionIdDelta.cs │ │ ├── TransactionListItem.cs │ │ ├── UserTransaction.cs │ │ └── ValueDelta.cs │ ├── StandardModification │ │ ├── ModificationType.cs │ │ └── PostDeleteExecutor.cs │ ├── SystemDataAccessProvider.cs │ ├── TableCondition.cs │ └── TableRetrievalRow.cs ├── DataCleanupOps.cs ├── DataMigrationOps.cs ├── DataValueManagement │ ├── AbstractDataValue.cs │ ├── DataValue.cs │ └── InitializationAwareValue.cs ├── DatabaseSpecification │ ├── DatabaseInfo.cs │ └── Databases │ │ ├── MySqlInfo.cs │ │ ├── OracleInfo.cs │ │ └── SqlServerInfo.cs ├── DoNotEmailOrLogException.cs ├── Email │ ├── EmailAddress.cs │ ├── EmailAttachment.cs │ ├── EmailMessage.cs │ ├── EmailSendingException.cs │ ├── EmailStatics.cs │ ├── EmailTemplate.cs │ ├── EmailTemplateName.cs │ └── SystemManagerInterface │ │ ├── Schema.xsd │ │ └── SystemManagerEmailInterface.cs ├── Encryption │ ├── EncryptionOps.cs │ └── SystemEncryptionProvider.cs ├── EnterpriseWebFramework │ ├── Action Components │ │ ├── ActionComponentCssElementCreator.cs │ │ ├── ActionComponentIcon.cs │ │ ├── ActionComponentIconPlacement.cs │ │ ├── ActionComponentSetup.cs │ │ ├── Button │ │ │ ├── Behaviors │ │ │ │ ├── ChangeValueBehavior.cs │ │ │ │ ├── CustomButtonBehavior.cs │ │ │ │ ├── FormActionBehavior.cs │ │ │ │ ├── MenuButtonBehavior.cs │ │ │ │ └── PostBackBehavior.cs │ │ │ ├── ButtonBehavior.cs │ │ │ ├── ButtonSetup.cs │ │ │ ├── ButtonSize.cs │ │ │ ├── ButtonStyle.cs │ │ │ ├── EwfButton.cs │ │ │ └── Styles │ │ │ │ ├── CustomButtonStyle.cs │ │ │ │ ├── ImageButtonStyle.cs │ │ │ │ └── StandardButtonStyle.cs │ │ ├── ElementActivationBehavior.cs │ │ ├── Hyperlink │ │ │ ├── BrowsingContextSetup.cs │ │ │ ├── EwfHyperlink.cs │ │ │ ├── HyperlinkBehavior.cs │ │ │ ├── HyperlinkSetup.cs │ │ │ ├── HyperlinkStyle.cs │ │ │ └── Styles │ │ │ │ ├── ButtonHyperlinkStyle.cs │ │ │ │ ├── CustomHyperlinkStyle.cs │ │ │ │ ├── ImageHyperlinkStyle.cs │ │ │ │ └── StandardHyperlinkStyle.cs │ │ ├── SubmitButton.cs │ │ └── ToolTip.cs │ ├── Admin │ │ ├── BasicTests.cs │ │ ├── CssElements.cs │ │ ├── DiagnosticLog.cs │ │ ├── EntitySetup.cs │ │ ├── ErrorLog.cs │ │ ├── OpenIdProvider.cs │ │ ├── RequestProfiling.cs │ │ ├── User.cs │ │ └── UserManagement.cs │ ├── Automatic Layout │ │ ├── FormItem.cs │ │ ├── FormItemList.cs │ │ ├── FormItemListSetup.cs │ │ └── FormItemSetup.cs │ ├── BLOB Management │ │ ├── BlobFileCollectionManager.cs │ │ ├── BlobFileManager.cs │ │ ├── BlobFileManagerSetup.cs │ │ ├── BlobManagementStatics.cs │ │ ├── MarkFileAsReadMethod.cs │ │ └── NewFileNotificationMethod.cs │ ├── Base Page │ │ ├── AppStandardPageLogicProvider.cs │ │ ├── BasePageStatics.cs │ │ ├── BasicPageContent.cs │ │ ├── NotificationSectionContainer.cs │ │ ├── StatusMessageList.cs │ │ └── StatusMessageModalBox.cs │ ├── CSS Length │ │ ├── AncestorRelativeLength.cs │ │ ├── ContentBasedLength.cs │ │ └── CssLength.cs │ ├── CSS Preprocessing │ │ ├── ControlCssElementCreator.cs │ │ ├── CssElement.cs │ │ ├── CssPreprocessingStatics.cs │ │ └── CssPreprocessor.cs │ ├── CalendarIntegrationStatics.cs │ ├── Charting │ │ ├── Chart.cs │ │ ├── ChartDataSet.cs │ │ ├── ChartSetup.cs │ │ └── ChartType.cs │ ├── Component Display │ │ ├── DisplaySetup.cs │ │ ├── DisplayableElement.cs │ │ ├── DisplayableElementData.cs │ │ ├── DisplayableElementFocusDependentData.cs │ │ └── DisplayableElementLocalData.cs │ ├── ContactSupport.cs │ ├── Core │ │ ├── AccessDeniedException.cs │ │ ├── AspNetStatics.cs │ │ ├── ConnectionSecurity.cs │ │ ├── CookieStatics.cs │ │ ├── EwfConfigurationStatics.cs │ │ ├── EwfHttpContext.cs │ │ ├── EwfHttpContextAccessor.cs │ │ ├── HTTP │ │ │ ├── AppRequestBaseUrlProvider.cs │ │ │ ├── BlobFileResponse.cs │ │ │ ├── EwfRequest.cs │ │ │ ├── EwfResponse.cs │ │ │ ├── EwfResponseBodyCreator.cs │ │ │ ├── FullResponse.cs │ │ │ ├── ResponseMemoryCachingSetup.cs │ │ │ └── URL Handling │ │ │ │ ├── BaseUrlPattern.cs │ │ │ │ ├── BasicUrlHandler.cs │ │ │ │ ├── DecodingBaseUrl.cs │ │ │ │ ├── DecodingUrlParameterCollection.cs │ │ │ │ ├── DecodingUrlSegment.cs │ │ │ │ ├── EncodingBaseUrl.cs │ │ │ │ ├── EncodingUrlParameterCollection.cs │ │ │ │ ├── EncodingUrlSegment.cs │ │ │ │ ├── UnresolvableUrlException.cs │ │ │ │ ├── UrlDecoder.cs │ │ │ │ ├── UrlEncoder.cs │ │ │ │ ├── UrlHandler.cs │ │ │ │ ├── UrlHandlingStatics.cs │ │ │ │ └── UrlPattern.cs │ │ ├── NonLiveInstallationStatics.cs │ │ ├── PageDisabledException.cs │ │ ├── Resource Meta Logic │ │ │ ├── Alternative Resource Modes │ │ │ │ ├── DisabledResourceMode.cs │ │ │ │ └── NewContentResourceMode.cs │ │ │ ├── AlternativeResourceMode.cs │ │ │ ├── ExternalResource.cs │ │ │ └── ResourceInfo.cs │ │ ├── ResourceNotAvailableException.cs │ │ ├── Translation.cs │ │ └── UserDisabledException.cs │ ├── Element Base │ │ ├── Classification │ │ │ ├── ElementClass.cs │ │ │ └── ElementClassSet.cs │ │ ├── ElementComponent.cs │ │ ├── ElementData.cs │ │ ├── ElementFocusDependentData.cs │ │ ├── ElementLocalData.cs │ │ └── ID Referencing │ │ │ ├── ElementId.cs │ │ │ ├── ElementIdReference.cs │ │ │ └── ElementIdSet.cs │ ├── EmailSendingFormItems.cs │ ├── Error Display │ │ ├── ErrorDisplayStyle.cs │ │ ├── FlowErrorContainer.cs │ │ └── Styles │ │ │ ├── CustomErrorDisplayStyle.cs │ │ │ ├── ListErrorDisplayStyle.cs │ │ │ └── SectionErrorDisplayStyle.cs │ ├── EwfOps.cs │ ├── FontAwesomeIcon.cs │ ├── Form Controls │ │ ├── Checkboxes │ │ │ ├── Checkbox.cs │ │ │ ├── CheckboxSetup.cs │ │ │ ├── FlowCheckbox.cs │ │ │ ├── FlowCheckboxSetup.cs │ │ │ ├── FlowRadioButtonSetup.cs │ │ │ └── RadioButtonSetup.cs │ │ ├── Date and Time │ │ │ ├── DateAndTimeControl.cs │ │ │ ├── DateAndTimeControlSetup.cs │ │ │ ├── DateControl.cs │ │ │ ├── DateControlSetup.cs │ │ │ ├── DurationControl.cs │ │ │ ├── DurationControlSetup.cs │ │ │ ├── TimeControl.cs │ │ │ └── TimeControlSetup.cs │ │ ├── Email Address Control │ │ │ ├── EmailAddressControl.cs │ │ │ └── EmailAddressControlSetup.cs │ │ ├── EwfHiddenField.cs │ │ ├── FileUpload.cs │ │ ├── FormControl.cs │ │ ├── FormControlExtensionCreators.cs │ │ ├── FormControlLabeler.cs │ │ ├── HTML Editor │ │ │ ├── WysiwygHtmlEditor.cs │ │ │ └── WysiwygHtmlEditorSetup.cs │ │ ├── HiddenFieldId.cs │ │ ├── Imprecise Number Control │ │ │ ├── ImpreciseNumberControl.cs │ │ │ └── ImpreciseNumberControlSetup.cs │ │ ├── Lists │ │ │ ├── Checkbox Lists │ │ │ │ ├── ChangeBasedCheckboxList.cs │ │ │ │ ├── CheckboxList.cs │ │ │ │ └── CheckboxListSetup.cs │ │ │ ├── Free-Form Radio List │ │ │ │ ├── FreeFormRadioList.cs │ │ │ │ └── FreeFormRadioListSetup.cs │ │ │ ├── List Items │ │ │ │ ├── ChangeBasedListItem.cs │ │ │ │ ├── ChangeBasedListItemWithSelectionState.cs │ │ │ │ └── SelectListItem.cs │ │ │ ├── ListItemMatchPageModificationSetup.cs │ │ │ └── Select List │ │ │ │ ├── DropDownSetup.cs │ │ │ │ ├── RadioListSetup.cs │ │ │ │ └── SelectList.cs │ │ ├── Navigational Form Control │ │ │ ├── NavFormControl.cs │ │ │ ├── NavFormControlSetup.cs │ │ │ └── NavFormControlValidationResult.cs │ │ ├── Number Control │ │ │ ├── NumberControl.cs │ │ │ └── NumberControlSetup.cs │ │ ├── Numeric Text Control │ │ │ ├── NumericTextControl.cs │ │ │ └── NumericTextControlSetup.cs │ │ ├── RadioButtonGroup.cs │ │ ├── Telephone Number Control │ │ │ ├── TelephoneNumberControl.cs │ │ │ └── TelephoneNumberControlSetup.cs │ │ ├── Text Box │ │ │ ├── AutoCompleteItem.cs │ │ │ └── AutoCompleteService.cs │ │ ├── Text Control │ │ │ ├── TextControl.cs │ │ │ └── TextControlSetup.cs │ │ └── URL Control │ │ │ ├── UrlControl.cs │ │ │ └── UrlControlSetup.cs │ ├── FragmentMarker.cs │ ├── General Content Models │ │ ├── Ethereal │ │ │ └── EtherealIdContainer.cs │ │ ├── Flow │ │ │ └── FlowIdContainer.cs │ │ └── Phrasing │ │ │ ├── CustomPhrasingComponent.cs │ │ │ ├── PhrasingAutofocusRegion.cs │ │ │ ├── PhrasingComponent.cs │ │ │ └── PhrasingIdContainer.cs │ ├── GenericPhrasingContainer.cs │ ├── HtmlBlockEditing │ │ ├── HtmlBlockContainer.cs │ │ ├── HtmlBlockEditor.cs │ │ ├── HtmlBlockEditorModification.cs │ │ ├── HtmlBlockEditorSetup.cs │ │ ├── HtmlBlockStatics.cs │ │ └── SystemHtmlBlockEditingProvider.cs │ ├── Image Embedding │ │ ├── EwfImage.cs │ │ ├── FixedSizeImageSourceSet.cs │ │ ├── FlexibleImageSourceSet.cs │ │ └── ImageSetup.cs │ ├── Layout │ │ ├── Figure │ │ │ ├── EwfFigure.cs │ │ │ └── FigureCaption.cs │ │ ├── GenericFlowContainer.cs │ │ ├── Lists │ │ │ ├── ComponentListItem.cs │ │ │ ├── ComponentListSetup.cs │ │ │ ├── CssElementCreator.cs │ │ │ ├── FlexboxAlignment.cs │ │ │ ├── FlexboxVerticalAlignment.cs │ │ │ ├── GridAlignment.cs │ │ │ ├── GridVerticalAlignment.cs │ │ │ ├── Inline │ │ │ │ └── InlineList.cs │ │ │ ├── ItemInsertionUpdateRegion.cs │ │ │ ├── Line │ │ │ │ ├── LineList.cs │ │ │ │ └── LineListItem.cs │ │ │ ├── Raw │ │ │ │ └── RawList.cs │ │ │ ├── Stack │ │ │ │ └── StackList.cs │ │ │ └── Wrapping │ │ │ │ ├── WrappingList.cs │ │ │ │ └── WrappingListItem.cs │ │ ├── Paragraph.cs │ │ ├── Section │ │ │ ├── Section.cs │ │ │ └── SectionStyle.cs │ │ ├── Tables │ │ │ ├── CellPlaceholder.cs │ │ │ ├── ColumnPrimaryItemGroup.cs │ │ │ ├── ColumnPrimaryTable.cs │ │ │ ├── DataRowLimit.cs │ │ │ ├── EwfTable.cs │ │ │ ├── EwfTableCell.cs │ │ │ ├── EwfTableField.cs │ │ │ ├── EwfTableFieldOrItemSetup.cs │ │ │ ├── EwfTableItem.cs │ │ │ ├── EwfTableItemGroup.cs │ │ │ ├── EwfTableItemGroupRemainingData.cs │ │ │ ├── EwfTableItemSetup.cs │ │ │ ├── EwfTableStyle.cs │ │ │ ├── ResponsiveTable.cs │ │ │ ├── SelectedItemAction.cs │ │ │ ├── SpaceForMultiColOrRowCell.cs │ │ │ ├── TableCellSetup.cs │ │ │ ├── TableCellVerticalAlignment.cs │ │ │ ├── TableCssElementCreator.cs │ │ │ ├── TableSelectedItemData.cs │ │ │ └── TableStatics.cs │ │ ├── TailUpdateRegion.cs │ │ └── TextAlignment.cs │ ├── MailMergingStatics.cs │ ├── MarkupBlockComponent.cs │ ├── Modal Boxes │ │ ├── ConfirmationButtonBehavior.cs │ │ ├── ConfirmationDialog.cs │ │ ├── ConfirmationDialogId.cs │ │ ├── ConfirmationFormAction.cs │ │ ├── ModalBox.cs │ │ ├── ModalBoxId.cs │ │ └── OpenModalBehavior.cs │ ├── MvcStatics.cs │ ├── NonLiveLogIn.cs │ ├── OpenIdProvider │ │ ├── AppOpenIdProviderProvider.cs │ │ ├── OpenIdAuthenticationResult.cs │ │ ├── OpenIdClient.cs │ │ ├── OpenIdProviderStatics.cs │ │ └── Resources │ │ │ ├── Authenticate.cs │ │ │ ├── EntitySetup.cs │ │ │ ├── Keys.cs │ │ │ ├── Token.cs │ │ │ └── UserInfo.cs │ ├── Page Infrastructure │ │ ├── Autofocus │ │ │ ├── AutofocusCondition.cs │ │ │ ├── EtherealAutofocusRegion.cs │ │ │ └── FlowAutofocusRegion.cs │ │ ├── Data Modification │ │ │ ├── BasicDataModificationAction.cs │ │ │ ├── DataModificationAction.cs │ │ │ ├── DataModificationException.cs │ │ │ ├── DataUpdateAction.cs │ │ │ ├── EwfValidation.cs │ │ │ ├── PostBackValueDictionary.cs │ │ │ └── ValidationList.cs │ │ ├── Form Setup │ │ │ ├── FormAction.cs │ │ │ ├── FormState.cs │ │ │ ├── NonPostBackFormAction.cs │ │ │ └── PostBackFormAction.cs │ │ ├── Form Submission │ │ │ ├── PageReloadBehavior.cs │ │ │ ├── PostBack.cs │ │ │ ├── PostBackAction.cs │ │ │ └── SecondaryResponse.cs │ │ ├── Identified Components │ │ │ ├── IdentifiedComponentData.cs │ │ │ ├── IdentifiedEtherealComponent.cs │ │ │ └── IdentifiedFlowComponent.cs │ │ ├── Page Modification │ │ │ ├── PageModificationValue.cs │ │ │ └── PageModificationValueCondition.cs │ │ ├── Page Structure │ │ │ ├── ComponentStateItem.cs │ │ │ ├── Components │ │ │ │ ├── EtherealComponent.cs │ │ │ │ ├── EtherealComponentOrElement.cs │ │ │ │ ├── FlowComponent.cs │ │ │ │ ├── FlowComponentOrNode.cs │ │ │ │ └── PageComponent.cs │ │ │ ├── ErrorSourceSet.cs │ │ │ ├── FocusabilityCondition.cs │ │ │ ├── Form Data │ │ │ │ ├── FormValue.cs │ │ │ │ ├── PostBackValue.cs │ │ │ │ └── PostBackValueValidationResult.cs │ │ │ └── Nodes │ │ │ │ ├── ElementAttribute.cs │ │ │ │ ├── ElementContext.cs │ │ │ │ ├── ElementNode.cs │ │ │ │ ├── ElementNodeData.cs │ │ │ │ ├── ElementNodeFocusDependentData.cs │ │ │ │ ├── ElementNodeLocalData.cs │ │ │ │ ├── MarkupBlockNode.cs │ │ │ │ └── TextNode.cs │ │ ├── PageBase.cs │ │ ├── PageContent.cs │ │ ├── PageNode.cs │ │ ├── PageRequestState.cs │ │ ├── PageTree.cs │ │ ├── Partial Updating │ │ │ ├── ModificationErrorDictionary.cs │ │ │ ├── PreModificationUpdateRegion.cs │ │ │ ├── UpdateRegionLinker.cs │ │ │ └── UpdateRegionSet.cs │ │ ├── PreBuiltResponse.cs │ │ ├── RequestStateStatics.cs │ │ ├── SecondaryResponseDataStore.cs │ │ └── StatusMessageType.cs │ ├── PageName.cs │ ├── PagePath.cs │ ├── PaymentProcessing │ │ ├── CreditCardCollector.cs │ │ ├── JsStatementList.cs │ │ └── StatusMessageAndDestination.cs │ ├── Request Dispatching │ │ ├── AppRequestDispatchingProvider.cs │ │ ├── ErrorPages │ │ │ ├── AccessDenied.cs │ │ │ ├── ErrorPageContent.cs │ │ │ ├── LogInSessionExpired.cs │ │ │ ├── ResourceDisabled.cs │ │ │ ├── ResourceNotAvailable.cs │ │ │ └── UnhandledException.cs │ │ ├── RequestContinuationDataStore.cs │ │ ├── RequestDispatchingStatics.cs │ │ ├── RequestState.cs │ │ └── SlowRequestThreshold.cs │ ├── Request Handling │ │ ├── AppResourceSerializationProvider.cs │ │ ├── EntitySetupBase.cs │ │ ├── EwfSafeRequestHandler.cs │ │ ├── EwfSafeResponseWriter.cs │ │ ├── ExternalRedirect.cs │ │ ├── ResourceBase.cs │ │ ├── ResourceGroup.cs │ │ ├── ResourceParent.cs │ │ ├── SystemResourceSerializationProvider.cs │ │ └── WellKnownUrlHandling │ │ │ ├── WellKnownResource.cs │ │ │ └── WellKnownUrl.cs │ ├── RevisionDisplayStatics.cs │ ├── Static File Handling │ │ ├── AppStaticFileHandlingProvider.cs │ │ ├── FrameworkStaticFilesFolderSetup.cs │ │ ├── MediaTypeOverride.cs │ │ ├── StaticFile.cs │ │ └── StaticFileFolderSetup.cs │ ├── StaticFiles │ │ ├── code.js │ │ ├── instant-page.js │ │ ├── modernizr.js │ │ ├── spinner.svg │ │ ├── styles │ │ │ ├── basic.css │ │ │ └── ui │ │ │ │ ├── colors.css │ │ │ │ ├── fonts.css │ │ │ │ ├── layout.css │ │ │ │ ├── newUI.css │ │ │ │ └── transitions.css │ │ ├── third-party │ │ │ ├── qtip2 │ │ │ │ ├── jquery.qtip.min.css │ │ │ │ └── jquery.qtip.min.js │ │ │ ├── select-css.css │ │ │ └── spin-js │ │ │ │ └── spin.min.js │ │ ├── ui │ │ │ └── home-icon.svg │ │ └── versioned │ │ │ ├── third-party │ │ │ ├── ReadMe.txt │ │ │ ├── chosen │ │ │ │ └── chosen_v1.8.7 │ │ │ │ │ ├── LICENSE.md │ │ │ │ │ ├── chosen-sprite.png │ │ │ │ │ ├── chosen-sprite@2x.png │ │ │ │ │ ├── chosen.jquery.min.js │ │ │ │ │ └── chosen.min.css │ │ │ └── jquery-ui │ │ │ │ ├── ReadMe.txt │ │ │ │ └── jquery-ui-1.13.2.custom-v2 │ │ │ │ ├── images │ │ │ │ ├── ui-bg_glass_55_fbf9ee_1x400.png │ │ │ │ ├── ui-bg_glass_65_ffffff_1x400.png │ │ │ │ ├── ui-bg_glass_75_dadada_1x400.png │ │ │ │ ├── ui-bg_glass_75_e6e6e6_1x400.png │ │ │ │ ├── ui-bg_glass_95_fef1ec_1x400.png │ │ │ │ ├── ui-bg_highlight-soft_75_cccccc_1x100.png │ │ │ │ ├── ui-icons_222222_256x240.png │ │ │ │ ├── ui-icons_2e83ff_256x240.png │ │ │ │ ├── ui-icons_454545_256x240.png │ │ │ │ ├── ui-icons_888888_256x240.png │ │ │ │ └── ui-icons_cd0a0a_256x240.png │ │ │ │ ├── jquery-ui.min.css │ │ │ │ └── jquery-ui.min.js │ │ │ └── ui │ │ │ ├── account-v1.svg │ │ │ ├── arrow-v1.svg │ │ │ └── menu-icon-v1.svg │ ├── Text │ │ ├── EmphasizedContent.cs │ │ ├── ImportantContent.cs │ │ ├── LineBreak.cs │ │ ├── LineBreakOpportunity.cs │ │ ├── SideComments.cs │ │ ├── Subscript.cs │ │ ├── Superscript.cs │ │ └── TextComponent.cs │ ├── Ui │ │ ├── AppEwfUiProvider.cs │ │ ├── Entity │ │ │ ├── EntityUiSetup.cs │ │ │ ├── TabMode.cs │ │ │ └── UiEntitySetup.cs │ │ ├── EwfUiStatics.cs │ │ └── UiPageContent.cs │ └── UserManagement │ │ ├── AppAuthenticationProvider.cs │ │ ├── AuthenticationStatics.cs │ │ ├── LogInException.cs │ │ ├── LogInPageAutoUserRegistrationSetup.cs │ │ ├── Pages │ │ ├── ChangePassword.cs │ │ ├── Impersonate.cs │ │ └── LogIn.cs │ │ ├── SamlResources │ │ ├── Assertions.cs │ │ ├── LogIn.cs │ │ ├── Metadata.cs │ │ └── VerifyClientFunctionality.cs │ │ ├── UserDisplayStatics.cs │ │ ├── UserEditor.cs │ │ └── UserImpersonationStatics.cs ├── EwlNuGetPackageSpecificationStatics.cs ├── EwlStatics.cs ├── ExternalFunctionality │ ├── ExternalFunctionalityStatics.cs │ ├── ExternalMySqlProvider.cs │ ├── ExternalOpenIdConnectProvider.cs │ ├── ExternalOracleDatabaseProvider.cs │ ├── ExternalPdfProvider.cs │ ├── ExternalSamlProvider.cs │ ├── ExternalWordProvider.cs │ └── SystemExternalFunctionalityProvider.cs ├── GlobalInitializationOps.cs ├── IO │ ├── PdfOps.cs │ ├── RsFile.cs │ └── ZipOps.cs ├── IisConfigurationStatics.cs ├── InstallationFileStatics.cs ├── InstallationSupportUtility │ ├── DataUpdateStatics.cs │ ├── DatabaseAbstraction │ │ ├── Database.cs │ │ ├── DatabaseOps.cs │ │ └── Databases │ │ │ ├── MySql.cs │ │ │ ├── NoDatabase.cs │ │ │ ├── Oracle.cs │ │ │ └── SqlServer.cs │ ├── InstallationModel │ │ ├── DevelopmentInstallation.cs │ │ ├── ExistingInstallation.cs │ │ ├── ExistingInstalledInstallation.cs │ │ ├── Installation.cs │ │ ├── KnownInstallation.cs │ │ ├── KnownInstalledInstallation.cs │ │ ├── Logic │ │ │ ├── DevelopmentInstallationLogic.cs │ │ │ ├── ExistingInstallationLogic.cs │ │ │ ├── ExistingInstalledInstallationLogic.cs │ │ │ ├── GeneralInstallationLogic.cs │ │ │ ├── KnownInstallationLogic.cs │ │ │ ├── KnownSystemLogic.cs │ │ │ └── RecognizedInstallationLogic.cs │ │ ├── NonexistentInstallation.cs │ │ ├── RecognizedDevelopmentInstallation.cs │ │ ├── RecognizedInstallation.cs │ │ ├── RecognizedInstalledInstallation.cs │ │ ├── UnrecognizedDevelopmentInstallation.cs │ │ └── UnrecognizedInstalledInstallation.cs │ ├── IsuStatics.cs │ ├── Operation.cs │ ├── OperationResult.cs │ ├── StatusStatics.cs │ ├── SystemManagerConnectionStatics.cs │ ├── SystemManagerInterface │ │ └── Messages │ │ │ ├── BuildMessage │ │ │ └── Build.xsd │ │ │ └── SystemListMessage │ │ │ ├── RsisInstallation.cs │ │ │ ├── System List.xsd │ │ │ └── SystemList.cs │ └── UserCorrectableException.cs ├── MailMerging │ ├── AsposeMergeRowEnumerator.cs │ ├── DataTree │ │ ├── MergeDataTreeChild.cs │ │ ├── MergeDataTreeOps.cs │ │ └── MergeDataTreeRemapping.cs │ ├── FieldImplementation │ │ ├── BasicMergeFieldImplementation.cs │ │ ├── BasicMergeFieldImplementationWithCustomName.cs │ │ ├── BasicMergeFieldImplementationWithMsWordName.cs │ │ └── MergeFieldAdapterImplementation.cs │ ├── Fields │ │ ├── BasicMergeField.cs │ │ ├── MergeField.cs │ │ ├── MergeFieldAdapter.cs │ │ └── MergeFieldOps.cs │ ├── MailMergingException.cs │ ├── MergeFieldNameTree.cs │ ├── MergeOps.cs │ └── RowTree │ │ ├── MergeRow.cs │ │ ├── MergeRowTree.cs │ │ └── MergeValue.cs ├── MultiMessageApplicationException.cs ├── NetTools.cs ├── RateLimiter.cs ├── SpecifiedValue.cs ├── StreamMethod.cs ├── StructuralEqualityComparer.cs ├── SystemGeneralProvider.cs ├── SystemInitializer.cs ├── SystemSpecificLogic │ ├── SystemProviderGetter.cs │ ├── SystemProviderReference.cs │ └── SystemSpecificLogicStatics.cs ├── TelemetryStatics.cs ├── TestStatics.cs ├── TewlContrib │ ├── Chronometer.cs │ ├── RandomStatics.cs │ └── Tools │ │ └── ProcessTools.cs ├── Tools │ ├── IntervalTools.cs │ └── ServiceControllerTools.cs ├── TrustedHtmlString.cs ├── UnexpectedValueException.cs ├── UnitTestingInitializationOps.cs ├── UserManagement │ ├── IdentityProvider.cs │ ├── IdentityProviders │ │ ├── LocalIdentityProvider.cs │ │ └── SamlIdentityProvider.cs │ ├── Role.cs │ ├── SystemUser.cs │ ├── SystemUserManagementProvider.cs │ ├── UserManagementStatics.cs │ └── UserRequest.cs ├── WebTestingFramework │ ├── Name.cs │ ├── OneTimeInstall.cs │ ├── Read me.txt │ └── WebTester.cs └── WindowsServiceFramework │ ├── OperationRecurrencePattern.cs │ ├── ServiceBaseAdapter.cs │ ├── TickInterval.cs │ ├── WindowsServiceBase.cs │ └── WindowsServiceStatics.cs ├── Development Utility ├── AppStatics.cs ├── CodeGeneration │ ├── CSharpParameter.cs │ ├── CodeGenerationStatics.cs │ ├── DataAccess │ │ ├── Column.cs │ │ ├── DataAccessStatics.cs │ │ ├── ProcedureParameter.cs │ │ ├── RetrievalStatics.cs │ │ ├── Subsystems │ │ │ ├── CommandConditionStatics.cs │ │ │ ├── CustomModificationStatics.cs │ │ │ ├── ProcedureStatics.cs │ │ │ ├── QueryRetrievalStatics.cs │ │ │ ├── RowConstantStatics.cs │ │ │ ├── SequenceStatics.cs │ │ │ ├── StandardModification │ │ │ │ └── StandardModificationStatics.cs │ │ │ ├── TableConstantStatics.cs │ │ │ └── TableRetrievalStatics.cs │ │ ├── TableColumns.cs │ │ └── ValueContainer.cs │ ├── ModificationField.cs │ ├── ModificationFormItemMethodWriter.cs │ ├── TypedCssClassStatics.cs │ └── WebFramework │ │ ├── InfoStatics.cs │ │ ├── OptionalParameterPackageStatics.cs │ │ ├── ParametersModificationStatics.cs │ │ ├── UrlStatics.cs │ │ ├── WebFrameworkStatics.cs │ │ ├── WebItemGeneralData.cs │ │ ├── WebItemParameter.cs │ │ └── WebItems │ │ ├── EntitySetup.cs │ │ ├── Resource.cs │ │ └── StaticFile.cs ├── Configuration │ └── Packaging.xsd ├── Development Utility.csproj ├── Operations │ ├── ExportEwlToLocalFeed.cs │ ├── ExportLogic.cs │ ├── GetLogicSize.cs │ ├── InstallAndStartServices.cs │ ├── StopAndUninstallServices.cs │ ├── UpdateData.cs │ └── UpdateDependentLogic.cs ├── Package Manager Console Commands.ps1 ├── Program.cs ├── Properties │ └── launchSettings.json └── Referenced Files │ ├── NDepend.API.dll │ └── NDepend.API.xml ├── Directory.Build.props ├── Documentation ├── DeliberateOmissions.md ├── Faq.md ├── Guides │ ├── DataAccess.md │ ├── DatabaseMigration.md │ ├── GettingStarted.md │ ├── UserManagement.md │ ├── UserManagementSupplements │ │ └── DatabaseScripts.md │ ├── WebFramework.md │ └── WebFrameworkSupplements │ │ └── DatabaseScript.sql ├── Procedures │ ├── AddingReordering.md │ ├── AddingRevisionHistory.md │ ├── CreatingSchemaForCommonTypes.md │ └── MakingEwfUiSite.md ├── Reference │ └── ConfigurationFiles.md └── TableOfContents.md ├── Enterprise Web Library.ndproj ├── Enterprise Web Library.sln ├── Library ├── Configuration │ ├── Development.xml │ ├── General.xml │ ├── Installation │ │ ├── Installations Template │ │ │ ├── Development │ │ │ │ └── Standard.xml │ │ │ ├── Live │ │ │ │ └── Standard.xml │ │ │ ├── Shared.xml │ │ │ └── Testing │ │ │ │ └── Standard.xml │ │ └── Shared.xsd │ └── ReSharper Settings.DotSettings ├── Files │ ├── ReSharper Settings.DotSettings │ ├── System Template │ │ ├── Directory.Build.props │ │ ├── Library │ │ │ ├── Configuration │ │ │ │ ├── Development.xml │ │ │ │ ├── General.xml │ │ │ │ └── Installation │ │ │ │ │ └── Installations │ │ │ │ │ ├── Development │ │ │ │ │ └── Standard.xml │ │ │ │ │ ├── Live │ │ │ │ │ └── Standard.xml │ │ │ │ │ └── Testing │ │ │ │ │ └── Standard.xml │ │ │ ├── GlobalInitializer.cs │ │ │ ├── GlobalStatics.cs │ │ │ ├── Library.csproj │ │ │ └── Providers │ │ │ │ └── General.cs │ │ ├── Solution.sln │ │ └── Website │ │ │ ├── AppStatics.cs │ │ │ ├── Home.cs │ │ │ ├── Program.cs │ │ │ ├── Providers │ │ │ ├── EwfUi.cs │ │ │ ├── RequestDispatching.cs │ │ │ └── StandardPageLogic.cs │ │ │ └── Website.csproj │ └── Web Project Configuration │ │ ├── launchSettings.json │ │ └── web.config ├── GlobalInitializer.cs ├── GlobalStatics.cs ├── Library.csproj ├── MailMerging │ ├── MergeStatics.cs │ ├── PseudoChildRow.cs │ ├── PseudoTableFields │ │ ├── FullName.cs │ │ └── Test.cs │ ├── PseudoTableRow.cs │ └── PsuedoChildFields │ │ ├── Another.cs │ │ └── TheValue.cs └── Providers │ ├── BlobStorage.cs │ ├── Encryption.cs │ ├── ExternalFunctionality.cs │ ├── General.cs │ └── UserManagement.cs ├── Providers ├── MySQL │ ├── MySQL.csproj │ └── MySqlProvider.cs ├── OpenID Connect │ ├── OpenID Connect.csproj │ └── OpenIdConnectProvider.cs ├── Oracle Database │ ├── Oracle Database.csproj │ └── OracleDatabaseProvider.cs ├── PDF │ ├── PDF.csproj │ └── PdfProvider.cs ├── SAML │ ├── AppSamlProvider.cs │ ├── SAML.csproj │ └── SamlProvider.cs └── Word │ ├── Word.csproj │ └── WordProvider.cs ├── README.md ├── Solution Files ├── Export EWL to Local Feed.bat ├── Update Dependent Logic.ps1 ├── nuget.exe └── stdLibDoxySettings.txt ├── Tests ├── DateTimeTools │ ├── DateRangesOverlap.cs │ └── DateTimeRangeOverlapsDateRange.cs ├── DoubleTools │ └── ToMoneyString.cs ├── IO │ └── ExcelFileWriterTester.cs ├── MailMerging │ ├── DataStructure │ │ ├── PracticeDocumentDataStructure │ │ │ ├── PhysicianDataStructure │ │ │ │ └── PhysicianMockData.cs │ │ │ ├── PracticeManagerDataStructure │ │ │ │ └── PracticeManagerMockData.cs │ │ │ └── PracticeMockData.cs │ │ └── TestFileDataStructure │ │ │ ├── MergeTestData.cs │ │ │ └── TheValue.cs │ ├── MergeFields │ │ ├── PhysicianMergeFields │ │ │ ├── Email.cs │ │ │ ├── FirstName.cs │ │ │ ├── LastName.cs │ │ │ └── PhysicianEmail.cs │ │ ├── PracticeDocumentMergeFields │ │ │ └── PracticeName.cs │ │ ├── PracticeManagerMergeFields │ │ │ └── Email.cs │ │ └── TestFileMergeFields │ │ │ └── FullName.cs │ └── MergeOpsTester.cs ├── NUnitInitializer.cs ├── RsLibraryTester.cs ├── StringTools │ └── RemoveCommonNonAlphaNumericCharacters.cs ├── TestFiles │ ├── MergeOps │ │ ├── PracticesUserAccess.docx │ │ ├── pdf.pdf │ │ └── word.docx │ └── PdfOps │ │ ├── onepage.pdf │ │ ├── threepage.pdf │ │ └── twopage.pdf ├── Tests.csproj └── Validation │ └── UrlValidatorTester.cs └── Website ├── ConfigurationSchemas ├── EntitySetup.cs └── GetSchema.cs ├── CreateSystem.cs ├── LegacyUrlStatics.cs ├── Program.cs ├── Providers ├── EwfUi.cs ├── RequestDispatching.cs └── StandardPageLogic.cs ├── StaticFiles ├── Logic │ └── TestCss.cs └── test.css ├── WebFrameworkDemo ├── ActionControls.cs ├── Basic │ ├── Legacy URLs │ │ └── LegacyUrlFolderSetup.cs │ └── ModalContent.cs ├── BoxDemo.cs ├── CalendarIntegration.cs ├── Charts.cs ├── CheckboxListDemo.cs ├── Checkboxes.cs ├── ColumnPrimaryTableDemo.cs ├── ComponentLists.cs ├── DataUpdateModification.cs ├── DateAndTimePickers.cs ├── EntitySetup.cs ├── EwfTableDemo.cs ├── FileManagers.cs ├── FileUploadDemo.cs ├── FormItemListDemo.cs ├── GetImage.cs ├── HtmlEditing.cs ├── IntermediatePostBacks.cs ├── KeyboardFocus.cs ├── Legacy URLs │ └── LegacyUrlFolderSetup.cs ├── MailMerging.cs ├── ModalBoxes.cs ├── NumberControlDemo.cs ├── OptionalParametersDemo.cs ├── PageModificationValues.cs ├── RegexHelper.cs ├── ResponsiveTableDemo.cs ├── SelectListDemo.cs ├── StatusMessages.cs ├── SubFolder │ ├── Details.cs │ ├── Disabled.cs │ ├── EntitySetup.cs │ ├── General.cs │ ├── Legacy URLs │ │ └── LegacyUrlFolderSetup.cs │ └── New.cs ├── TestService.cs ├── TextControlDemo.cs └── UnauthorizedPage.cs └── Website.csproj /.editorconfig: -------------------------------------------------------------------------------- 1 | # generated by EWL 2 | [*.cs] 3 | dotnet_style_collection_initializer = false 4 | csharp_style_prefer_primary_constructors = false 5 | dotnet_diagnostic.IDE0051.severity = none 6 | dotnet_diagnostic.IDE1006.severity = none 7 | -------------------------------------------------------------------------------- /Core/AppTools.cs: -------------------------------------------------------------------------------- 1 | using EnterpriseWebLibrary.UserManagement; 2 | 3 | namespace EnterpriseWebLibrary; 4 | 5 | // Do NOT add anything new to this class; we will soon delete it. 6 | public static class AppTools { 7 | [ Obsolete( "Guaranteed through 30 June 2025. Use SystemUser.Current instead." ) ] 8 | public static SystemUser? User => SystemUser.Current; 9 | } -------------------------------------------------------------------------------- /Core/Caching/DateAndTimeVersionedCache.cs: -------------------------------------------------------------------------------- 1 | using EnterpriseWebLibrary.Collections; 2 | 3 | namespace EnterpriseWebLibrary.Caching; 4 | 5 | internal class DateAndTimeVersionedCache: PeriodicEvictionCompositeCacheEntry { 6 | public readonly Cache ValuesByDateAndTime = new( true ); 7 | 8 | void PeriodicEvictionCompositeCacheEntry.EvictOldEntries() { 9 | // When we remove values, we remove all of them because we don't ever really know which ones to keep. In some cases, the latest values could all be from 10 | // within a transaction that is going to roll back. 11 | if( ValuesByDateAndTime.Keys.Count() <= 2 ) 12 | return; 13 | foreach( var key in ValuesByDateAndTime.Keys ) 14 | ValuesByDateAndTime.Remove( key ); 15 | } 16 | } -------------------------------------------------------------------------------- /Core/Caching/PeriodicEvictionCompositeCacheEntry.cs: -------------------------------------------------------------------------------- 1 | namespace EnterpriseWebLibrary.Caching; 2 | 3 | internal interface PeriodicEvictionCompositeCacheEntry { 4 | void EvictOldEntries(); 5 | } -------------------------------------------------------------------------------- /Core/Clock.cs: -------------------------------------------------------------------------------- 1 | using NodaTime; 2 | 3 | namespace EnterpriseWebLibrary; 4 | 5 | public static class Clock { 6 | private static Func? currentTimeGetter; 7 | private static Func? transactionTimeGetter; 8 | 9 | internal static void Init( ( Func current, Func transaction ) timeGetters ) { 10 | currentTimeGetter = timeGetters.current; 11 | transactionTimeGetter = timeGetters.transaction; 12 | } 13 | 14 | internal static Instant GetCurrentTime() => currentTimeGetter!(); 15 | 16 | /// 17 | /// Gets the time instant for the current user transaction. 18 | /// 19 | public static Instant TransactionTime => transactionTimeGetter!(); 20 | } -------------------------------------------------------------------------------- /Core/Configuration/DefaultCookieAttributes.cs: -------------------------------------------------------------------------------- 1 | namespace EnterpriseWebLibrary.Configuration; 2 | 3 | internal class DefaultCookieAttributes { 4 | internal readonly string? Domain; 5 | internal readonly string? Path; 6 | internal readonly string? NamePrefix; 7 | 8 | internal DefaultCookieAttributes( string? domain, string? path, string? namePrefix ) { 9 | Domain = domain; 10 | Path = path; 11 | NamePrefix = namePrefix; 12 | } 13 | } -------------------------------------------------------------------------------- /Core/Configuration/InstallationType.cs: -------------------------------------------------------------------------------- 1 | namespace EnterpriseWebLibrary.Configuration { 2 | /// 3 | /// A type of installation. 4 | /// 5 | public enum InstallationType { 6 | /// 7 | /// A development installation. 8 | /// 9 | Development, 10 | 11 | /// 12 | /// A live installation. 13 | /// 14 | Live, 15 | 16 | /// 17 | /// An intermediate installation, such as a testing or demonstration installation. 18 | /// 19 | Intermediate 20 | } 21 | } -------------------------------------------------------------------------------- /Core/Configuration/Machine/MachineConfiguration.cs: -------------------------------------------------------------------------------- 1 | namespace EnterpriseWebLibrary.Configuration.Machine { 2 | partial class MachineConfiguration { 3 | /// 4 | /// Gets the NDepend folder path relative to the user profile folder. 5 | /// 6 | public string NDependFolderPathInUserProfileFolderEffective => Development?.NDependFolderPathInUserProfileFolder ?? "NDepend"; 7 | } 8 | } -------------------------------------------------------------------------------- /Core/Configuration/SystemDevelopment/QueryPostSelectFromClause.cs: -------------------------------------------------------------------------------- 1 | namespace EnterpriseWebLibrary.Configuration.SystemDevelopment; 2 | 3 | partial class QueryPostSelectFromClause { 4 | public string ValueNonNullable => Value ?? ""; 5 | } -------------------------------------------------------------------------------- /Core/Configuration/SystemDevelopment/SystemDevelopmentConfiguration.cs: -------------------------------------------------------------------------------- 1 | namespace EnterpriseWebLibrary.Configuration.SystemDevelopment; 2 | 3 | partial class SystemDevelopmentConfiguration { 4 | public WebProject GetWebProject( string name ) => webProjects.Single( i => string.Equals( i.name, name, StringComparison.Ordinal ) ); 5 | 6 | public IEnumerable ServerSideConsoleProjectsNonNullable => 7 | serverSideConsoleProjects ?? Enumerable.Empty(); 8 | } -------------------------------------------------------------------------------- /Core/Core.csproj.DotSettings: -------------------------------------------------------------------------------- 1 |  2 | True 3 | True -------------------------------------------------------------------------------- /Core/DataAccess/AutomaticTransactionDisablingProvider.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace EnterpriseWebLibrary.DataAccess { 4 | /// 5 | /// System-specific automatic-transaction disabling logic. 6 | /// 7 | public interface AutomaticTransactionDisablingProvider: SystemDataAccessProvider { 8 | /// 9 | /// Returns the names of secondary databases that should have automatic transactions disabled. 10 | /// 11 | IEnumerable GetDisabledAutomaticTransactionSecondaryDatabaseNames(); 12 | } 13 | } -------------------------------------------------------------------------------- /Core/DataAccess/CommandWriting/InlineConditionAbstraction/InlineDbCommandCondition.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Data; 3 | using EnterpriseWebLibrary.DatabaseSpecification; 4 | 5 | namespace EnterpriseWebLibrary.DataAccess.CommandWriting.InlineConditionAbstraction { 6 | /// 7 | /// EWL use only. 8 | /// 9 | public interface InlineDbCommandCondition: IEquatable, IComparable, IComparable { 10 | /// 11 | /// EWL use only. 12 | /// 13 | void AddToCommand( IDbCommand command, DatabaseInfo databaseInfo, string parameterName ); 14 | } 15 | } -------------------------------------------------------------------------------- /Core/DataAccess/CommandWriting/InlineConditionAbstraction/InlineDbCommandWithConditions.cs: -------------------------------------------------------------------------------- 1 | namespace EnterpriseWebLibrary.DataAccess.CommandWriting.InlineConditionAbstraction; 2 | 3 | /// 4 | /// EWL use only. 5 | /// 6 | public interface InlineDbCommandWithConditions { 7 | /// 8 | /// EWL use only. 9 | /// 10 | void AddConditions( IEnumerable conditions ); 11 | } -------------------------------------------------------------------------------- /Core/DataAccess/CommandWriting/InlineDbModificationCommand.cs: -------------------------------------------------------------------------------- 1 | namespace EnterpriseWebLibrary.DataAccess.CommandWriting; 2 | 3 | /// 4 | /// Not yet documented. 5 | /// 6 | public interface InlineDbModificationCommand { 7 | /// 8 | /// Not yet documented. 9 | /// 10 | void AddColumnModifications( IEnumerable columnModifications ); 11 | } -------------------------------------------------------------------------------- /Core/DataAccess/DbCommandTimeoutException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace EnterpriseWebLibrary.DataAccess { 4 | /// 5 | /// An exception caused by a database command timeout. 6 | /// 7 | public class DbCommandTimeoutException: ApplicationException { 8 | /// 9 | /// Creates a DB command timeout exception. 10 | /// 11 | public DbCommandTimeoutException( string message, Exception innerException ): base( message, innerException ) {} 12 | } 13 | } -------------------------------------------------------------------------------- /Core/DataAccess/DbConcurrencyException.cs: -------------------------------------------------------------------------------- 1 | namespace EnterpriseWebLibrary.DataAccess; 2 | 3 | /// 4 | /// An exception caused by a database concurrency error. Do not handle this inside a transaction as the database will have already rolled it back, rendering the 5 | /// connnection unusable until is called for all nesting levels. 6 | /// 7 | public class DbConcurrencyException: Exception { 8 | /// 9 | /// Creates a DB concurrency exception. 10 | /// 11 | public DbConcurrencyException( string message, Exception innerException ): base( message, innerException ) {} 12 | } -------------------------------------------------------------------------------- /Core/DataAccess/DbConnectionFailureException.cs: -------------------------------------------------------------------------------- 1 | namespace EnterpriseWebLibrary.DataAccess; 2 | 3 | /// 4 | /// An exception caused by a database configuration problem. 5 | /// 6 | internal class DbConnectionFailureException: Exception { 7 | /// 8 | /// Creates a DB connection failure exception. 9 | /// 10 | public DbConnectionFailureException( string message, Exception innerException ): base( message, innerException ) {} 11 | } -------------------------------------------------------------------------------- /Core/DataAccess/DoNotCommitException.cs: -------------------------------------------------------------------------------- 1 | namespace EnterpriseWebLibrary.DataAccess; 2 | 3 | /// 4 | /// Use in ExecuteInTransaction to rollback the transaction instead of committing it. 5 | /// 6 | public class DoNotCommitException: Exception; -------------------------------------------------------------------------------- /Core/DataAccess/Ranking/RankingProvider.cs: -------------------------------------------------------------------------------- 1 | namespace EnterpriseWebLibrary.DataAccess.Ranking { 2 | /// 3 | /// Defines how ranking operations will be carried out against the database for a particular system. 4 | /// 5 | public interface RankingProvider: SystemDataAccessProvider { 6 | /// 7 | /// Retrieves the rank matching the specified ID. 8 | /// 9 | int GetRank( int rankId ); 10 | 11 | /// 12 | /// Inserts a new rank. 13 | /// 14 | void InsertRank( int rankId, int rank ); 15 | 16 | /// 17 | /// Updates the rank matching the specified ID. 18 | /// 19 | void UpdateRank( int rankId, int rank ); 20 | } 21 | } -------------------------------------------------------------------------------- /Core/DataAccess/RetrievalCaching/ParameterlessQueryCache.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | 3 | namespace EnterpriseWebLibrary.DataAccess.RetrievalCaching; 4 | 5 | /// 6 | /// EWL use only. 7 | /// 8 | public class ParameterlessQueryCache { 9 | private IEnumerable? resultSet; 10 | 11 | [ EditorBrowsable( EditorBrowsableState.Never ) ] 12 | public IEnumerable GetResultSet( Func> resultSetCreator ) => resultSet ??= resultSetCreator(); 13 | } -------------------------------------------------------------------------------- /Core/DataAccess/RetrievalCaching/QueryRetrievalQueryCache.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using EnterpriseWebLibrary.Collections; 5 | 6 | namespace EnterpriseWebLibrary.DataAccess.RetrievalCaching { 7 | /// 8 | /// EWL use only. 9 | /// 10 | public class QueryRetrievalQueryCache { 11 | private readonly Cache> cache; 12 | 13 | [ EditorBrowsable( EditorBrowsableState.Never ) ] 14 | public QueryRetrievalQueryCache() { 15 | cache = new Cache>( false, comparer: new StructuralEqualityComparer() ); 16 | } 17 | 18 | [ EditorBrowsable( EditorBrowsableState.Never ) ] 19 | public IEnumerable GetResultSet( object[] parameterValues, Func> resultSetCreator ) { 20 | return cache.GetOrAdd( parameterValues, resultSetCreator ); 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /Core/DataAccess/RevisionHistory/EventId.cs: -------------------------------------------------------------------------------- 1 | using JetBrains.Annotations; 2 | 3 | namespace EnterpriseWebLibrary.DataAccess.RevisionHistory; 4 | 5 | /// 6 | /// An identifier for an event. 7 | /// 8 | [ PublicAPI ] 9 | public readonly struct EventId { 10 | private readonly int id; 11 | private readonly int userTransactionId; 12 | private readonly int conceptualEntityId; 13 | 14 | /// 15 | /// Creates an event identifier object. 16 | /// 17 | /// The event identifier. 18 | /// The transaction ID. 19 | /// The conceptual-entity identifier, i.e. the latest-revision ID of the main entity. 20 | public EventId( int id, int userTransactionId, int conceptualEntityId ) { 21 | this.id = id; 22 | this.userTransactionId = userTransactionId; 23 | this.conceptualEntityId = conceptualEntityId; 24 | } 25 | 26 | internal int Id => id; 27 | internal int UserTransactionId => userTransactionId; 28 | internal int ConceptualEntityId => conceptualEntityId; 29 | } -------------------------------------------------------------------------------- /Core/DataAccess/RevisionHistory/RevisionId.cs: -------------------------------------------------------------------------------- 1 | using JetBrains.Annotations; 2 | 3 | namespace EnterpriseWebLibrary.DataAccess.RevisionHistory; 4 | 5 | /// 6 | /// An identifier for a revision of a data entity. 7 | /// 8 | [ PublicAPI ] 9 | public readonly struct RevisionId { 10 | private readonly int id; 11 | private readonly int? conceptualEntityId; 12 | 13 | /// 14 | /// Creates a revision identifier object. 15 | /// 16 | /// The revision identifier. 17 | /// The conceptual-entity identifier, i.e. the latest-revision ID of the main entity. If this revision is itself a revision 18 | /// of the main entity, you can pass null to automatically use the latest-revision ID. 19 | public RevisionId( int id, int? conceptualEntityId ) { 20 | this.id = id; 21 | this.conceptualEntityId = conceptualEntityId; 22 | } 23 | 24 | internal int Id => id; 25 | internal int? ConceptualEntityId => conceptualEntityId; 26 | } -------------------------------------------------------------------------------- /Core/DataAccess/RevisionHistory/ValueDelta.cs: -------------------------------------------------------------------------------- 1 | using JetBrains.Annotations; 2 | 3 | namespace EnterpriseWebLibrary.DataAccess.RevisionHistory; 4 | 5 | /// 6 | /// A value and the previous revision's value. 7 | /// 8 | [ PublicAPI ] 9 | public class ValueDelta { 10 | public readonly string ValueName; 11 | public readonly T New; 12 | private readonly SpecifiedValue? old; 13 | 14 | internal ValueDelta( string valueName, T @new, SpecifiedValue? old ) { 15 | ValueName = valueName; 16 | New = @new; 17 | this.old = old; 18 | } 19 | 20 | /// 21 | /// Gets whether there is a previous revision. 22 | /// 23 | public bool HasOld => old != null; 24 | 25 | public T Old => old!.Value; 26 | 27 | public bool ValueChanged => !EwlStatics.AreEqual( New, Old ); 28 | } -------------------------------------------------------------------------------- /Core/DataAccess/StandardModification/ModificationType.cs: -------------------------------------------------------------------------------- 1 | using JetBrains.Annotations; 2 | 3 | namespace EnterpriseWebLibrary.DataAccess.StandardModification; 4 | 5 | /// 6 | /// A type of database modification object. EWL use only. 7 | /// 8 | [ PublicAPI ] 9 | public enum ModificationType { 10 | /// 11 | /// EWL use only. 12 | /// 13 | Insert, 14 | 15 | /// 16 | /// EWL use only. 17 | /// 18 | Update 19 | } -------------------------------------------------------------------------------- /Core/DataAccess/SystemDataAccessProvider.cs: -------------------------------------------------------------------------------- 1 | namespace EnterpriseWebLibrary.DataAccess; 2 | 3 | /// 4 | /// System-specific data-access logic. 5 | /// 6 | public interface SystemDataAccessProvider { 7 | /// 8 | /// EWL use only. 9 | /// 10 | void InitRetrievalCaches() {} 11 | 12 | /// 13 | /// Retrieves the next value from the system’s main sequence. 14 | /// 15 | int GetNextMainSequenceValue(); 16 | } -------------------------------------------------------------------------------- /Core/DataAccess/TableCondition.cs: -------------------------------------------------------------------------------- 1 | using EnterpriseWebLibrary.DataAccess.CommandWriting.InlineConditionAbstraction; 2 | 3 | namespace EnterpriseWebLibrary.DataAccess { 4 | /// 5 | /// A database command condition associated with a particular table. 6 | /// 7 | public interface TableCondition { 8 | /// 9 | /// Gets the underlying condition for this table condition. 10 | /// 11 | InlineDbCommandCondition CommandCondition { get; } 12 | } 13 | } -------------------------------------------------------------------------------- /Core/DataAccess/TableRetrievalRow.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | 3 | namespace EnterpriseWebLibrary.DataAccess; 4 | 5 | /// 6 | /// EWL use only. 7 | /// 8 | [ EditorBrowsable( EditorBrowsableState.Never ) ] 9 | public interface TableRetrievalRow { 10 | /// 11 | /// EWL use only. 12 | /// 13 | [ EditorBrowsable( EditorBrowsableState.Never ) ] 14 | PkType PrimaryKey { get; } 15 | } -------------------------------------------------------------------------------- /Core/DataValueManagement/AbstractDataValue.cs: -------------------------------------------------------------------------------- 1 | namespace EnterpriseWebLibrary.DataValueManagement; 2 | 3 | /// 4 | /// A value that knows whether it corresponds to existing data and whether it has been initialized. 5 | /// 6 | public interface AbstractDataValue { 7 | /// 8 | /// Gets whether data currently exists for this value. 9 | /// 10 | bool DataExists { get; } 11 | 12 | /// 13 | /// Gets or sets the value. Throws an exception if you try to get the value before it has been initialized. 14 | /// 15 | T Value { get; set; } 16 | 17 | /// 18 | /// Creates a new value with the data from this value, optionally transformed into a new type. 19 | /// 20 | DataValue CreateNewValue( Func valueSelector ) => new( DataExists, () => valueSelector( Value ) ); 21 | } -------------------------------------------------------------------------------- /Core/DoNotEmailOrLogException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace EnterpriseWebLibrary { 4 | public class DoNotEmailOrLogException: ApplicationException {} 5 | } -------------------------------------------------------------------------------- /Core/Email/EmailSendingException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace EnterpriseWebLibrary.Email { 4 | /// 5 | /// An exception caused by a failure to send an email message. 6 | /// 7 | public class EmailSendingException: ApplicationException { 8 | /// 9 | /// Creates an email sending exception. 10 | /// 11 | public EmailSendingException( string message, Exception innerException ): base( message, innerException ) {} 12 | } 13 | } -------------------------------------------------------------------------------- /Core/Email/EmailTemplateName.cs: -------------------------------------------------------------------------------- 1 | namespace EnterpriseWebLibrary.Email { 2 | /// 3 | /// The name of a file-based email template. 4 | /// 5 | public sealed class EmailTemplateName { 6 | internal readonly string TemplateName; 7 | 8 | /// 9 | /// Development Utility use only. 10 | /// 11 | public EmailTemplateName( string templateName ) { 12 | TemplateName = templateName; 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /Core/Email/SystemManagerInterface/Schema.xsd: -------------------------------------------------------------------------------- 1 |  2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Core/Email/SystemManagerInterface/SystemManagerEmailInterface.cs: -------------------------------------------------------------------------------- 1 | namespace EnterpriseWebLibrary.Email.SystemManagerInterface { 2 | partial class SystemManagerEmailInterface { 3 | public EmailAddress GetEmailAddress() => new EmailAddress( Address, Name ); 4 | } 5 | } -------------------------------------------------------------------------------- /Core/Encryption/SystemEncryptionProvider.cs: -------------------------------------------------------------------------------- 1 | namespace EnterpriseWebLibrary.Encryption { 2 | /// 3 | /// System-specific encryption logic. 4 | /// 5 | public interface SystemEncryptionProvider { 6 | /// 7 | /// To generate a key for a new system, use Rijndael.Create() and then retrieve the key from the resulting object. It should be 32 bytes (256 bits) long 8 | /// since that is the default key length for the encryption algorithm. 9 | /// 10 | byte[] Key { get; } 11 | } 12 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Action Components/ActionComponentIconPlacement.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 3 | public enum ActionComponentIconPlacement { 4 | Left, 5 | Right 6 | } 7 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Action Components/Button/ButtonBehavior.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | using System.Collections.Generic; 3 | 4 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 5 | /// 6 | /// The behavior for a button. 7 | /// 8 | public interface ButtonBehavior { 9 | IEnumerable GetAttributes(); 10 | bool IncludesIdAttribute(); 11 | IReadOnlyCollection GetEtherealChildren(); 12 | string GetJsInitStatements( string id ); 13 | void AddPostBack(); 14 | } 15 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Action Components/Button/ButtonStyle.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | namespace EnterpriseWebLibrary.EnterpriseWebFramework; 3 | 4 | public interface ButtonStyle { 5 | ElementClassSet GetClasses(); 6 | IEnumerable GetAttributes(); 7 | IReadOnlyCollection GetChildren(); 8 | string GetJsInitStatements( string id ); 9 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Action Components/Hyperlink/BrowsingContextSetup.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 3 | /// 4 | /// The configuration for an iframe element. 5 | /// 6 | public class BrowsingContextSetup { 7 | internal readonly CssLength Width; 8 | internal readonly CssLength Height; 9 | 10 | /// 11 | /// Creates a browsing-context setup object. 12 | /// 13 | /// The width of the iframe. 14 | /// The height of the iframe. 15 | public BrowsingContextSetup( ContentBasedLength width = null, ContentBasedLength height = null ) { 16 | Width = width; 17 | Height = height; 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Action Components/Hyperlink/HyperlinkStyle.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | using System.Collections.Generic; 3 | 4 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 5 | public interface HyperlinkStyle { 6 | ElementClassSet GetClasses(); 7 | IReadOnlyCollection GetChildren( string destinationUrl ); 8 | string GetJsInitStatements( string id ); 9 | } 10 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Admin/BasicTests.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | using Humanizer; 3 | 4 | // EwlPage 5 | 6 | namespace EnterpriseWebLibrary.EnterpriseWebFramework.Admin { 7 | partial class BasicTests { 8 | protected override PageContent getContent() => 9 | new UiPageContent().Add( 10 | new StackList( 11 | new EwfButton( 12 | new StandardButtonStyle( "Send Health Check" ), 13 | behavior: new PostBackBehavior( postBack: PostBack.CreateFull( id: "sendHealthCheck", modificationMethod: TelemetryStatics.SendHealthCheck ) ) ) 14 | .ToComponentListItem() 15 | .Append( 16 | new EwfButton( 17 | new StandardButtonStyle( "Throw Unhandled Exception" ), 18 | behavior: new PostBackBehavior( postBack: PostBack.CreateFull( id: "throwException", modificationMethod: throwException ) ) ) 19 | .ToComponentListItem() ) ) ); 20 | 21 | private void throwException() { 22 | throw new ApplicationException( "This is a test from the {0} page.".FormatWith( ResourceFullName ) ); 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Admin/CssElements.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | // EwlPage 3 | 4 | namespace EnterpriseWebLibrary.EnterpriseWebFramework.Admin; 5 | 6 | partial class CssElements { 7 | protected override string getResourceName() => "CSS Elements"; 8 | 9 | protected override PageContent getContent() => 10 | new UiPageContent().Add( new StackList( CssPreprocessingStatics.Elements.OrderBy( i => i.Name ).Select( i => i.Name.ToComponentListItem() ) ) ); 11 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Admin/ErrorLog.cs: -------------------------------------------------------------------------------- 1 | using EnterpriseWebLibrary.Configuration; 2 | 3 | // EwlResource 4 | 5 | namespace EnterpriseWebLibrary.EnterpriseWebFramework.Admin; 6 | 7 | partial class ErrorLog { 8 | protected override EwfSafeRequestHandler getOrHead() => 9 | new EwfSafeResponseWriter( 10 | EwfResponse.Create( 11 | ContentTypes.PlainText, 12 | new EwfResponseBodyCreator( 13 | writer => { 14 | if( !File.Exists( ConfigurationStatics.InstallationConfiguration.ErrorLogFilePath ) ) 15 | return; 16 | 17 | using var reader = new StreamReader( 18 | ConfigurationStatics.InstallationConfiguration.ErrorLogFilePath, 19 | new FileStreamOptions { Mode = FileMode.Open, Access = FileAccess.Read, Share = FileShare.ReadWrite } ); 20 | var buffer = new char[ 4096 ]; 21 | int count; 22 | while( ( count = reader.Read( buffer, 0, buffer.Length ) ) > 0 ) 23 | writer.Write( buffer, 0, count ); 24 | } ) ) ); 25 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/BLOB Management/MarkFileAsReadMethod.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 3 | /// 4 | /// Method that marks the file with the given ID as read. 5 | /// 6 | public delegate void MarkFileAsReadMethod( int fileId ); 7 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/BLOB Management/NewFileNotificationMethod.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 3 | /// 4 | /// Method invoked when a new file is uploaded. 5 | /// 6 | public delegate void NewFileNotificationMethod( int newFileId ); 7 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Base Page/BasePageStatics.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | using EnterpriseWebLibrary.SystemSpecificLogic; 3 | 4 | namespace EnterpriseWebLibrary.EnterpriseWebFramework; 5 | 6 | internal static class BasePageStatics { 7 | internal const string FormSelector = "form#" + PageBase.FormId; 8 | 9 | private static SystemProviderReference provider; 10 | 11 | internal static void Init( SystemProviderReference provider ) { 12 | BasePageStatics.provider = provider; 13 | } 14 | 15 | internal static AppStandardPageLogicProvider AppProvider => provider.GetProvider(); 16 | 17 | internal static bool StatusMessagesDisplayAsNotification() => 18 | PageBase.Current.StatusMessages.All( i => i.Item1 == StatusMessageType.Info ) && PageBase.Current.StatusMessages.Count() <= 3; 19 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Base Page/StatusMessageModalBox.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | namespace EnterpriseWebLibrary.EnterpriseWebFramework; 3 | 4 | internal class StatusMessageModalBox: EtherealComponent { 5 | // Status messages must be retrieved after PageBase.getContent in case that method adds them. 6 | IReadOnlyCollection EtherealComponent.GetChildren() => 7 | new ModalBox( 8 | new ModalBoxId(), 9 | true, 10 | new FlowIdContainer( 11 | new Section( 12 | "Messages", 13 | PageBase.Current.StatusMessages.Any() && !BasePageStatics.StatusMessagesDisplayAsNotification() 14 | ? new StatusMessageList().ToCollection() 15 | : Enumerable.Empty().Materialize() ).ToCollection() ).ToCollection(), 16 | open: PageBase.Current.StatusMessages.Any() && !BasePageStatics.StatusMessagesDisplayAsNotification() ).ToCollection(); 17 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/CSS Length/AncestorRelativeLength.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | using Humanizer; 3 | 4 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 5 | /// 6 | /// A length that is relative to the parent or viewport. 7 | /// 8 | public class AncestorRelativeLength: CssLength { 9 | private readonly string value; 10 | 11 | internal AncestorRelativeLength( string value ) { 12 | this.value = value; 13 | } 14 | 15 | string CssLength.Value => value; 16 | } 17 | 18 | public static class AncestorRelativeLengthExtensionCreators { 19 | /// 20 | /// Creates a CSS percentage length from this number. 21 | /// 22 | public static AncestorRelativeLength ToPercentage( this decimal number ) { 23 | return new AncestorRelativeLength( "{0}%".FormatWith( number ) ); 24 | } 25 | 26 | /// 27 | /// Creates a CSS percentage length from this number. 28 | /// 29 | public static AncestorRelativeLength ToPercentage( this int number ) { 30 | return ( (decimal)number ).ToPercentage(); 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/CSS Length/CssLength.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 3 | /// 4 | /// A CSS length value. See https://www.w3.org/TR/css-values-3/#lengths. 5 | /// 6 | public interface CssLength { 7 | /// 8 | /// Gets the length value. 9 | /// 10 | string Value { get; } 11 | } 12 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/CSS Preprocessing/ControlCssElementCreator.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | using System.Collections.Generic; 3 | 4 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 5 | /// 6 | /// An object that defines one or more CSS elements. 7 | /// 8 | public interface ControlCssElementCreator { 9 | /// 10 | /// Creates an array of CSS elements. 11 | /// 12 | IReadOnlyCollection CreateCssElements(); 13 | } 14 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Charting/ChartType.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 3 | public enum ChartType { 4 | Line, 5 | Bar, 6 | StackedBar, 7 | HorizontalBar, 8 | HorizontalStackedBar 9 | } 10 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Component Display/DisplayableElement.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | using System; 3 | using System.Collections.Generic; 4 | using Tewl.Tools; 5 | 6 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 7 | /// 8 | /// A displayable element. 9 | /// 10 | public class DisplayableElement: FlowComponent, EtherealComponent { 11 | private readonly IReadOnlyCollection children; 12 | 13 | /// 14 | /// Creates a displayable element. 15 | /// 16 | public DisplayableElement( Func elementDataGetter, FormValue formValue = null ) { 17 | children = new ElementComponent( context => elementDataGetter( context ).BaseDataGetter( context ), formValue: formValue ).ToCollection(); 18 | } 19 | 20 | IReadOnlyCollection FlowComponent.GetChildren() { 21 | return children; 22 | } 23 | 24 | IReadOnlyCollection EtherealComponent.GetChildren() { 25 | return children; 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Core/AccessDeniedException.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | using System; 3 | 4 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 5 | /// 6 | /// An exception caused by a failed authorization check. 7 | /// 8 | public class AccessDeniedException: ApplicationException { 9 | internal readonly bool CausedByIntermediateUser; 10 | internal readonly ResourceBase LogInPage; 11 | 12 | /// 13 | /// MVC and internal use only. 14 | /// 15 | public AccessDeniedException( bool causedByIntermediateUser, ResourceBase logInPage ) { 16 | CausedByIntermediateUser = causedByIntermediateUser; 17 | LogInPage = logInPage; 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Core/AspNetStatics.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | namespace EnterpriseWebLibrary.EnterpriseWebFramework.Core { 3 | public static class AspNetStatics { 4 | private static Func currentServicesGetter; 5 | 6 | internal static void Init( Func currentServicesGetter ) { 7 | AspNetStatics.currentServicesGetter = currentServicesGetter; 8 | } 9 | 10 | /// 11 | /// Gets the service container for the current request, or for the application if called outside of a request. 12 | /// 13 | public static IServiceProvider Services => currentServicesGetter(); 14 | } 15 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Core/ConnectionSecurity.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 3 | /// 4 | /// A desired security setting for a request. 5 | /// 6 | public enum ConnectionSecurity { 7 | /// 8 | /// The request should use standard http. 9 | /// 10 | NonSecure, 11 | 12 | /// 13 | /// The request should use https if the application supports it. 14 | /// 15 | SecureIfPossible, 16 | 17 | /// 18 | /// The security setting should match that of the current request. 19 | /// 20 | MatchingCurrentRequest 21 | } 22 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Core/EwfConfigurationStatics.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | using EnterpriseWebLibrary.Configuration; 3 | 4 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 5 | public static class EwfConfigurationStatics { 6 | internal static WebApplication AppConfiguration { get; private set; } 7 | 8 | internal static void Init() { 9 | AppConfiguration = ConfigurationStatics.InstallationConfiguration.WebApplications.Single( a => a.Name == ConfigurationStatics.AppName ); 10 | } 11 | 12 | internal static bool AppSupportsSecureConnections => AppConfiguration.SupportsSecureConnections; 13 | } 14 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Core/HTTP/ResponseMemoryCachingSetup.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | using System; 3 | 4 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 5 | /// 6 | /// The memory-caching configuration for an HTTP response. 7 | /// 8 | public class ResponseMemoryCachingSetup { 9 | internal readonly string CacheKey; 10 | internal readonly DateTimeOffset LastModificationDateAndTime; 11 | 12 | /// 13 | /// Creates a response memory-caching setup object. 14 | /// 15 | /// The memory-cache key for the response. Everything that the response varies on should be incorporated into the key. Do not pass 16 | /// null or the empty string. 17 | /// The last-modification date/time of the response. 18 | public ResponseMemoryCachingSetup( string cacheKey, DateTimeOffset lastModificationDateAndTime ) { 19 | CacheKey = cacheKey; 20 | LastModificationDateAndTime = lastModificationDateAndTime; 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Core/HTTP/URL Handling/BaseUrlPattern.cs: -------------------------------------------------------------------------------- 1 | namespace EnterpriseWebLibrary.EnterpriseWebFramework; 2 | 3 | /// 4 | /// A pattern that can generate and parse application base URLs. 5 | /// 6 | public sealed class BaseUrlPattern { 7 | internal readonly Func Generator; 8 | internal readonly Func Parser; 9 | 10 | /// 11 | /// Creates a two-way base URL pattern. 12 | /// 13 | /// A function that takes an encoder and returns a base URL, or null if the encoder does not match the pattern. 14 | /// A function that takes a base URL and returns a decoder, or null if the base URL does not match the pattern. 15 | public BaseUrlPattern( Func generator, Func parser ) { 16 | Generator = generator; 17 | Parser = parser; 18 | } 19 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Core/HTTP/URL Handling/BasicUrlHandler.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | using Microsoft.AspNetCore.Http; 3 | 4 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 5 | /// 6 | /// An object that defines a particular URL in the application and handles a request to it. 7 | /// 8 | public interface BasicUrlHandler: IEquatable { 9 | /// 10 | /// Returns this handler’s URL encoder. 11 | /// 12 | UrlEncoder GetEncoder(); 13 | 14 | /// 15 | /// Handles an HTTP request. 16 | /// 17 | void HandleRequest( HttpContext context ); 18 | } 19 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Core/HTTP/URL Handling/DecodingBaseUrl.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 3 | public sealed class DecodingBaseUrl { 4 | private readonly bool secure; 5 | private readonly string host; 6 | private readonly int port; 7 | private readonly string path; 8 | private readonly DecodingUrlParameterCollection parameters; 9 | 10 | internal DecodingBaseUrl( bool secure, string host, int port, string path, DecodingUrlParameterCollection parameters ) { 11 | this.secure = secure; 12 | this.host = host; 13 | this.port = port; 14 | this.path = path; 15 | this.parameters = parameters; 16 | } 17 | 18 | public bool Secure => secure; 19 | public string Host => host; 20 | public int Port => port; 21 | public string Path => path; 22 | 23 | /// 24 | /// Gets this base URL’s parameters. 25 | /// 26 | public DecodingUrlParameterCollection Parameters => parameters; 27 | } 28 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Core/HTTP/URL Handling/EncodingBaseUrl.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 3 | public sealed class EncodingBaseUrl { 4 | internal readonly BaseUrl BaseUrl; 5 | internal readonly EncodingUrlParameterCollection Parameters; 6 | 7 | /// 8 | /// Creates a base URL. 9 | /// 10 | /// The base URL. Do not pass null. 11 | /// The parameters. 12 | public EncodingBaseUrl( BaseUrl baseUrl, EncodingUrlParameterCollection parameters = null ) { 13 | BaseUrl = baseUrl; 14 | Parameters = parameters ?? new EncodingUrlParameterCollection(); 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Core/HTTP/URL Handling/UnresolvableUrlException.cs: -------------------------------------------------------------------------------- 1 | namespace EnterpriseWebLibrary.EnterpriseWebFramework; 2 | 3 | /// 4 | /// Framework use only. 5 | /// 6 | public class UnresolvableUrlException: Exception { 7 | /// 8 | /// Framework use only. 9 | /// 10 | public UnresolvableUrlException( string message, Exception? innerException ): base( message, innerException ) {} 11 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Core/HTTP/URL Handling/UrlDecoder.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 3 | public interface UrlDecoder { 4 | /// 5 | /// Framework use only. 6 | /// 7 | BasicUrlHandler GetUrlHandler( DecodingUrlParameterCollection parameters ); 8 | } 9 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Core/HTTP/URL Handling/UrlEncoder.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | using System.Collections.Generic; 3 | 4 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 5 | public interface UrlEncoder { 6 | /// 7 | /// Framework use only. 8 | /// 9 | IReadOnlyCollection<( string name, string value, bool isSegmentParameter )> GetRemainingParameters(); 10 | 11 | /// 12 | /// Framework use only. 13 | /// 14 | void ResetState(); 15 | } 16 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Core/PageDisabledException.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | using System; 3 | 4 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 5 | /// 6 | /// An exception caused by an attempt to access a disabled page. 7 | /// 8 | public class PageDisabledException: ApplicationException { 9 | /// 10 | /// Creates a page disabled exception. 11 | /// 12 | public PageDisabledException( string message ): base( message ) {} 13 | } 14 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Core/Resource Meta Logic/Alternative Resource Modes/DisabledResourceMode.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 3 | /// 4 | /// A mode that prevents a resource or entity setup from being accessed. 5 | /// 6 | public class DisabledResourceMode: AlternativeResourceMode { 7 | private readonly string message; 8 | 9 | /// 10 | /// Creates a disabled page mode object. 11 | /// 12 | public DisabledResourceMode( string message ) { 13 | this.message = message; 14 | } 15 | 16 | /// 17 | /// Gets the message. 18 | /// 19 | public string Message { get { return message; } } 20 | } 21 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Core/Resource Meta Logic/Alternative Resource Modes/NewContentResourceMode.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 3 | /// 4 | /// A mode that indicates new content is available in a resource or entity setup. 5 | /// 6 | public class NewContentResourceMode: AlternativeResourceMode {} 7 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Core/Resource Meta Logic/AlternativeResourceMode.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 3 | /// 4 | /// A mode for a resource or entity setup that is different from normal display. 5 | /// Implementors are DisabledResourceMode and NewContentResourceMode. 6 | /// 7 | public interface AlternativeResourceMode {} 8 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Core/Resource Meta Logic/ExternalResource.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | namespace EnterpriseWebLibrary.EnterpriseWebFramework; 3 | 4 | /// 5 | /// A web resource outside of the system. 6 | /// 7 | public sealed class ExternalResource: ResourceInfo { 8 | private readonly string url; 9 | 10 | /// 11 | /// Creates an external resource. Do not pass null or the empty string for url. 12 | /// 13 | public ExternalResource( string url ) { 14 | this.url = url; 15 | } 16 | 17 | public override bool UserCanAccess => true; 18 | public override AlternativeResourceMode AlternativeMode => null; 19 | internal override string GetUrl( bool ensureUserCanAccessResource, bool ensureResourceNotDisabled ) => url; 20 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Core/ResourceNotAvailableException.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | using System; 3 | 4 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 5 | internal class ResourceNotAvailableException: Exception { 6 | public ResourceNotAvailableException( string message, Exception innerException ): base( message, innerException ) {} 7 | } 8 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Core/UserDisabledException.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | using System; 3 | 4 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 5 | /// 6 | /// An exception caused by an attempt to access the authenticated user when it has been disabled. 7 | /// 8 | public class UserDisabledException: Exception { 9 | internal UserDisabledException( string message ): base( message ) {} 10 | } 11 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Element Base/Classification/ElementClass.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 3 | public sealed class ElementClass { 4 | public readonly string ClassName; 5 | 6 | /// 7 | /// Creates an element class. 8 | /// 9 | public ElementClass( string className ) { 10 | ClassName = className; 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Element Base/ElementComponent.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | using System; 3 | using System.Collections.Generic; 4 | using Tewl.Tools; 5 | 6 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 7 | /// 8 | /// A page element. 9 | /// 10 | public class ElementComponent: FlowComponent, EtherealComponent { 11 | private readonly IReadOnlyCollection children; 12 | 13 | /// 14 | /// Creates an element. 15 | /// 16 | public ElementComponent( Func elementDataGetter, FormValue formValue = null ) { 17 | children = new ElementNode( context => elementDataGetter( context ).NodeDataGetter( context ), formValue: formValue ).ToCollection(); 18 | } 19 | 20 | IReadOnlyCollection FlowComponent.GetChildren() { 21 | return children; 22 | } 23 | 24 | IReadOnlyCollection EtherealComponent.GetChildren() { 25 | return children; 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Element Base/ID Referencing/ElementId.cs: -------------------------------------------------------------------------------- 1 | namespace EnterpriseWebLibrary.EnterpriseWebFramework; 2 | 3 | public sealed class ElementId: ElementIdReference { 4 | private string id = ""; 5 | 6 | /// 7 | /// Creates an element-ID reference. 8 | /// 9 | public ElementId() {} 10 | 11 | /// 12 | /// Adds the element’s client-side ID. This can only be called once. ElementData use only. 13 | /// 14 | internal override void AddId( string id ) { 15 | PageBase.AssertPageTreeNotBuilt(); 16 | if( this.id.Length > 0 ) 17 | throw new ApplicationException( "The ID was already added." ); 18 | this.id = id; 19 | } 20 | 21 | /// 22 | /// Gets the element’s client-side ID, or the empty string if no ID exists. Not available until after the page tree has been built. 23 | /// 24 | public string Id { 25 | get { 26 | PageBase.AssertPageTreeBuilt(); 27 | return id; 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Element Base/ID Referencing/ElementIdReference.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 3 | public abstract class ElementIdReference { 4 | internal abstract void AddId( string id ); 5 | } 6 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Element Base/ID Referencing/ElementIdSet.cs: -------------------------------------------------------------------------------- 1 | using JetBrains.Annotations; 2 | 3 | namespace EnterpriseWebLibrary.EnterpriseWebFramework; 4 | 5 | [ PublicAPI ] 6 | public sealed class ElementIdSet: ElementIdReference { 7 | private readonly List ids = new(); 8 | 9 | /// 10 | /// Creates an element-ID set. 11 | /// 12 | public ElementIdSet() {} 13 | 14 | /// 15 | /// Adds an element’s client-side ID to this set. ElementData use only. 16 | /// 17 | internal override void AddId( string id ) { 18 | PageBase.AssertPageTreeNotBuilt(); 19 | ids.Add( id ); 20 | } 21 | 22 | /// 23 | /// Gets the element client-side IDs in this set, which are not available until after the page tree has been built. 24 | /// 25 | public IReadOnlyCollection Ids { 26 | get { 27 | PageBase.AssertPageTreeBuilt(); 28 | return ids; 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Error Display/ErrorDisplayStyle.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | using System.Collections.Generic; 3 | 4 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 5 | /// 6 | /// A display style for modification errors. 7 | /// 8 | public interface ErrorDisplayStyle where ComponentType: PageComponent { 9 | /// 10 | /// EWL use only. 11 | /// 12 | IReadOnlyCollection GetComponents( ErrorSourceSet errorSources, IEnumerable errors, bool componentsFocusableOnError ); 13 | } 14 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Form Controls/FormControl.cs: -------------------------------------------------------------------------------- 1 | namespace EnterpriseWebLibrary.EnterpriseWebFramework; 2 | 3 | public interface FormControl where T: PageComponent { 4 | /// 5 | /// Gets the labeler, or null if this control is not labelable. 6 | /// 7 | FormControlLabeler? Labeler { get; } 8 | 9 | /// 10 | /// Gets the page component. 11 | /// 12 | T PageComponent { get; } 13 | 14 | /// 15 | /// Gets the validation, or null if there isn't one. 16 | /// 17 | EwfValidation? Validation { get; } 18 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Form Controls/HiddenFieldId.cs: -------------------------------------------------------------------------------- 1 | namespace EnterpriseWebLibrary.EnterpriseWebFramework; 2 | 3 | public sealed class HiddenFieldId { 4 | internal readonly ElementId ElementId; 5 | 6 | /// 7 | /// Creates a hidden-field ID. 8 | /// 9 | public HiddenFieldId() { 10 | ElementId = new ElementId(); 11 | } 12 | 13 | /// 14 | /// Returns the JavaScript statements that should be executed to change the field value. Not available until after the page tree has been built. 15 | /// 16 | public string GetJsValueModificationStatements( string valueExpression ) { 17 | if( !ElementId.Id.Any() ) 18 | throw new ApplicationException( "The hidden field must be on the page." ); 19 | return "$( '#{0}' ).val( {1} ).change();".FormatWith( ElementId.Id, valueExpression ); 20 | } 21 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Form Controls/Navigational Form Control/NavFormControlValidationResult.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 3 | public class NavFormControlValidationResult { 4 | internal ResourceInfo Destination { get; } 5 | internal string ErrorMessage { get; } 6 | 7 | /// 8 | /// Creates a successful-validation result. 9 | /// 10 | /// Do not pass null. 11 | public NavFormControlValidationResult( ResourceInfo destination ) { 12 | Destination = destination; 13 | } 14 | 15 | /// 16 | /// Creates a failed-validation result. 17 | /// 18 | /// Do not pass null or the empty string. 19 | public NavFormControlValidationResult( string errorMessage ) { 20 | ErrorMessage = errorMessage; 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Form Controls/Text Box/AutoCompleteItem.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 3 | public class AutoCompleteItem { 4 | // Javascript is case-sensitive. These must be lowercase. 5 | // ReSharper disable InconsistentNaming 6 | public readonly string label; 7 | public readonly string value; 8 | // ReSharper restore InconsistentNaming 9 | 10 | public AutoCompleteItem( string label, string value ) { 11 | this.label = label; 12 | this.value = value; 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Form Controls/Text Box/AutoCompleteService.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | using Newtonsoft.Json; 3 | 4 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 5 | public abstract class AutoCompleteService: ResourceBase { 6 | protected sealed override bool disablesUrlNormalization => base.disablesUrlNormalization; 7 | 8 | protected override EwfSafeRequestHandler getOrHead() => 9 | new EwfSafeResponseWriter( 10 | EwfResponse.Create( ContentTypes.PlainText, new EwfResponseBodyCreator( () => JsonConvert.SerializeObject( getItems(), Formatting.None ) ) ) ); 11 | 12 | protected abstract IEnumerable getItems(); 13 | } 14 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/FragmentMarker.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | using System.Collections.Generic; 3 | using Tewl.Tools; 4 | 5 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 6 | /// 7 | /// An invisible marker used in conjunction with fragment navigation. 8 | /// 9 | public sealed class FragmentMarker: PhrasingComponent { 10 | private readonly IReadOnlyCollection children; 11 | 12 | /// 13 | /// Creates a fragment marker. 14 | /// 15 | /// The ID of the marker, which should be unique on the page. Do not pass null or the empty string. 16 | public FragmentMarker( string id ) { 17 | children = new ElementComponent( 18 | context => new ElementData( 19 | () => new ElementLocalData( "span", focusDependentData: new ElementFocusDependentData( includeIdAttribute: true ) ), 20 | clientSideIdOverride: id ) ).ToCollection(); 21 | } 22 | 23 | IReadOnlyCollection FlowComponent.GetChildren() => children; 24 | } 25 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/General Content Models/Phrasing/CustomPhrasingComponent.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | using System.Collections.Generic; 3 | using System.Collections.Immutable; 4 | 5 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 6 | /// 7 | /// A phrasing component with custom children. 8 | /// 9 | public class CustomPhrasingComponent: PhrasingComponent { 10 | private readonly IReadOnlyCollection children; 11 | 12 | /// 13 | /// Creates a custom phrasing component. 14 | /// 15 | public CustomPhrasingComponent( IEnumerable children ) { 16 | this.children = children.ToImmutableArray(); 17 | } 18 | 19 | IReadOnlyCollection FlowComponent.GetChildren() => children; 20 | } 21 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/General Content Models/Phrasing/PhrasingAutofocusRegion.cs: -------------------------------------------------------------------------------- 1 | using JetBrains.Annotations; 2 | 3 | namespace EnterpriseWebLibrary.EnterpriseWebFramework; 4 | 5 | /// 6 | /// A phrasing component that can be autofocused. 7 | /// 8 | [ PublicAPI ] 9 | public class PhrasingAutofocusRegion: PhrasingComponent { 10 | private readonly IReadOnlyCollection children; 11 | 12 | /// 13 | /// Creates an autofocus region. 14 | /// 15 | /// 16 | /// 17 | public PhrasingAutofocusRegion( AutofocusCondition? condition, IReadOnlyCollection children ) { 18 | this.children = new FlowAutofocusRegion( condition, children ).ToCollection(); 19 | } 20 | 21 | IReadOnlyCollection FlowComponent.GetChildren() => children; 22 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/General Content Models/Phrasing/PhrasingComponent.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 3 | public interface PhrasingComponent: FlowComponent {} 4 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Image Embedding/FlexibleImageSourceSet.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | using System; 3 | 4 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 5 | /// 6 | /// A source-set for an image whose size depends on the viewport size. 7 | /// 8 | public class FlexibleImageSourceSet { 9 | internal readonly Tuple, Func> SrcAndSrcsetGetters; 10 | 11 | /// 12 | /// Creates an image source-set. 13 | /// 14 | /// The maximum width supported by the image resource, in pixels. 15 | /// A function that takes a pixel width and returns a representation of the image resource at that width. 16 | public FlexibleImageSourceSet( uint resourceMaxWidth, Func resourceGetter ) { 17 | SrcAndSrcsetGetters = Tuple.Create( new Func( () => resourceGetter( resourceMaxWidth ).GetUrl() ), new Func( () => "" ) ); 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Layout/Lists/Inline/InlineList.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 6 | public class InlineList: FlowComponent { 7 | private readonly IReadOnlyCollection children; 8 | 9 | /// 10 | /// Creates an inline list, which separates items with a pipe character. 11 | /// 12 | /// The items. Do not pass null. 13 | /// The setup object for the list. 14 | public InlineList( IEnumerable items, ComponentListSetup setup = null ) { 15 | children = ( setup ?? new ComponentListSetup() ).GetComponents( 16 | CssElementCreator.InlineListClass, 17 | from i in items select i.GetItemAndComponent( ElementClassSet.Empty, null, includeContentContainer: true ) ); 18 | } 19 | 20 | IReadOnlyCollection FlowComponent.GetChildren() { 21 | return children; 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Layout/Lists/Raw/RawList.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 6 | public class RawList: FlowComponent { 7 | private readonly IReadOnlyCollection children; 8 | 9 | /// 10 | /// Creates a raw list. 11 | /// 12 | /// The items. Do not pass null. 13 | /// The setup object for the list. 14 | public RawList( IEnumerable items, ComponentListSetup setup = null ) { 15 | children = ( setup ?? new ComponentListSetup() ).GetComponents( 16 | ElementClassSet.Empty, 17 | from i in items select i.GetItemAndComponent( ElementClassSet.Empty, null ) ); 18 | } 19 | 20 | IReadOnlyCollection FlowComponent.GetChildren() { 21 | return children; 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Layout/Lists/Stack/StackList.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 6 | public class StackList: FlowComponent { 7 | private readonly IReadOnlyCollection children; 8 | 9 | /// 10 | /// Creates a stack list. 11 | /// 12 | /// The items. Do not pass null. 13 | /// The setup object for the list. 14 | public StackList( IEnumerable items, ComponentListSetup setup = null ) { 15 | children = ( setup ?? new ComponentListSetup() ).GetComponents( 16 | CssElementCreator.StackListClass, 17 | from i in items select i.GetItemAndComponent( ElementClassSet.Empty, null ) ); 18 | } 19 | 20 | IReadOnlyCollection FlowComponent.GetChildren() { 21 | return children; 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Layout/Section/SectionStyle.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 3 | /// 4 | /// A style for a section. 5 | /// 6 | public enum SectionStyle { 7 | /// 8 | /// Normal style. 9 | /// 10 | Normal, 11 | 12 | /// 13 | /// A captioned rectangular area that distinguishes itself from its surroundings. 14 | /// 15 | Box 16 | } 17 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Layout/Tables/CellPlaceholder.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 3 | /// 4 | /// Represents either a cell or the space taken up be a spanning cell. 5 | /// 6 | internal interface CellPlaceholder { 7 | /// 8 | /// Returns null if the cell does not contain simple text (such as a Control). 9 | /// 10 | string SimpleText { get; } 11 | } 12 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Layout/Tables/DataRowLimit.cs: -------------------------------------------------------------------------------- 1 | namespace EnterpriseWebLibrary.EnterpriseWebFramework; 2 | 3 | /// 4 | /// A limit on the number of data rows displayed in a table. 5 | /// 6 | public enum DataRowLimit { 7 | /// 8 | /// Show a max of 50 results. 9 | /// 10 | Fifty = 50, 11 | 12 | /// 13 | /// Show a max of five hundred results. 14 | /// 15 | FiveHundred = 500, 16 | 17 | /// 18 | /// Show all results. 19 | /// 20 | Unlimited = int.MaxValue 21 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Layout/Tables/EwfTableFieldOrItemSetup.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 3 | internal class EwfTableFieldOrItemSetup { 4 | internal readonly ElementClassSet Classes; 5 | internal readonly CssLength Size; 6 | internal readonly TextAlignment TextAlignment; 7 | internal readonly TableCellVerticalAlignment VerticalAlignment; 8 | internal readonly ElementActivationBehavior ActivationBehavior; 9 | 10 | internal EwfTableFieldOrItemSetup( 11 | ElementClassSet classes, CssLength size, TextAlignment textAlignment, TableCellVerticalAlignment verticalAlignment, 12 | ElementActivationBehavior activationBehavior ) { 13 | Classes = classes ?? ElementClassSet.Empty; 14 | Size = size; 15 | TextAlignment = textAlignment; 16 | VerticalAlignment = verticalAlignment; 17 | ActivationBehavior = activationBehavior; 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Layout/Tables/EwfTableStyle.cs: -------------------------------------------------------------------------------- 1 | using JetBrains.Annotations; 2 | 3 | namespace EnterpriseWebLibrary.EnterpriseWebFramework; 4 | 5 | /// 6 | /// A style for a table. 7 | /// 8 | [ PublicAPI ] 9 | public enum EwfTableStyle { 10 | /// 11 | /// None of the standard aspects that are defined by the style sheets. 12 | /// 13 | Raw, 14 | 15 | /// 16 | /// Standard layout, i.e. 100% width and fixed table layout. 17 | /// 18 | StandardLayoutOnly, 19 | 20 | /// 21 | /// Standard non-layout aspects. 22 | /// 23 | StandardExceptLayout, 24 | 25 | /// 26 | /// Fully standard. 27 | /// 28 | Standard 29 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Layout/Tables/SpaceForMultiColOrRowCell.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 3 | internal class SpaceForMultiColOrRowCell: CellPlaceholder { 4 | string CellPlaceholder.SimpleText => ""; 5 | } 6 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Layout/Tables/TableSelectedItemData.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | using System.Collections.Generic; 3 | 4 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 5 | internal class TableSelectedItemData { 6 | internal IReadOnlyCollection Buttons; 7 | internal EwfValidation Validation; 8 | 9 | internal IReadOnlyList<( IReadOnlyCollection buttons, EwfValidation validation, IReadOnlyCollection checkboxes, 10 | List selectedIds )?> ItemGroupData; 11 | } 12 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/MarkupBlockComponent.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | using System.Collections.Generic; 3 | using Tewl.Tools; 4 | 5 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 6 | /// 7 | /// A block of markup. 8 | /// 9 | public sealed class MarkupBlockComponent: FlowComponent { 10 | private readonly IReadOnlyCollection children; 11 | 12 | internal MarkupBlockComponent( string markup ) { 13 | children = new MarkupBlockNode( () => markup ).ToCollection(); 14 | } 15 | 16 | IReadOnlyCollection FlowComponent.GetChildren() { 17 | return children; 18 | } 19 | } 20 | 21 | public static class MarkupBlockComponentExtensionCreators { 22 | /// 23 | /// Creates a component representing this HTML string. 24 | /// 25 | /// Do not pass null. 26 | public static FlowComponent ToComponent( this TrustedHtmlString s ) { 27 | return new MarkupBlockComponent( s.Html ); 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Modal Boxes/ConfirmationDialogId.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 3 | public sealed class ConfirmationDialogId { 4 | internal readonly ModalBoxId ModalBoxId; 5 | 6 | /// 7 | /// Creates a confirmation-dialog ID. 8 | /// 9 | public ConfirmationDialogId() { 10 | ModalBoxId = new ModalBoxId(); 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Modal Boxes/ConfirmationFormAction.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | using System; 3 | using System.Linq; 4 | using Humanizer; 5 | 6 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 7 | /// 8 | /// An action that opens a confirmation dialog box. 9 | /// 10 | public class ConfirmationFormAction: NonPostBackFormAction { 11 | private readonly ConfirmationDialogId dialogId; 12 | 13 | public ConfirmationFormAction( ConfirmationDialogId dialogId ) { 14 | this.dialogId = dialogId; 15 | } 16 | 17 | void FormAction.AddToPageIfNecessary() {} 18 | 19 | string FormAction.GetJsStatements() { 20 | if( !dialogId.ModalBoxId.ElementId.Id.Any() ) 21 | throw new ApplicationException( "The confirmation dialog box must be on the page." ); 22 | return "document.getElementById( '{0}' ).showModal();".FormatWith( dialogId.ModalBoxId.ElementId.Id ); 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Modal Boxes/ModalBoxId.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 3 | public sealed class ModalBoxId { 4 | internal readonly ElementId ElementId; 5 | 6 | /// 7 | /// Creates a modal-box ID. 8 | /// 9 | public ModalBoxId() { 10 | ElementId = new ElementId(); 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/MvcStatics.cs: -------------------------------------------------------------------------------- 1 | using EnterpriseWebLibrary.DataAccess; 2 | using JetBrains.Annotations; 3 | using Microsoft.AspNetCore.Mvc.Filters; 4 | 5 | namespace EnterpriseWebLibrary.EnterpriseWebFramework; 6 | 7 | [ PublicAPI ] 8 | public static class MvcStatics { 9 | private class EwfActionFilterAttribute: IActionFilter { 10 | void IActionFilter.OnActionExecuting( ActionExecutingContext filterContext ) { 11 | DataAccessState.Current.DisableCache(); 12 | } 13 | 14 | void IActionFilter.OnActionExecuted( ActionExecutedContext filterContext ) { 15 | DataAccessState.Current.ResetCache(); 16 | } 17 | } 18 | 19 | // This needs to be updated for ASP.NET Core MVC. 20 | //public static void ConfigureMvc() { 21 | // AreaRegistration.RegisterAllAreas(); 22 | 23 | // GlobalFilters.Filters.Add( new EwfActionFilterAttribute() ); 24 | 25 | // RouteTable.Routes.IgnoreRoute( "{resource}.axd/{*pathInfo}" ); 26 | // RouteTable.Routes.IgnoreRoute( "Ewf/{*path}" ); 27 | //} 28 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/OpenIdProvider/AppOpenIdProviderProvider.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | namespace EnterpriseWebLibrary.EnterpriseWebFramework.OpenIdProvider; 3 | 4 | /// 5 | /// Application-specific OpenID Provider logic. 6 | /// 7 | public abstract class AppOpenIdProviderProvider { 8 | /// 9 | /// Returns a pair of methods for managing the installation’s self-signed certificate, or null if a certificate is not supported. 10 | /// 11 | protected internal virtual ( Func getter, Action updater )? GetCertificateMethods() => null; 12 | 13 | /// 14 | /// Returns the clients that are registered with the OpenID Provider. 15 | /// 16 | protected internal abstract IEnumerable GetClients(); 17 | 18 | /// 19 | /// Authenticates the user for the Authorization Endpoint. 20 | /// 21 | protected internal abstract OpenIdAuthenticationResult AuthenticateUser( string clientIdentifier ); 22 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/OpenIdProvider/OpenIdClient.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | namespace EnterpriseWebLibrary.EnterpriseWebFramework.OpenIdProvider; 3 | 4 | public class OpenIdClient { 5 | public readonly string ClientIdentifier; 6 | public readonly string ClientName; 7 | public readonly IReadOnlyCollection RedirectionUrls; 8 | 9 | /// 10 | /// Creates an OpenID Provider client. 11 | /// 12 | /// The client identifier. Do not pass null or the empty string. 13 | /// The redirection URLs used by the client in authentication requests. 14 | /// The name of the client, which may be displayed to the end-user. Do not pass null. 15 | public OpenIdClient( string clientIdentifier, IReadOnlyCollection redirectionUrls, string clientName = "" ) { 16 | ClientIdentifier = clientIdentifier; 17 | ClientName = clientName.Any() ? clientName : clientIdentifier; 18 | RedirectionUrls = redirectionUrls; 19 | } 20 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/OpenIdProvider/Resources/Keys.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | using EnterpriseWebLibrary.ExternalFunctionality; 3 | 4 | // EwlResource 5 | 6 | namespace EnterpriseWebLibrary.EnterpriseWebFramework.OpenIdProvider.Resources; 7 | 8 | partial class Keys { 9 | protected internal override bool IsIntermediateInstallationPublicResource => true; 10 | 11 | protected override EwfSafeRequestHandler getOrHead() => 12 | new EwfSafeResponseWriter( EwfResponse.CreateFromAspNetMvcAction( ExternalFunctionalityStatics.ExternalOpenIdConnectProvider.WriteKeys ) ); 13 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/OpenIdProvider/Resources/Token.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | using EnterpriseWebLibrary.ExternalFunctionality; 3 | 4 | // EwlResource 5 | 6 | namespace EnterpriseWebLibrary.EnterpriseWebFramework.OpenIdProvider.Resources; 7 | 8 | partial class Token { 9 | protected internal override bool IsIntermediateInstallationPublicResource => true; 10 | 11 | protected override EwfSafeRequestHandler getOrHead() => 12 | new EwfSafeResponseWriter( EwfResponse.CreateFromAspNetMvcAction( ExternalFunctionalityStatics.ExternalOpenIdConnectProvider.WriteTokenResponse ) ); 13 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/OpenIdProvider/Resources/UserInfo.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | using EnterpriseWebLibrary.ExternalFunctionality; 3 | 4 | // EwlResource 5 | 6 | namespace EnterpriseWebLibrary.EnterpriseWebFramework.OpenIdProvider.Resources; 7 | 8 | partial class UserInfo { 9 | protected internal override bool IsIntermediateInstallationPublicResource => true; 10 | 11 | protected override EwfSafeRequestHandler getOrHead() => 12 | new EwfSafeResponseWriter( EwfResponse.CreateFromAspNetMvcAction( ExternalFunctionalityStatics.ExternalOpenIdConnectProvider.WriteUserInfoResponse ) ); 13 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Page Infrastructure/Autofocus/EtherealAutofocusRegion.cs: -------------------------------------------------------------------------------- 1 | using JetBrains.Annotations; 2 | 3 | namespace EnterpriseWebLibrary.EnterpriseWebFramework; 4 | 5 | /// 6 | /// An ethereal component that can be autofocused. 7 | /// 8 | [ PublicAPI ] 9 | public class EtherealAutofocusRegion: EtherealComponent { 10 | internal readonly AutofocusCondition? Condition; 11 | private readonly IReadOnlyCollection children; 12 | 13 | /// 14 | /// Creates an autofocus region. 15 | /// 16 | /// Do not pass null. 17 | /// 18 | public EtherealAutofocusRegion( AutofocusCondition? condition, IReadOnlyCollection children ) { 19 | Condition = condition; 20 | this.children = children; 21 | } 22 | 23 | IReadOnlyCollection EtherealComponent.GetChildren() => children; 24 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Page Infrastructure/Autofocus/FlowAutofocusRegion.cs: -------------------------------------------------------------------------------- 1 | using JetBrains.Annotations; 2 | 3 | namespace EnterpriseWebLibrary.EnterpriseWebFramework; 4 | 5 | /// 6 | /// A flow component that can be autofocused. 7 | /// 8 | [ PublicAPI ] 9 | public class FlowAutofocusRegion: FlowComponent { 10 | internal readonly AutofocusCondition? Condition; 11 | private readonly IReadOnlyCollection children; 12 | 13 | /// 14 | /// Creates an autofocus region. 15 | /// 16 | /// Do not pass null. 17 | /// 18 | public FlowAutofocusRegion( AutofocusCondition? condition, IReadOnlyCollection children ) { 19 | Condition = condition; 20 | this.children = children; 21 | } 22 | 23 | IReadOnlyCollection FlowComponent.GetChildren() => children; 24 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Page Infrastructure/Data Modification/DataUpdateAction.cs: -------------------------------------------------------------------------------- 1 | namespace EnterpriseWebLibrary.EnterpriseWebFramework; 2 | 3 | public class DataUpdateAction: DataModificationAction, ValidationList { 4 | public static implicit operator DataModificationActionsParameter( DataUpdateAction action ) => new( [ action ] ); 5 | 6 | internal readonly BasicDataModificationAction Action; 7 | 8 | internal DataUpdateAction( BasicDataModificationAction dataModificationAction ) { 9 | Action = dataModificationAction; 10 | } 11 | 12 | void ValidationList.AddValidation( EwfValidation validation ) { 13 | Action.AddValidation( validation ); 14 | } 15 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Page Infrastructure/Data Modification/ValidationList.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 3 | internal interface ValidationList { 4 | void AddValidation( EwfValidation validation ); 5 | } 6 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Page Infrastructure/Form Setup/FormAction.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 3 | /// 4 | /// An action triggered by a form control or button. 5 | /// 6 | public interface FormAction { 7 | void AddToPageIfNecessary(); 8 | string GetJsStatements(); 9 | } 10 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Page Infrastructure/Form Setup/NonPostBackFormAction.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 3 | /// 4 | /// A form action that is not a post-back. 5 | /// 6 | public interface NonPostBackFormAction: FormAction {} 7 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Page Infrastructure/Form Submission/PageReloadBehavior.cs: -------------------------------------------------------------------------------- 1 | namespace EnterpriseWebLibrary.EnterpriseWebFramework; 2 | 3 | public class PageReloadBehavior { 4 | internal string FocusKey { get; } 5 | internal SecondaryResponse? SecondaryResponse { get; } 6 | 7 | /// 8 | /// Creates a behavior. 9 | /// 10 | /// The focus key, which you can use to autofocus on a region of the reloaded page by referencing the key from autofocus conditions. Do 11 | /// not pass null. Pass the empty string for no autofocus. 12 | /// A secondary response, which will load in a new window/tab or as an attachment. 13 | public PageReloadBehavior( string focusKey = "", SecondaryResponse? secondaryResponse = null ) { 14 | FocusKey = focusKey; 15 | SecondaryResponse = secondaryResponse; 16 | } 17 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Page Infrastructure/Identified Components/IdentifiedEtherealComponent.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | using System; 3 | 4 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 5 | internal class IdentifiedEtherealComponent: EtherealComponentOrElement { 6 | internal readonly Func> ComponentDataGetter; 7 | 8 | internal IdentifiedEtherealComponent( Func> componentDataGetter ) { 9 | ComponentDataGetter = componentDataGetter; 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Page Infrastructure/Identified Components/IdentifiedFlowComponent.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | using System; 3 | 4 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 5 | internal class IdentifiedFlowComponent: FlowComponentOrNode { 6 | internal readonly Func> ComponentDataGetter; 7 | 8 | internal IdentifiedFlowComponent( Func> componentDataGetter ) { 9 | ComponentDataGetter = componentDataGetter; 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Page Infrastructure/Page Structure/Components/EtherealComponent.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | using System.Collections.Generic; 3 | 4 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 5 | public interface EtherealComponent: EtherealComponentOrElement { 6 | IReadOnlyCollection GetChildren(); 7 | } 8 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Page Infrastructure/Page Structure/Components/EtherealComponentOrElement.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 3 | public interface EtherealComponentOrElement: PageComponent {} 4 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Page Infrastructure/Page Structure/Components/FlowComponent.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | using System.Collections.Generic; 3 | 4 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 5 | public interface FlowComponent: FlowComponentOrNode { 6 | IReadOnlyCollection GetChildren(); 7 | } 8 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Page Infrastructure/Page Structure/Components/FlowComponentOrNode.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 3 | public interface FlowComponentOrNode: PageComponent {} 4 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Page Infrastructure/Page Structure/Components/PageComponent.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 6 | public interface PageComponent {} 7 | 8 | public static class PageComponentExtensionCreators { 9 | /// 10 | /// Concatenates page components. 11 | /// 12 | public static IEnumerable Concat( this ComponentType first, IEnumerable second ) 13 | where ComponentType: PageComponent => 14 | second.Prepend( first ); 15 | 16 | /// 17 | /// Returns a sequence of two page components. 18 | /// 19 | public static IEnumerable Append( this ComponentType first, ComponentType second ) where ComponentType: PageComponent => 20 | Enumerable.Empty().Append( first ).Append( second ); 21 | } 22 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Page Infrastructure/Page Structure/ErrorSourceSet.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | using System.Collections.Generic; 3 | using System.Collections.Immutable; 4 | 5 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 6 | /// 7 | /// A set of data-modification error sources. 8 | /// 9 | public sealed class ErrorSourceSet { 10 | internal IReadOnlyCollection Validations { get; } 11 | internal bool IncludeGeneralErrors { get; } 12 | 13 | /// 14 | /// Creates an error-source set. 15 | /// 16 | public ErrorSourceSet( IEnumerable validations = null, bool includeGeneralErrors = false ) { 17 | Validations = validations?.ToImmutableArray() ?? ImmutableArray.Empty; 18 | IncludeGeneralErrors = includeGeneralErrors; 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Page Infrastructure/Page Structure/FocusabilityCondition.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 3 | /// 4 | /// A condition that determines whether an element is focusable. 5 | /// 6 | public sealed class FocusabilityCondition { 7 | internal bool IsNormallyFocusable { get; } 8 | internal ErrorSourceSet ErrorFocusabilitySources { get; } 9 | 10 | public FocusabilityCondition( bool isNormallyFocusable, ErrorSourceSet errorFocusabilitySources = null ) { 11 | IsNormallyFocusable = isNormallyFocusable; 12 | ErrorFocusabilitySources = errorFocusabilitySources ?? new ErrorSourceSet(); 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Page Infrastructure/Page Structure/Form Data/PostBackValue.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 3 | /// 4 | /// A post-back value. 5 | /// 6 | public sealed class PostBackValue { 7 | private readonly T value; 8 | private readonly bool changedOnPostBack; 9 | 10 | /// 11 | /// Creates a post-back value. 12 | /// 13 | /// The value. 14 | /// Pass true if the value changed on this post back. 15 | public PostBackValue( T value, bool changedOnPostBack ) { 16 | this.value = value; 17 | this.changedOnPostBack = changedOnPostBack; 18 | } 19 | 20 | /// 21 | /// Gets the value. 22 | /// 23 | public T Value { get { return value; } } 24 | 25 | /// 26 | /// Gets whether the value changed on this post back. 27 | /// 28 | public bool ChangedOnPostBack { get { return changedOnPostBack; } } 29 | } 30 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Page Infrastructure/Page Structure/Form Data/PostBackValueValidationResult.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 3 | internal class PostBackValueValidationResult { 4 | internal static PostBackValueValidationResult CreateInvalid() { 5 | return new PostBackValueValidationResult( false ); 6 | } 7 | 8 | internal static PostBackValueValidationResult CreateValid( T value ) { 9 | return new PostBackValueValidationResult( true, value ); 10 | } 11 | 12 | private readonly bool isValid; 13 | private readonly T value; 14 | 15 | private PostBackValueValidationResult( bool isValid, T value = default( T ) ) { 16 | this.isValid = isValid; 17 | this.value = value; 18 | } 19 | 20 | internal bool IsValid { get { return isValid; } } 21 | internal T Value { get { return value; } } 22 | } 23 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Page Infrastructure/Page Structure/Nodes/ElementContext.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 3 | public sealed class ElementContext { 4 | /// 5 | /// The generated ID for the element. 6 | /// 7 | public readonly string Id; 8 | 9 | internal ElementContext( string id ) { 10 | Id = id; 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Page Infrastructure/Page Structure/Nodes/ElementNode.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | using System; 3 | 4 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 5 | internal sealed class ElementNode: FlowComponentOrNode, EtherealComponentOrElement { 6 | internal readonly Func ElementDataGetter; 7 | internal readonly FormValue FormValue; 8 | 9 | public ElementNode( Func elementDataGetter, FormValue formValue = null ) { 10 | ElementDataGetter = elementDataGetter; 11 | FormValue = formValue; 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Page Infrastructure/Page Structure/Nodes/MarkupBlockNode.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | using System; 3 | 4 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 5 | internal sealed class MarkupBlockNode: FlowComponentOrNode { 6 | internal readonly Func MarkupGetter; 7 | 8 | public MarkupBlockNode( Func markupGetter ) { 9 | MarkupGetter = markupGetter; 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Page Infrastructure/Page Structure/Nodes/TextNode.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | using System; 3 | 4 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 5 | internal sealed class TextNode: FlowComponentOrNode { 6 | internal readonly Func TextGetter; 7 | 8 | public TextNode( Func textGetter ) { 9 | TextGetter = textGetter; 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Page Infrastructure/PageContent.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 3 | public abstract class PageContent { 4 | protected internal abstract PageContent GetContent(); 5 | } 6 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Page Infrastructure/Partial Updating/PreModificationUpdateRegion.cs: -------------------------------------------------------------------------------- 1 | namespace EnterpriseWebLibrary.EnterpriseWebFramework; 2 | 3 | internal class PreModificationUpdateRegion { 4 | internal readonly UpdateRegionSetsParameter? Sets; 5 | internal readonly Func> ComponentGetter; 6 | internal readonly Func ArgumentGetter; 7 | 8 | internal PreModificationUpdateRegion( UpdateRegionSetsParameter? sets, Func> componentGetter, Func argumentGetter ) { 9 | Sets = sets; 10 | ComponentGetter = componentGetter; 11 | ArgumentGetter = argumentGetter; 12 | } 13 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Page Infrastructure/Partial Updating/UpdateRegionLinker.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | using System; 3 | using System.Collections.Generic; 4 | 5 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 6 | internal class UpdateRegionLinker { 7 | internal readonly string KeySuffix; 8 | internal readonly IEnumerable PreModificationRegions; 9 | internal readonly Func> PostModificationRegionGetter; 10 | 11 | internal UpdateRegionLinker( 12 | string keySuffix, IEnumerable preModificationRegions, 13 | Func> postModificationRegionGetter ) { 14 | KeySuffix = keySuffix; 15 | PreModificationRegions = preModificationRegions; 16 | PostModificationRegionGetter = postModificationRegionGetter; 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Page Infrastructure/PreBuiltResponse.cs: -------------------------------------------------------------------------------- 1 | using EnterpriseWebLibrary.EnterpriseWebFramework.PageInfrastructure; 2 | 3 | // EwlResource 4 | // Parameter: uint responseId 5 | // Parameter: string secret 6 | 7 | namespace EnterpriseWebLibrary.EnterpriseWebFramework; 8 | 9 | partial class PreBuiltResponse { 10 | private FullResponse? response; 11 | 12 | protected override void init() { 13 | response = SecondaryResponseDataStore.GetResponse( ResponseId, Secret ); 14 | } 15 | 16 | protected override AlternativeResourceMode? createAlternativeMode() => response is null ? new DisabledResourceMode( "There is no response to send." ) : null; 17 | 18 | protected override UrlHandler getUrlParent() => new Admin.EntitySetup(); 19 | 20 | public override ConnectionSecurity ConnectionSecurity => ConnectionSecurity.MatchingCurrentRequest; 21 | 22 | protected override EwfSafeRequestHandler getOrHead() => new EwfSafeResponseWriter( new EwfResponse( response ) ); 23 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Page Infrastructure/StatusMessageType.cs: -------------------------------------------------------------------------------- 1 | namespace EnterpriseWebLibrary.EnterpriseWebFramework; 2 | 3 | /// 4 | /// Defines whether a status message shows information or a warning. 5 | /// 6 | public enum StatusMessageType { 7 | /// 8 | /// An informational message. 9 | /// 10 | Info, 11 | 12 | /// 13 | /// A warning message. 14 | /// 15 | Warning 16 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/PaymentProcessing/StatusMessageAndDestination.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 3 | public class StatusMessageAndDestination { 4 | private readonly string message; 5 | private readonly ResourceInfo destination; 6 | 7 | /// 8 | /// Creates a StatusMessageAndDestination. 9 | /// 10 | /// The status message. Do not pass null. 11 | /// The resource to which the user will be redirected. Pass null for no redirection. 12 | public StatusMessageAndDestination( string message, ResourceInfo destination ) { 13 | this.message = message; 14 | this.destination = destination; 15 | } 16 | 17 | internal string Message { get { return message; } } 18 | internal ResourceInfo Destination { get { return destination; } } 19 | } 20 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Request Dispatching/ErrorPages/ErrorPageContent.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | using JetBrains.Annotations; 3 | 4 | namespace EnterpriseWebLibrary.EnterpriseWebFramework.ErrorPages { 5 | public class ErrorPageContent: PageContent { 6 | private static readonly ElementClass elementClass = new( "ewfError" ); 7 | 8 | [ UsedImplicitly ] 9 | private class CssElementCreator: ControlCssElementCreator { 10 | IReadOnlyCollection ControlCssElementCreator.CreateCssElements() => 11 | new CssElement( "ErrorPageBody", "body.{0}".FormatWith( elementClass.ClassName ) ).ToCollection(); 12 | } 13 | 14 | private readonly BasicPageContent basicContent; 15 | 16 | public ErrorPageContent( IReadOnlyCollection content, ElementClassSet bodyClasses = null ) { 17 | basicContent = new BasicPageContent( bodyClasses: elementClass.Add( bodyClasses ?? ElementClassSet.Empty ) ).Add( content ); 18 | } 19 | 20 | protected internal override PageContent GetContent() => basicContent; 21 | } 22 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Request Dispatching/ErrorPages/LogInSessionExpired.cs: -------------------------------------------------------------------------------- 1 | // EwlPage 2 | 3 | namespace EnterpriseWebLibrary.EnterpriseWebFramework.ErrorPages; 4 | 5 | partial class LogInSessionExpired { 6 | protected internal override bool IsIntermediateInstallationPublicResource => true; 7 | protected override UrlHandler getUrlParent() => new Admin.EntitySetup(); 8 | 9 | protected override PageContent getContent() => 10 | new ErrorPageContent( new Paragraph( "Your log-in attempt took too long. Please try logging in again.".ToComponents() ).ToCollection() ); 11 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Request Dispatching/ErrorPages/ResourceDisabled.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | // EwlPage 3 | // Parameter: string message 4 | 5 | namespace EnterpriseWebLibrary.EnterpriseWebFramework.ErrorPages; 6 | 7 | partial class ResourceDisabled { 8 | protected internal override bool IsIntermediateInstallationPublicResource => true; 9 | protected override UrlHandler getUrlParent() => new Admin.EntitySetup(); 10 | public override ConnectionSecurity ConnectionSecurity => ConnectionSecurity.MatchingCurrentRequest; 11 | 12 | protected override PageContent getContent() => 13 | new ErrorPageContent( 14 | new Paragraph( Message.Length > 0 ? Message.ToComponents() : Translation.ThePageYouRequestedIsDisabled.ToComponents() ).ToCollection() ); 15 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Request Handling/AppResourceSerializationProvider.cs: -------------------------------------------------------------------------------- 1 | namespace EnterpriseWebLibrary.EnterpriseWebFramework; 2 | 3 | /// 4 | /// Application-specific logic for JSON serialization of resources. 5 | /// 6 | public interface AppResourceSerializationProvider { 7 | ( string name, string parameters )? SerializeResource( ResourceBase resource ); 8 | ResourceBase? DeserializeResource( string name, string parameters ); 9 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Request Handling/ExternalRedirect.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 3 | /// 4 | /// An HTTP redirect to an external resource. 5 | /// 6 | public sealed class ExternalRedirect { 7 | internal ExternalResource Resource; 8 | internal bool IsPermanent; 9 | 10 | /// 11 | /// Creates an external redirect. 12 | /// 13 | /// The external resource. Do not pass null. 14 | /// Pass true to use HTTP 308 (Permanent Redirect) instead of HTTP 307 (Temporary Redirect). 15 | public ExternalRedirect( ExternalResource resource, bool isPermanent ) { 16 | Resource = resource; 17 | IsPermanent = isPermanent; 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Request Handling/ResourceGroup.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 3 | /// 4 | /// A group of resources. 5 | /// 6 | public class ResourceGroup { 7 | private readonly string name; 8 | private readonly ResourceBase[] resources; 9 | 10 | /// 11 | /// Creates a resource group. 12 | /// 13 | public ResourceGroup( string name, params ResourceBase[] resources ) { 14 | this.name = name; 15 | this.resources = resources; 16 | } 17 | 18 | /// 19 | /// Creates a resource group. 20 | /// 21 | public ResourceGroup( params ResourceBase[] resources ): this( "", resources ) {} 22 | 23 | /// 24 | /// Gets the name of the resource group. 25 | /// 26 | public string Name { get { return name; } } 27 | 28 | /// 29 | /// Gets the list of resources. 30 | /// 31 | public ResourceBase[] Resources { get { return resources; } } 32 | } 33 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Request Handling/SystemResourceSerializationProvider.cs: -------------------------------------------------------------------------------- 1 | namespace EnterpriseWebLibrary.EnterpriseWebFramework; 2 | 3 | /// 4 | /// System-specific logic for JSON serialization of resources. 5 | /// 6 | public interface SystemResourceSerializationProvider { 7 | ( string name, string parameters )? SerializeResource( ResourceBase resource ); 8 | ResourceBase? DeserializeResource( string name, string parameters ); 9 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Request Handling/WellKnownUrlHandling/WellKnownUrl.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | namespace EnterpriseWebLibrary.EnterpriseWebFramework.WellKnownUrlHandling; 3 | 4 | public class WellKnownUrl { 5 | internal readonly string SuffixSegment; 6 | internal readonly Func GetOrHeadHandlerGetter; 7 | 8 | public WellKnownUrl( string suffixSegment, Func getOrHeadHandlerGetter ) { 9 | SuffixSegment = suffixSegment; 10 | GetOrHeadHandlerGetter = getOrHeadHandlerGetter; 11 | } 12 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Static File Handling/AppStaticFileHandlingProvider.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 3 | /// 4 | /// Application-specific logic for static-file handling. 5 | /// 6 | public class AppStaticFileHandlingProvider { 7 | /// 8 | /// Gets the Internet media type overrides for the application, which are used when serving static files. Do not return null. 9 | /// 10 | protected internal virtual IEnumerable GetMediaTypeOverrides() => Enumerable.Empty(); 11 | } 12 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Static File Handling/FrameworkStaticFilesFolderSetup.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | namespace EnterpriseWebLibrary.EnterpriseWebFramework.StaticFiles { 3 | partial class FolderSetup { 4 | protected override UrlHandler getUrlParent() => new Admin.EntitySetup(); 5 | } 6 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/StaticFiles/instant-page.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enduracode/enterprise-web-library/e48feb24f3a9a5671db78f59cd63c62a7538d8ac/Core/EnterpriseWebFramework/StaticFiles/instant-page.js -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/StaticFiles/styles/ui/fonts.css: -------------------------------------------------------------------------------- 1 | body, 2 | ewfTableItemGroupNameAndGeneralActionContainer > ewfTableActionListContainer { 3 | font-family: 'Open Sans', sans-serif; 4 | } 5 | 6 | ewfPagePathContainer, 7 | ewfSectionNormalStyleBothStates > ewfSectionHeadingContainer > ewfSectionHeading, 8 | ewfActionComponentLargeButtonStyleAllStates, 9 | ewfTableStandardAndStandardExceptLayoutStyles > caption, 10 | ewfTableStandardAndStandardExceptLayoutStyles > ewfTheadAndTfootAndTbody > ewfTrAllStates > ewfTh { 11 | font-family: 'Libre Franklin', sans-serif; 12 | } 13 | 14 | body.ewfDiagnosticLog samp { 15 | font-family: 'Roboto Mono', monospace; 16 | } 17 | 18 | ewfTopWarningContainer ewfActionComponentAllStylesAllStates { 19 | text-transform: uppercase; 20 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/StaticFiles/styles/ui/newUI.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --default-border-radius: .5em; 3 | --default-form-color: #ccc; 4 | } 5 | 6 | /*******************/ 7 | /* BREADCRUMBS 8 | /*******************/ 9 | .breadcrumbHome { 10 | width: 1vw; 11 | opacity: .5; 12 | transition: opacity .2s; 13 | } 14 | 15 | .breadcrumbHome:hover { 16 | opacity: 1; 17 | } 18 | 19 | 20 | /* TABLET */ 21 | @media only screen and (max-width: 1200px) { 22 | .breadcrumbHome { 23 | width: 1.5vw; 24 | } 25 | } 26 | 27 | /* MOBILE */ 28 | @media only screen and (max-width: 768px) { 29 | .breadcrumbHome { 30 | width: 4vw; 31 | } 32 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/StaticFiles/ui/home-icon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/StaticFiles/versioned/third-party/ReadMe.txt: -------------------------------------------------------------------------------- 1 | We've placed several third-party components in version-specific folders because they self-reference their files from within CSS, and there's no way we can 2 | append time stamps to those requests to force new versions to be downloaded. -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/StaticFiles/versioned/third-party/chosen/chosen_v1.8.7/chosen-sprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enduracode/enterprise-web-library/e48feb24f3a9a5671db78f59cd63c62a7538d8ac/Core/EnterpriseWebFramework/StaticFiles/versioned/third-party/chosen/chosen_v1.8.7/chosen-sprite.png -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/StaticFiles/versioned/third-party/chosen/chosen_v1.8.7/chosen-sprite@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enduracode/enterprise-web-library/e48feb24f3a9a5671db78f59cd63c62a7538d8ac/Core/EnterpriseWebFramework/StaticFiles/versioned/third-party/chosen/chosen_v1.8.7/chosen-sprite@2x.png -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/StaticFiles/versioned/third-party/jquery-ui/ReadMe.txt: -------------------------------------------------------------------------------- 1 | jQuery UI Components 2 | Widgets: Autocomplete 3 | Effects: Effects Core (for toggleClass animation) 4 | 5 | Use the Smoothness theme since it is visually compatible with most other designs. This is important since EWF apps could be using the default EWF UI theme, a custom theme, or not using the EWF UI at all. -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/StaticFiles/versioned/third-party/jquery-ui/jquery-ui-1.13.2.custom-v2/images/ui-bg_glass_55_fbf9ee_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enduracode/enterprise-web-library/e48feb24f3a9a5671db78f59cd63c62a7538d8ac/Core/EnterpriseWebFramework/StaticFiles/versioned/third-party/jquery-ui/jquery-ui-1.13.2.custom-v2/images/ui-bg_glass_55_fbf9ee_1x400.png -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/StaticFiles/versioned/third-party/jquery-ui/jquery-ui-1.13.2.custom-v2/images/ui-bg_glass_65_ffffff_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enduracode/enterprise-web-library/e48feb24f3a9a5671db78f59cd63c62a7538d8ac/Core/EnterpriseWebFramework/StaticFiles/versioned/third-party/jquery-ui/jquery-ui-1.13.2.custom-v2/images/ui-bg_glass_65_ffffff_1x400.png -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/StaticFiles/versioned/third-party/jquery-ui/jquery-ui-1.13.2.custom-v2/images/ui-bg_glass_75_dadada_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enduracode/enterprise-web-library/e48feb24f3a9a5671db78f59cd63c62a7538d8ac/Core/EnterpriseWebFramework/StaticFiles/versioned/third-party/jquery-ui/jquery-ui-1.13.2.custom-v2/images/ui-bg_glass_75_dadada_1x400.png -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/StaticFiles/versioned/third-party/jquery-ui/jquery-ui-1.13.2.custom-v2/images/ui-bg_glass_75_e6e6e6_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enduracode/enterprise-web-library/e48feb24f3a9a5671db78f59cd63c62a7538d8ac/Core/EnterpriseWebFramework/StaticFiles/versioned/third-party/jquery-ui/jquery-ui-1.13.2.custom-v2/images/ui-bg_glass_75_e6e6e6_1x400.png -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/StaticFiles/versioned/third-party/jquery-ui/jquery-ui-1.13.2.custom-v2/images/ui-bg_glass_95_fef1ec_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enduracode/enterprise-web-library/e48feb24f3a9a5671db78f59cd63c62a7538d8ac/Core/EnterpriseWebFramework/StaticFiles/versioned/third-party/jquery-ui/jquery-ui-1.13.2.custom-v2/images/ui-bg_glass_95_fef1ec_1x400.png -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/StaticFiles/versioned/third-party/jquery-ui/jquery-ui-1.13.2.custom-v2/images/ui-bg_highlight-soft_75_cccccc_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enduracode/enterprise-web-library/e48feb24f3a9a5671db78f59cd63c62a7538d8ac/Core/EnterpriseWebFramework/StaticFiles/versioned/third-party/jquery-ui/jquery-ui-1.13.2.custom-v2/images/ui-bg_highlight-soft_75_cccccc_1x100.png -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/StaticFiles/versioned/third-party/jquery-ui/jquery-ui-1.13.2.custom-v2/images/ui-icons_222222_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enduracode/enterprise-web-library/e48feb24f3a9a5671db78f59cd63c62a7538d8ac/Core/EnterpriseWebFramework/StaticFiles/versioned/third-party/jquery-ui/jquery-ui-1.13.2.custom-v2/images/ui-icons_222222_256x240.png -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/StaticFiles/versioned/third-party/jquery-ui/jquery-ui-1.13.2.custom-v2/images/ui-icons_2e83ff_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enduracode/enterprise-web-library/e48feb24f3a9a5671db78f59cd63c62a7538d8ac/Core/EnterpriseWebFramework/StaticFiles/versioned/third-party/jquery-ui/jquery-ui-1.13.2.custom-v2/images/ui-icons_2e83ff_256x240.png -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/StaticFiles/versioned/third-party/jquery-ui/jquery-ui-1.13.2.custom-v2/images/ui-icons_454545_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enduracode/enterprise-web-library/e48feb24f3a9a5671db78f59cd63c62a7538d8ac/Core/EnterpriseWebFramework/StaticFiles/versioned/third-party/jquery-ui/jquery-ui-1.13.2.custom-v2/images/ui-icons_454545_256x240.png -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/StaticFiles/versioned/third-party/jquery-ui/jquery-ui-1.13.2.custom-v2/images/ui-icons_888888_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enduracode/enterprise-web-library/e48feb24f3a9a5671db78f59cd63c62a7538d8ac/Core/EnterpriseWebFramework/StaticFiles/versioned/third-party/jquery-ui/jquery-ui-1.13.2.custom-v2/images/ui-icons_888888_256x240.png -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/StaticFiles/versioned/third-party/jquery-ui/jquery-ui-1.13.2.custom-v2/images/ui-icons_cd0a0a_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enduracode/enterprise-web-library/e48feb24f3a9a5671db78f59cd63c62a7538d8ac/Core/EnterpriseWebFramework/StaticFiles/versioned/third-party/jquery-ui/jquery-ui-1.13.2.custom-v2/images/ui-icons_cd0a0a_256x240.png -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/StaticFiles/versioned/ui/account-v1.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 8 | 10 | 11 | -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/StaticFiles/versioned/ui/arrow-v1.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 9 | 10 | 11 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/StaticFiles/versioned/ui/menu-icon-v1.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 8 | 10 | 11 | -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Text/LineBreak.cs: -------------------------------------------------------------------------------- 1 | using JetBrains.Annotations; 2 | 3 | namespace EnterpriseWebLibrary.EnterpriseWebFramework; 4 | 5 | /// 6 | /// A line break. 7 | /// 8 | [ PublicAPI ] 9 | public sealed class LineBreak: PhrasingComponent { 10 | private readonly IReadOnlyCollection children; 11 | 12 | /// 13 | /// Creates a line break. 14 | /// 15 | public LineBreak() { 16 | children = new ElementComponent( _ => new ElementData( () => new ElementLocalData( "br" ) ) ).ToCollection(); 17 | } 18 | 19 | IReadOnlyCollection FlowComponent.GetChildren() => children; 20 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Text/LineBreakOpportunity.cs: -------------------------------------------------------------------------------- 1 | using JetBrains.Annotations; 2 | 3 | namespace EnterpriseWebLibrary.EnterpriseWebFramework; 4 | 5 | /// 6 | /// A line break opportunity. 7 | /// 8 | [ PublicAPI ] 9 | public sealed class LineBreakOpportunity: PhrasingComponent { 10 | private readonly IReadOnlyCollection children; 11 | 12 | /// 13 | /// Creates a line break opportunity. 14 | /// 15 | public LineBreakOpportunity() { 16 | children = new ElementComponent( _ => new ElementData( () => new ElementLocalData( "wbr" ) ) ).ToCollection(); 17 | } 18 | 19 | IReadOnlyCollection FlowComponent.GetChildren() => children; 20 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Ui/Entity/TabMode.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 3 | /// 4 | /// Affects how tabs (if any) are displayed. 5 | /// 6 | public enum TabMode { 7 | /// 8 | /// Intelligently decides whether to use horizontal or vertical tabs based on the number of tabs and the presence of tab groups. 9 | /// 10 | Automatic, 11 | 12 | /// 13 | /// Forces horizontal tabs. Cannot be used when tab groups exist. 14 | /// 15 | Horizontal, 16 | 17 | /// 18 | /// Forces vertical tabs. 19 | /// 20 | Vertical 21 | } 22 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Ui/Entity/UiEntitySetup.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | namespace EnterpriseWebLibrary.EnterpriseWebFramework { 3 | /// 4 | /// User-interface logic for an entity setup. 5 | /// 6 | public interface UiEntitySetup { 7 | /// 8 | /// Returns the UI setup object for the entity. 9 | /// 10 | EntityUiSetup GetUiSetup(); 11 | } 12 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/Ui/EwfUiStatics.cs: -------------------------------------------------------------------------------- 1 | using EnterpriseWebLibrary.SystemSpecificLogic; 2 | 3 | namespace EnterpriseWebLibrary.EnterpriseWebFramework.Ui; 4 | 5 | internal static class EwfUiStatics { 6 | private static SystemProviderReference? provider; 7 | internal static Func>? UserInfoComponentGetter { get; private set; } 8 | 9 | internal static void Init( SystemProviderReference provider, Func> userInfoComponentGetter ) { 10 | EwfUiStatics.provider = provider; 11 | UserInfoComponentGetter = userInfoComponentGetter; 12 | } 13 | 14 | internal static AppEwfUiProvider AppProvider => provider!.GetProvider()!; 15 | } -------------------------------------------------------------------------------- /Core/EnterpriseWebFramework/UserManagement/LogInException.cs: -------------------------------------------------------------------------------- 1 | namespace EnterpriseWebLibrary.EnterpriseWebFramework.UserManagement; 2 | 3 | internal class LogInException: Exception; -------------------------------------------------------------------------------- /Core/ExternalFunctionality/ExternalMySqlProvider.cs: -------------------------------------------------------------------------------- 1 | using System.Data.Common; 2 | using FluentMigrator.Runner; 3 | 4 | namespace EnterpriseWebLibrary.ExternalFunctionality; 5 | 6 | /// 7 | /// External MySQL logic. 8 | /// 9 | public interface ExternalMySqlProvider { 10 | DbProviderFactory GetDbProviderFactory(); 11 | 12 | void RegisterDependencyInjectionServicesForMigration( IMigrationRunnerBuilder builder ); 13 | } -------------------------------------------------------------------------------- /Core/ExternalFunctionality/ExternalOracleDatabaseProvider.cs: -------------------------------------------------------------------------------- 1 | using System.Data.Common; 2 | using FluentMigrator.Runner; 3 | 4 | namespace EnterpriseWebLibrary.ExternalFunctionality; 5 | 6 | /// 7 | /// External Oracle Database logic. 8 | /// 9 | public interface ExternalOracleDatabaseProvider { 10 | DbConnection CreateConnection( string connectionString, bool allowVersion11Authentication ); 11 | 12 | DbCommand CreateCommand(); 13 | 14 | DbParameter CreateParameter(); 15 | 16 | string GetDbTypeString( object databaseSpecificType ); 17 | 18 | void SetParameterType( DbParameter parameter, string dbTypeString ); 19 | 20 | void RegisterDependencyInjectionServicesForMigration( IMigrationRunnerBuilder builder ); 21 | } -------------------------------------------------------------------------------- /Core/ExternalFunctionality/ExternalPdfProvider.cs: -------------------------------------------------------------------------------- 1 | namespace EnterpriseWebLibrary.ExternalFunctionality; 2 | 3 | /// 4 | /// External PDF logic. 5 | /// 6 | public interface ExternalPdfProvider { 7 | /// 8 | /// Initializes the provider. 9 | /// 10 | void InitStatics( string asposePdfLicensePath ); 11 | } -------------------------------------------------------------------------------- /Core/ExternalFunctionality/ExternalWordProvider.cs: -------------------------------------------------------------------------------- 1 | namespace EnterpriseWebLibrary.ExternalFunctionality; 2 | 3 | /// 4 | /// External Word document logic. 5 | /// 6 | public interface ExternalWordProvider { 7 | /// 8 | /// Initializes the provider. 9 | /// 10 | void InitStatics( string asposeWordsLicensePath ); 11 | } -------------------------------------------------------------------------------- /Core/IisConfigurationStatics.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Web.Administration; 2 | 3 | namespace EnterpriseWebLibrary; 4 | 5 | internal static class IisConfigurationStatics { 6 | internal static void ExecuteInServerManagerTransaction( Action method ) { 7 | using var serverManager = new ServerManager(); 8 | method( serverManager ); 9 | serverManager.CommitChanges(); 10 | } 11 | } -------------------------------------------------------------------------------- /Core/InstallationFileStatics.cs: -------------------------------------------------------------------------------- 1 | namespace EnterpriseWebLibrary { 2 | /// 3 | /// Installation Support Utility and internal use only. 4 | /// 5 | public static class InstallationFileStatics { 6 | /// 7 | /// Development Utility and internal use only. 8 | /// 9 | public const string WebFrameworkStaticFilesFolderName = "Web Framework Static Files"; 10 | 11 | /// 12 | /// Development Utility and internal use only. 13 | /// 14 | public const string FilesFolderName = "Files"; 15 | 16 | /// 17 | /// Installation Support Utility and internal use only. 18 | /// 19 | public static string GetGeneralFilesFolderPath( string installationPath, bool isDevelopmentInstallation ) { 20 | if( isDevelopmentInstallation ) 21 | return EwlStatics.CombinePaths( installationPath, "Library" ); 22 | return installationPath; 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /Core/InstallationSupportUtility/InstallationModel/DevelopmentInstallation.cs: -------------------------------------------------------------------------------- 1 | namespace EnterpriseWebLibrary.InstallationSupportUtility.InstallationModel { 2 | public interface DevelopmentInstallation: ExistingInstallation { 3 | DevelopmentInstallationLogic DevelopmentInstallationLogic { get; } 4 | int CurrentMajorVersion { get; } 5 | int NextBuildNumber { get; } 6 | } 7 | } -------------------------------------------------------------------------------- /Core/InstallationSupportUtility/InstallationModel/ExistingInstallation.cs: -------------------------------------------------------------------------------- 1 | namespace EnterpriseWebLibrary.InstallationSupportUtility.InstallationModel { 2 | public interface ExistingInstallation: Installation { 3 | ExistingInstallationLogic ExistingInstallationLogic { get; } 4 | } 5 | } -------------------------------------------------------------------------------- /Core/InstallationSupportUtility/InstallationModel/ExistingInstalledInstallation.cs: -------------------------------------------------------------------------------- 1 | namespace EnterpriseWebLibrary.InstallationSupportUtility.InstallationModel { 2 | public interface ExistingInstalledInstallation: ExistingInstallation { 3 | ExistingInstalledInstallationLogic ExistingInstalledInstallationLogic { get; } 4 | } 5 | } -------------------------------------------------------------------------------- /Core/InstallationSupportUtility/InstallationModel/Installation.cs: -------------------------------------------------------------------------------- 1 | namespace EnterpriseWebLibrary.InstallationSupportUtility.InstallationModel { 2 | public interface Installation { 3 | string LatestFullName { get; } 4 | string LatestFullShortName { get; } 5 | GeneralInstallationLogic GeneralLogic { get; } 6 | } 7 | } -------------------------------------------------------------------------------- /Core/InstallationSupportUtility/InstallationModel/KnownInstallation.cs: -------------------------------------------------------------------------------- 1 | namespace EnterpriseWebLibrary.InstallationSupportUtility.InstallationModel { 2 | public interface KnownInstallation: Installation { 3 | int Id { get; } 4 | KnownSystemLogic KnownSystemLogic { get; } 5 | } 6 | } -------------------------------------------------------------------------------- /Core/InstallationSupportUtility/InstallationModel/KnownInstalledInstallation.cs: -------------------------------------------------------------------------------- 1 | namespace EnterpriseWebLibrary.InstallationSupportUtility.InstallationModel { 2 | public interface KnownInstalledInstallation: KnownInstallation { 3 | KnownInstallationLogic KnownInstallationLogic { get; } 4 | } 5 | } -------------------------------------------------------------------------------- /Core/InstallationSupportUtility/InstallationModel/Logic/GeneralInstallationLogic.cs: -------------------------------------------------------------------------------- 1 | namespace EnterpriseWebLibrary.InstallationSupportUtility.InstallationModel { 2 | public class GeneralInstallationLogic { 3 | private readonly string path; 4 | 5 | public GeneralInstallationLogic( string path ) { 6 | this.path = path; 7 | } 8 | 9 | /// 10 | /// For example, C:\Inetpub\Red Stapler Information System - Live. 11 | /// 12 | public string Path { get { return path; } } 13 | } 14 | } -------------------------------------------------------------------------------- /Core/InstallationSupportUtility/InstallationModel/Logic/KnownInstallationLogic.cs: -------------------------------------------------------------------------------- 1 | using EnterpriseWebLibrary.InstallationSupportUtility.SystemManagerInterface.Messages.SystemListMessage; 2 | 3 | namespace EnterpriseWebLibrary.InstallationSupportUtility.InstallationModel { 4 | public class KnownInstallationLogic { 5 | private readonly RsisInstallation rsisInstallation; 6 | 7 | public KnownInstallationLogic( RsisInstallation rsisInstallation ) { 8 | this.rsisInstallation = rsisInstallation; 9 | } 10 | 11 | /// 12 | /// Use only if this installation exists in RSIS. This information comes from the System List. 13 | /// 14 | public RsisInstallation RsisInstallation => rsisInstallation; 15 | } 16 | } -------------------------------------------------------------------------------- /Core/InstallationSupportUtility/InstallationModel/RecognizedInstallation.cs: -------------------------------------------------------------------------------- 1 | namespace EnterpriseWebLibrary.InstallationSupportUtility.InstallationModel { 2 | public interface RecognizedInstallation: ExistingInstallation, KnownInstallation { 3 | RecognizedInstallationLogic RecognizedInstallationLogic { get; } 4 | } 5 | } -------------------------------------------------------------------------------- /Core/InstallationSupportUtility/Operation.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using EnterpriseWebLibrary.InstallationSupportUtility.InstallationModel; 3 | 4 | namespace EnterpriseWebLibrary.InstallationSupportUtility { 5 | public interface Operation { 6 | bool IsValid( Installation installation ); 7 | 8 | /// 9 | /// Never call this method directly. 10 | /// 11 | void Execute( Installation installation, IReadOnlyList arguments, OperationResult operationResult ); 12 | } 13 | } -------------------------------------------------------------------------------- /Core/InstallationSupportUtility/OperationResult.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace EnterpriseWebLibrary.InstallationSupportUtility { 4 | /// 5 | /// Contains useful information about the execution of an operation. Created by the caller of the operation. 6 | /// All properties are set by the operation itself. 7 | /// 8 | public class OperationResult { 9 | /// 10 | /// If applicable, the number of bytes transferred during this operation. The operation will set this value if it is applicable. 11 | /// 12 | public long? NumberOfBytesTransferred { get; set; } 13 | 14 | public TimeSpan? TimeSpentWaitingForNetwork { get; set; } 15 | 16 | private string summary = ""; 17 | 18 | /// 19 | /// The detailed summary of the operation. 20 | /// 21 | public string Summary { get { return summary; } set { summary = value; } } 22 | } 23 | } -------------------------------------------------------------------------------- /Core/InstallationSupportUtility/StatusStatics.cs: -------------------------------------------------------------------------------- 1 | using Tewl.IO; 2 | 3 | namespace EnterpriseWebLibrary.InstallationSupportUtility; 4 | 5 | public static class StatusStatics { 6 | public static event Action? StatusChanged; 7 | 8 | public static void SetStatus( string status ) { 9 | Output.WriteTimeStampedOutput( status ); 10 | 11 | // According to .NET framework event guidelines (http://msdn.microsoft.com/en-us/library/w369ty8x.aspx), you are supposed to cache an event before raising 12 | // it in case the last subscriber unsubscribes in another thread between the null check and the raising. 13 | var sc = StatusChanged; 14 | 15 | sc?.Invoke( status ); 16 | } 17 | } -------------------------------------------------------------------------------- /Core/InstallationSupportUtility/SystemManagerInterface/Messages/SystemListMessage/RsisInstallation.cs: -------------------------------------------------------------------------------- 1 | using EnterpriseWebLibrary.Configuration; 2 | 3 | namespace EnterpriseWebLibrary.InstallationSupportUtility.SystemManagerInterface.Messages.SystemListMessage; 4 | 5 | public partial class RsisInstallation { 6 | public string FullName => 7 | InstallationConfiguration.GetFullNameFromSystemAndInstallationNames( 8 | SystemManagerConnectionStatics.SystemList.GetSystemByInstallationId( Id )!.Name, 9 | Name ); 10 | 11 | public string FullShortName => 12 | InstallationConfiguration.GetFullShortNameFromSystemAndInstallationNames( 13 | SystemManagerConnectionStatics.SystemList.GetSystemByInstallationId( Id )!.ShortName, 14 | ShortName ); 15 | 16 | public override string ToString() => FullName; 17 | } -------------------------------------------------------------------------------- /Core/MailMerging/FieldImplementation/BasicMergeFieldImplementation.cs: -------------------------------------------------------------------------------- 1 | namespace EnterpriseWebLibrary.MailMerging.FieldImplementation { 2 | /// 3 | /// An implementation for a basic merge field. 4 | /// 5 | public interface BasicMergeFieldImplementation where RowType: class { 6 | /// 7 | /// Gets a description of the field. 8 | /// 9 | string GetDescription(); 10 | 11 | /// 12 | /// Evaluates the field based on the specified row. The row will never be null. 13 | /// 14 | ValueType Evaluate( RowType row ); 15 | } 16 | } -------------------------------------------------------------------------------- /Core/MailMerging/FieldImplementation/BasicMergeFieldImplementationWithCustomName.cs: -------------------------------------------------------------------------------- 1 | namespace EnterpriseWebLibrary.MailMerging.FieldImplementation { 2 | /// 3 | /// An implementation for a basic merge field with a custom name. 4 | /// 5 | public interface BasicMergeFieldImplementationWithCustomName: BasicMergeFieldImplementationWithMsWordName 6 | where RowType: class { 7 | /// 8 | /// Gets the name of this merge field. 9 | /// 10 | string Name { get; } 11 | } 12 | } -------------------------------------------------------------------------------- /Core/MailMerging/FieldImplementation/BasicMergeFieldImplementationWithMsWordName.cs: -------------------------------------------------------------------------------- 1 | namespace EnterpriseWebLibrary.MailMerging.FieldImplementation { 2 | /// 3 | /// An implementation for a basic merge field with a separate name for Microsoft Word. 4 | /// 5 | public interface BasicMergeFieldImplementationWithMsWordName: BasicMergeFieldImplementation where RowType: class { 6 | /// 7 | /// Gets the Microsoft Word name of this merge field. 8 | /// 9 | string MsWordName { get; } 10 | } 11 | } -------------------------------------------------------------------------------- /Core/MailMerging/FieldImplementation/MergeFieldAdapterImplementation.cs: -------------------------------------------------------------------------------- 1 | namespace EnterpriseWebLibrary.MailMerging.FieldImplementation { 2 | /// 3 | /// An implementation for a merge field adapter. 4 | /// 5 | public interface MergeFieldAdapterImplementation { 6 | /// 7 | /// Gets the prefix that will be added to the name of the adapted merge field. 8 | /// 9 | string NamePrefix { get; } 10 | 11 | /// 12 | /// Gets the prefix that will be added to the Microsoft Word name of the adapted merge field. 13 | /// 14 | string MsWordNamePrefix { get; } 15 | 16 | /// 17 | /// Gets the suffix that will be added to the description of the adapted merge field. 18 | /// 19 | string DescriptionSuffix { get; } 20 | 21 | /// 22 | /// Gets the adapted field row that corresponds to the specified row. 23 | /// 24 | AdaptedFieldRowType GetAdaptedFieldRow( RowType row ); 25 | } 26 | } -------------------------------------------------------------------------------- /Core/MailMerging/Fields/MergeField.cs: -------------------------------------------------------------------------------- 1 | using EnterpriseWebLibrary.MailMerging.RowTree; 2 | 3 | namespace EnterpriseWebLibrary.MailMerging.Fields; 4 | 5 | /// 6 | /// A merge field. 7 | /// 8 | public interface MergeField { 9 | /// 10 | /// Gets the name of the merge field. 11 | /// 12 | string Name { get; } 13 | 14 | /// 15 | /// Gets the name of the merge field for Microsoft Word. 16 | /// 17 | string MsWordName { get; } 18 | 19 | /// 20 | /// Gets a description of the field. 21 | /// 22 | string GetDescription(); 23 | 24 | /// 25 | /// Creates a value for the combination of this field and the specified row. Mail Merging subsystem use only. 26 | /// 27 | MergeValue CreateValue( string name, string msWordName, Func descriptionGetter, Func rowGetter ); 28 | } -------------------------------------------------------------------------------- /Core/MailMerging/MailMergingException.cs: -------------------------------------------------------------------------------- 1 | namespace EnterpriseWebLibrary.MailMerging { 2 | /// 3 | /// An exception that is thrown during a mail merging operation and that is caused by a template problem. 4 | /// 5 | public class MailMergingException: MultiMessageApplicationException { 6 | /// 7 | /// Creates a mail merging exception with the specified messages. 8 | /// 9 | public MailMergingException( params string[] messages ): base( messages ) {} 10 | } 11 | } -------------------------------------------------------------------------------- /Core/MailMerging/MergeFieldNameTree.cs: -------------------------------------------------------------------------------- 1 | namespace EnterpriseWebLibrary.MailMerging; 2 | 3 | /// 4 | /// A tree of merge field names. 5 | /// 6 | public class MergeFieldNameTree { 7 | private readonly IEnumerable fieldNames; 8 | private readonly IEnumerable> childNamesAndChildren; 9 | 10 | public MergeFieldNameTree( IEnumerable fieldNames, IEnumerable>? childNamesAndChildren = null ) { 11 | this.fieldNames = fieldNames; 12 | this.childNamesAndChildren = childNamesAndChildren ?? Enumerable.Empty>(); 13 | } 14 | 15 | public IEnumerable FieldNames => fieldNames; 16 | public IEnumerable> ChildNamesAndChildren => childNamesAndChildren; 17 | } -------------------------------------------------------------------------------- /Core/MailMerging/RowTree/MergeRow.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace EnterpriseWebLibrary.MailMerging.RowTree { 4 | /// 5 | /// A row in a merge row tree. 6 | /// 7 | public class MergeRow { 8 | /// 9 | /// Gets values for the merge fields at this tree depth, i.e. the fields that correspond to the data type of this row. 10 | /// 11 | public IEnumerable Values { get; private set; } 12 | 13 | /// 14 | /// Gets the children of this row, each of which is the child rows for a specific data type. 15 | /// 16 | public IEnumerable Children { get; private set; } 17 | 18 | internal MergeRow( IEnumerable values, IEnumerable children ) { 19 | Values = values; 20 | Children = children; 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /Core/MailMerging/RowTree/MergeRowTree.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace EnterpriseWebLibrary.MailMerging.RowTree { 4 | /// 5 | /// A tree of merge rows. 6 | /// 7 | public class MergeRowTree { 8 | private readonly string nodeName; 9 | private readonly IEnumerable rows; 10 | private readonly string xmlRowElementName; 11 | 12 | internal MergeRowTree( string nodeName, IEnumerable rows, string xmlRowElementName ) { 13 | this.nodeName = nodeName; 14 | this.rows = rows; 15 | this.xmlRowElementName = xmlRowElementName; 16 | } 17 | 18 | /// 19 | /// Gets the name of this node. 20 | /// 21 | public string NodeName { get { return nodeName; } } 22 | 23 | /// 24 | /// Gets the merge rows. 25 | /// 26 | public IEnumerable Rows { get { return rows; } } 27 | 28 | /// 29 | /// Gets the XML row element name. 30 | /// 31 | public string XmlRowElementName { get { return xmlRowElementName; } } 32 | } 33 | } -------------------------------------------------------------------------------- /Core/MultiMessageApplicationException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Collections.Immutable; 4 | using Tewl.Tools; 5 | 6 | namespace EnterpriseWebLibrary { 7 | /// 8 | /// An application exception with multiple messages. 9 | /// 10 | public class MultiMessageApplicationException: ApplicationException { 11 | private readonly ImmutableArray messages; 12 | 13 | /// 14 | /// Creates an exception with the specified messages. 15 | /// 16 | public MultiMessageApplicationException( params string[] messages ): base( StringTools.ConcatenateWithDelimiter( Environment.NewLine, messages ) ) { 17 | this.messages = ImmutableArray.Create( messages ); 18 | } 19 | 20 | /// 21 | /// Gets the messages that describe the exception. 22 | /// 23 | public IReadOnlyCollection Messages { get { return messages; } } 24 | } 25 | } -------------------------------------------------------------------------------- /Core/SpecifiedValue.cs: -------------------------------------------------------------------------------- 1 | namespace EnterpriseWebLibrary; 2 | 3 | /// 4 | /// A value that has been specified. 5 | /// 6 | public class SpecifiedValue { 7 | public T Value { get; } 8 | 9 | /// 10 | /// Creates a specified value. 11 | /// 12 | public SpecifiedValue( T value ) { 13 | Value = value; 14 | } 15 | } -------------------------------------------------------------------------------- /Core/StreamMethod.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | 4 | namespace EnterpriseWebLibrary { 5 | 6 | /// 7 | /// A method that takes a stream. 8 | /// 9 | public delegate void StreamMethod( Stream stream ); 10 | 11 | } -------------------------------------------------------------------------------- /Core/StructuralEqualityComparer.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | 3 | namespace EnterpriseWebLibrary; 4 | 5 | /// 6 | /// A generic version of StructuralComparisons.StructuralEqualityComparer. 7 | /// 8 | public class StructuralEqualityComparer: EqualityComparer where T: notnull { 9 | public override bool Equals( T? x, T? y ) => StructuralComparisons.StructuralEqualityComparer.Equals( x, y ); 10 | 11 | public override int GetHashCode( T obj ) => StructuralComparisons.StructuralEqualityComparer.GetHashCode( obj ); 12 | } -------------------------------------------------------------------------------- /Core/SystemGeneralProvider.cs: -------------------------------------------------------------------------------- 1 | namespace EnterpriseWebLibrary { 2 | /// 3 | /// General system-specific logic. 4 | /// 5 | public abstract class SystemGeneralProvider { 6 | /// 7 | /// Gets the display name of the system. 8 | /// 9 | protected internal virtual string SystemDisplayName => ""; 10 | 11 | /// 12 | /// Gets the password used for intermediate log-in. 13 | /// 14 | protected internal abstract string IntermediateLogInPassword { get; } 15 | 16 | /// 17 | /// Gets the email default from name. 18 | /// 19 | protected internal abstract string EmailDefaultFromName { get; } 20 | 21 | /// 22 | /// Gets the email default from address. 23 | /// 24 | protected internal abstract string EmailDefaultFromAddress { get; } 25 | 26 | /// 27 | /// Gets whether Imageflow, used for image resizing, is licensed. 28 | /// 29 | protected internal virtual bool ImageflowLicensed => false; 30 | } 31 | } -------------------------------------------------------------------------------- /Core/SystemInitializer.cs: -------------------------------------------------------------------------------- 1 | namespace EnterpriseWebLibrary { 2 | /// 3 | /// System-specific initialization logic. 4 | /// 5 | public interface SystemInitializer { 6 | /// 7 | /// Performs system-specific initialization. 8 | /// 9 | void InitStatics(); 10 | 11 | /// 12 | /// Performs cleanup activities so the application can be shut down. 13 | /// 14 | void CleanUpStatics(); 15 | } 16 | } -------------------------------------------------------------------------------- /Core/SystemSpecificLogic/SystemProviderGetter.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | 3 | namespace EnterpriseWebLibrary.SystemSpecificLogic; 4 | 5 | /// 6 | /// EWL use only. 7 | /// 8 | public class SystemProviderGetter { 9 | private readonly Assembly assembly; 10 | private readonly string providerNamespace; 11 | private readonly Func errorMessageGetter; 12 | 13 | internal SystemProviderGetter( Assembly assembly, string providerNamespace, Func errorMessageGetter ) { 14 | this.assembly = assembly; 15 | this.providerNamespace = providerNamespace; 16 | this.errorMessageGetter = errorMessageGetter; 17 | } 18 | 19 | public SystemProviderReference GetProvider( string providerName ) where ProviderType: class { 20 | var typeName = providerNamespace + "." + providerName; 21 | var provider = assembly.GetType( typeName ) != null ? assembly.CreateInstance( typeName ) as ProviderType : null; 22 | return new SystemProviderReference( provider, errorMessageGetter( providerName ) ); 23 | } 24 | } -------------------------------------------------------------------------------- /Core/SystemSpecificLogic/SystemProviderReference.cs: -------------------------------------------------------------------------------- 1 | namespace EnterpriseWebLibrary.SystemSpecificLogic; 2 | 3 | /// 4 | /// EWL use only. 5 | /// 6 | public class SystemProviderReference where ProviderType: class { 7 | private readonly ProviderType? provider; 8 | private readonly string errorMessage; 9 | 10 | internal SystemProviderReference( ProviderType? provider, string errorMessage ) { 11 | this.provider = provider; 12 | this.errorMessage = errorMessage; 13 | } 14 | 15 | public ProviderType? GetProvider( bool returnNullIfNotFound = false ) => 16 | provider != null || returnNullIfNotFound ? provider : throw new ApplicationException( errorMessage ); 17 | } -------------------------------------------------------------------------------- /Core/TewlContrib/Chronometer.cs: -------------------------------------------------------------------------------- 1 | using NodaTime; 2 | 3 | namespace EnterpriseWebLibrary.TewlContrib; 4 | 5 | /// 6 | /// Provides a way to measure duration. The timer begins as soon as the object is created. Elapsed reports how much time has elasped since creation. The timer 7 | /// never stops. 8 | /// 9 | public class Chronometer { 10 | private readonly Instant created = Clock.GetCurrentTime(); 11 | 12 | /// 13 | /// Returns the time elasped since this object was created. 14 | /// 15 | public Duration Elapsed => Clock.GetCurrentTime() - created; 16 | } -------------------------------------------------------------------------------- /Core/Tools/ServiceControllerTools.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ServiceProcess; 3 | 4 | namespace EnterpriseWebLibrary { 5 | public static class ServiceControllerTools { 6 | public static void WaitForStatusWithTimeOut( this ServiceController s, ServiceControllerStatus desiredStatus ) { 7 | s.WaitForStatus( desiredStatus, TimeSpan.FromMinutes( 5 ) ); 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /Core/TrustedHtmlString.cs: -------------------------------------------------------------------------------- 1 | namespace EnterpriseWebLibrary { 2 | /// 3 | /// A trusted HTML string. 4 | /// 5 | public sealed class TrustedHtmlString { 6 | public string Html { get; } 7 | 8 | /// 9 | /// Creates a trusted HTML string. 10 | /// 11 | /// Do not pass null. 12 | public TrustedHtmlString( string html ) { 13 | Html = html; 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /Core/UnexpectedValueException.cs: -------------------------------------------------------------------------------- 1 | namespace EnterpriseWebLibrary; 2 | 3 | /// 4 | /// An exception that is thrown when an unexpected value is encountered, usually in a switch statement. 5 | /// 6 | public class UnexpectedValueException: Exception { 7 | private static string getMessage( string valueType, string value ) => "Unexpected {0}: '{1}'".FormatWith( valueType, value ); 8 | 9 | /// 10 | /// Creates an exception from a value type string and a value. 11 | /// 12 | /// Do not pass null. 13 | /// 14 | public UnexpectedValueException( string valueType, object value ): base( getMessage( valueType, value.ToString()! ) ) {} 15 | 16 | /// 17 | /// Creates an exception from an enumeration value. 18 | /// 19 | /// 20 | public UnexpectedValueException( Enum value ): base( getMessage( value.GetType().Name, value.ToEnglish() ) ) {} 21 | } -------------------------------------------------------------------------------- /Core/UserManagement/IdentityProvider.cs: -------------------------------------------------------------------------------- 1 | namespace EnterpriseWebLibrary.UserManagement { 2 | /// 3 | /// An identity provider. 4 | /// 5 | public interface IdentityProvider {} 6 | } -------------------------------------------------------------------------------- /Core/UserManagement/UserRequest.cs: -------------------------------------------------------------------------------- 1 | using NodaTime; 2 | 3 | namespace EnterpriseWebLibrary.UserManagement; 4 | 5 | /// 6 | /// A request a user made to the system. 7 | /// 8 | /// The ID of the user. 9 | /// The time of the request. 10 | public record UserRequest( int UserId, Instant RequestTime ); -------------------------------------------------------------------------------- /Core/WebTestingFramework/Read me.txt: -------------------------------------------------------------------------------- 1 | Pre-requisites for the current iteration of the web testing framework, which relies on Selenium, are to have Firefox and the Java Run Time installed on the server. 2 | Projects that invoke the WebTestingFramework must reference the Selenium Core DLL and the nUnit core dll. This is so the tests generated by Selenium compile correctly. 3 | 4 | There is a problem with testing locally for sites that use SSL. 5 | Using the -trustAllSSLCertificates flag is supposed to work with Firefox, but it doesn't. 6 | Using the -firefoxProfileTemplate flag to point to a folder with cert_override.txt and cert8.db files that have an exception specified for the Main certificate does work, but it's a pain. 7 | 8 | To run tests locally, you must copy cert_override.txt and cert8.db from a Firefox profile that has an exception for the Main certificate into c:\Red Stapler\Selenium Support\Firefox. -------------------------------------------------------------------------------- /Core/WindowsServiceFramework/WindowsServiceBase.cs: -------------------------------------------------------------------------------- 1 | namespace EnterpriseWebLibrary.WindowsServiceFramework { 2 | /// 3 | /// A Windows service. 4 | /// 5 | public interface WindowsServiceBase { 6 | /// 7 | /// Gets the name of the service. 8 | /// 9 | string Name { get; } 10 | 11 | /// 12 | /// Initializes the service. 13 | /// 14 | void Init(); 15 | 16 | /// 17 | /// Performs cleanup activities so the service can be shut down. 18 | /// 19 | void CleanUp(); 20 | 21 | /// 22 | /// Performs tasks that have emerged since the last call to this method. 23 | /// 24 | void Tick( TickInterval interval ); 25 | } 26 | } -------------------------------------------------------------------------------- /Core/WindowsServiceFramework/WindowsServiceStatics.cs: -------------------------------------------------------------------------------- 1 | using NodaTime; 2 | 3 | namespace EnterpriseWebLibrary.WindowsServiceFramework { 4 | public static class WindowsServiceStatics { 5 | /// 6 | /// Gets the time instant for the current call of . 7 | /// 8 | public static Instant TickTime { get; internal set; } 9 | } 10 | } -------------------------------------------------------------------------------- /Development Utility/CodeGeneration/CSharpParameter.cs: -------------------------------------------------------------------------------- 1 | using Tewl.Tools; 2 | 3 | namespace EnterpriseWebLibrary.DevelopmentUtility.CodeGeneration { 4 | internal class CSharpParameter { 5 | private readonly string type; 6 | internal readonly string Name; 7 | private readonly string defaultValue; 8 | internal readonly string Description; 9 | 10 | /// 11 | /// If defaultValue happens to be a string in the compiled code, it must be passed with surrounding double quotes. 12 | /// 13 | public CSharpParameter( string type, string name, string defaultValue = "", string description = "" ) { 14 | this.type = type; 15 | Name = name; 16 | this.defaultValue = defaultValue; 17 | Description = description; 18 | } 19 | 20 | public string MethodSignatureDeclaration => StringTools.ConcatenateWithDelimiter( " = ", type.ConcatenateWithSpace( Name ), defaultValue ); 21 | } 22 | } -------------------------------------------------------------------------------- /Development Utility/CodeGeneration/CodeGenerationStatics.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.CodeAnalysis.CSharp; 2 | 3 | namespace EnterpriseWebLibrary.DevelopmentUtility.CodeGeneration; 4 | 5 | internal static class CodeGenerationStatics { 6 | public static void AddSummaryDocComment( TextWriter writer, string text ) { 7 | if( text.Length == 0 ) 8 | return; 9 | text = text.Replace( writer.NewLine, writer.NewLine + "/// " ); 10 | writer.WriteLine( "/// " ); 11 | writer.WriteLine( "/// " + text ); 12 | writer.WriteLine( "/// " ); 13 | } 14 | 15 | public static void AddParamDocComment( TextWriter writer, string name, string description ) { 16 | writer.WriteLine( "/// " + description + "" ); 17 | } 18 | 19 | public static void AddGeneratedCodeUseOnlyComment( TextWriter writer ) { 20 | AddSummaryDocComment( writer, "Auto-generated code use only." ); 21 | } 22 | 23 | public static string EscapeForLiteral( this string value ) => SymbolDisplay.FormatLiteral( value, true )[ 1..^1 ]; 24 | } -------------------------------------------------------------------------------- /Development Utility/Configuration/Packaging.xsd: -------------------------------------------------------------------------------- 1 |  2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Development Utility/Development Utility.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | en-US 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | Referenced Files\NDepend.API.dll 21 | False 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Development Utility/Operations/InstallAndStartServices.cs: -------------------------------------------------------------------------------- 1 | using EnterpriseWebLibrary.InstallationSupportUtility; 2 | using EnterpriseWebLibrary.InstallationSupportUtility.InstallationModel; 3 | 4 | namespace EnterpriseWebLibrary.DevelopmentUtility.Operations; 5 | 6 | internal class InstallAndStartServices: Operation { 7 | private static readonly Operation instance = new InstallAndStartServices(); 8 | public static Operation Instance => instance; 9 | private InstallAndStartServices() {} 10 | 11 | bool Operation.IsValid( Installation installation ) => installation is RecognizedDevelopmentInstallation; 12 | 13 | void Operation.Execute( Installation genericInstallation, IReadOnlyList arguments, OperationResult operationResult ) { 14 | var installation = (RecognizedDevelopmentInstallation)genericInstallation; 15 | installation.ExistingInstallationLogic.InstallServices(); 16 | installation.ExistingInstallationLogic.Start(); 17 | } 18 | } -------------------------------------------------------------------------------- /Development Utility/Operations/StopAndUninstallServices.cs: -------------------------------------------------------------------------------- 1 | using EnterpriseWebLibrary.InstallationSupportUtility; 2 | using EnterpriseWebLibrary.InstallationSupportUtility.InstallationModel; 3 | 4 | namespace EnterpriseWebLibrary.DevelopmentUtility.Operations; 5 | 6 | internal class StopAndUninstallServices: Operation { 7 | private static readonly Operation instance = new StopAndUninstallServices(); 8 | public static Operation Instance => instance; 9 | private StopAndUninstallServices() {} 10 | 11 | bool Operation.IsValid( Installation installation ) => installation is RecognizedDevelopmentInstallation; 12 | 13 | void Operation.Execute( Installation genericInstallation, IReadOnlyList arguments, OperationResult operationResult ) { 14 | var installation = (RecognizedDevelopmentInstallation)genericInstallation; 15 | installation.ExistingInstallationLogic.UninstallServices(); 16 | } 17 | } -------------------------------------------------------------------------------- /Development Utility/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "Development Utility": { 4 | "commandName": "Project", 5 | "commandLineArgs": "..\\..\\..\\..\\.. UpdateDependentLogic" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /Development Utility/Referenced Files/NDepend.API.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enduracode/enterprise-web-library/e48feb24f3a9a5671db78f59cd63c62a7538d8ac/Development Utility/Referenced Files/NDepend.API.dll -------------------------------------------------------------------------------- /Directory.Build.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net8.0-windows 5 | 6 | 7 | -------------------------------------------------------------------------------- /Documentation/Faq.md: -------------------------------------------------------------------------------- 1 | # FAQ 2 | 3 | * *Why restrict the name of EWL providers? They already have to implement an interface, shouldn't that be the only handle we need to find the implementation in the system? Why do they have to name it a certain way too?* 4 | 5 | We force each provider to use a specific name to save you the effort of having to think of what to name it. -------------------------------------------------------------------------------- /Documentation/Procedures/CreatingSchemaForCommonTypes.md: -------------------------------------------------------------------------------- 1 | # Creating database schema for common types (section needs work) 2 | 3 | Below are recommended lengths/types for common data types. There may be better (shorter) values to use, and there may be fundamentally better ways to store data (like storing an address as one large field and assuming we can parse it later rather than breaking it up) eventually, but for now these are values that work well, and it saves the time of having to re-think it every time. 4 | 5 | ```SQL 6 | ZipCode varchar( 20 ) NOT NULL 7 | PhoneNumber varchar( 25 ) NOT NULL 8 | City nvarchar( 100 ) NOT NULL 9 | Street nvarchar( 200 ) NOT NULL 10 | Url nvarchar( 2083 ) NOT NULL 11 | ``` -------------------------------------------------------------------------------- /Documentation/Procedures/MakingEwfUiSite.md: -------------------------------------------------------------------------------- 1 | # Making an EWF-UI web site 2 | 3 | Add a `Providers` folder to the web project. Inside, create an `EwfUiProvider` class that looks like this: 4 | 5 | ```C# 6 | using EnterpriseWebLibrary.EnterpriseWebFramework.Ui; 7 | 8 | namespace Fusion.DigitalNow.WebSite.Providers { 9 | internal class EwfUiProvider: AppEwfUiProvider {} 10 | } 11 | ``` -------------------------------------------------------------------------------- /Documentation/TableOfContents.md: -------------------------------------------------------------------------------- 1 | # Table of Contents 2 | 3 | * Guides 4 | * [Getting started](Guides/GettingStarted.md) 5 | * [Database migration](Guides/DatabaseMigration.md) 6 | * [Data access](Guides/DataAccess.md) 7 | * [Adding user management](Guides/UserManagement.md) 8 | * [Using the web framework](Guides/WebFramework.md) 9 | * Procedures 10 | * [Creating database schema for common types](Procedures/CreatingSchemaForCommonTypes.md) 11 | * [Adding revision history](Procedures/AddingRevisionHistory.md) 12 | * [Making an EWF-UI web site](Procedures/MakingEwfUiSite.md) 13 | * [Adding re-ordering to a table](Procedures/AddingReordering.md) 14 | * Reference 15 | * [Configuration files](Reference/ConfigurationFiles.md) 16 | * [FAQ](Faq.md) 17 | * [Deliberate Omissions](DeliberateOmissions.md) 18 | * [Contributing to EWL](https://enduracode.fogbugz.com/default.asp?W5) -------------------------------------------------------------------------------- /Library/Configuration/General.xml: -------------------------------------------------------------------------------- 1 |  2 | 4 | Enterprise Web Library 5 | Ewl 6 | 7 | 8 | Website 9 | true 10 | 11 | 12 | 13 | 14 | William Gross 15 | william@wgross.net 16 | 17 | 18 | -------------------------------------------------------------------------------- /Library/Configuration/Installation/Installations Template/Development/Standard.xml: -------------------------------------------------------------------------------- 1 |  2 | 4 | 5 | 6 | Jane Doe 7 | jane.doe@example.com 8 | 9 | 10 | -------------------------------------------------------------------------------- /Library/Configuration/Installation/Installations Template/Shared.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | your-password 4 | Your Organization 5 | contact@example.com 6 | -------------------------------------------------------------------------------- /Library/Configuration/Installation/Shared.xsd: -------------------------------------------------------------------------------- 1 |  2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Library/Configuration/ReSharper Settings.DotSettings: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /Library/Files/System Template/Directory.Build.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | @@TargetFramework 5 | 6 | 7 | -------------------------------------------------------------------------------- /Library/Files/System Template/Library/Configuration/Development.xml: -------------------------------------------------------------------------------- 1 |  2 | 4 | @@BaseNamespace.Library 5 | 6 | 7 | Website 8 | @@BaseNamespace.Website 9 | 10 | 11 | -------------------------------------------------------------------------------- /Library/Files/System Template/Library/Configuration/General.xml: -------------------------------------------------------------------------------- 1 |  2 | 4 | @@SystemName 5 | @@SystemShortName 6 | 7 | 8 | Website 9 | false 10 | 11 | 12 | 13 | 14 | John Doe 15 | john.doe@example.com 16 | 17 | 18 | -------------------------------------------------------------------------------- /Library/Files/System Template/Library/Configuration/Installation/Installations/Development/Standard.xml: -------------------------------------------------------------------------------- 1 |  2 | 4 | 5 | 6 | Jane Doe 7 | jane.doe@example.com 8 | 9 | 10 | -------------------------------------------------------------------------------- /Library/Files/System Template/Library/GlobalInitializer.cs: -------------------------------------------------------------------------------- 1 | namespace @@BaseNamespace.Library; 2 | 3 | public class GlobalInitializer: SystemInitializer { 4 | void SystemInitializer.InitStatics() {} 5 | void SystemInitializer.CleanUpStatics() {} 6 | } -------------------------------------------------------------------------------- /Library/Files/System Template/Library/GlobalStatics.cs: -------------------------------------------------------------------------------- 1 | namespace @@BaseNamespace.Library; 2 | 3 | public static class GlobalStatics { 4 | // Use this class for any general static members you need in your system. 5 | } -------------------------------------------------------------------------------- /Library/Files/System Template/Library/Library.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Library/Files/System Template/Library/Providers/General.cs: -------------------------------------------------------------------------------- 1 | namespace @@BaseNamespace.Library.Providers; 2 | 3 | internal class General: SystemGeneralProvider { 4 | protected override string IntermediateLogInPassword => "your-password"; 5 | protected override string EmailDefaultFromName => "Organization Name"; 6 | protected override string EmailDefaultFromAddress => "contact@example.com"; 7 | } -------------------------------------------------------------------------------- /Library/Files/System Template/Website/AppStatics.cs: -------------------------------------------------------------------------------- 1 | namespace @@BaseNamespace.Website; 2 | 3 | internal static class AppStatics { 4 | // Use this class for any general static members you need in this particular application. 5 | } -------------------------------------------------------------------------------- /Library/Files/System Template/Website/Home.cs: -------------------------------------------------------------------------------- 1 | using @@BaseNamespace.Library; 2 | 3 | namespace @@BaseNamespace.Website; 4 | 5 | // EwlPage 6 | partial class Home { 7 | protected override string getResourceName() => ""; 8 | 9 | protected override IEnumerable getChildUrlPatterns() => RequestDispatchingStatics.GetFrameworkUrlPatterns( WebApplicationNames.Website ); 10 | 11 | protected override PageContent getContent() => new UiPageContent().Add( new Paragraph( "Welcome to the Enterprise Web Library!".ToComponents() ) ); 12 | } -------------------------------------------------------------------------------- /Library/Files/System Template/Website/Program.cs: -------------------------------------------------------------------------------- 1 | using @@BaseNamespace.Library; 2 | 3 | EwfOps.RunApplication( new GlobalInitializer() ); -------------------------------------------------------------------------------- /Library/Files/System Template/Website/Providers/EwfUi.cs: -------------------------------------------------------------------------------- 1 | namespace @@BaseNamespace.Website.Providers; 2 | 3 | internal class EwfUi: AppEwfUiProvider { 4 | // Override methods here to configure the EWF UI. 5 | } -------------------------------------------------------------------------------- /Library/Files/System Template/Website/Providers/RequestDispatching.cs: -------------------------------------------------------------------------------- 1 | namespace @@BaseNamespace.Website.Providers; 2 | 3 | partial class RequestDispatching { 4 | protected override IEnumerable GetBaseUrlPatterns() => Home.UrlPatterns.BaseUrlPattern().ToCollection(); 5 | public override UrlHandler GetFrameworkUrlParent() => new Home(); 6 | } -------------------------------------------------------------------------------- /Library/Files/System Template/Website/Providers/StandardPageLogic.cs: -------------------------------------------------------------------------------- 1 | namespace @@BaseNamespace.Website.Providers; 2 | 3 | internal class StandardPageLogic: AppStandardPageLogicProvider { 4 | // Override methods here to configure the standard functionality in all pages. 5 | } -------------------------------------------------------------------------------- /Library/Files/System Template/Website/Website.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Library/Files/Web Project Configuration/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iis": { 6 | "applicationUrl": "https://localhost/@@Path", 7 | "sslPort": 443 8 | } 9 | }, 10 | "profiles": { 11 | "Kestrel": { 12 | "commandName": "Project", 13 | "launchBrowser": true, 14 | "applicationUrl": "https://localhost:@@SecurePort;http://localhost:@@NonsecurePort", 15 | "dotnetRunMessages": true 16 | }, 17 | "IIS": { 18 | "commandName": "IIS", 19 | "launchBrowser": true 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /Library/GlobalInitializer.cs: -------------------------------------------------------------------------------- 1 | using EnterpriseWebLibrary.MailMerging; 2 | 3 | namespace EnterpriseWebLibrary { 4 | public class GlobalInitializer: SystemInitializer { 5 | void SystemInitializer.InitStatics() { 6 | GlobalStatics.Init(); 7 | MergeStatics.Init(); 8 | } 9 | 10 | void SystemInitializer.CleanUpStatics() {} 11 | } 12 | } -------------------------------------------------------------------------------- /Library/GlobalStatics.cs: -------------------------------------------------------------------------------- 1 | using EnterpriseWebLibrary.Configuration; 2 | using EnterpriseWebLibrary.Configuration.Installation; 3 | 4 | namespace EnterpriseWebLibrary; 5 | 6 | public static class GlobalStatics { 7 | public static readonly string[] ConfigurationXsdFileNames = { "Installation Standard", "Machine", "System Development", "System General" }; 8 | 9 | private static InstallationSharedConfiguration? installationSharedConfiguration; 10 | 11 | internal static void Init() { 12 | installationSharedConfiguration = ConfigurationStatics.LoadInstallationSharedConfiguration(); 13 | } 14 | 15 | internal static string IntermediateLogInPassword => installationSharedConfiguration!.IntermediateLogInPassword; 16 | internal static string EmailDefaultFromName => installationSharedConfiguration!.EmailDefaultFromName; 17 | internal static string EmailDefaultFromAddress => installationSharedConfiguration!.EmailDefaultFromAddress; 18 | } -------------------------------------------------------------------------------- /Library/Library.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | EnterpriseWebLibrary.Library 5 | $(DefaultItemExcludesInProjectFolder);Files\System Template\\**\*.* 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /Library/MailMerging/PseudoChildRow.cs: -------------------------------------------------------------------------------- 1 | namespace EnterpriseWebLibrary.MailMerging { 2 | public class PseudoChildRow { 3 | private readonly int num; 4 | public int Num => num; 5 | 6 | public PseudoChildRow( int num ) { 7 | this.num = num; 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /Library/MailMerging/PseudoTableFields/FullName.cs: -------------------------------------------------------------------------------- 1 | using EnterpriseWebLibrary.MailMerging.FieldImplementation; 2 | 3 | namespace EnterpriseWebLibrary.MailMerging.PseudoTableFields { 4 | internal class FullName: BasicMergeFieldImplementation { 5 | public string GetDescription() { 6 | return "Someone's full name"; 7 | } 8 | 9 | public string Evaluate( PseudoTableRow row ) { 10 | return row.FullName; 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /Library/MailMerging/PseudoTableFields/Test.cs: -------------------------------------------------------------------------------- 1 | using EnterpriseWebLibrary.MailMerging.FieldImplementation; 2 | 3 | namespace EnterpriseWebLibrary.MailMerging.PseudoTableFields { 4 | internal class Test: BasicMergeFieldImplementation { 5 | public string GetDescription() { 6 | return "Just a test."; 7 | } 8 | 9 | public string Evaluate( PseudoTableRow row ) { 10 | return "Test"; 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /Library/MailMerging/PseudoTableRow.cs: -------------------------------------------------------------------------------- 1 | namespace EnterpriseWebLibrary.MailMerging { 2 | /// 3 | /// Has fields in it like a table row would. 4 | /// 5 | public class PseudoTableRow { 6 | private readonly int num; 7 | 8 | public PseudoTableRow( int num ) { 9 | this.num = num; 10 | } 11 | 12 | internal string FullName => getString( "First Middle Last" ); 13 | 14 | private string getString( string s ) { 15 | return s + num; 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /Library/MailMerging/PsuedoChildFields/Another.cs: -------------------------------------------------------------------------------- 1 | using EnterpriseWebLibrary.MailMerging.FieldImplementation; 2 | 3 | namespace EnterpriseWebLibrary.MailMerging.PsuedoChildFields { 4 | public class Another: BasicMergeFieldImplementation { 5 | public string GetDescription() { 6 | return "Another value"; 7 | } 8 | 9 | public string Evaluate( PseudoChildRow row ) { 10 | return "The value: " + row.Num * 2; 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /Library/MailMerging/PsuedoChildFields/TheValue.cs: -------------------------------------------------------------------------------- 1 | using EnterpriseWebLibrary.MailMerging.FieldImplementation; 2 | 3 | namespace EnterpriseWebLibrary.MailMerging.PsuedoChildFields { 4 | public class TheValue: BasicMergeFieldImplementation { 5 | public string GetDescription() { 6 | return "The value"; 7 | } 8 | 9 | public string Evaluate( PseudoChildRow row ) { 10 | return "The value: " + row.Num; 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /Library/Providers/Encryption.cs: -------------------------------------------------------------------------------- 1 | using EnterpriseWebLibrary.Encryption; 2 | 3 | namespace EnterpriseWebLibrary.Providers; 4 | 5 | internal class Encryption: SystemEncryptionProvider { 6 | byte[] SystemEncryptionProvider.Key => 7 | new byte[] 8 | { 9 | 17, 222, 224, 85, 183, 92, 155, 130, 182, 123, 40, 219, 161, 200, 237, 120, 82, 210, 77, 71, 246, 76, 54, 220, 77, 30, 100, 115, 247, 41, 86, 177 10 | }; 11 | } -------------------------------------------------------------------------------- /Library/Providers/ExternalFunctionality.cs: -------------------------------------------------------------------------------- 1 | using EnterpriseWebLibrary.ExternalFunctionality; 2 | using EnterpriseWebLibrary.MySql; 3 | using EnterpriseWebLibrary.OracleDatabase; 4 | using JetBrains.Annotations; 5 | 6 | namespace EnterpriseWebLibrary.Providers; 7 | 8 | [ UsedImplicitly ] 9 | internal class ExternalFunctionality: SystemExternalFunctionalityProvider { 10 | protected override ExternalMySqlProvider GetMySqlProvider() => new MySqlProvider(); 11 | protected override ExternalOracleDatabaseProvider GetOracleDatabaseProvider() => new OracleDatabaseProvider(); 12 | } -------------------------------------------------------------------------------- /Library/Providers/General.cs: -------------------------------------------------------------------------------- 1 | namespace EnterpriseWebLibrary.Providers; 2 | 3 | internal class General: SystemGeneralProvider { 4 | protected override string IntermediateLogInPassword => GlobalStatics.IntermediateLogInPassword; 5 | protected override string EmailDefaultFromName => GlobalStatics.EmailDefaultFromName; 6 | protected override string EmailDefaultFromAddress => GlobalStatics.EmailDefaultFromAddress; 7 | } -------------------------------------------------------------------------------- /Providers/MySQL/MySQL.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Providers/MySQL/MySqlProvider.cs: -------------------------------------------------------------------------------- 1 | using System.Data.Common; 2 | using EnterpriseWebLibrary.ExternalFunctionality; 3 | using FluentMigrator.Runner; 4 | using MySqlConnector; 5 | 6 | namespace EnterpriseWebLibrary.MySql; 7 | 8 | public class MySqlProvider: ExternalMySqlProvider { 9 | DbProviderFactory ExternalMySqlProvider.GetDbProviderFactory() => MySqlConnectorFactory.Instance; 10 | 11 | void ExternalMySqlProvider.RegisterDependencyInjectionServicesForMigration( IMigrationRunnerBuilder builder ) { 12 | builder.AddMySql8(); 13 | } 14 | } -------------------------------------------------------------------------------- /Providers/OpenID Connect/OpenID Connect.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Providers/Oracle Database/Oracle Database.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Providers/PDF/PDF.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Providers/PDF/PdfProvider.cs: -------------------------------------------------------------------------------- 1 | using EnterpriseWebLibrary.ExternalFunctionality; 2 | 3 | namespace EnterpriseWebLibrary.Pdf; 4 | 5 | public class PdfProvider: ExternalPdfProvider { 6 | void ExternalPdfProvider.InitStatics( string asposePdfLicensePath ) { 7 | new Aspose.Pdf.License().SetLicense( asposePdfLicensePath ); 8 | } 9 | } -------------------------------------------------------------------------------- /Providers/SAML/AppSamlProvider.cs: -------------------------------------------------------------------------------- 1 | using ComponentSpace.Saml2.Configuration; 2 | using Tewl.Tools; 3 | 4 | namespace EnterpriseWebLibrary.Saml { 5 | /// 6 | /// Application-specific SAML logic. 7 | /// 8 | public abstract class AppSamlProvider { 9 | protected internal virtual IReadOnlyCollection GetCustomConfigurations() => Enumerable.Empty().Materialize(); 10 | } 11 | } -------------------------------------------------------------------------------- /Providers/SAML/SAML.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Providers/Word/Word.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Providers/Word/WordProvider.cs: -------------------------------------------------------------------------------- 1 | using EnterpriseWebLibrary.ExternalFunctionality; 2 | 3 | namespace EnterpriseWebLibrary.Word; 4 | 5 | public class WordProvider: ExternalWordProvider { 6 | void ExternalWordProvider.InitStatics( string asposeWordsLicensePath ) { 7 | new Aspose.Words.License().SetLicense( asposeWordsLicensePath ); 8 | } 9 | } -------------------------------------------------------------------------------- /Solution Files/Export EWL to Local Feed.bat: -------------------------------------------------------------------------------- 1 | cd ..\Latest Package\Ewl*\tools\Development Utility 2 | EnterpriseWebLibrary.DevelopmentUtility ..\..\..\.. ExportEwlToLocalFeed -------------------------------------------------------------------------------- /Solution Files/Update Dependent Logic.ps1: -------------------------------------------------------------------------------- 1 | cd .. 2 | if( Test-Path "Latest Package" ) { Remove-Item "Latest Package" -Recurse } 3 | 4 | $packagingConfigurationFilePath = 'Library\Configuration\Installation\Installations\Packaging.xml' 5 | $packageId = if( Test-Path $packagingConfigurationFilePath ) { ( [xml]( Get-Content $packagingConfigurationFilePath ) ).PackagingConfiguration.SystemShortName } else { 'Ewl' } 6 | & "Solution Files\nuget" install $packageId -DependencyVersion Ignore -ExcludeVersion -NonInteractive -OutputDirectory "Latest Package" -PackageSaveMode nuspec -PreRelease 7 | 8 | cd "Latest Package\$packageId\tools\Development Utility" 9 | & .\EnterpriseWebLibrary.DevelopmentUtility ..\..\..\.. UpdateDependentLogic -------------------------------------------------------------------------------- /Solution Files/nuget.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enduracode/enterprise-web-library/e48feb24f3a9a5671db78f59cd63c62a7538d8ac/Solution Files/nuget.exe -------------------------------------------------------------------------------- /Tests/DoubleTools/ToMoneyString.cs: -------------------------------------------------------------------------------- 1 | using NUnit.Framework; 2 | using Tewl.Tools; 3 | 4 | namespace EnterpriseWebLibrary.Tests.DoubleTools; 5 | 6 | [ TestFixture ] 7 | public class ToMoneyString { 8 | [ Test ] 9 | public void Test() { 10 | Assert.That( 1.23.ToMoneyString(), Is.EqualTo( "$1.23" ) ); 11 | Assert.That( 2.5.ToMoneyString(), Is.EqualTo( "$2.50" ) ); 12 | Assert.That( 3.0.ToMoneyString(), Is.EqualTo( "$3.00" ) ); 13 | Assert.That( 4.567.ToMoneyString(), Is.EqualTo( "$4.57" ) ); 14 | } 15 | } -------------------------------------------------------------------------------- /Tests/MailMerging/DataStructure/PracticeDocumentDataStructure/PhysicianDataStructure/PhysicianMockData.cs: -------------------------------------------------------------------------------- 1 | namespace EnterpriseWebLibrary.Tests.MailMerging.DataStructure.PracticeDocumentDataStructure.PhysicianDataStructure { 2 | public class PhysicianMockData { 3 | public readonly string Email; 4 | public readonly string FirstName; 5 | public readonly string LastName; 6 | 7 | public PhysicianMockData( string email, string firstName, string lastName ) { 8 | Email = email; 9 | FirstName = firstName; 10 | LastName = lastName; 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /Tests/MailMerging/DataStructure/PracticeDocumentDataStructure/PracticeManagerDataStructure/PracticeManagerMockData.cs: -------------------------------------------------------------------------------- 1 | namespace EnterpriseWebLibrary.Tests.MailMerging.DataStructure.PracticeDocumentDataStructure.PracticeManagerDataStructure { 2 | public class PracticeManagerMockData { 3 | public readonly string EmailAddress; 4 | 5 | public PracticeManagerMockData( string emailAddress ) { 6 | EmailAddress = emailAddress; 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /Tests/MailMerging/DataStructure/PracticeDocumentDataStructure/PracticeMockData.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using EnterpriseWebLibrary.Tests.MailMerging.DataStructure.PracticeDocumentDataStructure.PhysicianDataStructure; 3 | using EnterpriseWebLibrary.Tests.MailMerging.DataStructure.PracticeDocumentDataStructure.PracticeManagerDataStructure; 4 | 5 | namespace EnterpriseWebLibrary.Tests.MailMerging.DataStructure.PracticeDocumentDataStructure { 6 | public class PracticeMockData { 7 | public readonly string PracticeName; 8 | internal IEnumerable Managers { get; private set; } 9 | public IEnumerable Physicians { get; private set; } 10 | 11 | public PracticeMockData( string practiceName, IEnumerable managers, IEnumerable physicians ) { 12 | PracticeName = practiceName; 13 | Managers = managers; 14 | Physicians = physicians; 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /Tests/MailMerging/DataStructure/TestFileDataStructure/MergeTestData.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | using System.Collections.Generic; 3 | 4 | namespace EnterpriseWebLibrary.Tests.MailMerging.DataStructure.TestFileDataStructure; 5 | 6 | public class MergeTestData { 7 | public string FullName; 8 | public List Things; 9 | 10 | public class Thing { 11 | public string TheValue; 12 | } 13 | } -------------------------------------------------------------------------------- /Tests/MailMerging/DataStructure/TestFileDataStructure/TheValue.cs: -------------------------------------------------------------------------------- 1 | using EnterpriseWebLibrary.MailMerging.FieldImplementation; 2 | 3 | namespace EnterpriseWebLibrary.Tests.MailMerging.DataStructure.TestFileDataStructure { 4 | public class TheValue: BasicMergeFieldImplementation { 5 | public string GetDescription() { 6 | return "This is a thing."; 7 | } 8 | 9 | public string Evaluate( MergeTestData.Thing row ) { 10 | return row.TheValue; 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /Tests/MailMerging/MergeFields/PhysicianMergeFields/Email.cs: -------------------------------------------------------------------------------- 1 | using EnterpriseWebLibrary.MailMerging.FieldImplementation; 2 | using EnterpriseWebLibrary.Tests.MailMerging.DataStructure.PracticeDocumentDataStructure.PhysicianDataStructure; 3 | 4 | namespace EnterpriseWebLibrary.Tests.MailMerging.MergeFields.PhysicianMergeFields { 5 | internal class Email: BasicMergeFieldImplementation { 6 | public string GetDescription() { 7 | return "The physician's email"; 8 | } 9 | 10 | public string Evaluate( PhysicianMockData row ) { 11 | return row.Email; 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /Tests/MailMerging/MergeFields/PhysicianMergeFields/FirstName.cs: -------------------------------------------------------------------------------- 1 | using EnterpriseWebLibrary.MailMerging.FieldImplementation; 2 | using EnterpriseWebLibrary.Tests.MailMerging.DataStructure.PracticeDocumentDataStructure.PhysicianDataStructure; 3 | 4 | namespace EnterpriseWebLibrary.Tests.MailMerging.MergeFields.PhysicianMergeFields { 5 | internal class FirstName: BasicMergeFieldImplementation { 6 | public string GetDescription() { 7 | return "The physician's first name"; 8 | } 9 | 10 | public string Evaluate( PhysicianMockData row ) { 11 | return row.FirstName; 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /Tests/MailMerging/MergeFields/PhysicianMergeFields/LastName.cs: -------------------------------------------------------------------------------- 1 | using EnterpriseWebLibrary.MailMerging.FieldImplementation; 2 | using EnterpriseWebLibrary.Tests.MailMerging.DataStructure.PracticeDocumentDataStructure.PhysicianDataStructure; 3 | 4 | namespace EnterpriseWebLibrary.Tests.MailMerging.MergeFields.PhysicianMergeFields { 5 | internal class LastName: BasicMergeFieldImplementation { 6 | public string GetDescription() { 7 | return "The physician's last name"; 8 | } 9 | 10 | public string Evaluate( PhysicianMockData row ) { 11 | return row.LastName; 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /Tests/MailMerging/MergeFields/PhysicianMergeFields/PhysicianEmail.cs: -------------------------------------------------------------------------------- 1 | using EnterpriseWebLibrary.MailMerging.FieldImplementation; 2 | using EnterpriseWebLibrary.Tests.MailMerging.DataStructure.PracticeDocumentDataStructure.PhysicianDataStructure; 3 | 4 | namespace EnterpriseWebLibrary.Tests.MailMerging.MergeFields.PhysicianMergeFields { 5 | public class PhysicianEmail: BasicMergeFieldImplementation { 6 | public string GetDescription() { 7 | return "The physician's email"; 8 | } 9 | 10 | public string Evaluate( PhysicianMockData row ) { 11 | return row.Email; 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /Tests/MailMerging/MergeFields/PracticeDocumentMergeFields/PracticeName.cs: -------------------------------------------------------------------------------- 1 | using EnterpriseWebLibrary.MailMerging.FieldImplementation; 2 | using EnterpriseWebLibrary.Tests.MailMerging.DataStructure.PracticeDocumentDataStructure; 3 | 4 | namespace EnterpriseWebLibrary.Tests.MailMerging.MergeFields.PracticeDocumentMergeFields { 5 | public class PracticeName: BasicMergeFieldImplementation { 6 | public string GetDescription() { 7 | return "The Practice's name"; 8 | } 9 | 10 | public string Evaluate( PracticeMockData row ) { 11 | return row.PracticeName; 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /Tests/MailMerging/MergeFields/PracticeManagerMergeFields/Email.cs: -------------------------------------------------------------------------------- 1 | using EnterpriseWebLibrary.MailMerging.FieldImplementation; 2 | using EnterpriseWebLibrary.Tests.MailMerging.DataStructure.PracticeDocumentDataStructure.PracticeManagerDataStructure; 3 | 4 | namespace EnterpriseWebLibrary.Tests.MailMerging.MergeFields.PracticeManagerMergeFields { 5 | public class Email: BasicMergeFieldImplementation { 6 | public string GetDescription() { 7 | return "The practice manager's email"; 8 | } 9 | 10 | public string Evaluate( PracticeManagerMockData row ) { 11 | return row.EmailAddress; 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /Tests/MailMerging/MergeFields/TestFileMergeFields/FullName.cs: -------------------------------------------------------------------------------- 1 | using EnterpriseWebLibrary.MailMerging.FieldImplementation; 2 | using EnterpriseWebLibrary.Tests.MailMerging.DataStructure.TestFileDataStructure; 3 | 4 | namespace EnterpriseWebLibrary.Tests.MailMerging.MergeFields.TestFileMergeFields { 5 | public class FullName: BasicMergeFieldImplementation { 6 | public string GetDescription() { 7 | return "This is a full name."; 8 | } 9 | 10 | public string Evaluate( MergeTestData row ) { 11 | return row.FullName; 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /Tests/NUnitInitializer.cs: -------------------------------------------------------------------------------- 1 | using EnterpriseWebLibrary; 2 | using NUnit.Framework; 3 | 4 | [ SetUpFixture ] 5 | public class NUnitInitializer { 6 | [ OneTimeSetUp ] 7 | public void InitStatics() { 8 | UnitTestingInitializationOps.InitStatics( new GlobalInitializer() ); 9 | } 10 | 11 | [ OneTimeTearDown ] 12 | public void CleanUpStatics() { 13 | UnitTestingInitializationOps.CleanUpStatics(); 14 | } 15 | } -------------------------------------------------------------------------------- /Tests/TestFiles/MergeOps/PracticesUserAccess.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enduracode/enterprise-web-library/e48feb24f3a9a5671db78f59cd63c62a7538d8ac/Tests/TestFiles/MergeOps/PracticesUserAccess.docx -------------------------------------------------------------------------------- /Tests/TestFiles/MergeOps/pdf.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enduracode/enterprise-web-library/e48feb24f3a9a5671db78f59cd63c62a7538d8ac/Tests/TestFiles/MergeOps/pdf.pdf -------------------------------------------------------------------------------- /Tests/TestFiles/MergeOps/word.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enduracode/enterprise-web-library/e48feb24f3a9a5671db78f59cd63c62a7538d8ac/Tests/TestFiles/MergeOps/word.docx -------------------------------------------------------------------------------- /Tests/TestFiles/PdfOps/onepage.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enduracode/enterprise-web-library/e48feb24f3a9a5671db78f59cd63c62a7538d8ac/Tests/TestFiles/PdfOps/onepage.pdf -------------------------------------------------------------------------------- /Tests/TestFiles/PdfOps/threepage.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enduracode/enterprise-web-library/e48feb24f3a9a5671db78f59cd63c62a7538d8ac/Tests/TestFiles/PdfOps/threepage.pdf -------------------------------------------------------------------------------- /Tests/TestFiles/PdfOps/twopage.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enduracode/enterprise-web-library/e48feb24f3a9a5671db78f59cd63c62a7538d8ac/Tests/TestFiles/PdfOps/twopage.pdf -------------------------------------------------------------------------------- /Tests/Tests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net8.0-windows 5 | EnterpriseWebLibrary.Tests 6 | EnterpriseWebLibrary.Tests 7 | win-x64 8 | enable 9 | direct 10 | 11 | 12 | 13 | 14 | 15 | all 16 | runtime; build; native; contentfiles; analyzers; buildtransitive 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Website/ConfigurationSchemas/GetSchema.cs: -------------------------------------------------------------------------------- 1 | using EnterpriseWebLibrary.Configuration; 2 | 3 | // EwlResource 4 | // Parameter: string fileName 5 | 6 | namespace EnterpriseWebLibrary.Website.ConfigurationSchemas; 7 | 8 | partial class GetSchema { 9 | private string filePath = null!; 10 | 11 | protected override void init() { 12 | filePath = EwlStatics.CombinePaths( ConfigurationStatics.FilesFolderPath, FileName + FileExtensions.Xsd ); 13 | if( !File.Exists( filePath ) ) 14 | throw new ApplicationException( "File does not exist." ); 15 | } 16 | 17 | protected override EwfSafeRequestHandler getOrHead() => 18 | new EwfSafeResponseWriter( 19 | () => EwfResponse.Create( ContentTypes.Xml, new EwfResponseBodyCreator( () => File.ReadAllText( filePath ) ) ), 20 | EwlStatics.EwlBuildDateTime, 21 | () => "getSchema" + FileName ); 22 | } -------------------------------------------------------------------------------- /Website/LegacyUrlStatics.cs: -------------------------------------------------------------------------------- 1 | namespace EnterpriseWebLibrary.Website; 2 | 3 | internal static class LegacyUrlStatics { 4 | public static IReadOnlyCollection GetPatterns() { 5 | var patterns = new List(); 6 | patterns.Add( WebFrameworkDemo.LegacyUrlFolderSetup.UrlPatterns.Literal( "TestPages" ) ); 7 | return patterns; 8 | } 9 | 10 | public static UrlHandler GetParent() => new WebFrameworkDemo.EntitySetup(); 11 | } -------------------------------------------------------------------------------- /Website/Program.cs: -------------------------------------------------------------------------------- 1 | using EnterpriseWebLibrary; 2 | using EnterpriseWebLibrary.EnterpriseWebFramework; 3 | 4 | EwfOps.RunApplication( new GlobalInitializer() ); -------------------------------------------------------------------------------- /Website/Providers/RequestDispatching.cs: -------------------------------------------------------------------------------- 1 | namespace EnterpriseWebLibrary.Website.Providers; 2 | 3 | partial class RequestDispatching { 4 | protected override SlowRequestThreshold GetSlowRequestThreshold() => SlowRequestThreshold._0500ms; 5 | protected override IEnumerable GetBaseUrlPatterns() => WebFrameworkDemo.EntitySetup.UrlPatterns.BaseUrlPattern().ToCollection(); 6 | public override UrlHandler GetFrameworkUrlParent() => new WebFrameworkDemo.EntitySetup(); 7 | } -------------------------------------------------------------------------------- /Website/Providers/StandardPageLogic.cs: -------------------------------------------------------------------------------- 1 | using EnterpriseWebLibrary.Website.StaticFiles; 2 | 3 | namespace EnterpriseWebLibrary.Website.Providers { 4 | internal class StandardPageLogic: AppStandardPageLogicProvider { 5 | protected override List GetStyleSheets() => new() { new TestCss() }; 6 | } 7 | } -------------------------------------------------------------------------------- /Website/StaticFiles/Logic/TestCss.cs: -------------------------------------------------------------------------------- 1 | namespace EnterpriseWebLibrary.Website.StaticFiles { 2 | partial class TestCss { 3 | protected override bool IsIntermediateInstallationPublicResource => true; 4 | } 5 | } -------------------------------------------------------------------------------- /Website/StaticFiles/test.css: -------------------------------------------------------------------------------- 1 | /* 2 | body { 3 | color: Blue; 4 | } 5 | */ 6 | 7 | .longColumn { 8 | white-space: normal; 9 | min-width: 20em; 10 | } 11 | 12 | .navigationBox { 13 | background-color: Green; 14 | } 15 | 16 | .daysOfWeek { 17 | background-color: Fuchsia; 18 | } 19 | 20 | .spacers { 21 | background-color: Orange; 22 | } 23 | 24 | .today { 25 | background-color: Aqua; 26 | } 27 | 28 | .days { 29 | background-color: Maroon; 30 | } 31 | .red { 32 | background-color: red; 33 | } 34 | .green { 35 | background-color: green; 36 | } -------------------------------------------------------------------------------- /Website/WebFrameworkDemo/Basic/Legacy URLs/LegacyUrlFolderSetup.cs: -------------------------------------------------------------------------------- 1 | // EwlResource 2 | 3 | namespace EnterpriseWebLibrary.Website.WebFrameworkDemo.Basic; 4 | 5 | partial class LegacyUrlFolderSetup { 6 | protected override UrlHandler getUrlParent() => new WebFrameworkDemo.LegacyUrlFolderSetup(); 7 | public override ConnectionSecurity ConnectionSecurity => ConnectionSecurity.MatchingCurrentRequest; 8 | 9 | protected override IEnumerable getChildUrlPatterns() { 10 | var patterns = new List(); 11 | patterns.Add( 12 | new UrlPattern( 13 | encoder => encoder is ModalContent.UrlEncoder ? EncodingUrlSegment.Create( "ModalContent.aspx" ) : null, 14 | url => string.Equals( url.Segment, "ModalContent.aspx", StringComparison.OrdinalIgnoreCase ) ? new ModalContent.UrlDecoder() : null ) ); 15 | return patterns; 16 | } 17 | } -------------------------------------------------------------------------------- /Website/WebFrameworkDemo/CheckboxListDemo.cs: -------------------------------------------------------------------------------- 1 | // EwlPage 2 | 3 | namespace EnterpriseWebLibrary.Website.WebFrameworkDemo { 4 | partial class CheckboxListDemo { 5 | protected override string getResourceName() => "Checkbox List"; 6 | 7 | protected override PageContent getContent() => 8 | new UiPageContent( isAutoDataUpdater: true ).Add( 9 | new CheckboxList( 10 | CheckboxListSetup.Create( 11 | from i in Enumerable.Range( 1, 20 ) select SelectListItem.Create( i, "Item " + i ), 12 | includeSelectAndDeselectAllButtons: true, 13 | minColumnWidth: 20.ToEm() ), 14 | new[] { 3, 9, 19 } ).ToFormItem() 15 | .ToComponentCollection() ); 16 | } 17 | } 18 | 19 | namespace EnterpriseWebLibrary.Website.WebFrameworkDemo { 20 | partial class CheckboxListDemo { 21 | protected override UrlHandler getUrlParent() => new LegacyUrlFolderSetup(); 22 | } 23 | } -------------------------------------------------------------------------------- /Website/WebFrameworkDemo/ComponentLists.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using EnterpriseWebLibrary.EnterpriseWebFramework; 3 | using Tewl.Tools; 4 | 5 | // EwlPage 6 | 7 | namespace EnterpriseWebLibrary.Website.WebFrameworkDemo { 8 | partial class ComponentLists { 9 | protected override PageContent getContent() => 10 | new UiPageContent().Add( 11 | new Section( 12 | "List of form controls", 13 | new StackList( 14 | Enumerable.Range( 1, 3 ) 15 | .Select( i => new TextControl( "", false, maxLength: 10, validationMethod: ( value, validator ) => {} ).ToFormItem().ToListItem() ) ) 16 | .ToCollection() ) ); 17 | } 18 | } 19 | 20 | namespace EnterpriseWebLibrary.Website.WebFrameworkDemo { 21 | partial class ComponentLists { 22 | protected override UrlHandler getUrlParent() => new LegacyUrlFolderSetup(); 23 | } 24 | } -------------------------------------------------------------------------------- /Website/WebFrameworkDemo/FileManagers.cs: -------------------------------------------------------------------------------- 1 | using EnterpriseWebLibrary.Providers; 2 | 3 | namespace EnterpriseWebLibrary.Website.WebFrameworkDemo; 4 | 5 | // EwlPage 6 | partial class FileManagers { 7 | protected override PageContent getContent() => 8 | new UiPageContent( omitContentBox: true ) 9 | .Add( 10 | new Section( 11 | "File manager", 12 | new BlobFileManager( BlobStorage.FileManagerCollectionId, false, _ => {}, out _ ).ToCollection(), 13 | style: SectionStyle.Box ) ) 14 | .Add( 15 | new Section( 16 | "File-collection manager", 17 | new BlobFileCollectionManager( BlobStorage.FileCollectionManagerCollectionId ).ToCollection(), 18 | style: SectionStyle.Box ) ); 19 | } -------------------------------------------------------------------------------- /Website/WebFrameworkDemo/FileUploadDemo.cs: -------------------------------------------------------------------------------- 1 | // EwlPage 2 | 3 | namespace EnterpriseWebLibrary.Website.WebFrameworkDemo; 4 | 5 | partial class FileUploadDemo { 6 | protected override string getResourceName() => "File Upload"; 7 | 8 | protected override PageContent getContent() => 9 | new UiPageContent( isAutoDataUpdater: true ).Add( 10 | FormItemList.CreateStack() 11 | .AddItem( 12 | new FileUpload( 13 | validationMethod: ( value, _ ) => AddStatusMessage( 14 | StatusMessageType.Info, 15 | value != null ? "File size: {0} bytes".FormatWith( value.Contents.Length ) : "No file uploaded." ) ).ToFormItem( 16 | label: "File upload".ToComponents() ) ) ); 17 | } -------------------------------------------------------------------------------- /Website/WebFrameworkDemo/GetImage.cs: -------------------------------------------------------------------------------- 1 | using EnterpriseWebLibrary.EnterpriseWebFramework; 2 | 3 | // EwlResource 4 | // Parameter: string text 5 | 6 | namespace EnterpriseWebLibrary.Website.WebFrameworkDemo { 7 | partial class GetImage { 8 | protected override EwfSafeRequestHandler getOrHead() => new EwfSafeResponseWriter( NetTools.CreateImageFromText( Text, null ) ); 9 | } 10 | } 11 | 12 | namespace EnterpriseWebLibrary.Website.WebFrameworkDemo { 13 | partial class GetImage { 14 | protected override UrlHandler getUrlParent() => new LegacyUrlFolderSetup(); 15 | } 16 | } -------------------------------------------------------------------------------- /Website/WebFrameworkDemo/HtmlEditing.cs: -------------------------------------------------------------------------------- 1 | // EwlPage 2 | 3 | namespace EnterpriseWebLibrary.Website.WebFrameworkDemo { 4 | partial class HtmlEditing { 5 | protected override PageContent getContent() => 6 | FormState.ExecuteWithActions( 7 | PostBack.CreateFull(), 8 | () => new UiPageContent( contentFootActions: new ButtonSetup( "Post Back" ) ).Add( 9 | new WysiwygHtmlEditor( "", true, ( _, _ ) => {} ).ToFormItem( label: Enumerable.Empty().Materialize() ) 10 | .ToComponentCollection() ) ); 11 | } 12 | } 13 | 14 | namespace EnterpriseWebLibrary.Website.WebFrameworkDemo { 15 | partial class HtmlEditing { 16 | protected override UrlHandler getUrlParent() => new LegacyUrlFolderSetup(); 17 | } 18 | } -------------------------------------------------------------------------------- /Website/WebFrameworkDemo/MailMerging.cs: -------------------------------------------------------------------------------- 1 | using EnterpriseWebLibrary.MailMerging; 2 | 3 | // EwlPage 4 | 5 | namespace EnterpriseWebLibrary.Website.WebFrameworkDemo; 6 | 7 | partial class MailMerging { 8 | protected override PageContent getContent() => 9 | new UiPageContent().Add( 10 | MergeStatics.CreateEmptyPseudoTableRowTree() 11 | .ToFieldTreeDisplay( "Merge Fields" ) 12 | .Append( 13 | new Section( 14 | "A Pseudo Row", 15 | MergeStatics.CreatePseudoTableRowTree( new PseudoTableRow( 4 ).ToCollection() ) 16 | .ToRowTreeDisplay( 17 | new MergeFieldNameTree( 18 | new[] { "Test", "FullName" }, 19 | childNamesAndChildren: Tuple.Create( "Things", new MergeFieldNameTree( "Another".ToCollection() ) ).ToCollection() ), 20 | omitListIfSingleRow: true ) 21 | .ToCollection() ) ) 22 | .Materialize() ); 23 | } -------------------------------------------------------------------------------- /Website/WebFrameworkDemo/SubFolder/Details.cs: -------------------------------------------------------------------------------- 1 | using EnterpriseWebLibrary.EnterpriseWebFramework; 2 | 3 | // EwlPage 4 | 5 | namespace EnterpriseWebLibrary.Website.WebFrameworkDemo.SubFolder { 6 | partial class Details {} 7 | } 8 | 9 | namespace EnterpriseWebLibrary.Website.WebFrameworkDemo.SubFolder { 10 | partial class Details { 11 | protected override UrlHandler getUrlParent() => new LegacyUrlFolderSetup(); 12 | } 13 | } -------------------------------------------------------------------------------- /Website/WebFrameworkDemo/SubFolder/Disabled.cs: -------------------------------------------------------------------------------- 1 | using EnterpriseWebLibrary.EnterpriseWebFramework; 2 | 3 | // EwlPage 4 | 5 | namespace EnterpriseWebLibrary.Website.WebFrameworkDemo.SubFolder { 6 | partial class Disabled { 7 | protected override AlternativeResourceMode createAlternativeMode() => new DisabledResourceMode( "Disabled!" ); 8 | } 9 | } 10 | 11 | namespace EnterpriseWebLibrary.Website.WebFrameworkDemo.SubFolder { 12 | partial class Disabled { 13 | protected override UrlHandler getUrlParent() => new LegacyUrlFolderSetup(); 14 | } 15 | } -------------------------------------------------------------------------------- /Website/WebFrameworkDemo/SubFolder/EntitySetup.cs: -------------------------------------------------------------------------------- 1 | namespace EnterpriseWebLibrary.Website.WebFrameworkDemo.SubFolder; 2 | 3 | partial class EntitySetup: UiEntitySetup { 4 | protected override ResourceBase createParent() => ActionControls.GetInfo(); 5 | 6 | protected override string getEntitySetupName() => "Nested"; 7 | 8 | public override ResourceBase DefaultResource => new General( this ); 9 | 10 | protected override IEnumerable createListedResources() => 11 | new[] { new ResourceGroup( new General( this ), new Details( this ), new Disabled( this ), new New( this ) ) }; 12 | 13 | protected override UrlHandler? getRequestHandler() => null; 14 | 15 | EntityUiSetup UiEntitySetup.GetUiSetup() => 16 | new( entitySummaryContent: new Paragraph( "Awesome content goes here.".ToComponents() ).ToCollection(), tabMode: TabMode.Horizontal ); 17 | } -------------------------------------------------------------------------------- /Website/WebFrameworkDemo/SubFolder/General.cs: -------------------------------------------------------------------------------- 1 | using EnterpriseWebLibrary.EnterpriseWebFramework; 2 | 3 | // EwlPage 4 | 5 | namespace EnterpriseWebLibrary.Website.WebFrameworkDemo.SubFolder { 6 | partial class General { 7 | protected override PageContent getContent() => 8 | new UiPageContent().Add( 9 | new Paragraph( 10 | "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec lectus orci, lobortis at sem eget, iaculis rhoncus justo. Proin at erat urna. Duis porttitor sollicitudin lacus non faucibus. In consectetur sit amet metus ac gravida. Aliquam malesuada euismod rutrum. Suspendisse eu tincidunt neque, at finibus leo. Phasellus auctor velit blandit ante vulputate, ac condimentum quam dictum." 11 | .ToComponents() ) ); 12 | } 13 | } 14 | 15 | namespace EnterpriseWebLibrary.Website.WebFrameworkDemo.SubFolder { 16 | partial class General { 17 | protected override UrlHandler getUrlParent() => new LegacyUrlFolderSetup(); 18 | } 19 | } -------------------------------------------------------------------------------- /Website/WebFrameworkDemo/SubFolder/New.cs: -------------------------------------------------------------------------------- 1 | using EnterpriseWebLibrary.EnterpriseWebFramework; 2 | 3 | // EwlPage 4 | 5 | namespace EnterpriseWebLibrary.Website.WebFrameworkDemo.SubFolder { 6 | partial class New { 7 | protected override AlternativeResourceMode createAlternativeMode() => new NewContentResourceMode(); 8 | } 9 | } 10 | 11 | namespace EnterpriseWebLibrary.Website.WebFrameworkDemo.SubFolder { 12 | partial class New { 13 | protected override UrlHandler getUrlParent() => new LegacyUrlFolderSetup(); 14 | } 15 | } -------------------------------------------------------------------------------- /Website/WebFrameworkDemo/TestService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using EnterpriseWebLibrary.EnterpriseWebFramework; 5 | 6 | // EwlAutoCompleteService 7 | // OptionalParameter: string term 8 | 9 | namespace EnterpriseWebLibrary.Website.WebFrameworkDemo { 10 | partial class TestService { 11 | protected override IEnumerable getItems() { 12 | var rand = new Random(); 13 | return Enumerable.Range( 0, 10 ) 14 | .Select( 15 | i => { 16 | var next = Term + rand.Next( 1000 ); 17 | return new AutoCompleteItem( next, next ); 18 | } ); 19 | } 20 | } 21 | } 22 | 23 | namespace EnterpriseWebLibrary.Website.WebFrameworkDemo { 24 | partial class TestService { 25 | protected override UrlHandler getUrlParent() => new LegacyUrlFolderSetup(); 26 | } 27 | } -------------------------------------------------------------------------------- /Website/WebFrameworkDemo/UnauthorizedPage.cs: -------------------------------------------------------------------------------- 1 | // EwlPage 2 | 3 | namespace EnterpriseWebLibrary.Website.WebFrameworkDemo; 4 | 5 | partial class UnauthorizedPage { 6 | protected override bool userCanAccess => false; 7 | } -------------------------------------------------------------------------------- /Website/Website.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | en-US 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | --------------------------------------------------------------------------------