15 protected readonly IServiceProvider _serviceProvider;
24 _workspaceService = workspaceService;
25 _serviceProvider = serviceProvider;
27 Type resolverType = typeof(IDocumentPlaceholderResolver<>).MakeGenericType(
ItemType);
28 PlaceholderResolver = _serviceProvider.GetService(resolverType) as IDocumentPlaceholderResolver<TData>;
29 if (
PlaceholderResolver is
null)
throw new InvalidOperationException($
"No Resolver found for type {ItemType.Name}.");
69 Placeholders.PLACEHOLDER_KEY_COMPETITION_YEAR,
70 Placeholders.PLACEHOLDER_KEY_COMPETITION_DATE,
71 Placeholders.PLACEHOLDER_KEY_APP_VERSION,
72 Placeholders.PLACEHOLDER_KEY_WORKSPACE_PATH
85 return supportedPlaceholderKeys;
95 return postfixNumbersResolver;
object[] GetItems()
Retrieves the items that will be used to create the document.List with items
virtual bool SupportTablePlaceholders
Indicating if DocXPlaceholderHelper.TablePlaceholders are supported.If CreateMultiplePages is false,...
DocumentCreationTypes DocumentType
Gets the type of document this strategy creates.
virtual string TemplateFileNamePostfixReplaceStr
Use this string instead of the template file name postfix during document creation....
List< string > SupportedPlaceholderKeys
List of all placeholder keys that are supported by the PlaceholderResolver.
string TemplatePath
Gets the path to the template used for creating the document.
virtual bool SupportTextPlaceholders
Indicating if DocXPlaceholderHelper.TextPlaceholders are supported.If CreateMultiplePages is true,...
virtual IEnumerable< Enum > AvailableItemFilters
Array with all available filters for the items.If no filtering is supported, this will be null.
DocumentStrategyBase(IWorkspaceService workspaceService, IServiceProvider serviceProvider)
Constructor for the document strategy base class.
DocXPlaceholderHelper.TablePlaceholders ResolveTablePlaceholders(object[] items)
Resolve table placeholders for the given items.DocXPlaceholderHelper.TablePlaceholders
bool CreateMultiplePages
Gets a value indicating whether this strategy supports creating multiple pages in the document....
DocXPlaceholderHelper.TextPlaceholders ResolveTextPlaceholders(object item=null)
Resolve text placeholders for the given item.DocXPlaceholderHelper.TextPlaceholders
Type ItemType
Gets the type of items that this strategy will handle.
virtual Enum ItemFilter
Current filter for the items.If no filtering is supported, this will be null.
List< string > AlwaysSupportedPlaceholderKeys
List with placeholder keys that are always supported, no matter what the PlaceholderResolver supports...
IDocumentPlaceholderResolver< TData > PlaceholderResolver
Placeholder resolver used to resolve placeholders in the document.
virtual Enum ItemOrdering
Current ordering for the items.If no ordering is supported, this will be null.
List< int > PostfixNumbersSupported
Number of postfix numbers that are supported for the placeholders.If this is e.g. 2,...
virtual object ItemFilterParameter
Filter parameter that can be used together with ItemFiltering.The type and usage of this parameter de...
virtual IEnumerable< Enum > AvailableItemOrderings
Array with all available orderings for the items.If no ordering is supported, this will be null.
Class to hold table placeholders and their list of values.
Class to hold text placeholders and their values.
Interface for a service used to manage a workspace.
Interface for document strategies that define how to create and collect data for different types of d...
DocumentCreationTypes
Different types of documents that can be created.