Opc.Ua.VariableNode.VariableNode C# (CSharp) Method

VariableNode() public method

Creates a node from another node (copies attributes - not references).
public VariableNode ( ILocalNode source ) : System
source ILocalNode The source.
return System
        public VariableNode(ILocalNode source) : base(source)
        {
            this.NodeClass = NodeClass.Variable;

            IVariable variable = source as IVariable;

            if (variable != null)
            {
                this.DataType = variable.DataType;
                this.ValueRank = variable.ValueRank;
                this.AccessLevel = variable.AccessLevel;
                this.UserAccessLevel = variable.UserAccessLevel;
                this.MinimumSamplingInterval = variable.MinimumSamplingInterval;
                this.Historizing = variable.Historizing;

                object value = variable.Value;

                if (value == null)
                {
                    value = TypeInfo.GetDefaultValue(variable.DataType, variable.ValueRank);
                }

                this.Value = new Variant(value);

                if (variable.ArrayDimensions != null)
                {
                    this.ArrayDimensions = new UInt32Collection(variable.ArrayDimensions);
                }
            }
        }
        #endregion