Opc.Ua.ServerTest.TestBase.VerifyAttributeConsistency C# (CSharp) Method

VerifyAttributeConsistency() protected method

Verifies that the node attributes are consistent with each other.
protected VerifyAttributeConsistency ( Node node ) : bool
node Node
return bool
        protected bool VerifyAttributeConsistency(Node node)
        {
            if (((~node.WriteMask) & node.UserWriteMask) != 0)
            {
                Log(
                    "UserWriteMask allows more access that WriteMask for  Node '{0}'. NodeId = {1}, WriteMask = {2}, UserWriteMask = {3}",
                    node,
                    node.NodeId,
                    node.WriteMask,
                    node.UserWriteMask);

                return false;
            }

            IMethod method = node as IMethod;

            if (method != null)
            {
                if (method.UserExecutable && !method.Executable)
                {
                    Log(
                        "UserExecutable allows more access that Executable for  Node '{0}'. NodeId = {1}, Executable = {2}, UserExecutable = {3}",
                        node,
                        node.NodeId,
                        method.Executable,
                        method.UserExecutable);

                    return false;
                }
            }

            IVariableBase variableBase = node as IVariableBase;

            if (variableBase != null)
            {
                if (!VerifyVariableBaseConsistency(variableBase))
                {
                    return false;
                }
            }

            IVariable variable = node as IVariable;

            if (variable != null)
            {
                if (!VerifyVariableConsistency(variable))
                {
                    return false;
                }
            }

            IVariableType variableType = node as IVariableType;
            
            if (variableType != null)
            {
                if (!VerifyVariableTypeConsistency(variableType))
                {
                    return false;
                }
            }

            return true;
        }