1 using System; 2 using System.Collections.Generic; 3 using System.Text; 4 5 namespace System.Data.Linq.SqlClient { 6 7 /// <summary> 8 /// Annotation which indicates that the given node will cause a compatibility problem 9 /// for the indicated set of providers. 10 /// </summary> 11 internal class SqlServerCompatibilityAnnotation : SqlNodeAnnotation { 12 SqlProvider.ProviderMode[] providers; 13 14 /// <summary> 15 /// Constructor 16 /// </summary> 17 /// <param name="message">The compatibility message.</param> 18 /// <param name="providers">The set of providers this compatibility issue applies to.</param> SqlServerCompatibilityAnnotation(string message, params SqlProvider.ProviderMode[] providers)19 internal SqlServerCompatibilityAnnotation(string message, params SqlProvider.ProviderMode[] providers) 20 : base(message) { 21 this.providers = providers; 22 } 23 24 /// <summary> 25 /// Returns true if this annotation applies to the specified provider. 26 /// </summary> AppliesTo(SqlProvider.ProviderMode provider)27 internal bool AppliesTo(SqlProvider.ProviderMode provider) { 28 foreach (SqlProvider.ProviderMode p in providers) { 29 if (p == provider) { 30 return true; 31 } 32 } 33 return false; 34 } 35 } 36 } 37