Home > Providers > DXCore standard string providers list

DXCore standard string providers list

August 15th, 2011 Leave a comment Go to comments

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 NameDescription
AddQuotesReturns the string passed as a parameter with double quotes added.
DateReturns the current date in the short date string format.
DateLongReturns the current date in the long date string format.
DateTimeNowReturns the DateTime.Now in a specified format.
DayReturns the day of the month.
DayOfWeekReturns the name of the weekday.
DecIntegerDecrements 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.
DeclareOverrideItemReturns 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.

DoubleIntegerDoubles 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.
EnumerableTypeReturns the IEnumerable type name of the specified variable.
FileBaseReturns the name of the active file without a path and without an extension.
FileDriveReturns the drive of the active file (e.g., “C:\”).
FileExtensionReturns the extension of the active file.
FileNameReturns the name of the active file including the path.
FilePathReturns the path of the active file.
FirstCamelCaseWordReturns 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.
FormatFieldNameFormats 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.
FormatLocalNameFormats 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.
FormatParamNameFormats 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.
GetGets a previously-specified string assigned to the specified variable.
GetColorShows the CodeRush Color Picker and returns the name of the chosen color.
GetIteratorNameReturns an iterator variable name based on the name of a collection to iterate through.
GetPropertySuffixReturns a property name suffix if the specified field name will be in conflict with the property name obtained from the PropertyNameFromField string provider.
GetTypeSuffixReturns the type suffix for the current language (e.g. ‘^’, ‘*’ for C++).
GetUniqueIDGets a unique ID for the active XML file.
GetUniqueValueGets a unique value for all the children of the active XML element.
GetUserFirstNameGets the user first name specified on the IDE | User Info options page.
GetUserInfoGets the user information specified on the IDE | User Info options page by the key passed as a parameter.
GetUserInitialsGets the user initials based on the user first and last name specified on the IDE | User Info options page.
GetUserLastNameGets the user last name specified on the IDE | User Info options page.
GetUserMiddleNameGets the user middle name specified on the IDE | User Info options page.
HourReturns the hour.
IncIntegerIncrements 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.
InitialCapMakes the first letter of the string passed as a parameter to this StringProvider upparcase.
InitialLowMakes the first letter of the string passed as a parameter to this StringProvider lowercase.
InitialValueFromTypeReturns an initial value based on a full type name passed to it.
InvertBooleanReturns the logical opposite of the specified boolean constant (passed as a parameter to this StringProvider). So “true” becomes “false”, and “False” becomes “True”.
LongestSelectedCodeLineReturns 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.
LongestSelectedLineReturns the length of the longest line in the active selection (a TextView must have focus when invoking this string provider).
MemberGets the name of the active member (e.g., property, method, etc.) containing the caret.
MemberFooterThe region footer for the specified declaration section.
MemberHeaderThe region header for the specified declaration section.
Method As ParameterReturns 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).
MinuteReturns the minute.
MonthReturns the month.
NearestLocalOfTypeReturns the local variable name for the specified full type name.
NewGuidGenerates 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).
OneTrailingEnsures 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.
PasteReturns the text on the clipboard.
PasteArrayBaseTypeReturns the base type name of the array on the clipboard.
PasteFirstLineGets the first line of the clipboard text (everything up to the first line terminator).
PasteTypeReturns the full type name on the clipboard.
PrefixFieldReturns the prefix associated with field variables for the active language based on customer settings (on the Editor\Code Style\Identifiers options page).
PrefixLocalReturns the prefix associated with local variables for the active language based on customer settings (on the Editor\Code Style\Identifiers options page).
PrefixParamReturns the prefix associated with parameters for the active language based on customer settings (on the Editor\Code Style\Identifiers options page).
PrimitiveDefaultValueReturns a primitive initial value based on a full type name passed to it.
ProjectFileNameReturns the file name of the active project.
ProjectNameReturns the name of the active project.
PropertyNameFromFieldConverts 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.
PropertyNameFromLocalConverts 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.
PropertyNameFromParamConverts 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.
RemoveQuotesReturns the string passed as a parameter without double quotes.
RepeatCreates a string that repeats the specified sequence, up to a specified maximum length.
RootFormatFieldNameReturns the field variable name formatted according to customer preferences (either camel case or pascal case) without a leading prefix or a trailing suffix.
RootFormatLocalNameReturns the local variable name formatted according to customer preferences (either camel case or pascal case) without a leading prefix or a trailing suffix.
RootFormatParamNameReturns the parameter variable name formatted according to customer preferences (either camel case or pascal case) without a leading prefix or a trailing suffix.
ScopeConstantReturns the default scope for constants.
ScopeEventReturns the default scope for events.
ScopeFieldReturns the default scope for fields
ScopeMethodReturns the default scope for methods.
ScopeNestedTypeReturns the default scope for nested types.
ScopePropertyReturns the default scope for properties.
ScopeTypeReturns the default scope for types.
SecondReturns the second.
SemicolonReturns the semicolon character if required for the current lambda expression.
SetSets a variable to a specified string for later use through the “Get” string provider. Returns an empty string.
SimpleNameReturns the simple name based on a full member name passed to it.
SimpleTypeNameReturns the simple type name based on a full type name passed to it.
SolutionFileNameReturns the file name of the active solution.
SolutionNameReturns the name of the active solution.
SuffixFieldReturns the suffix associated with field variables for the active language based on customer settings (on the Editor\Code Style\Identifiers options page).
SuffixLocalReturns the suffix associated with local variables for the active language based on customer settings (on the Editor\Code Style\Identifiers options page).
SuffixParamReturns the suffix associated with parameters for the active language based on customer settings (on the Editor\Code Style\Identifiers options page).
TextCommandBeginReturns the start character for text command.
TextCommandEndReturns the end character for text command.
TimeReturns the time in the short time string format.
TimeLongReturns the time in the long time string format.
TypeGets the name of the active type containing the caret.
UserNameReturns the user name of the logged in user.
WcfBaseAddressReturns 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.
XmlDocCommentBeginReturns the XML comment delimiters.
XMLMultilineDocCommentBeginReturn the XML Multi-line Doc comment begin delimiter.
XMLMultilineDocCommentEndReturns the XML Multi-line Doc comment end delimiter.
YearReturns the year.
—–
Products: DXCore
Versions: 11.1 and up
VS IDEs: any
Updated: Aug/16/2011
ID: D105

Similar Posts:

  1. No comments yet. Be the first and leave a comment!
  1. No trackbacks yet.