Beispiel #1
0
        /// <summary>
        /// Raises the CannotWriteValue event
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected virtual void OnCannotReadValue(object sender, XmlConfigurationReaderEventArgs e)
        {
            try
            {
                string message = string.Format("The value for the option '{0}' in the category '{1}' could not be read due to the following exception.\n\t{2}\n\tThe buffer contained '{3}' when the exception was thrown.", e.Option.ElementName, e.Option.Category, e.Exception, e.Buffer);
                Trace.WriteLine(message);
            }
            catch (Exception) {}

            try
            {
                if (this.CannotReadValue != null)
                {
                    this.CannotReadValue(sender, e);
                }
            }
            catch (System.Exception systemException)
            {
                System.Diagnostics.Trace.WriteLine(systemException);
            }
        }
		/// <summary>
		/// Raises the CannotWriteValue event
		/// </summary>
		/// <param name="sender"></param>
		/// <param name="e"></param>
		protected virtual void OnCannotReadValue(object sender, XmlConfigurationReaderEventArgs e)
		{
			try
			{
				string message = string.Format("The value for the option '{0}' in the category '{1}' could not be read due to the following exception.\n\t{2}\n\tThe buffer contained '{3}' when the exception was thrown.", e.Option.ElementName, e.Option.Category, e.Exception, e.Buffer);
				Trace.WriteLine(message);
			}
			catch(Exception) {}

			try
			{			
				if (this.CannotReadValue != null)
					this.CannotReadValue(sender, e);
			}
			catch(System.Exception systemException)
			{
				System.Diagnostics.Trace.WriteLine(systemException);
			}
		}