예제 #1
0
        /// <summary>
        /// Initializes a new instance of <see cref="IResource" /> using the specified parameters.
        /// </summary>
        /// <param name="etpAdapter">The ETP adapter.</param>
        /// <param name="protocolUri">The protocol URI.</param>
        /// <param name="folderName">The folder name.</param>
        /// <param name="count">Elements count</param>
        /// <returns>The resource instance.</returns>
        public static IResource NewProtocol(this IEtpAdapter etpAdapter, EtpUri protocolUri, string folderName, int count = -1)
        {
            if (etpAdapter is Energistics.Etp.v11.Etp11Adapter)
            {
                return(Discovery11StoreProvider.NewProtocol(protocolUri, folderName, count));
            }

            return(Discovery12StoreProvider.NewProtocol(protocolUri, folderName, count));
        }
예제 #2
0
        /// <summary>
        /// Initializes a new instance of <see cref="IResource" /> using the specified parameters.
        /// </summary>
        /// <param name="etpAdapter">The ETP adapter.</param>
        /// <param name="protocolUri">The protocol URI.</param>
        /// <param name="folderName">The folder name.</param>
        /// <param name="count">Elements count</param>
        /// <returns>The resource instance.</returns>
        public static IResource NewProtocol(this IEtpAdapter etpAdapter, EtpUri protocolUri, string folderName, int count = -1)
        {
            if (etpAdapter.SupportedVersion == EtpVersion.v11)
            {
                return(Discovery11StoreProvider.NewProtocol(protocolUri, folderName, count));
            }

            return(Discovery12StoreProvider.NewProtocol(protocolUri, folderName, count));
        }