Click here to Skip to main content
15,886,026 members
Articles / Programming Languages / C#

IMAP and POP3 Clients in C#

Rate me:
Please Sign up or sign in to vote.
4.67/5 (21 votes)
28 Sep 2012CPOL1 min read 258.2K   16.6K   48  
IMAP & POP3 Clients C#. A library for intuitive ease of use of these two protocols.
using System;
using System.Collections.Generic;
using System.Text;

namespace LumiSoft.Net.Media
{
    /// <summary>
    /// This class holds audio information for input or output audio devices.
    /// </summary>
    public class AudioFormat
    {
        private int m_SamplesPerSecond = 0;
        private int m_BitsPerSample    = 0;
        private int m_Channels         = 0;

        /// <summary>
        /// Default constructor.
        /// </summary>
        /// <param name="samplesPerSecond">The number of samples per second that are provided by the audio format.</param>
        /// <param name="bitsPerSample">The number of bits that are used to store the audio information for a single sample of an audio format.</param>
        /// <param name="channels">The number of channels that are provided by the audio format.</param>
        public AudioFormat(int samplesPerSecond,int bitsPerSample,int channels)
        {
            m_SamplesPerSecond = samplesPerSecond;
            m_BitsPerSample    = bitsPerSample;
            m_Channels         = channels;
        }


        #region ovveride method Equals

        /// <summary>
        /// Compares the current instance with another object of the same type.
        /// </summary>
        /// <param name="obj">An object to compare with this instance.</param>
        /// <returns>Returns true if two objects are equal.</returns>
        public override bool Equals(object obj)
        {
            if(obj == null){
                return false;
            }
            if(!(obj is AudioFormat)){
                return false;
            }

            AudioFormat format = (AudioFormat)obj;
            if(format.SamplesPerSecond != this.SamplesPerSecond){
                return false;
            }
            if(format.BitsPerSample != this.BitsPerSample){
                return false;
            }
            if(format.Channels != this.Channels){
                return false;
            }

            return true;
        }

        #endregion

        #region override method GetHashCode

        /// <summary>
        /// Returns the hash code.
        /// </summary>
        /// <returns>Returns the hash code.</returns>
        public override int GetHashCode()
        {
            return base.GetHashCode();
        }

        #endregion


        #region Properties implementation

        /// <summary>
        /// Gets the number of samples per second that are provided by the audio format.
        /// </summary>
        public int SamplesPerSecond
        {
            get{ return m_SamplesPerSecond; }
        }

        /// <summary>
        /// Gets the number of bits that are used to store the audio information for a single sample of an audio format.
        /// </summary>
        public int BitsPerSample
        {
            get{ return m_BitsPerSample; }
        }

        /// <summary>
        /// Gets the number of channels that are provided by the audio format.
        /// </summary>
        public int Channels
        {
            get{ return m_Channels; }
        }
                
        #endregion
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) D.Net Solution
Italy Italy
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions