Beispiel #1
0
        private EnumString GetEnumerator(string itemID, BrowseFilters filters, bool branches)
        {
            EnumString str2;
            IOPCBrowseServerAddressSpace server = (IOPCBrowseServerAddressSpace)base.m_server;

            try
            {
                server.ChangeBrowsePosition(OPCBROWSEDIRECTION.OPC_BROWSE_TO, (itemID != null) ? itemID : "");
            }
            catch
            {
                try
                {
                    server.ChangeBrowsePosition(OPCBROWSEDIRECTION.OPC_BROWSE_DOWN, (itemID != null) ? itemID : "");
                }
                catch
                {
                    throw new ResultIDException(ResultID.Da.E_UNKNOWN_ITEM_NAME);
                }
            }
            try
            {
                OpcRcw.Da.IEnumString ppIEnumString = null;
                server.BrowseOPCItemIDs(branches ? OPCBROWSETYPE.OPC_BRANCH : OPCBROWSETYPE.OPC_LEAF, (filters.ElementNameFilter != null) ? filters.ElementNameFilter : "", 0, 0, out ppIEnumString);
                str2 = new EnumString(ppIEnumString);
            }
            catch
            {
                throw new ResultIDException(ResultID.Da.E_UNKNOWN_ITEM_NAME);
            }
            return(str2);
        }
Beispiel #2
0
 public void BrowseAccessPaths(string szItemID, out OpcRcw.Da.IEnumString ppIEnumString)
 {
     OpcCom.Da.Wrapper.Server server;
     Monitor.Enter(server = this);
     try
     {
         throw new ExternalException("BrowseAccessPaths", -2147467263);
     }
     catch (Exception exception)
     {
         throw CreateException(exception);
     }
     finally
     {
         Monitor.Exit(server);
     }
 }
Beispiel #3
0
        public void Clone(out OpcRcw.Da.IEnumString ppenum)
        {
            EnumString str;

            Monitor.Enter(str = this);
            try
            {
                ppenum = new EnumString(this.m_strings);
            }
            catch (Exception exception)
            {
                throw Server.CreateException(exception);
            }
            finally
            {
                Monitor.Exit(str);
            }
        }
Beispiel #4
0
 public void BrowseOPCItemIDs(OPCBROWSETYPE dwBrowseFilterType, string szFilterCriteria, short vtDataTypeFilter, int dwAccessRightsFilter, out OpcRcw.Da.IEnumString ppIEnumString)
 {
     OpcCom.Da.Wrapper.Server server;
     Monitor.Enter(server = this);
     try
     {
         ItemIdentifier itemID = null;
         if (this.m_browseStack.Count > 0)
         {
             itemID = (ItemIdentifier)this.m_browseStack.Peek();
         }
         ArrayList hits = new ArrayList();
         this.Browse(itemID, dwBrowseFilterType, szFilterCriteria, vtDataTypeFilter, dwAccessRightsFilter, hits);
         ppIEnumString = new OpcCom.Da.Wrapper.EnumString(hits);
     }
     catch (Exception exception)
     {
         throw CreateException(exception);
     }
     finally
     {
         Monitor.Exit(server);
     }
 }
Beispiel #5
0
        private void IterateOPCItems(IOPCBrowseServerAddressSpace srv, TreeNodeCollection root, OpcRcw.Da.IEnumString es)
        {
            int fetched;

            do
            {
                string[] tmp = new string[100];
                es.RemoteNext(tmp.Length, tmp, out fetched);
                for (int i = 0; i < fetched; i++)
                {
                    AddTreeNode(srv, root, tmp[i]);
                }
            } while (fetched > 0);
        }