Home > Providers > DXCore standard string providers list

DXCore standard string providers list

August 15th, 2011

DXCore string providers are functions that return strings, and can be used to provide calculated information (e.g., date/time stamps, user names, active file name, etc) inside text expansions or DXCore plug-ins.

Provider Name Description
AddQuotes Returns the string passed as a parameter with double quotes added.
Date Returns the current date in the short date string format.
DateLong Returns the current date in the long date string format.
DateTimeNow Returns the DateTime.Now in a specified format.
Day Returns the day of the month.
DayOfWeek Returns the name of the weekday.
DecInteger Decrements an integer (passed as a parameter to this string provider) in a hex or decimal format. The output string is the decremented value in the same format as the input number.
DeclareOverrideItem Returns a member override declaration for the abstract ForEach item. You can use the ForEach TextCommand like this:

«ForEach(abstact method in base,TemplateToExpand)»

Then inside your TemplateToExpand template, reference this DeclareOverrideItem string provider. This will create overrides for each abstract method found in the ancestor classes.

DoubleInteger Doubles the value of an integer (passed as a parameter to this StringProvider) in a hex or decimal format. The output string is the doubled value in the same format as the input value.
EnumerableType Returns the IEnumerable type name of the specified variable.
FileBase Returns the name of the active file without a path and without an extension.
FileDrive Returns the drive of the active file (e.g., “C:\”).
FileExtension Returns the extension of the active file.
FileName Returns the name of the active file including the path.
FilePath Returns the path of the active file.
FirstCamelCaseWord Returns the first camel-case sequence of characters (the first character of the specified string, plus all lower-case characters that follow) from the specified string parameter.
FormatFieldName Formats the specified identifier (passed as a string parameter) so it matches the style specified for field variable declarations. You can change style options in the Editor\Code Style section of the CodeRush Options dialog.
FormatLocalName Formats the specified identifier (passed as a string parameter) so it matches the style specified for local variable declarations. You can change style options in the Editor\Code Style section of the CodeRush Options dialog.
FormatParamName Formats the specified identifier (passed as a string parameter) so it matches the style specified for parameter declarations. You can change style options in the Editor\Code Style section of the CodeRush Options dialog.
Get Gets a previously-specified string assigned to the specified variable.
GetColor Shows the CodeRush Color Picker and returns the name of the chosen color.
GetIteratorName Returns an iterator variable name based on the name of a collection to iterate through.
GetPropertySuffix Returns a property name suffix if the specified field name will be in conflict with the property name obtained from the PropertyNameFromField string provider.
GetTypeSuffix Returns the type suffix for the current language (e.g. ‘^’, ‘*’ for C++).
GetUniqueID Gets a unique ID for the active XML file.
GetUniqueValue Gets a unique value for all the children of the active XML element.
GetUserFirstName Gets the user first name specified on the IDE | User Info options page.
GetUserInfo Gets the user information specified on the IDE | User Info options page by the key passed as a parameter.
GetUserInitials Gets the user initials based on the user first and last name specified on the IDE | User Info options page.
GetUserLastName Gets the user last name specified on the IDE | User Info options page.
GetUserMiddleName Gets the user middle name specified on the IDE | User Info options page.
Hour Returns the hour.
IncInteger Increments an integer (passed as a parameter to this StringProvider) in a hex or decimal format. The output string is the incremented value, in the same format as the input value.
InitialCap Makes the first letter of the string passed as a parameter to this StringProvider upparcase.
InitialLow Makes the first letter of the string passed as a parameter to this StringProvider lowercase.
InitialValueFromType Returns an initial value based on a full type name passed to it.
InvertBoolean Returns the logical opposite of the specified boolean constant (passed as a parameter to this StringProvider). So “true” becomes “false”, and “False” becomes “True”.
LongestSelectedCodeLine Returns the length of the longest code line in the active selection (a TextView must have focus when invoking this StringProvider), ignoring leading and trailing white spaces.
LongestSelectedLine Returns the length of the longest line in the active selection (a TextView must have focus when invoking this string provider).
Member Gets the name of the active member (e.g., property, method, etc.) containing the caret.
MemberFooter The region footer for the specified declaration section.
MemberHeader The region header for the specified declaration section.
Method As Parameter Returns the type reference of the method that will be associated with refactorings (and code providers) that work with method references (on the Editor\Code Style\Identifiers options page).
Minute Returns the minute.
Month Returns the month.
NearestLocalOfType Returns the local variable name for the specified full type name.
NewGuid Generates and returns a new string guid. (This string provider accepts an optional format string; if a format is not specified, then “B” format is used).
OneTrailing Ensures that only one instance of the specified character exists at the end of a template expansion. This string provider is used internally by the CodeRush template engine and calls CodeRush.Templates.RightText, which is valid only during template expansion.
Paste Returns the text on the clipboard.
PasteArrayBaseType Returns the base type name of the array on the clipboard.
PasteFirstLine Gets the first line of the clipboard text (everything up to the first line terminator).
PasteType Returns the full type name on the clipboard.
PrefixField Returns the prefix associated with field variables for the active language based on customer settings (on the Editor\Code Style\Identifiers options page).
PrefixLocal Returns the prefix associated with local variables for the active language based on customer settings (on the Editor\Code Style\Identifiers options page).
PrefixParam Returns the prefix associated with parameters for the active language based on customer settings (on the Editor\Code Style\Identifiers options page).
PrimitiveDefaultValue Returns a primitive initial value based on a full type name passed to it.
ProjectFileName Returns the file name of the active project.
ProjectName Returns the name of the active project.
PropertyNameFromField Converts a field name (passed as a parameter to this string provider) to a property name. You can change style options in the Editor\Code Style section of the CodeRush Options dialog.
PropertyNameFromLocal Converts a local name (passed as a parameter to this string provider) to a property name. You can change style options in the Editor\Code Style section of the CodeRush Options dialog.
PropertyNameFromParam Converts a parameter name (passed as a parameter to this string provider) to a property name. You can change style options in the Editor\Code Style section of the CodeRush Options dialog.
RemoveQuotes Returns the string passed as a parameter without double quotes.
Repeat Creates a string that repeats the specified sequence, up to a specified maximum length.
RootFormatFieldName Returns the field variable name formatted according to customer preferences (either camel case or pascal case) without a leading prefix or a trailing suffix.
RootFormatLocalName Returns the local variable name formatted according to customer preferences (either camel case or pascal case) without a leading prefix or a trailing suffix.
RootFormatParamName Returns the parameter variable name formatted according to customer preferences (either camel case or pascal case) without a leading prefix or a trailing suffix.
ScopeConstant Returns the default scope for constants.
ScopeEvent Returns the default scope for events.
ScopeField Returns the default scope for fields
ScopeMethod Returns the default scope for methods.
ScopeNestedType Returns the default scope for nested types.
ScopeProperty Returns the default scope for properties.
ScopeType Returns the default scope for types.
Second Returns the second.
Semicolon Returns the semicolon character if required for the current lambda expression.
Set Sets a variable to a specified string for later use through the “Get” string provider. Returns an empty string.
SimpleName Returns the simple name based on a full member name passed to it.
SimpleTypeName Returns the simple type name based on a full type name passed to it.
SolutionFileName Returns the file name of the active solution.
SolutionName Returns the name of the active solution.
SuffixField Returns the suffix associated with field variables for the active language based on customer settings (on the Editor\Code Style\Identifiers options page).
SuffixLocal Returns the suffix associated with local variables for the active language based on customer settings (on the Editor\Code Style\Identifiers options page).
SuffixParam Returns the suffix associated with parameters for the active language based on customer settings (on the Editor\Code Style\Identifiers options page).
TextCommandBegin Returns the start character for text command.
TextCommandEnd Returns the end character for text command.
Time Returns the time in the short time string format.
TimeLong Returns the time in the long time string format.
Type Gets the name of the active type containing the caret.
UserName Returns the user name of the logged in user.
WcfBaseAddress Returns a default base address for specified binding. If no binding is specified, then the value of the active “Binding” variable (set by WCF template mnemonics) is used.
XmlDocCommentBegin Returns the XML comment delimiters.
XMLMultilineDocCommentBegin Return the XML Multi-line Doc comment begin delimiter.
XMLMultilineDocCommentEnd Returns the XML Multi-line Doc comment end delimiter.
Year Returns the year.
—–
Products: DXCore
Versions: 11.1 and up
VS IDEs: any
Updated: Aug/16/2011
ID: D105

Similar Posts: