///////////////////////////////////////////////////////////////////////
        #region ICloneable Members

        /// <summary>
        /// Creates a deep copy of the object.
        /// </summary>
        public virtual object Clone()
        {
            TsCDaBrowseFilters clone = (TsCDaBrowseFilters)MemberwiseClone();

            clone.PropertyIDs = (TsDaPropertyID[])((PropertyIDs != null) ? PropertyIDs.Clone() : null);
            return(clone);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Saves the parameters for an incomplete browse information.
        /// </summary>
        public TsCDaBrowsePosition(OpcItem itemId, TsCDaBrowseFilters filters)
        {
            if (filters == null)
            {
                throw new ArgumentNullException(nameof(filters));
            }

            itemId_        = (OpcItem)itemId?.Clone();
            browseFilters_ = (TsCDaBrowseFilters)filters.Clone();
        }
Ejemplo n.º 3
0
        ///////////////////////////////////////////////////////////////////////
        #region Constructors, Destructor, Initialization

        /// <summary>
        /// Saves the parameters for an incomplete browse information.
        /// </summary>
        public TsCDaBrowsePosition(OpcItem itemID, TsCDaBrowseFilters filters)
        {
            if (filters == null)
            {
                throw new ArgumentNullException("Filters");
            }

            _itemID  = (itemID != null) ? (OpcItem)itemID.Clone() : null;
            _filters = (TsCDaBrowseFilters)filters.Clone();
        }
Ejemplo n.º 4
0
 /// <summary>Fetches the children of a branch that meet the filter criteria.</summary>
 /// <returns>The set of elements found.</returns>
 /// <requirements>OPC XML-DA Server or OPC Data Access Server V2.x / V3.x</requirements>
 /// <param name="itemID">The identifier of branch which is the target of the search.</param>
 /// <param name="filters">The filters to use to limit the set of child elements returned.</param>
 /// <param name="position">An object used to continue a browse that could not be completed.</param>
 public TsCDaBrowseElement[] Browse(
     OpcItem itemID,
     TsCDaBrowseFilters filters,
     out Da.TsCDaBrowsePosition position)
 {
     if (_server == null)
     {
         throw new NotConnectedException();
     }
     return(((ITsDaServer)_server).Browse(itemID, filters, out position));
 }
Ejemplo n.º 5
0
 /// <summary>Fetches the children of a branch that meet the filter criteria.</summary>
 /// <returns>The set of elements found.</returns>
 /// <requirements>OPC XML-DA Server or OPC Data Access Server V2.x / V3.x</requirements>
 /// <param name="itemId">The identifier of branch which is the target of the search.</param>
 /// <param name="filters">The filters to use to limit the set of child elements returned.</param>
 /// <param name="position">An object used to continue a browse that could not be completed.</param>
 public TsCDaBrowseElement[] Browse(
     OpcItem itemId,
     TsCDaBrowseFilters filters,
     out TsCDaBrowsePosition position)
 {
     LicenseHandler.ValidateFeatures(LicenseHandler.ProductFeature.DataAccess);
     if (Server == null)
     {
         throw new NotConnectedException();
     }
     return(((ITsDaServer)Server).Browse(itemId, filters, out position));
 }
Ejemplo n.º 6
0
        /// <summary>Fetches all the childrens of the root branch that meet the filter criteria.</summary>
        /// <returns>The set of elements found.</returns>
        /// <requirements>OPC XML-DA Server or OPC Data Access Server V2.x / V3.x</requirements>
        /// <param name="filters">The filters to use to limit the set of child elements returned.</param>
        private TsCDaBrowseElement[] Browse(
            TsCDaBrowseFilters filters)
        {
            if (_server == null)
            {
                throw new NotConnectedException();
            }
            Da.TsCDaBrowsePosition    position;
            List <TsCDaBrowseElement> elementsList = new List <TsCDaBrowseElement>();

            TsCDaBrowseElement[] elements = ((ITsDaServer)_server).Browse(null, filters, out position);

            if (elements != null)
            {
                Browse(elements, filters, ref elementsList);
            }

            return(elementsList.ToArray());
        }
Ejemplo n.º 7
0
        /// <summary>Fetches all the children of the root branch that meet the filter criteria.</summary>
        /// <returns>The set of elements found.</returns>
        /// <requirements>OPC Data Access Server V2.x / V3.x</requirements>
        /// <param name="filters">The filters to use to limit the set of child elements returned.</param>
        private TsCDaBrowseElement[] Browse(
            TsCDaBrowseFilters filters)
        {
            LicenseHandler.ValidateFeatures(LicenseHandler.ProductFeature.DataAccess);
            if (Server == null)
            {
                throw new NotConnectedException();
            }
            TsCDaBrowsePosition       position;
            List <TsCDaBrowseElement> elementsList = new List <TsCDaBrowseElement>();

            TsCDaBrowseElement[] elements = ((ITsDaServer)Server).Browse(null, filters, out position);

            if (elements != null)
            {
                Browse(elements, filters, ref elementsList);
            }

            return(elementsList.ToArray());
        }
Ejemplo n.º 8
0
        private void Browse(TsCDaBrowseElement[] elements, TsCDaBrowseFilters filters, ref List <TsCDaBrowseElement> elementsList)
        {
            Da.TsCDaBrowsePosition position;

            foreach (TsCDaBrowseElement element in elements)
            {
                if (element.HasChildren)
                {
                    OpcItem itemID = new OpcItem(element.ItemPath, element.ItemName);;

                    TsCDaBrowseElement[] childElements = ((ITsDaServer)_server).Browse(itemID, filters, out position);
                    if (childElements != null)
                    {
                        Browse(childElements, filters, ref elementsList);
                    }
                }
                else
                {
                    elementsList.Add(element);
                }
            }
        }
Ejemplo n.º 9
0
        private void Browse(TsCDaBrowseElement[] elements, TsCDaBrowseFilters filters, ref List <TsCDaBrowseElement> elementsList)
        {
            LicenseHandler.ValidateFeatures(LicenseHandler.ProductFeature.DataAccess);
            TsCDaBrowsePosition position;

            foreach (TsCDaBrowseElement element in elements)
            {
                if (element.HasChildren)
                {
                    OpcItem itemId = new OpcItem(element.ItemPath, element.ItemName);

                    TsCDaBrowseElement[] childElements = ((ITsDaServer)Server).Browse(itemId, filters, out position);
                    if (childElements != null)
                    {
                        Browse(childElements, filters, ref elementsList);
                    }
                }
                else
                {
                    elementsList.Add(element);
                }
            }
        }