Boiler.BoilerNodeManager.UpdateDisplayName C# (CSharp) Method

UpdateDisplayName() private method

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
return 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;
        }