IAdmAttributeFriendlyNamesOps
The IAdmAttributeFriendlyNamesOps interface is used to manage property display names.
Inheritance: IUnknown
To use the IAdmAttributeFriendlyNamesOps interface, you need to bind to the Configuration Set Settings container using the "ConfigurationSetSettings"
alias.
Methods
-
Method
-
Description
-
GetLanguages()
-
Returns an array of languages, for which property display names are specified.
-
GetAttributeFriendlyNames()
-
Returns an array of property display names specified for the given language.
-
SetAttributeFriendlyNames()
-
Sets property display names for the given language.
Details
GetLanguages()
Returns an array of languages, for which property display names are specified. Each language in the array is represented by an ISO 639-2 three-letter code (e.g. deu).
string[] GetLanguages()
GetAttributeFriendlyNames()
Returns an array of property display names specified for the given language.
IAdmAttributeFriendlyNames[] GetAttributeFriendlyNames(
string language,
ADM_GETATTRFRIENDLYNAMESMODE_ENUM friendlyNamesType)
Parameters
- language - Specifies the ISO 639-2 three-letter code of the language (e.g. deu) for which to return property display names.
- friendlyNamesType - Specifies what property display names to return. You can retrieve built-in property display names provided out of the box, modified property display names or a merged array of modified and built-in property display names.
SetAttributeFriendlyNames()
Sets property display names for the given language.
void SetAttributeFriendlyNames(string language, IAdmAttributeFriendlyNames[] friendlyNames)
Parameters
- language - Specifies the ISO 639-2 three-letter code of the language (e.g. deu).
- friendlyNames - Specifies an array of property display names.
Remarks
To save the changes, call IADs::SetInfo after calling this method.
Examples
The following code sample sets a display name for the CustomAttributeText1 property.
- PowerShell
-
[Reflection.Assembly]::LoadWithPartialName("Softerra.Adaxes.Adsi") # Bind to the Adaxes service $ns = New-Object "Softerra.Adaxes.Adsi.AdmNamespace" $service = $ns.GetServiceDirectly("localhost") # Bind to the 'Configuration Set Settings' container $settingsPath = $service.Backend.GetConfigurationContainerPath(` "ConfigurationSetSettings") $settingsContainer = $service.OpenObject($settingsPath, $null, $null, 0) # Specify property display name $attributeFriendlyNames = New-Object "Softerra.Adaxes.Management.AdmAttributeFriendlyNames" $attributeFriendlyNames.AttributeName = "adm-CustomAttributeText1" $attributeFriendlyNames.GenericFriendlyName = "Details" # Get property display names [System.Array]$displayNames = $settingsContainer.GetAttributeFriendlyNames("eng", "ADM_GETATTRFRIENDLYNAMESMODE_USERDEF") | Where-Object {$_.AttributeName -ne "adm-CustomAttributeText1"} # Add new property display name $displayNames += $attributeFriendlyNames # Save the changes $settingsContainer.SetAttributeFriendlyNames("eng", $displayNames) $settingsContainer.SetInfo()
- C#
-
using System; using System.Collections.Generic; using System.Linq; using Softerra.Adaxes.Adsi; using Softerra.Adaxes.Interop.Adsi; using Softerra.Adaxes.Interop.Adsi.Management; using Softerra.Adaxes.Interop.Adsi.PersistentObjects; using Softerra.Adaxes.Management; class Program { static void Main(string[] args) { // Connect to the Adaxes service AdmNamespace ns = new AdmNamespace(); IAdmService service = ns.GetServiceDirectly("localhost"); // Bind to the 'Configuration Set Settings' container string settingsPath = service.Backend.GetConfigurationContainerPath( "ConfigurationSetSettings"); IAdmAttributeFriendlyNamesOps settingsContainer = (IAdmAttributeFriendlyNamesOps)service.OpenObject(settingsPath, null, null, 0); // Specify property display name IAdmAttributeFriendlyNames attributeFriendlyNames = new AdmAttributeFriendlyNames(); attributeFriendlyNames.AttributeName = "adm-CustomAttributeText1"; attributeFriendlyNames.GenericFriendlyName = "Details"; // Get property display names List<IAdmAttributeFriendlyNames> displayNames = settingsContainer.GetAttributeFriendlyNames( "eng", ADM_GETATTRFRIENDLYNAMESMODE_ENUM.ADM_GETATTRFRIENDLYNAMESMODE_USERDEF).ToList(); displayNames.RemoveAll(displayName => string.Equals( displayName.AttributeName, "adm-CustomAttributeText1", StringComparison.CurrentCultureIgnoreCase)); // Add new property display name displayNames.Add(attributeFriendlyNames); // Save the changes settingsContainer.SetAttributeFriendlyNames("eng", displayNames.ToArray()); IAdmTop settingsContainer2 = (IAdmTop)settingsContainer; settingsContainer2.SetInfo(); } }
Requirements
Minimum required version: 2018.1