You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some of the supported expandable properties resolve to information that can be represented in different ways (i.e. are related to classes that implement the IFormattable interface). By leveraging these capabilities, the values of the properties used within a license header definition can be more diverse.
For example, date- or time-related properties could be formatted to the user's liking (e.g. leading zeros, which DateTime parts to include, ...)
Above example represents a (new) property with the name CreationYear that will be expanded to a string that displays the date and time in the current culture's short date and time format.
Important Classes
The changes needed to implement such a functionality are not very far-reaching. The most important classes are the following:
DocumentHeaderProperty.cs: A model class representing a property that will be expanded (with a Predicate that determines whether a value can be created as well as a Func that creates the value).
DocumentHeaderProperties.cs: Actually defines the properties that are resolved during license header insertion.
Implementation Notes
There is no rigid pre-conceived solution we are aiming for. However, the behavior for the existing properties must not change (at least not by default), this would be a breaking change for the userbase. This implies that the format specifier should not become mandatory for pre-existing (or any) properties. Also keep in mind that the culture used for formatting affects the resulting string, so this should not be neglected.
The text was updated successfully, but these errors were encountered:
Some of the supported expandable properties resolve to information that can be represented in different ways (i.e. are related to classes that implement the
IFormattable
interface). By leveraging these capabilities, the values of the properties used within a license header definition can be more diverse.For example, date- or time-related properties could be formatted to the user's liking (e.g. leading zeros, which
DateTime
parts to include, ...)(Potential, Tentative) Usage
Generally:
%PropertyName:FormatSpecifier%
Example:
%CreationYear:G%
Above example represents a (new) property with the name
CreationYear
that will be expanded to a string that displays the date and time in the current culture's short date and time format.Important Classes
The changes needed to implement such a functionality are not very far-reaching. The most important classes are the following:
DocumentHeaderProperty.cs
: A model class representing a property that will be expanded (with aPredicate
that determines whether a value can be created as well as aFunc
that creates the value).DocumentHeaderProperties.cs
: Actually defines the properties that are resolved during license header insertion.Implementation Notes
There is no rigid pre-conceived solution we are aiming for. However, the behavior for the existing properties must not change (at least not by default), this would be a breaking change for the userbase. This implies that the format specifier should not become mandatory for pre-existing (or any) properties. Also keep in mind that the culture used for formatting affects the resulting string, so this should not be neglected.
The text was updated successfully, but these errors were encountered: