ICQ-клиент

Автор: Пользователь скрыл имя, 08 Апреля 2012 в 14:17, курсовая работа

Описание работы

В первые годы существования Всемирной паутины пользователи общались преимущественно через электронную почту, но отправлять письма было неудобно и даже нерационально, если оба собеседника одновременно находились в Интернете. Все изменилось, когда появились первые программы мгновенного общения или, менее официально, мессенджеры или интернет-пейджеры.

Содержание

Введение 5
1 Аналитический обзор литературы
1.1 Анализ предметной области
1.2 Сравнительная характеристика существующих аналогов 8
1.3 Постановка задачи 10
2 Модели, положенные в основу ПС
2.1 Функциональные модели
2.2 Разработка спецификации требований к программному средству 13
3 Разработка программного средства
3.1 Обоснование выбора среды разаработки
3.2 Особенности реализации
3.3 Разработка программной архитектуры
4 Тестирование программного средства
5 Методика работы с программным средством 20
Заключение
Список использованных источников
Приложение A. Листинг программного средства

Работа содержит 1 файл

KursKSIS.doc

— 841.00 Кб (Скачать)

        }

 

        /// <summary>

        /// Occurs when the server sends a list of interests

        /// </summary>

        public event InterestsReceivedHandler InterestsReceived;

 

        /// <summary>

        /// Raises the <see cref="InterestsReceived"/> event

        /// </summary>

        /// <param name="results">The results of the interests request</param>

        protected internal void OnInterestsReceived(InterestItem[] results)

        {

            if (InterestsReceived != null)

                InterestsReceived(this, results);

        }

 

        #endregion

 

        #region SNAC13 events

 

        /// <summary>

        /// Occurs when the buddy list has been completely sent by the server

        /// </summary>

        public event ContactListFinishedHandler ContactListFinished;

 

        /// <summary>

        /// Notifies the server to activate the SSI data for the client, and to begin

        /// alerting its contacts that it is now online and ready to receive messages

        ///

        /// Implementing clients should call <see cref="ActivateBuddyList"/> in response to this event

        /// </summary>

        protected internal void OnContactListFinished(DateTime lastModificationDate)

        {

            if (ContactListFinished != null)

            {

                LastModificationDate = lastModificationDate;

                ContactListFinished(this, lastModificationDate);

            }

        }

 

        /// <summary>

        /// Occurs when the server sends a new buddy item to the client

        /// </summary>

        public event BuddyItemReceivedHandler BuddyItemReceived;

 

        /// <summary>

        /// Raises the <see cref="BuddyItemReceived"/> event

        /// </summary>

        /// <param name="buddy">An <see cref="SSIBuddy"/> object</param>

        protected internal void OnBuddyItemReceived(SSIBuddy buddy)

        {

            if (BuddyItemReceived != null)

                BuddyItemReceived(this, buddy);

        }

 

        /// <summary>

        /// Occurs when a buddy item has been removed from the server-side list

        /// </summary>

        public event BuddyItemRemovedHandler BuddyItemRemoved;

 

        /// <summary>

        /// Raises the <see cref="BuddyItemRemoved"/> event

        /// </summary>

        /// <param name="buddy">An <see cref="SSIBuddy"/> object</param>

        protected internal void OnBuddyItemRemoved(SSIBuddy buddy)

        {

            if (BuddyItemRemoved != null)

            {

                BuddyItemRemoved(this, buddy);

            }

        }

 

        /// <summary>

        /// Occurs when the server sends a new group item to the client

        /// </summary>

        public event GroupItemReceivedHandler GroupItemReceived;

 

        /// <summary>

        /// Raises the <see cref="GroupItemReceived"/> event

        /// </summary>

        /// <param name="group">An <see cref="SSIGroup"/>"/> object</param>

        protected internal void OnGroupItemReceived(SSIGroup group)

        {

            if (GroupItemReceived != null)

                GroupItemReceived(this, group);

        }

 

        /// <summary>

        /// Occurs when a buddy item has been removed from the server-side list

        /// </summary>

        public event GroupItemRemovedHandler GroupItemRemoved;

 

        /// <summary>

        /// Raises the <see cref="GroupItemRemoved"/> event

        /// </summary>

        /// <param name="group">An <see cref="SSIGroup"/> object</param>

        protected internal void OnGroupItemRemoved(SSIGroup group)

        {

            if (GroupItemRemoved != null)

            {

                GroupItemRemoved(this, group);

            }

        }

 

        /// <summary>

        /// Occurs when the server sends the master group item to the client

        /// </summary>

        public event MasterGroupItemReceivedHandler MasterGroupItemReceived;

 

        /// <summary>

        /// Raises the <see cref="MasterGroupItemReceived"/> event

        /// </summary>

        /// <param name="numgroups">The number of groups we are going to receive</param>

        protected internal void OnMasterGroupItemReceived(int numgroups)

        {

            if (MasterGroupItemReceived != null)

                MasterGroupItemReceived(this, numgroups);

        }

 

        /// <summary>

        /// Occurs when the an SSI edit is completed

        /// </summary>

        public event SSIEditCompleteHandler SSIEditComplete;

 

        /// <summary>

        /// Raises the <see cref="SSIEditComplete"/> event

        /// </summary>

        protected internal void OnSSIEditComplete()

        {

            if (SSIEditComplete != null)

            {

                SSIEditComplete(this);

            }

        }

 

        /// <summary>

        /// Occurs when a client ask for authorization (ICQ)

        /// </summary>

        public event AuthorizationRequestReceivedHandler AuthorizationRequestReceived;

 

        /// <summary>

        /// Raises the <see cref="AuthorizationRequestReceived"/> event

        /// </summary>

        /// <param name="screenname">the screenname that ask for authorization</param>

        /// <param name="reason">the reason message</param>

        protected internal void OnAuthorizationRequestReceived(string screenname, string reason)

        {

            if (AuthorizationRequestReceived != null)

                AuthorizationRequestReceived(this, screenname, reason);

        }

 

 

        /// <summary>

        /// Occurs when a client granted or declined the authorization (ICQ)

        /// </summary>

        public event AuthorizationResponseReceivedHandler AuthorizationResponseReceived;

 

        /// <summary>

        /// Raises the <see cref="AuthorizationResponseReceived"/> event

        /// </summary>

        /// <param name="screenname">the screenname that should get the response</param>

        /// <param name="authorizationGranted">Determines, if the authorization will be granted or not.</param>

        /// <param name="reason">The reason message</param>

        protected internal void OnAuthorizationResponseReceived(string screenname, bool authorizationGranted,

                                                                string reason)

        {

            if (AuthorizationResponseReceived != null)

                AuthorizationResponseReceived(this, screenname, authorizationGranted, reason);

        }

 

        /// <summary>

        /// Occurs when a client granted the authorization for the future (ICQ)

        /// </summary>

        public event FutureAuthorizationReceivedHandler FutureAuthorizationReceived;

 

        /// <summary>

        /// Raises the <see cref="FutureAuthorizationReceived"/> event

        /// </summary>

        /// <param name="screenname">the screenname that should get the future authorization</param>

        /// <param name="reason">The reason message</param>

        protected internal void OnAuthorizationResponseReceived(string screenname, string reason)

        {

            if (FutureAuthorizationReceived != null)

                FutureAuthorizationReceived(this, screenname, reason);

        }

 

        #endregion

 

        #region Authorization manager events

 

        /// <summary>

        /// Occurs when the login sequence fails

        /// </summary>

        public event LoginFailedHandler LoginFailed;

 

        /// <summary>

        /// Raises the <see cref="LoginFailed"/> event

        /// </summary>

        /// <param name="errorcode">A <see cref="LoginErrorCode"/> describing the failure</param>

        protected internal void OnLoginFailed(LoginErrorCode errorcode)

        {

            if (LoginFailed != null)

            {

                LoggedIn = false;

                LoginFailed(this, errorcode);

            }

        }

 

        #endregion

 

        #region Direct Connection events

 

        /// <summary>

        /// Occurs during a file transfer to indicate transfer progression

        /// </summary>

        public event FileTransferProgressHandler FileTransferProgress;

 

        /// <summary>

        /// Raises the <see cref="FileTransferProgress"/> event

        /// </summary>

        /// <param name="cookie">The rendezvous cookie belonging to the file being transfered</param>

        /// <param name="bytestransfered">The number of bytes transfered so far</param>

        /// <param name="bytestotal">The total number of bytes to be transfered</param>

        protected internal void OnFileTransferProgress(Cookie cookie,

                                                       uint bytestransfered, uint bytestotal)

        {

            if (FileTransferProgress != null)

            {

                FileTransferProgress(this, cookie, bytestransfered, bytestotal);

            }

        }

 

        /// <summary>

        /// Occurs during a DirectIM session to indicate the progress of an incoming message

        /// </summary>

        /// <remarks>This event will only fire if the incoming message contains attachments</remarks>

        public event DirectIMIncomingMessageProgressHandler DirectIMIncomingMessageProgress;

 

        /// <summary>

        /// Occurs during a DirectIM session to indicate the progress of an outgoing message

        /// </summary>

        /// <remarks>This event will only fire if the outgoing message contains attachments</remarks>

        public event DirectIMOutgoingMessageProgressHandler DirectIMOutgoingMessageProgress;

 

        /// <summary>

        /// Raises the DirectIM message progress events

        /// </summary>

        /// <param name="incoming">A value indicating whether the message is incoming or outgoing</param>

        /// <param name="cookie">The rendezvous cookie belonging to the DirectIM session</param>

        /// <param name="bytestransfered">The number of bytes transfered so far</param>

        /// <param name="bytestotal">The total number of bytes to be transfered</param>

        protected internal void OnDirectIMMessageProgress(bool incoming, Cookie cookie, uint bytestransfered,

                                                          uint bytestotal)

        {

            if (incoming)

            {

                if (DirectIMIncomingMessageProgress != null)

                {

                    DirectIMIncomingMessageProgress(this, cookie, bytestransfered, bytestotal);

                }

            }

            else

            {

                if (DirectIMOutgoingMessageProgress != null)

                {

                    DirectIMOutgoingMessageProgress(this, cookie, bytestransfered, bytestotal);

                }

            }

        }

 

        /// <summary>

        /// Occurs when a file transfer has been cancelled

        /// </summary>

        public event FileTransferCancelledHandler FileTransferCancelled;

 

        /// <summary>

        /// Raises the <see cref="FileTransferCancelled"/> event

        /// </summary>

        /// <param name="other">The <see cref="UserInfo"/> of the user on the other side of the connection</param>

        /// <param name="cookie">The rendezvous cookie belonging to the cancelled file</param>

        /// <param name="reason">The reason for the cancellation</param>

        protected internal void OnFileTransferCancelled(UserInfo other, Cookie cookie, string reason)

        {

            if (FileTransferCancelled != null)

            {

                FileTransferCancelled(this, other, cookie, reason);

            }

        }

 

        /// <summary>

        /// Raised when a DirectIM session has been cancelled

        /// </summary>

        public event FileTransferCancelledHandler DirectIMSessionCancelled;

 

        /// <summary>

        /// Raises the <see cref="DirectIMSessionCancelled"/> event

        /// </summary>

        /// <param name="cookie">The rendezvous cookie belonging to the cancelled session</param>

        /// <param name="reason">The reason for the cancellation</param>

        protected internal void OnDirectIMSessionCancelled(DirectConnection conn, string reason)

        {

            Connections.RemoveDirectConnection(conn.Cookie);

            Messages.SendDirectConnectionCancellation(conn, reason);

 

            if (DirectIMSessionCancelled != null)

            {

                DirectIMSessionCancelled(this, conn.Other, conn.Cookie, reason);

            }

        }

 

        /// <summary>

        /// Raised when a DirectIM session has been closed

        /// </summary>

        public event DirectIMSessionChangedHandler DirectIMSessionClosed;

 

        /// <summary>

        /// Raises the <see cref="DirectIMSessionClosed"/>

        /// </summary>

        /// <param name="other">A <see cref="UserInfo"/> object describing the other session participant</param>

        /// <param name="cookie">The rendezvous cookie belonging to the cancelled session</param>

        protected internal void OnDirectIMSessionClosed(UserInfo other, Cookie cookie)

        {

            Connections.RemoveDirectConnection(cookie);

            if (DirectIMSessionClosed != null)

            {

                DirectIMSessionClosed(this, other, cookie);

            }

        }

 

        /// <summary>

        /// Raised when a DirectIM session is ready for data

        /// </summary>

        public event DirectIMSessionChangedHandler DirectIMSessionReady;

 

        /// <summary>

        /// Raises the <see cref="DirectIMSessionReady"/> event

        /// </summary>

        /// <param name="other">A <see cref="UserInfo"/> object describing the other session participant</param>

        /// <param name="cookie">The rendezvous cookie belonging to the session</param>

        protected internal void OnDirectConnectionComplete(UserInfo other, Cookie cookie)

        {

            if (DirectIMSessionReady != null)

            {

                DirectIMSessionReady(this, other, cookie);

            }

        }

 

        /// <summary>

        /// Occurs when a file transfer has completed

        /// </summary>

        public event FileTransferCompletedHandler FileTransferCompleted;

 

        /// <summary>

        /// Raises the <see cref="FileTransferCompleted"/> event

        /// </summary>

        /// <param name="cookie">The rendezvous cookie belonging to the completed file</param>

        protected internal void OnFileTransferCompleted(Cookie cookie)

        {

            if (FileTransferCompleted != null)

            {

                FileTransferCompleted(this, cookie);

            }

        }

 

        /// <summary>

        /// Occurs when a Direct IM has been received

        /// </summary>

        public event DirectIMReceivedHandler DirectIMReceived;

 

        /// <summary>

        /// Raises the <see cref="OscarLib_DirectIMReceived"/> event

        /// </summary>

        /// <param name="message">The <see cref="DirectIM"/> received</param>

        protected internal void OnDirectIMReceived(DirectIM message)

        {

            if (DirectIMReceived != null)

            {

                DirectIMReceived(this, message);

            }

        }

 

        #endregion

 

        #endregion

    }

}

 

4

 



Информация о работе ICQ-клиент