Opc.Ua.Com.Client.ComItemIdParser.Parse C# (CSharp) Method

Parse() public method

Parses the specified item id.
public Parse ( ComObject server, ComClientConfiguration configuration, string itemId, string &browseName ) : bool
server ComObject The COM server that provided the item id.
configuration ComClientConfiguration The COM wrapper configuration.
itemId string The item id to parse.
browseName string The name of the item.
return bool
        public bool Parse(ComObject server, ComClientConfiguration configuration, string itemId, out string browseName)
        {
            browseName = null;

            if (configuration == null || itemId == null)
            {
                return false;
            }

            if (String.IsNullOrEmpty(configuration.SeperatorChars))
            {                
                return false;
            }

            for (int ii = 0; ii < configuration.SeperatorChars.Length; ii++)
            {
                int index = itemId.LastIndexOf(configuration.SeperatorChars[ii]);

                if (index >= 0)
                {
                    browseName = itemId.Substring(index + 1);
                    return true;
                }
            }

            return false;
        }
        #endregion
ComItemIdParser