private void SavePathes(OpcDaBrowseElement[] elements)
 {
     foreach (var element in elements)
     {
         IEnumerable<string> pathPart = Enumerable.Repeat(element.Name, 1);
         _itemIdToPath[element.ItemId] = _currentPath.Union(pathPart);
     }
 }
 private static bool NoPropertiesReturned(OpcDaBrowseElement[] opcBrowseElements)
 {
     return NoPropertiesReturned(opcBrowseElements.Select(e => e.ItemProperties));
 }
 private static OpcDaBrowseElement ReadBrowseElementAndDealocate(ref IntPtr browseElement)
 {
     var opcBrowseElement = (OPCBROWSEELEMENT) Marshal.PtrToStructure(browseElement, typeof (OPCBROWSEELEMENT));
     var result = new OpcDaBrowseElement
     {
         Name = opcBrowseElement.szName,
         ItemId = opcBrowseElement.szItemID,
         HasChildren = (opcBrowseElement.dwFlagValue & OPC_BROWSE_HASCHILDREN) != 0,
         IsItem = (opcBrowseElement.dwFlagValue & OPC_BROWSE_ISITEM) != 0,
         ItemProperties = ReadItemProperties(ref opcBrowseElement.ItemProperties)
     };
     Marshal.DestroyStructure(browseElement, typeof (OPCBROWSEELEMENT));
     return result;
 }