コード例 #1
0
        // ******************************************************************
        // *																*
        // *				          Public Methods				        *
        // *																*
        // ******************************************************************

        /// <summary>
        /// Adds a new type to the <i>StreamerTypes</i> collection
        /// </summary>
        /// <param name="streamerType">
        /// A Type that specify the class type that must implement the ILogStreamer
        /// interface and has a parameterless constructors
        /// </param>
        /// <param name="parameters">
        /// A string that holds a name-value pairs expression which will be passed
        /// to the actual LogStreamer instance during its initialization
        /// </param>
        /// <returns>
        /// A reference to the LogConfigStreamerType instance that was added to
        /// the <i>StreamerTypes</i> collection
        /// </returns>
        /// <exception cref="InvalidOperationException">
        /// Thrown when the specified type does not implement the <i>ILogStreamer</i>
        /// interface or has no parameterless constructor
        /// </exception>
        public virtual LogConfigStreamerType AddStreamerType(
            Type streamerType,
            string parameters)
        {
            // Declare variables
            var type = new LogConfigStreamerType(
                streamerType,
                parameters);

            // Add new streamer type to collection and return reference
            StreamerTypes.Add(type);
            return(type);
        }
コード例 #2
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="streamerType">
 /// A LogConfigStreamerType instance whose value members must be copied into
 /// this instance (deep copy)
 /// </param>
 protected LogConfigStreamerType(LogConfigStreamerType streamerType)
 {
     // Deep copy members
     m_type   = streamerType.m_type;
     m_params = streamerType.m_params;
 }