diff --git a/src/Opc.Ua.Types/State/BaseDataVariableState.cs b/src/Opc.Ua.Types/State/BaseDataVariableState.cs index 7110fa4171..492feb2aa7 100644 --- a/src/Opc.Ua.Types/State/BaseDataVariableState.cs +++ b/src/Opc.Ua.Types/State/BaseDataVariableState.cs @@ -184,20 +184,6 @@ namespace Opc.Ua context, browseName, createOrReplace, replacement, assignInstanceNodeIds); } - /// - protected override void RemoveExplicitlyDefinedChild(BaseInstanceState child) - { - if (ReferenceEquals(EnumStrings, child)) - { - EnumStrings = null; - if (ReferenceEquals(child.Parent, this)) - { - child.Parent = null; - } - } - base.RemoveExplicitlyDefinedChild(child); - } - /// /// Create or replace enum strings /// diff --git a/src/Opc.Ua.Types/State/MethodState.cs b/src/Opc.Ua.Types/State/MethodState.cs index 800f420c44..795ff6d3fb 100644 --- a/src/Opc.Ua.Types/State/MethodState.cs +++ b/src/Opc.Ua.Types/State/MethodState.cs @@ -544,27 +544,6 @@ namespace Opc.Ua } } - /// - protected override void RemoveExplicitlyDefinedChild(BaseInstanceState child) - { - bool removed = false; - if (ReferenceEquals(InputArguments, child)) - { - InputArguments = null; - removed = true; - } - if (ReferenceEquals(OutputArguments, child)) - { - OutputArguments = null; - removed = true; - } - if (removed && ReferenceEquals(child.Parent, this)) - { - child.Parent = null; - } - base.RemoveExplicitlyDefinedChild(child); - } - /// /// Create or replace output arguments /// diff --git a/tests/Opc.Ua.Types.Tests/State/NodeStateTests.cs b/tests/Opc.Ua.Types.Tests/State/NodeStateTests.cs index 9e04489535..195027304e 100644 --- a/tests/Opc.Ua.Types.Tests/State/NodeStateTests.cs +++ b/tests/Opc.Ua.Types.Tests/State/NodeStateTests.cs @@ -2766,46 +2766,6 @@ namespace Opc.Ua.Types.Tests.State Assert.That(parent.AfterCreateCount, Is.EqualTo(1)); } - [Test] - public void RemoveChildClearsMethodArgumentSlots() - { - var method = new MethodState(null); - PropertyState> inputArguments = method - .CreateOrReplaceInputArguments(m_context, null, false); - PropertyState> outputArguments = method - .CreateOrReplaceOutputArguments(m_context, null, false); - - method.RemoveChild(inputArguments); - - Assert.That(method.InputArguments, Is.Null); - Assert.That(inputArguments.Parent, Is.Null); - Assert.That(method.OutputArguments, Is.SameAs(outputArguments)); - - method.RemoveChild(outputArguments); - - Assert.That(method.OutputArguments, Is.Null); - Assert.That(outputArguments.Parent, Is.Null); - Assert.That( - method.FindChild(m_context, inputArguments.BrowseName), - Is.Null); - } - - [Test] - public void RemoveChildClearsEnumStringsSlot() - { - var variable = new BaseDataVariableState(null); - PropertyState> enumStrings = variable - .CreateOrReplaceEnumStrings(m_context, null, false); - - variable.RemoveChild(enumStrings); - - Assert.That(variable.EnumStrings, Is.Null); - Assert.That(enumStrings.Parent, Is.Null); - Assert.That( - variable.FindChild(m_context, enumStrings.BrowseName), - Is.Null); - } - [Test] public void DeleteResetsCreatedState() {