AFNameSubstitution.ResolveName Method (AFObject, IAFDataProvider, String, IFormatProvider)
- Last UpdatedNov 18, 2025
- 3 minute read
- PI System
- AF SDK 2024 R2
- Developer
Resolves the substitution fields within the new name for the specified object and IAFDataProvider.
Namespace: OSIsoft.AF
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
public static bool ResolveName( AFObject item, IAFDataProvider dataProvider, string name = null, IFormatProvider provider = null )
Public Shared Function ResolveName ( item As AFObject, dataProvider As IAFDataProvider, Optional name As String = Nothing, Optional provider As IFormatProvider = Nothing ) As Boolean Dim item As AFObject Dim dataProvider As IAFDataProvider Dim name As String Dim provider As IFormatProvider Dim returnValue As Boolean returnValue = AFNameSubstitution.ResolveName(item, dataProvider, name, provider)
public: static bool ResolveName( AFObject^ item, IAFDataProvider^ dataProvider, String^ name = nullptr, IFormatProvider^ provider = nullptr )
static member ResolveName : item : AFObject * dataProvider : IAFDataProvider * ?name : string * ?provider : IFormatProvider (* Defaults: let _name = defaultArg name null let _provider = defaultArg provider null *) -> bool
Parameters
- item
- Type: OSIsoft.AFAFObject
The object to be updated with the resolved name. - dataProvider
- Type: OSIsoft.AF.DataIAFDataProvider
A data provider that cached data can be acquired from. - name (Optional)
- Type: SystemString
The new name string for the item that may contain substitution fields that need to be resolved. If the name ends with an asterisk (*), then a unique name will be generated based on the supplied name after any substitution fields have been resolved. If the name is not specified or , then the NamingPattern will be used to generate the new name. See the ValidateName(String, String) method for a description of what is valid when setting the name of the object. - provider (Optional)
- Type: SystemIFormatProvider
An object that supplies culture-specific formatting information used when replacing the substitution fields in the specified name. If , then InvariantCulture will be used when replacing the substitution fields. This would affect the formatting of the time related substitution fields.
Return Value
Type: BooleanReturns if the name of the item was modified. If the resolved name is different than the current name of item, then the name of item will be updated before returning.
Remarks
This method will resolve the substitution fields in the specified new name for the object and then set its Name property. If the name is not specified or , then the NamingPattern from the object's AFElementTemplate will be used to generate the new name or do nothing if the object does not have a template. Any substitution fields that cannot be resolved will be replaced with an empty string. Any characters that are not valid for the item's name within the substitution field value will be replaced by a space. See AFNameSubstitutionType for description of the allowed substitution fields.
| This method, property, or class is not available in the legacy .NET 3.5 version of the SDK. |