예제 #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="uuid">The UUID.</param>
        /// <param name="uri">The URI.</param>
        /// <param name="resourceType">The resource type.</param>
        /// <param name="name">The name.</param>
        /// <param name="count">The count.</param>
        /// <param name="lastChanged">The last changed in microseconds.</param>
        /// <returns>The resource instance.</returns>
        public static IResource CreateResource(this IEtpAdapter etpAdapter, string uuid, EtpUri uri, ResourceTypes resourceType, string name, int count = 0, long lastChanged = 0)
        {
            if (etpAdapter is Energistics.Etp.v11.Etp11Adapter)
            {
                return(Discovery11StoreProvider.New(uuid, uri, resourceType, name, count, lastChanged));
            }

            return(Discovery12StoreProvider.New(uuid, uri, resourceType, name, count, lastChanged));
        }
예제 #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="uuid">The UUID.</param>
        /// <param name="uri">The URI.</param>
        /// <param name="resourceType">The resource type.</param>
        /// <param name="name">The name.</param>
        /// <param name="count">The count.</param>
        /// <param name="lastChanged">The last changed in microseconds.</param>
        /// <returns>The resource instance.</returns>
        public static IResource CreateResource(this IEtpAdapter etpAdapter, string uuid, EtpUri uri, ResourceTypes resourceType, string name, int count = 0, long lastChanged = 0)
        {
            if (etpAdapter.SupportedVersion == EtpVersion.v11)
            {
                return(Discovery11StoreProvider.New(uuid, uri, resourceType, name, count, lastChanged));
            }

            return(Discovery12StoreProvider.New(uuid, uri, resourceType, name, count, lastChanged));
        }