Example #1
0
        /// <summary>
        /// Format a schema event into a string
        /// </summary>
        /// <param name="se">The schema event to format</param>
        /// <returns>The formatted event</returns>
        protected static string FormatEventArgs(SchemaEventArgs se)
        {
            if (se == null)
            {
                throw new ArgumentNullException("se");
            }

            string eventName;

            switch (se.EventType)
            {
            case SchemaEventType.BeforeDrop:
                eventName = Insight.Database.Schema.Properties.Resources.Dropping;
                break;

            case SchemaEventType.BeforeCreate:
                eventName = Insight.Database.Schema.Properties.Resources.Creating;
                break;

            case SchemaEventType.AfterCreate:
                eventName = Insight.Database.Schema.Properties.Resources.Created;
                break;

            case SchemaEventType.DropFailed:
                return(String.Format(CultureInfo.CurrentCulture, "Drop Failed: {0} {1}", se.ObjectName, se.Exception.Message));

            default:
                eventName = Enum.Format(typeof(SchemaEventType), se.EventType, "G");
                break;
            }

            return(String.Format(CultureInfo.CurrentCulture, "{0} {1}", eventName, se.ObjectName));
        }
        /// <summary>
        /// Format a schema event into a string
        /// </summary>
        /// <param name="se">The schema event to format</param>
        /// <returns>The formatted event</returns>
        protected static string FormatEventArgs (SchemaEventArgs se)
        {
			if (se == null) throw new ArgumentNullException("se");

            string eventName;
            switch (se.EventType)
            {
                case SchemaEventType.BeforeDrop:
                    eventName = Resources.Dropping;
                    break;
                case SchemaEventType.BeforeCreate:
                    eventName = Resources.Creating;
                    break;
                case SchemaEventType.AfterCreate:
                    eventName = Resources.Created;
                    break;
				case SchemaEventType.DropFailed:
					return String.Format(CultureInfo.CurrentCulture, "Drop Failed: {0} {1}", se.ObjectName, se.Exception.Message);

                default:
                    eventName = Enum.Format (typeof (SchemaEventType), se.EventType, "G");
                    break;
            }

            return String.Format (CultureInfo.CurrentCulture, "{0} {1}", eventName, se.ObjectName);
        }
 private void OnSchemaChange (object sender, SchemaEventArgs se)
 {
     LogSchemaChange (se);
 }
 /// <summary>
 /// Called when a schema event is received
 /// </summary>
 /// <param name="se">The schema event</param>
 public abstract void LogSchemaChange (SchemaEventArgs se);
Example #5
0
 private void OnSchemaChange(object sender, SchemaEventArgs se)
 {
     LogSchemaChange(se);
 }
Example #6
0
 /// <summary>
 /// Called when a schema event is received
 /// </summary>
 /// <param name="se">The schema event</param>
 public abstract void LogSchemaChange(SchemaEventArgs se);
 public override void LogSchemaChange(SchemaEventArgs se)
 {
     Console.WriteLine(FormatEventArgs(se));
 }
		internal void OnMissingObject (object sender, SchemaEventArgs e)
		{
			if (MissingObject != null)
				MissingObject (sender, e);
		}
        /// <summary>
        /// Format a schema event into a string
        /// </summary>
        /// <param name="se">The schema event to format</param>
        /// <returns>The formatted event</returns>
        protected static string FormatEventArgs (SchemaEventArgs se)
        {
            string eventName;
            switch (se.EventType)
            {
                case SchemaEventType.BeforeDrop:
                    eventName = Resources.Dropping;
                    break;
                case SchemaEventType.BeforeTableUpdate:
                    eventName = Resources.Updating;
                    break;
                case SchemaEventType.AfterTableUpdate:
                    eventName = Resources.Updated;
                    break;
                case SchemaEventType.BeforeCreate:
                    eventName = Resources.Creating;
                    break;
                case SchemaEventType.AfterCreate:
                    eventName = Resources.Created;
                    break;
                default:
                    eventName = Enum.Format (typeof (SchemaEventType), se.EventType, "G");
                    break;
            }

            return String.Format (CultureInfo.CurrentCulture, "{0} {1}", eventName, se.ObjectName);
        }
		public override void LogSchemaChange (SchemaEventArgs se)
		{
			Console.WriteLine (FormatEventArgs (se));
		}