Boiler.BoilerNodeManager.UpdateDisplayName C# (CSharp) Méthode

UpdateDisplayName() private méthode

Updates the display name for an instance with the unit label name.
This method assumes the DisplayName has the form NameX001 where X0 is the unit label placeholder.
private UpdateDisplayName ( BaseInstanceState instance, string unitLabel ) : void
instance Opc.Ua.BaseInstanceState The instance to update.
unitLabel string
Résultat void
        private void UpdateDisplayName(BaseInstanceState instance, string unitLabel)
        {
            LocalizedText displayName = instance.DisplayName;

            if (displayName != null)
            {
                string text = displayName.Text;

                if (text != null)
                {
                    text = text.Replace("X0", unitLabel);
                }

                displayName = new LocalizedText(displayName.Locale, text);
            }

            instance.DisplayName = displayName;
        }