#region Copyright (c) 2011-2023 Technosoftware GmbH. All rights reserved
//-----------------------------------------------------------------------------
// Copyright (c) 2011-2023 Technosoftware GmbH. All rights reserved
// Web: https://www.technosoftware.com
//
// The source code in this file is covered under a dual-license scenario:
// - Owner of a purchased license: SCLA 1.0
// - GPL V3: everybody else
//
// SCLA license terms accompanied with this source code.
// See SCLA 1.0: https://technosoftware.com/license/Source_Code_License_Agreement.pdf
//
// GNU General Public License as published by the Free Software Foundation;
// version 3 of the License are accompanied with this source code.
// See https://technosoftware.com/license/GPLv3License.txt
//
// This source code is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
// or FITNESS FOR A PARTICULAR PURPOSE.
//-----------------------------------------------------------------------------
#endregion Copyright (c) 2011-2023 Technosoftware GmbH. All rights reserved
#region Using Directives
using System;
#endregion
namespace Technosoftware.DaAeHdaClient.Da
{
///
/// Stores the state of a browse operation.
///
[Serializable]
public class TsCDaBrowsePosition : IOpcBrowsePosition
{
#region Fields
private TsCDaBrowseFilters browseFilters_;
private OpcItem itemId_;
#endregion
#region Constructors, Destructor, Initialization
///
/// Saves the parameters for an incomplete browse information.
///
public TsCDaBrowsePosition(OpcItem itemId, TsCDaBrowseFilters filters)
{
if (filters == null) throw new ArgumentNullException(nameof(filters));
itemId_ = (OpcItem)itemId?.Clone();
browseFilters_ = (TsCDaBrowseFilters)filters.Clone();
}
///
/// Releases unmanaged resources held by the object.
///
public virtual void Dispose()
{
// does nothing.
}
#endregion
#region Properties
///
/// The item identifier of the branch being browsed.
///
public OpcItem ItemID => itemId_;
///
/// The filters applied during the browse operation.
///
public TsCDaBrowseFilters Filters => (TsCDaBrowseFilters)browseFilters_.Clone();
///
/// The maximum number of elements that may be returned in a single browse.
///
// ReSharper disable once UnusedMember.Global
public int MaxElementsReturned
{
get => browseFilters_.MaxElementsReturned;
set => browseFilters_.MaxElementsReturned = value;
}
#endregion
#region ICloneable Members
///
/// Creates a deep copy of the object.
///
public virtual object Clone()
{
return (TsCDaBrowsePosition)MemberwiseClone();
}
#endregion
}
}