Пример #1
0
 /// <summary>
 /// Raises the Changed event
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected internal virtual void OnChanged(object sender, AddressingEventArgs e)
 {
     try
     {
         if (this.Changed != null)
         {
             this.Changed(sender, e);
         }
     }
     catch (Exception ex)
     {
         Trace.WriteLine(ex);
     }
 }
        /// <summary>
        /// Raises the Changed event
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected internal virtual void OnChanged(object sender, AddressingEventArgs e)
        {
            try
            {
                /*
                 * always call the universal changed event
                 *
                 * the parameter's are weak-typed, but they can be explicitly cast
                 * if you want the strongly typed event args
                 * wait and respond to the next set ... see below
                 * */

                if (this.Changed != null)
                {
                    this.Changed(sender, e);
                }
            }
            catch (Exception ex)
            {
                Trace.WriteLine(ex);
            }

            try
            {
                /*
                 * determine the type of event args
                 * */

                // address book changes
                if (e.GetType() == typeof(AddressBookEventArgs))
                {
                    this.OnAddressBookChanged(sender, (AddressBookEventArgs)e);
                    return;
                }

                // address book item changes
                if (e.GetType() == typeof(AddressBookItemEventArgs))
                {
                    this.OnAddressBookItemChanged(sender, (AddressBookItemEventArgs)e);
                    return;
                }
            }
            catch (Exception ex)
            {
                Trace.WriteLine(ex);
            }
        }
Пример #3
0
        /// <summary>
        /// Raises the Changed event
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected virtual void OnChanged(object sender, AddressingEventArgs e)
        {
            try
            {
                if (sender.GetType() == typeof(AddressBookItem) && e.Action == AddressingActions.Changed)
                {
                    sender = this;
                }

                if (this.Changed != null)
                {
                    this.Changed(sender, e);
                }
            }
            catch (Exception ex)
            {
                Trace.WriteLine(ex);
            }
        }
Пример #4
0
        /// <summary>
        /// Intercepts the events coming from the address book in order to manage the sessions related to each item in the book
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OnAddressBookChanged(object sender, AddressingEventArgs e)
        {
            /*
             * watch for changes to the address book and intercept them here
             * if an item is added then we'll connect them
             * and if an item is removed then we'll disconnect it
             * but if the entire book is removed then we'll disconnect them all
             * */
            switch (e.Action)
            {
            case AddressingActions.Added:
                break;

            case AddressingActions.Changed:
                break;

            case AddressingActions.Removed:
                break;
            }
            ;
        }
		/// <summary>
		/// Raises the Changed event
		/// </summary>
		/// <param name="sender"></param>
		/// <param name="e"></param>
		protected internal virtual void OnChanged(object sender, AddressingEventArgs e)
		{
			try
			{
				/*
				 * always call the universal changed event
				 * 
				 * the parameter's are weak-typed, but they can be explicitly cast 
				 * if you want the strongly typed event args
				 * wait and respond to the next set ... see below
				 * */

				if (this.Changed != null)
					this.Changed(sender, e);
			}
			catch(Exception ex)
			{
				Trace.WriteLine(ex);
			}

			try
			{
				/*
				 * determine the type of event args
				 * */

				// address book changes
				if (e.GetType() == typeof(AddressBookEventArgs))
				{			
					this.OnAddressBookChanged(sender, (AddressBookEventArgs)e);
					return;
				}
				
				// address book item changes
				if (e.GetType() == typeof(AddressBookItemEventArgs))
				{
					this.OnAddressBookItemChanged(sender, (AddressBookItemEventArgs)e);
					return;
				}
			}
			catch(Exception ex)
			{
				Trace.WriteLine(ex);
			}
		}
Пример #6
0
		/// <summary>
		/// Raises the Changed event
		/// </summary>
		/// <param name="sender"></param>
		/// <param name="e"></param>
		protected internal virtual void OnChanged(object sender, AddressingEventArgs e)
		{
			try
			{
				if (this.Changed != null)
					this.Changed(sender, e);
			}
			catch(Exception ex)
			{
				Trace.WriteLine(ex);
			}
		}
		/// <summary>
		/// Raises the Changed event
		/// </summary>
		/// <param name="sender"></param>
		/// <param name="e"></param>
		protected virtual void OnChanged(object sender, AddressingEventArgs e)
		{
			try
			{
				if (sender.GetType() == typeof(AddressBookItem) && e.Action == AddressingActions.Changed)
					sender = this;

				if (this.Changed != null)
					this.Changed(sender, e);
			}
			catch(Exception ex)
			{
				Trace.WriteLine(ex);	
			}
		}
		/// <summary>
		/// Intercepts the events coming from the address book in order to manage the sessions related to each item in the book
		/// </summary>
		/// <param name="sender"></param>
		/// <param name="e"></param>
		private void OnAddressBookChanged(object sender, AddressingEventArgs e)
		{
			/*
			 * watch for changes to the address book and intercept them here
			 * if an item is added then we'll connect them
			 * and if an item is removed then we'll disconnect it
			 * but if the entire book is removed then we'll disconnect them all
			 * */
			switch(e.Action)
			{
				case AddressingActions.Added:
					break;

				case AddressingActions.Changed:
					break;

				case AddressingActions.Removed:
					break;
			};
		}