Пример #1
0
        /// <summary>
        /// Return the actual (i.e. version specific) class of the given WITSML type.
        /// </summary>
        /// <param name="version">Version to consider. Non-null.</param>
        /// <param name="type">WITSML type to find class of. Non-null.</param>
        /// <returns>The actual class. Never null.</returns>
        private static Type getActualClass(WitsmlVersion version, String type)
        {
            string      nspace           = "v" + version.getVersion().Replace(".", "");
            List <Type> AvailableClasses = Assembly.GetExecutingAssembly().GetTypes().Where(x => x.Namespace.Contains(nspace)).ToList();
            Type        fountClass       = AvailableClasses.Where(x => x.Name.ToLower().Contains(type.ToLower())).FirstOrDefault();

            return(fountClass);
        }
Пример #2
0
        /// <summary>
        /// Create a capabilities object with the specified properties.
        /// </summary>
        /// <param name="version">WITSML version accepted by client. May be bull.</param>
        /// <param name="isServer">Indicates if this is a server (true) or client (false) capabilities instance.</param>
        /// <param name="contactName">Contact name for the site. May be null.</param>
        /// <param name="contactEmail">Contact e-mail for the site. May be null.</param>
        /// <param name="contactPhone">Contact phone for the site. May be null.</param>
        /// <param name="name">System product name. May be null.</param>
        /// <param name="description">System description. May be null.</param>
        /// <param name="vendor">System vendor. May be null.</param>
        /// <param name="programVersion">System version. May be null.</param>
        Capabilities(WitsmlVersion version,
                     bool isServer,
                     String contactName,
                     String contactEmail,
                     String contactPhone,
                     String name,
                     String description,
                     String vendor,
                     String programVersion)
        {
            this._isServer     = isServer;
            this.functions     = isServer ? new List <FunctionCapability>() : null;
            this.witsmlVersion = version != null?version.getVersion() : null;

            this.contactName    = contactName;
            this.contactEmail   = contactEmail;
            this.contactPhone   = contactPhone;
            this.name           = name;
            this.description    = description;
            this.vendor         = vendor;
            this.programVersion = programVersion;
        }