Opc.Ua.RelativePath.IsEmpty C# (CSharp) Method

IsEmpty() public static method

Returns true if the relative path does not specify any elements.
public static IsEmpty ( RelativePath relativePath ) : bool
relativePath RelativePath
return bool
        public static bool IsEmpty(RelativePath relativePath)
        {
            if (relativePath != null)
            {
                return relativePath.Elements.Count == 0;
            }

            return true;
        }

Usage Example

コード例 #1
0
        /// <summary>
        /// Converts an AttributeOperand to a displayable string.
        /// </summary>
        /// <param name="nodeTable">The node table.</param>
        /// <returns>AttributeOperand as a displayable string.</returns>
        public override string ToString(INodeTable nodeTable)
        {
            StringBuilder buffer = new StringBuilder();

            INode node = nodeTable.Find(m_nodeId);

            if (node != null)
            {
                buffer.AppendFormat("{0}", NodeId);
            }
            else
            {
                buffer.AppendFormat("{0}", NodeId);
            }

            if (!RelativePath.IsEmpty(BrowsePath))
            {
                buffer.AppendFormat("/{0}", BrowsePath.Format(nodeTable.TypeTree));
            }

            if (!String.IsNullOrEmpty(IndexRange))
            {
                buffer.AppendFormat("[{0}]", NumericRange.Parse(IndexRange));
            }

            if (!String.IsNullOrEmpty(Alias))
            {
                buffer.AppendFormat("- '{0}'", Alias);
            }

            return(buffer.ToString());
        }