More 1.1 code and NET_2_0 ifdefs removed
authorMarek Habersack <grendel@twistedcode.net>
Tue, 3 Nov 2009 20:19:37 +0000 (20:19 -0000)
committerMarek Habersack <grendel@twistedcode.net>
Tue, 3 Nov 2009 20:19:37 +0000 (20:19 -0000)
svn path=/trunk/mcs/; revision=145319

79 files changed:
mcs/class/System.Web/System.Web.Caching/AggregateCacheDependency.cs
mcs/class/System.Web/System.Web.Caching/Cache.cs
mcs/class/System.Web/System.Web.Caching/CacheDependency.cs
mcs/class/System.Web/System.Web.Caching/CachedRawResponse.cs
mcs/class/System.Web/System.Web.Caching/OutputCacheModule.cs
mcs/class/System.Web/System.Web.Caching/SqlCacheDependency.cs
mcs/class/System.Web/System.Web.Compilation/AppCodeCompiler.cs
mcs/class/System.Web/System.Web.Compilation/AppResourceFileInfo.cs
mcs/class/System.Web/System.Web.Compilation/AppResourceFilesCollection.cs
mcs/class/System.Web/System.Web.Compilation/AppResourcesAssemblyBuilder.cs
mcs/class/System.Web/System.Web.Compilation/AppResourcesCompiler.cs
mcs/class/System.Web/System.Web.Compilation/AppSettingsExpressionBuilder.cs
mcs/class/System.Web/System.Web.Compilation/AppWebReferencesCompiler.cs
mcs/class/System.Web/System.Web.Compilation/ApplicationFileBuildProvider.cs
mcs/class/System.Web/System.Web.Compilation/AspComponentFoundry.cs
mcs/class/System.Web/System.Web.Compilation/AspGenerator.cs
mcs/class/System.Web/System.Web.Compilation/AspParser.cs
mcs/class/System.Web/System.Web.Compilation/AspTokenizer.cs
mcs/class/System.Web/System.Web.Compilation/AssemblyBuilder.cs
mcs/class/System.Web/System.Web.Compilation/BaseCompiler.cs
mcs/class/System.Web/System.Web.Compilation/BuildDependencySet.cs
mcs/class/System.Web/System.Web.Compilation/BuildManager.cs
mcs/class/System.Web/System.Web.Compilation/BuildManagerCacheItem.cs
mcs/class/System.Web/System.Web.Compilation/BuildManagerDirectoryBuilder.cs
mcs/class/System.Web/System.Web.Compilation/BuildManagerHostUnloadEventArgs.cs
mcs/class/System.Web/System.Web.Compilation/BuildManagerHostUnloadEventHandler.cs
mcs/class/System.Web/System.Web.Compilation/BuildManagerRemoveEntryEventHandler.cs
mcs/class/System.Web/System.Web.Compilation/BuildProvider.cs
mcs/class/System.Web/System.Web.Compilation/BuildProviderAppliesTo.cs
mcs/class/System.Web/System.Web.Compilation/BuildProviderAppliesToAttribute.cs
mcs/class/System.Web/System.Web.Compilation/BuildProviderGroup.cs
mcs/class/System.Web/System.Web.Compilation/BuildProviderResultFlags.cs
mcs/class/System.Web/System.Web.Compilation/CachingCompiler.cs
mcs/class/System.Web/System.Web.Compilation/ClientBuildManager.cs
mcs/class/System.Web/System.Web.Compilation/ClientBuildManagerCallback.cs
mcs/class/System.Web/System.Web.Compilation/ClientBuildManagerParameter.cs
mcs/class/System.Web/System.Web.Compilation/CompilationException.cs
mcs/class/System.Web/System.Web.Compilation/CompilerType.cs
mcs/class/System.Web/System.Web.Compilation/ConnectionStringsExpressionBuilder.cs
mcs/class/System.Web/System.Web.Compilation/DefaultResourceProvider.cs
mcs/class/System.Web/System.Web.Compilation/DefaultResourceProviderFactory.cs
mcs/class/System.Web/System.Web.Compilation/DesignTimeResourceProviderFactoryAttribute.cs
mcs/class/System.Web/System.Web.Compilation/Directive.cs
mcs/class/System.Web/System.Web.Compilation/ExpressionBuilder.cs
mcs/class/System.Web/System.Web.Compilation/ExpressionBuilderContext.cs
mcs/class/System.Web/System.Web.Compilation/ExpressionEditorAttribute.cs
mcs/class/System.Web/System.Web.Compilation/ExpressionPrefixAttribute.cs
mcs/class/System.Web/System.Web.Compilation/ForceCopyBuildProvider.cs
mcs/class/System.Web/System.Web.Compilation/GenericBuildProvider.cs
mcs/class/System.Web/System.Web.Compilation/GlobalAsaxCompiler.cs
mcs/class/System.Web/System.Web.Compilation/IAssemblyPostProcessor.cs
mcs/class/System.Web/System.Web.Compilation/IImplicitResourceProvider.cs
mcs/class/System.Web/System.Web.Compilation/IResourceProvider.cs
mcs/class/System.Web/System.Web.Compilation/IgnoreFileBuildProvider.cs
mcs/class/System.Web/System.Web.Compilation/ImplicitResourceKey.cs
mcs/class/System.Web/System.Web.Compilation/LinePragmaCodeInfo.cs
mcs/class/System.Web/System.Web.Compilation/MasterPageBuildProvider.cs
mcs/class/System.Web/System.Web.Compilation/MasterPageCompiler.cs
mcs/class/System.Web/System.Web.Compilation/PageBuildProvider.cs
mcs/class/System.Web/System.Web.Compilation/PageCompiler.cs
mcs/class/System.Web/System.Web.Compilation/PageThemeCompiler.cs
mcs/class/System.Web/System.Web.Compilation/PrecompilationFlags.cs
mcs/class/System.Web/System.Web.Compilation/PreservationFile.cs
mcs/class/System.Web/System.Web.Compilation/ResourceExpressionBuilder.cs
mcs/class/System.Web/System.Web.Compilation/ResourceExpressionFields.cs
mcs/class/System.Web/System.Web.Compilation/ResourceProviderFactory.cs
mcs/class/System.Web/System.Web.Compilation/SimpleBuildProvider.cs
mcs/class/System.Web/System.Web.Compilation/TagAttributes.cs
mcs/class/System.Web/System.Web.Compilation/TemplateBuildProvider.cs
mcs/class/System.Web/System.Web.Compilation/TemplateControlCompiler.cs
mcs/class/System.Web/System.Web.Compilation/ThemeDirectoryBuildProvider.cs
mcs/class/System.Web/System.Web.Compilation/ThemeDirectoryCompiler.cs
mcs/class/System.Web/System.Web.Compilation/UserControlBuildProvider.cs
mcs/class/System.Web/System.Web.Compilation/UserControlCompiler.cs
mcs/class/System.Web/System.Web.Compilation/WebHandlerBuildProvider.cs
mcs/class/System.Web/System.Web.Compilation/WebServiceBuildProvider.cs
mcs/class/System.Web/System.Web.Compilation/WebServiceCompiler.cs
mcs/class/System.Web/System.Web.Compilation/WsdlBuildProvider.cs
mcs/class/System.Web/System.Web.Compilation/XsdBuildProvider.cs

index e4e60f314a43282c47e8931fc2a34f51a26632ea..da7c1238affc51aafe43a90c364e2c081aef8c6d 100644 (file)
@@ -26,7 +26,7 @@
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-#if NET_2_0
+
 using System;
 using System.Collections.Generic;
 using System.Text;
@@ -104,6 +104,6 @@ namespace System.Web.Caching
                }
        }
 }
-#endif
+
 
 
index 1b8625fad47ea74e4d743230786f3fef18a23ee1..fcbaf160ce7c1c64ad6a39b4d02c978613be6163 100644 (file)
 
 using System.Threading;
 using System.Collections;
-using System.Security.Permissions;
-#if NET_2_0
 using System.Collections.Generic;
-#endif
+using System.Security.Permissions;
 using System.Web.Configuration;
 
 namespace System.Web.Caching
@@ -44,23 +42,12 @@ namespace System.Web.Caching
        {
                public static readonly DateTime NoAbsoluteExpiration = DateTime.MaxValue;
                public static readonly TimeSpan NoSlidingExpiration = TimeSpan.Zero;
-               
-#if NET_2_0 && SYSTEMCORE_DEP
                ReaderWriterLockSlim cacheLock;
-#else
-               ReaderWriterLock cacheLock;
-#endif
-
-#if NET_2_0
                Dictionary <string, CacheItem> cache;
-#else
-               Hashtable cache;
-#endif
                CacheItemPriorityQueue timedItems;
                Timer expirationTimer;
                long expirationTimerPeriod = 0;
                Cache dependencyCache;
-#if NET_2_0
                bool? disableExpiration;
                long privateBytesLimit = -1;
                long percentagePhysicalMemoryLimit = -1;
@@ -118,25 +105,11 @@ namespace System.Web.Caching
                                return percentagePhysicalMemoryLimit;
                        }
                }
-#else
-               bool DisableExpiration {
-                       get { return false; }
-               }               
-#endif
                
                public Cache ()
                {
-#if NET_2_0 && SYSTEMCORE_DEP
                        cacheLock = new ReaderWriterLockSlim ();
-#else
-                       cacheLock = new ReaderWriterLock ();
-#endif
-
-#if NET_2_0
                        cache = new Dictionary <string, CacheItem> (StringComparer.Ordinal);
-#else
-                       cache = new Hashtable ();
-#endif
                }
 
                public int Count {
@@ -154,14 +127,8 @@ namespace System.Web.Caching
                                return null;
                        
                        CacheItem ret;
-#if NET_2_0
                        if (cache.TryGetValue (key, out ret))
                                return ret;
-#else
-                       ret = cache [key] as CacheItem;
-                       if (ret != null)
-                               return ret;
-#endif
                        return null;
                }
 
@@ -171,14 +138,8 @@ namespace System.Web.Caching
                                return null;
 
                        CacheItem ret = null;
-#if NET_2_0
                        if (!cache.TryGetValue (key, out ret))
                                return null;
-#else
-                       ret = cache [key] as CacheItem;
-                       if (ret == null)
-                               return null;
-#endif
                        ret.Disabled = true;
                        cache.Remove (key);
                        
@@ -192,11 +153,7 @@ namespace System.Web.Caching
 
                        bool locked = false;
                        try {
-#if NET_2_0 && SYSTEMCORE_DEP
                                cacheLock.EnterWriteLock ();
-#else
-                               cacheLock.AcquireWriterLock (-1);
-#endif
                                locked = true;
                                CacheItem it = GetCacheItem (key);
 
@@ -204,13 +161,8 @@ namespace System.Web.Caching
                                        return it.Value;
                                Insert (key, value, dependencies, absoluteExpiration, slidingExpiration, priority, onRemoveCallback, false);
                        } finally {
-                               if (locked) {
-#if NET_2_0 && SYSTEMCORE_DEP
+                               if (locked)
                                        cacheLock.ExitWriteLock ();
-#else
-                                       cacheLock.ReleaseWriterLock ();
-#endif
-                               }
                        }
                                
                        return null;
@@ -220,33 +172,18 @@ namespace System.Web.Caching
                {
                        bool locked = false;
                        try {
-#if NET_2_0 && SYSTEMCORE_DEP
                                cacheLock.EnterUpgradeableReadLock ();
-#else
-                               cacheLock.AcquireReaderLock (-1);
-#endif
                                locked = true;
                                CacheItem it = GetCacheItem (key);
                                if (it == null)
                                        return null;
                                
                                if (it.Dependency != null && it.Dependency.HasChanged) {
-#if !NET_2_0
-                                       LockCookie lc = default (LockCookie);
-#endif
                                        try {
-#if NET_2_0
                                                cacheLock.EnterWriteLock ();
-#else
-                                               lc = cacheLock.UpgradeToWriterLock (-1);
-#endif
                                                Remove (it.Key, CacheItemRemovedReason.DependencyChanged, false);
                                        } finally {
-#if NET_2_0
                                                cacheLock.ExitWriteLock ();
-#else
-                                               cacheLock.DowngradeFromWriterLock (ref lc);
-#endif
                                        }
                                        
                                        return null;
@@ -266,22 +203,11 @@ namespace System.Web.Caching
                                                }
                                        
                                        } else if (DateTime.Now >= it.AbsoluteExpiration) {
-#if !NET_2_0
-                                               LockCookie lc = default (LockCookie);
-#endif
                                                try {
-#if NET_2_0
                                                        cacheLock.EnterWriteLock ();
-#else
-                                                       lc = cacheLock.UpgradeToWriterLock (-1);
-#endif
                                                        Remove (key, CacheItemRemovedReason.Expired, false);
                                                } finally {
-#if NET_2_0
                                                        cacheLock.ExitWriteLock ();
-#else
-                                                       cacheLock.DowngradeFromWriterLock (ref lc);
-#endif
                                                }
 
                                                return null;
@@ -291,11 +217,7 @@ namespace System.Web.Caching
                                return it.Value;
                        } finally {
                                if (locked) {
-#if NET_2_0 && SYSTEMCORE_DEP
                                        cacheLock.ExitUpgradeableReadLock ();
-#else
-                                       cacheLock.ReleaseReaderLock ();
-#endif
                                }
                        }
                }
@@ -354,11 +276,7 @@ namespace System.Web.Caching
                        
                        try {
                                if (doLock) {
-#if NET_2_0 && SYSTEMCORE_DEP
                                        cacheLock.EnterWriteLock ();
-#else
-                                       cacheLock.AcquireWriterLock (-1);
-#endif
                                        locked = true;
                                }
                                
@@ -367,11 +285,7 @@ namespace System.Web.Caching
                                        SetItemTimeout (ci, absoluteExpiration, slidingExpiration, ci.OnRemoveCallback, null, false);
                        } finally {
                                if (locked) {
-#if NET_2_0 && SYSTEMCORE_DEP
                                        cacheLock.ExitWriteLock ();
-#else
-                                       cacheLock.ReleaseWriterLock ();
-#endif
                                }
                        }
                }
@@ -394,11 +308,7 @@ namespace System.Web.Caching
                        bool locked = false;
                        try {
                                if (doLock) {
-#if NET_2_0 && SYSTEMCORE_DEP
                                        cacheLock.EnterWriteLock ();
-#else
-                                       cacheLock.AcquireWriterLock (-1);
-#endif
                                        locked = true;
                                }
                                
@@ -415,11 +325,7 @@ namespace System.Web.Caching
                                        EnqueueTimedItem (ci);
                        } finally {
                                if (locked) {
-#if NET_2_0 && SYSTEMCORE_DEP
                                        cacheLock.ExitWriteLock ();
-#else
-                                       cacheLock.ReleaseWriterLock ();
-#endif
                                }
                        }
                }
@@ -461,22 +367,14 @@ namespace System.Web.Caching
                        bool locked = false;
                        try {
                                if (doLock) {
-#if NET_2_0 && SYSTEMCORE_DEP
                                        cacheLock.EnterWriteLock ();
-#else
-                                       cacheLock.AcquireWriterLock (-1);
-#endif
                                        locked = true;
                                }
                                
                                it = RemoveCacheItem (key);
                        } finally {
                                if (locked) {
-#if NET_2_0 && SYSTEMCORE_DEP
                                        cacheLock.ExitWriteLock ();
-#else
-                                       cacheLock.ReleaseWriterLock ();
-#endif
                                }
                        }
 
@@ -486,9 +384,7 @@ namespace System.Web.Caching
                                        t.Dispose ();
                                
                                if (it.Dependency != null) {
-#if NET_2_0
                                        it.Dependency.SetCache (null);
-#endif
                                        it.Dependency.DependencyChanged -= new EventHandler (OnDependencyChanged);
                                        it.Dependency.Dispose ();
                                }
@@ -517,11 +413,7 @@ namespace System.Web.Caching
                        CacheItemRemovedReason reason = CacheItemRemovedReason.Removed;
                        bool locked = false;
                        try {
-#if NET_2_0 && SYSTEMCORE_DEP
                                cacheLock.EnterReadLock ();
-#else
-                               cacheLock.AcquireReaderLock (-1);
-#endif
                                locked = true;
                                foreach (string key in cache.Keys) {
                                        CacheItem item = GetCacheItem (key);
@@ -538,11 +430,7 @@ namespace System.Web.Caching
                                }
                        }  finally {
                                if (locked) {
-#if NET_2_0 && SYSTEMCORE_DEP
                                        cacheLock.ExitReadLock ();
-#else
-                                       cacheLock.ReleaseReaderLock ();
-#endif
                                }
                        }
                }
@@ -552,25 +440,13 @@ namespace System.Web.Caching
                        ArrayList list = new ArrayList ();
                        bool locked = false;
                        try {
-#if NET_2_0 && SYSTEMCORE_DEP
                                cacheLock.EnterReadLock ();
-#else
-                               cacheLock.AcquireReaderLock (-1);
-#endif
                                locked = true;
-#if NET_2_0
                                foreach (CacheItem it in cache.Values)
                                        list.Add (it);
-#else
-                               list.AddRange (cache.Values);
-#endif
                        } finally {
                                if (locked) {
-#if NET_2_0 && SYSTEMCORE_DEP
                                        cacheLock.ExitReadLock ();
-#else
-                                       cacheLock.ReleaseReaderLock ();
-#endif
                                }
                        }
                        
@@ -629,20 +505,11 @@ namespace System.Web.Caching
                        IList list;
                        bool locked = false;
                        try {
-#if NET_2_0 && SYSTEMCORE_DEP
                                cacheLock.EnterWriteLock ();
-#else
-                               cacheLock.AcquireWriterLock (-1);
-#endif
                                locked = true;
-#if NET_2_0
                                list = new List <CacheItem> ();
                                foreach (CacheItem it in cache.Values)
                                        list.Add (it);
-#else
-                               list = new ArrayList ();
-                               ((ArrayList)list).AddRange (cache.Values);
-#endif
                        
                                foreach (CacheItem it in list) {
                                        if (it.Dependency != null && it.Dependency.HasChanged)
@@ -650,11 +517,7 @@ namespace System.Web.Caching
                                }
                        } finally {
                                if (locked) {
-#if NET_2_0 && SYSTEMCORE_DEP
                                        cacheLock.ExitWriteLock ();
-#else
-                                       cacheLock.ReleaseWriterLock ();
-#endif
                                }
                        }
                }
@@ -663,11 +526,7 @@ namespace System.Web.Caching
                {
                        bool locked = false;
                        try {
-#if NET_2_0 && SYSTEMCORE_DEP
                                cacheLock.EnterReadLock ();
-#else
-                               cacheLock.AcquireReaderLock (-1);
-#endif
                                locked = true;
                                CacheItem it = GetCacheItem (key);
 
@@ -677,11 +536,7 @@ namespace System.Web.Caching
                                return it.LastChange;
                        } finally {
                                if (locked) {
-#if NET_2_0 && SYSTEMCORE_DEP
                                        cacheLock.ExitReadLock ();
-#else
-                                       cacheLock.ReleaseReaderLock ();
-#endif
                                }
                        }
                }
index db8240f04b79351dbe5ae39c16da330847a444af..a7ff431fb7dde7d337d789ff387496c71840ade7 100644 (file)
@@ -30,22 +30,15 @@ using System.Collections;
 using System.ComponentModel;
 using System.IO;
 using System.Security.Permissions;
-#if NET_2_0
 using System.Text;
-#endif
 
 namespace System.Web.Caching
 {
-#if NET_2_0
        // CAS
        [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
        [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
-       public class CacheDependency: IDisposable {
-#else
-       // CAS - no InheritanceDemand here as the class is sealed
-       [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
-       public sealed class CacheDependency: IDisposable {
-#endif
+       public class CacheDependency: IDisposable
+       {
                static readonly object dependencyChangedEvent = new object ();
                string[] cachekeys;
                CacheDependency dependency;
@@ -53,10 +46,8 @@ namespace System.Web.Caching
                Cache cache;
                FileSystemWatcher[] watchers;
                bool hasChanged;
-#if NET_2_0
                bool used;
                DateTime utcLastModified;
-#endif
                object locker = new object ();
                EventHandlerList events = new EventHandlerList ();
                
@@ -65,11 +56,9 @@ namespace System.Web.Caching
                        remove { events.RemoveHandler (dependencyChangedEvent, value); }
                }
                
-#if NET_2_0
                public CacheDependency (): this (null, null, null, DateTime.Now)
                {
                }
-#endif
                
                public CacheDependency (string filename): this (new string[] { filename }, null, null, DateTime.Now)
                {
@@ -131,12 +120,9 @@ namespace System.Web.Caching
                                dependency.DependencyChanged += new EventHandler (OnChildDependencyChanged);
                        this.start = start;
 
-#if NET_2_0
                        FinishInit ();
-#endif
                }
 
-#if NET_2_0
                public virtual string GetUniqueID ()
                {
                        StringBuilder sb = new StringBuilder ();
@@ -152,7 +138,6 @@ namespace System.Web.Caching
                                        sb.AppendFormat ("_{0}", key);
                        return sb.ToString ();
                }
-#endif
                
                void OnChanged (object sender, FileSystemEventArgs args)
                {
@@ -164,9 +149,7 @@ namespace System.Web.Caching
                        if (DateTime.Now < start)
                                return false;
                        hasChanged = true;
-#if NET_2_0
                        utcLastModified = DateTime.UtcNow;
-#endif
                        DisposeWatchers ();
                        
                        if (cache != null)
@@ -192,20 +175,13 @@ namespace System.Web.Caching
                        DependencyDispose ();
                }
 
-#if NET_2_0
                internal virtual void DependencyDisposeInternal ()
                {
                }
-#endif
                
-#if NET_2_0
-               protected virtual
-#endif
-               void DependencyDispose () 
+               protected virtual void DependencyDispose () 
                {
-#if NET_2_0
                        DependencyDisposeInternal ();
-#endif
                        DisposeWatchers ();
                        if (dependency != null) {
                                dependency.DependencyChanged -= new EventHandler (OnChildDependencyChanged);
@@ -218,12 +194,9 @@ namespace System.Web.Caching
                internal void SetCache (Cache c)
                {
                        cache = c;
-#if NET_2_0
                        used = c != null;
-#endif
                }
                
-#if NET_2_0
                protected internal void FinishInit () 
                {
                        utcLastModified = DateTime.UtcNow;
@@ -248,7 +221,6 @@ namespace System.Web.Caching
                {
                        this.utcLastModified = utcLastModified;
                }
-#endif
                
                public bool HasChanged {
                        get {
@@ -287,14 +259,9 @@ namespace System.Web.Caching
                        EventHandler eh = events [dependencyChangedEvent] as EventHandler;
                        if (eh != null)
                                eh (sender, e);
-               }
-               
-#if NET_2_0
-               protected
-#else
-               internal
-#endif
-               void NotifyDependencyChanged (object sender, EventArgs e) 
+               }               
+
+               protected void NotifyDependencyChanged (object sender, EventArgs e) 
                {
                        OnDependencyChanged (sender, e);
                }
index d512070d02f9afa0a3b312d4ce91d23fac0d7f25..c2003813a45eb8c92ac23aca9c4b42adf916e069 100644 (file)
@@ -36,9 +36,7 @@ using System.Collections.Specialized;
 using System.IO;
 using System.Text;
 
-#if NET_2_0
 using System.Collections.Generic;
-#endif
 
 namespace System.Web.Caching
 {
@@ -48,9 +46,7 @@ namespace System.Web.Caching
                {
                        public readonly byte[] Buffer;
                        public readonly long Length;
-#if NET_2_0
                        public readonly HttpResponseSubstitutionCallback Callback;
-#endif
                        
                        public DataItem (byte[] buffer, long length)
                        {
@@ -58,12 +54,10 @@ namespace System.Web.Caching
                                Length = length;
                        }
 
-#if NET_2_0
                        public DataItem (HttpResponseSubstitutionCallback callback) : this (null, 0)
                        {
                                Callback = callback;
                        }
-#endif
                }
                
                HttpCachePolicy policy;
@@ -72,21 +66,12 @@ namespace System.Web.Caching
                string status_desc;
                int content_length;
                NameValueCollection headers;
-#if NET_2_0
                List <DataItem> data;
-#else
-               ArrayList data;
-#endif
 
                IList Data {
                        get {
-                               if (data == null) {
-#if NET_2_0
+                               if (data == null)
                                        data = new List <DataItem> ();
-#else
-                                       data = new ArrayList ();
-#endif
-                               }
 
                                return data;
                        }
@@ -134,7 +119,6 @@ namespace System.Web.Caching
                        Data.Add (new DataItem (ms.GetBuffer (), ms.Length));
                }
 
-#if NET_2_0
                public void SetData (HttpResponseSubstitutionCallback callback)
                {
                        if (callback == null)
@@ -142,7 +126,6 @@ namespace System.Web.Caching
 
                        Data.Add (new DataItem (callback));
                }
-#endif
                
                public IList GetData ()
                {
index af6afe555e4b73dc102af8858ca2d238b3c9935d..f723c8b91c062a3c4700ee1b7b0552ab281f3a4b 100644 (file)
@@ -30,6 +30,7 @@
 //
 
 using System.Collections;
+using System.Collections.Generic;
 using System.IO;
 using System.Text;
 using System.Web;
@@ -37,21 +38,14 @@ using System.Web.UI;
 using System.Web.Util;
 using System.Web.Compilation;
 
-#if NET_2_0
-using System.Collections.Generic;
-#endif
-
-namespace System.Web.Caching {
-       
-       internal sealed class OutputCacheModule : IHttpModule
+namespace System.Web.Caching
+{      
+       sealed class OutputCacheModule : IHttpModule
        {
                CacheItemRemovedCallback response_removed;
-               
-#if NET_2_0
                static object keysCacheLock = new object ();
                Dictionary <string, string> keysCache;
                Dictionary <string, string> entriesToInvalidate;
-#endif
                
                public OutputCacheModule ()
                {
@@ -68,7 +62,6 @@ namespace System.Web.Caching {
                        response_removed = new CacheItemRemovedCallback (OnRawResponseRemoved);
                }
 
-#if NET_2_0
                void OnBuildManagerRemoveEntry (BuildManagerRemoveEntryEventArgs args)
                {
                        string entry = args.EntryName;
@@ -96,7 +89,6 @@ namespace System.Web.Caching {
                        if (!String.IsNullOrEmpty (cacheValue))
                                context.InternalCache.Remove (cacheValue);
                }
-#endif
 
                void OnResolveRequestCache (object o, EventArgs args)
                {
@@ -116,7 +108,6 @@ namespace System.Web.Caching {
                        if (c == null)
                                return;
 
-#if NET_2_0
                        lock (keysCacheLock) {
                                string invValue;
                                if (entriesToInvalidate != null && entriesToInvalidate.TryGetValue (vary_key, out invValue) && String.Compare (invValue, key, StringComparison.Ordinal) == 0) {
@@ -126,7 +117,6 @@ namespace System.Web.Caching {
                                        return;
                                }
                        }
-#endif
                        
                        ArrayList callbacks = c.Policy.ValidationCallbacks;
                        if (callbacks != null && callbacks.Count > 0) {
@@ -174,7 +164,6 @@ namespace System.Web.Caching {
                                                continue;
                                        }
 
-#if NET_2_0
                                        if (d.Callback == null)
                                                continue;
 
@@ -184,7 +173,6 @@ namespace System.Web.Caching {
 
                                        byte[] bytes = outEnc.GetBytes (s);
                                        response.BinaryWrite (bytes, 0, bytes.Length);
-#endif
                                }
                        }
                        
@@ -213,9 +201,7 @@ namespace System.Web.Caching {
                        CachedVaryBy varyby = context.Cache [vary_key] as CachedVaryBy;
                        CachedRawResponse prev = null;
                        bool lookup = true;
-#if NET_2_0
                        string cacheKey = null, cacheValue = null;
-#endif
                        
                        if (varyby == null) {
                                string path = context.Request.MapPath (vary_key);
@@ -228,9 +214,7 @@ namespace System.Web.Caching {
                                                              Cache.NoSlidingExpiration,
                                                              CacheItemPriority.Normal, null);
                                lookup = false;
-#if NET_2_0
                                cacheKey = vary_key;
-#endif
                        } 
 
                        key = varyby.CreateKey (vary_key, context);
@@ -254,13 +238,10 @@ namespace System.Web.Caching {
                                                                      CacheItemPriority.Normal, response_removed);
                                        c.VaryBy = varyby;
                                        varyby.ItemList.Add (key);
-#if NET_2_0
                                        cacheValue = key;
-#endif
                                }
                        }
                        
-#if NET_2_0
                        if (cacheKey != null) {
                                lock (keysCacheLock) {
                                        if (keysCache == null) {
@@ -271,7 +252,6 @@ namespace System.Web.Caching {
                                                keysCache.Add (cacheKey, cacheValue);
                                }
                        }
-#endif
                }
 
                static void OnRawResponseRemoved (string key, object value, CacheItemRemovedReason reason)
index 784bb8231f44b74030afe92b6ce432c2ebd6126a..a936ed514aab1f0297122ee5eb4a3be9ea5cf2ac 100644 (file)
@@ -25,7 +25,7 @@
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-#if NET_2_0
+
 using System;
 using System.ComponentModel;
 using System.Security.Permissions;
@@ -55,4 +55,3 @@ namespace System.Web.Caching
                }
        }
 }
-#endif
\ No newline at end of file
index e827aa6c718d184adc780111a47340027244a58e..37b004944619d64c9d07fd87760c9c5435694f51 100644 (file)
@@ -27,7 +27,7 @@
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-#if NET_2_0
+
 using System;
 using System.CodeDom;
 using System.CodeDom.Compiler;
@@ -746,4 +746,4 @@ namespace System.Web.Compilation
                }
        }
 }
-#endif
+
index 65920779c6416b92d72f7581e23f58a4bb61af58..022d2f8f47cc20ad2e1f5675e501610b79735fa3 100644 (file)
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-#if NET_2_0
+
 using System.IO;
 
 namespace System.Web.Compilation 
 {
-       internal class AppResourceFileInfo
+       class AppResourceFileInfo
        {
                public readonly bool Embeddable;
                public readonly bool Compilable;
@@ -50,4 +50,3 @@ namespace System.Web.Compilation
                }
        };
 };
-#endif
\ No newline at end of file
index ff4dfafd9fe630d7683caa3662431b2992bfd3e9..3c4063554df0a2d5a2bb0446dc3c9cfd0ee86e5f 100644 (file)
@@ -27,7 +27,7 @@
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-#if NET_2_0
+
 using System;
 using System.Collections.Generic;
 using System.Globalization;
@@ -174,4 +174,4 @@ namespace System.Web.Compilation
                }
        };
 };
-#endif
+
index 4f74c16ea9c104c00e10d22a25bae40de3172437..2589c5d8498da09f2cafc4f038616b847e752a7f 100644 (file)
@@ -27,7 +27,7 @@
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-#if NET_2_0
+
 using System;
 using System.CodeDom;
 using System.CodeDom.Compiler;
@@ -296,4 +296,4 @@ namespace System.Web.Compilation
                }
        }
 }
-#endif
+
index 26224ce188180ac88aa3afe0c84ad154d043a959..c27e849a4499eeb607fd2b9ffb8fc422ea2c593f 100644 (file)
@@ -28,7 +28,7 @@
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-#if NET_2_0
+
 using System;
 using System.CodeDom;
 using System.CodeDom.Compiler;
@@ -874,4 +874,4 @@ namespace System.Web.Compilation
                }
        };
 };
-#endif
+
index ccfc79571c552a9a72bd787f696d19ce14053b1e..9ec169d9c25f935c95e4b5a39167886243d4ed37 100644 (file)
@@ -4,7 +4,7 @@
 // Authors:
 //     Chris Toshok (toshok@ximian.com)
 //
-// (C) 2006 Novell, Inc (http://www.novell.com)
+// (C) 2006-2009 Novell, Inc (http://www.novell.com)
 //
 
 //
@@ -28,7 +28,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
 
 using System;
 using System.CodeDom;
@@ -38,12 +37,12 @@ using System.Web.Configuration;
 using System.Web.UI;
 using System.Reflection;
 
-namespace System.Web.Compilation {
-
+namespace System.Web.Compilation
+{
        [ExpressionEditor("System.Web.UI.Design.AppSettingsExpressionEditor, " + Consts.AssemblySystem_Design)]
        [ExpressionPrefix("AppSettings")]
-       public class AppSettingsExpressionBuilder : ExpressionBuilder {
-
+       public class AppSettingsExpressionBuilder : ExpressionBuilder
+       {
                public override object EvaluateExpression (object target, BoundPropertyEntry entry, object parsedData, ExpressionBuilderContext context)
                {
                        return GetAppSetting (entry.Expression.Trim ());
@@ -80,7 +79,6 @@ namespace System.Web.Compilation {
                        }
                }
 
-
                public override CodeExpression GetCodeExpression (BoundPropertyEntry entry, object parsedData, ExpressionBuilderContext context)
                {
                        Type type = entry.DeclaringType;
@@ -100,4 +98,4 @@ namespace System.Web.Compilation {
 
 }
 
-#endif
+
index 7134f92671bd9337aece5b057fff6cc6dd929c79..dd27f5a4d46a4e5f880bba5abcaf1356da5ef425 100644 (file)
@@ -28,7 +28,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0 && WEBSERVICES_DEP
+#if WEBSERVICES_DEP
 using System;
 using System.CodeDom;
 using System.CodeDom.Compiler;
index 569cd3c307419df0bd167fa8ea8d8ce822e483ae..b160215e6a385db779507332b70d992bd076faef 100644 (file)
@@ -4,7 +4,7 @@
 // Authors:
 //   Marek Habersack (mhabersack@novell.com)
 //
-// (C) 2008 Novell, Inc
+// (C) 2008-2009 Novell, Inc
 //
 
 //
@@ -27,7 +27,7 @@
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-#if NET_2_0
+
 using System;
 using System.CodeDom;
 using System.CodeDom.Compiler;
@@ -58,5 +58,5 @@ namespace System.Web.Compilation
                }
        }
 }
-#endif
+
 
index 57b8e5ec18da5c3e4104883f275225e00b36a05d..97d9e1becd8b1a552b201ada1dbbfb09ac01a9b1 100644 (file)
 //
 using System;
 using System.Collections;
+using System.Collections.Generic;
 using System.Globalization;
 using System.IO;
 using System.Reflection;
-using System.Web.Util;
-
-#if NET_2_0
-using System.Collections.Generic;
 using System.Web;
 using System.Web.Configuration;
 using System.Web.UI;
-#endif
+using System.Web.Util;
 
 namespace System.Web.Compilation
 {
-       internal class AspComponentFoundry
+       class AspComponentFoundry
        {
                Hashtable foundries;
-#if NET_2_0
                Dictionary <string, AspComponent> components;
-#else
-               Hashtable components;
-#endif
-
-#if NET_2_0
                Dictionary <string, AspComponent> Components {
                        get {
                                if (components == null)
@@ -60,32 +51,14 @@ namespace System.Web.Compilation
                                return components;
                        }
                }
-#else
-               Hashtable Components {
-                       get {
-                               if (components == null)
-                                       components = new Hashtable (CaseInsensitiveHashCodeProvider.DefaultInvariant, CaseInsensitiveComparer.DefaultInvariant);
-                               return components;
-                       }
-               }
-#endif
                
                public AspComponentFoundry ()
                {
-#if NET_2_0
                        foundries = new Hashtable (StringComparer.InvariantCultureIgnoreCase);
-#else
-                       foundries = new Hashtable (CaseInsensitiveHashCodeProvider.DefaultInvariant,
-                                                  CaseInsensitiveComparer.DefaultInvariant);
-#endif
-
                        Assembly sw = typeof (AspComponentFoundry).Assembly;
                        RegisterFoundry ("asp", sw, "System.Web.UI.WebControls");
                        RegisterFoundry ("", "object", typeof (System.Web.UI.ObjectTag));
-
-#if NET_2_0
                        RegisterConfigControls ();
-#endif
                }
 
                public AspComponent GetComponent (string tagName)
@@ -94,14 +67,9 @@ namespace System.Web.Compilation
                                return null;
                        
                        if (components != null) {
-#if NET_2_0
                                AspComponent ret;
                                if (components.TryGetValue (tagName, out ret))
                                        return ret;
-#else
-                               if (components.Contains (tagName))
-                                       return components [tagName] as AspComponent;
-#endif
                        }
 
                        string foundryName, tag;
@@ -158,11 +126,7 @@ namespace System.Web.Compilation
                                return null;
                        
                        AspComponent ret = new AspComponent (type, ns, prefix, source, foundry.FromConfig);
-#if NET_2_0
                        Dictionary <string, AspComponent> components = Components;
-#else
-                       Hashtable components = Components;
-#endif
                        components.Add (tagName, ret);
                        return ret;
                }
@@ -197,7 +161,6 @@ namespace System.Web.Compilation
                        InternalRegister (foundryName, foundry, fromConfig);
                }
 
-#if NET_2_0
                public void RegisterFoundry (string foundryName, string tagName, string source)
                {
                        RegisterFoundry (foundryName, tagName, source, false);
@@ -255,7 +218,6 @@ namespace System.Web.Compilation
                                                                 true);
                        }
                }
-#endif
                
                void InternalRegister (string foundryName, Foundry foundry, bool fromConfig)
                {
@@ -326,8 +288,6 @@ namespace System.Web.Compilation
                {
                        string tagName;
                        Type type;
-
-#if NET_2_0
                        string source;
 
                        public bool FromWebConfig {
@@ -339,7 +299,6 @@ namespace System.Web.Compilation
                                this.tagName = tagName;
                                this.source = source;
                        }
-#endif
                        
                        public TagNameFoundry (string tagName, Type type)
                        {
@@ -354,15 +313,12 @@ namespace System.Web.Compilation
                                if (0 != String.Compare (componentName, tagName, true, Helpers.InvariantCulture))
                                        return null;
 
-#if NET_2_0
                                source = this.source;
-#endif
                                return LoadType ();
                        }
 
                        Type LoadType ()
                        {
-#if NET_2_0
                                if (type != null)
                                        return type;
 
@@ -388,9 +344,6 @@ namespace System.Web.Compilation
                                        BuildManager.AddToReferencedAssemblies (type.Assembly);
                                }
                                return type;
-#else
-                               return type;
-#endif
                        }
                        
                        public string TagName {
@@ -402,46 +355,39 @@ namespace System.Web.Compilation
                {
                        string nameSpace;
                        Assembly assembly;
-#if NET_2_0
                        string assemblyName;
                        Dictionary <string, Assembly> assemblyCache;
-#endif
                        
                        public AssemblyFoundry (Assembly assembly, string nameSpace)
                        {
                                this.assembly = assembly;
                                this.nameSpace = nameSpace;
-#if NET_2_0
+
                                if (assembly != null)
                                        this.assemblyName = assembly.FullName;
                                else
                                        this.assemblyName = null;
-#endif
                        }
 
-#if NET_2_0
                        public AssemblyFoundry (string assemblyName, string nameSpace)
                        {
                                this.assembly = null;
                                this.nameSpace = nameSpace;
                                this.assemblyName = assemblyName;
                        }
-#endif
                        
                        public override Type GetType (string componentName, out string source, out string ns)
                        {
                                source = null;
                                ns = nameSpace;
-                               
-#if NET_2_0
+
                                if (assembly == null && assemblyName != null)
                                        assembly = GetAssemblyByName (assemblyName, true);
-#endif
+
                                string typeName = String.Concat (nameSpace, ".", componentName);
                                if (assembly != null)
                                        return assembly.GetType (typeName, false, true);
 
-#if NET_2_0
                                IList tla = BuildManager.TopLevelAssemblies;
                                if (tla != null && tla.Count > 0) {
                                        Type ret = null;
@@ -453,11 +399,10 @@ namespace System.Web.Compilation
                                                        return ret;
                                        }
                                }
-#endif
+
                                return null;
                        }
 
-#if NET_2_0
                        Assembly GetAssemblyByName (string name, bool throwOnMissing)
                        {
                                if (assemblyCache == null)
@@ -489,7 +434,6 @@ namespace System.Web.Compilation
                                assemblyCache.Add (name, assembly);
                                return assembly;
                        }
-#endif
                }
 
                class CompoundFoundry : Foundry
@@ -501,12 +445,7 @@ namespace System.Web.Compilation
                        public CompoundFoundry (string tagPrefix)
                        {
                                this.tagPrefix = tagPrefix;
-#if NET_2_0
                                tagnames = new Hashtable (StringComparer.InvariantCultureIgnoreCase);
-#else
-                               tagnames = new Hashtable (CaseInsensitiveHashCodeProvider.DefaultInvariant,
-                                                         CaseInsensitiveComparer.DefaultInvariant);
-#endif
                        }
 
                        public void Add (Foundry foundry)
@@ -519,10 +458,9 @@ namespace System.Web.Compilation
                                TagNameFoundry tn = (TagNameFoundry) foundry;
                                string tagName = tn.TagName;
                                if (tagnames.Contains (tagName)) {
-#if NET_2_0
                                        if (tn.FromWebConfig)
                                                return;
-#endif
+
                                        string msg = String.Format ("{0}:{1} already registered.", tagPrefix, tagName);
                                        throw new ApplicationException (msg);
                                }
index cae0f606d049548a7427af30a79afcbb8a7871f1..a1bc469bf3969a0eac38e24e952bc2937938f0f6 100644 (file)
@@ -31,6 +31,7 @@
 //
 using System;
 using System.Collections;
+using System.Collections.Generic;
 using System.CodeDom.Compiler;
 using System.Globalization;
 using System.IO;
@@ -43,10 +44,6 @@ using System.Web.UI;
 using System.Web.UI.HtmlControls;
 using System.Web.Util;
 
-#if NET_2_0
-using System.Collections.Generic;
-#endif
-
 namespace System.Web.Compilation
 {
        class BuilderLocation
@@ -211,11 +208,10 @@ namespace System.Web.Compilation
        
        class AspGenerator
        {
-#if NET_2_0
                const int READ_BUFFER_SIZE = 8192;
                
                internal static Regex DirectiveRegex = new Regex (@"<%\s*@(\s*(?<attrname>\w[\w:]*(?=\W))(\s*(?<equal>=)\s*""(?<attrval>[^""]*)""|\s*(?<equal>=)\s*'(?<attrval>[^']*)'|\s*(?<equal>=)\s*(?<attrval>[^\s%>]*)|(?<equal>)(?<attrval>\s*?)))*\s*?%>", RegexOptions.Compiled | RegexOptions.IgnoreCase);
-#endif
+
                static readonly Regex runatServer = new Regex (@"<[\w:\.]+.*?runat=[""']?server[""']?.*?/?>",
                                                               RegexOptions.Compiled | RegexOptions.Singleline |
                                                               RegexOptions.Multiline | RegexOptions.IgnoreCase |
@@ -248,7 +244,6 @@ namespace System.Web.Compilation
                bool inForm;
                bool useOtherTags;
                TagType lastTag;
-#if NET_2_0
                AspComponentFoundry componentFoundry;
                Stream inputStream;
 
@@ -256,19 +251,12 @@ namespace System.Web.Compilation
                {
                        this.componentFoundry = componentFoundry;
                }
-#endif
                
                public AspGenerator (TemplateParser tparser)
                {
                        this.tparser = tparser;
                        text = new StringBuilder ();
                        stack = new BuilderLocationStack ();
-
-#if !NET_2_0
-                       rootBuilder = new RootBuilder (tparser);
-                       tparser.RootBuilder = rootBuilder;
-                       stack.Push (rootBuilder, null);
-#endif
                        pstack = new ParserStack ();
                }
 
@@ -284,7 +272,6 @@ namespace System.Web.Compilation
                        get { return pstack.Filename; }
                }
 
-#if NET_2_0
                PageParserFilter PageParserFilter {
                        get {
                                if (tparser == null)
@@ -523,7 +510,6 @@ namespace System.Web.Compilation
                        stack.Push (rootBuilder, null);
                        tparser.RootBuilder = rootBuilder;
                }
-#endif
                
                BaseCompiler GetCompilerFromType ()
                {
@@ -536,10 +522,9 @@ namespace System.Web.Compilation
 
                        if (type == typeof (UserControlParser))
                                return new UserControlCompiler ((UserControlParser) tparser);
-#if NET_2_0
+
                        if (type == typeof(MasterPageParser))
                                return new MasterPageCompiler ((MasterPageParser) tparser);
-#endif
 
                        throw new Exception ("Got type: " + type);
                }
@@ -550,11 +535,10 @@ namespace System.Web.Compilation
                        parser.Error += new ParseErrorHandler (ParseError);
                        parser.TagParsed += new TagParsedHandler (TagParsed);
                        parser.TextParsed += new TextParsedHandler (TextParsed);
-#if NET_2_0
                        parser.ParsingComplete += new ParsingCompleteHandler (ParsingCompleted);
                        tparser.AspGenerator = this;
                        CreateRootBuilder (inputStream, filename);
-#endif
+
                        if (!pstack.Push (parser))
                                throw new ParseException (Location, "Infinite recursion detected including file: " + filename);
 
@@ -567,13 +551,11 @@ namespace System.Web.Compilation
                        }
                }
                
-#if NET_2_0
                void InitParser (string filename)
                {
                        StreamReader reader = new StreamReader (filename, WebEncoding.FileEncoding);
                        InitParser (reader, filename);
                }
-#endif
 
                void CheckForDuplicateIds (ControlBuilder root, Stack scopes)
                {
@@ -581,27 +563,15 @@ namespace System.Web.Compilation
                                return;
                        
                        if (scopes == null)
-                               scopes = new Stack ();
-                       
-#if NET_2_0
+                               scopes = new Stack ();                  
+
                        Dictionary <string, bool> ids;
-#else
-                       Hashtable ids;
-#endif
                        
                        if (scopes.Count == 0 || root.IsNamingContainer) {
-#if NET_2_0
                                ids = new Dictionary <string, bool> (StringComparer.Ordinal);
-#else
-                               ids = new Hashtable ();
-#endif
                                scopes.Push (ids);
                        } else {
-#if NET_2_0
                                ids = scopes.Peek () as Dictionary <string, bool>;
-#else
-                               ids = scopes.Peek () as Hashtable;
-#endif
                        }
                        
                        if (ids == null)
@@ -631,11 +601,7 @@ namespace System.Web.Compilation
                
                public void Parse (string file)
                {
-#if ONLY_1_1
-                       Parse (file, true);
-#else
                        Parse (file, false);
-#endif
                }
                
                public void Parse (TextReader reader, string filename, bool doInitParser)
@@ -650,9 +616,7 @@ namespace System.Web.Compilation
                                if (text.Length > 0)
                                        FlushText ();
 
-#if NET_2_0
                                tparser.MD5Checksum = pstack.Parser.MD5Checksum;
-#endif
                                pstack.Pop ();
 
 #if DEBUG
@@ -672,9 +636,7 @@ namespace System.Web.Compilation
 
                public void Parse (Stream stream, string filename, bool doInitParser)
                {
-#if NET_2_0
                        inputStream = stream;
-#endif
                        Parse (new StreamReader (stream, WebEncoding.FileEncoding), filename, doInitParser);
                }
                
@@ -686,7 +648,6 @@ namespace System.Web.Compilation
 
                public void Parse ()
                {
-#if NET_2_0
                        string inputFile = tparser.InputFile;
                        TextReader inputReader = tparser.Reader;
 
@@ -716,9 +677,6 @@ namespace System.Web.Compilation
                                if (inputReader != null)
                                        inputReader.Close ();
                        }
-#else
-                       Parse (Path.GetFullPath (tparser.InputFile));
-#endif
                }
 
                internal static void AddTypeToCache (ArrayList dependencies, string inputFile, Type type)
@@ -749,15 +707,7 @@ namespace System.Web.Compilation
                                return type;
                        }
 
-#if NET_2_0
                        Parse ();
-#else
-                       try {
-                               Parse ();
-                       } catch (ParseException ex) {
-                               throw new HttpException ("Compilation failed.", ex);
-                       }
-#endif
                        BaseCompiler compiler = GetCompilerFromType ();
                        
                        type = compiler.GetCompiledType ();
@@ -876,7 +826,6 @@ namespace System.Web.Compilation
                                FlushText ();
                }
 
-#if NET_2_0
                void ParsingCompleted ()
                {
                        PageParserFilter pfilter = PageParserFilter;
@@ -885,7 +834,6 @@ namespace System.Web.Compilation
 
                        pfilter.ParseComplete (RootBuilder);
                }
-#endif
 
                void CheckIfIncludeFileIsSecure (string filePath)
                {
@@ -1011,7 +959,6 @@ namespace System.Web.Compilation
 
                                if (isvirtual) {
                                        bool parsed = false;
-#if NET_2_0
                                        VirtualPathProvider vpp = HostingEnvironment.VirtualPathProvider;
 
                                        if (vpp.FileExists (file)) {
@@ -1021,7 +968,6 @@ namespace System.Web.Compilation
                                                        parsed = true;
                                                }
                                        }
-#endif
                                        
                                        if (!parsed)
                                                Parse (tparser.MapPath (file), true);
@@ -1075,19 +1021,9 @@ namespace System.Web.Compilation
                        return !text.EndsWith ("/>");
                }
                
-#if NET_2_0
-               List <TextBlock>
-#else
-               ArrayList
-#endif
-               FindRegexBlocks (Regex rxStart, Regex rxEnd, CheckBlockEnd checkEnd, IList blocks, TextBlockType typeForMatches, bool discardBlocks)
+               List <TextBlock> FindRegexBlocks (Regex rxStart, Regex rxEnd, CheckBlockEnd checkEnd, IList blocks, TextBlockType typeForMatches, bool discardBlocks)
                {
-#if NET_2_0
                        var ret = new List <TextBlock> ();
-#else
-                       ArrayList ret = new ArrayList ();
-#endif
-                       
                        foreach (TextBlock block in blocks) {
                                if (block.Type != TextBlockType.Verbatim) {
                                        ret.Add (block);
@@ -1128,11 +1064,7 @@ namespace System.Web.Compilation
                
                IList SplitTextIntoBlocks (string text)
                {
-#if NET_2_0
                        var ret = new List <TextBlock> ();
-#else
-                       ArrayList ret = new ArrayList ();
-#endif
 
                        ret.Add (new TextBlock (TextBlockType.Verbatim, text));
                        ret = FindRegexBlocks (clientCommentRegex, null, null, ret, TextBlockType.Comment, false);
@@ -1211,11 +1143,10 @@ namespace System.Web.Compilation
                                return;
                        
                        if (inScript) {
-#if NET_2_0
                                PageParserFilter pfilter = PageParserFilter;
                                if (pfilter != null && !pfilter.ProcessCodeConstruct (CodeConstructType.ScriptTag, t))
                                        return;
-#endif
+
                                tparser.Scripts.Add (new ServerSideScript (t, new System.Web.Compilation.Location (tparser.Location)));
                                return;
                        }
@@ -1230,7 +1161,6 @@ namespace System.Web.Compilation
                        }
                }
 
-#if NET_2_0
                bool BuilderHasOtherThan (Type type, ControlBuilder cb)
                {
                        ArrayList al = cb.OtherTags;
@@ -1278,7 +1208,6 @@ namespace System.Web.Compilation
                        
                        return true;
                }
-#endif
 
                public void AddControl (Type type, IDictionary attributes)
                {
@@ -1347,14 +1276,13 @@ namespace System.Web.Compilation
                        string plainText = location.PlainText;
                        if (!runatServer && plainText.IndexOf ("<%$") == -1&& plainText.IndexOf ("<%") > -1)
                                return false;
-#if NET_2_0
+
                        PageParserFilter pfilter = PageParserFilter;
                        if (pfilter != null && !pfilter.AllowControl (builder.ControlType, builder))
                                throw new ParseException (Location, "Control type '" + builder.ControlType + "' not allowed.");
                        
                        if (!OtherControlsAllowed (builder))
                                throw new ParseException (Location, "Only Content controls are allowed directly in a content page that contains Content controls.");
-#endif
                        
                        builder.Location = location;
                        builder.ID = htable ["id"] as string;
@@ -1503,7 +1431,6 @@ namespace System.Web.Compilation
                        return true;
                }
 
-#if NET_2_0
                CodeConstructType MapTagTypeToConstructType (TagType tagtype)
                {
                        switch (tagtype) {
@@ -1521,10 +1448,8 @@ namespace System.Web.Compilation
                        }
                }
                
-#endif
                bool ProcessCode (TagType tagtype, string code, ILocation location)
                {
-#if NET_2_0
                        PageParserFilter pfilter = PageParserFilter;
                        // LAMESPEC:
                        //
@@ -1537,7 +1462,7 @@ namespace System.Web.Compilation
                        //
                        if (pfilter != null && (!pfilter.AllowCode || pfilter.ProcessCodeConstruct (MapTagTypeToConstructType (tagtype), code)))
                                return true;
-#endif
+
                        ControlBuilder b = null;
                        if (tagtype == TagType.CodeRender)
                                b = new CodeRenderBuilder (code, false, location);
@@ -1564,13 +1489,8 @@ namespace System.Web.Compilation
                        if (String.Compare (lang, tparser.Language, true, Helpers.InvariantCulture) == 0)
                                return;
 
-#if NET_2_0
                        CompilationSection section = (CompilationSection) WebConfigurationManager.GetWebApplicationSection ("system.web/compilation");
                        if (section.Compilers[tparser.Language] != section.Compilers[lang])
-#else
-                       CompilationConfiguration cfg = CompilationConfiguration.GetInstance (HttpContext.Current); 
-                       if (!cfg.Compilers.CompareLanguages (tparser.Language, lang))
-#endif
                                throw new ParseException (Location,
                                                String.Format ("Trying to mix language '{0}' and '{1}'.", 
                                                                tparser.Language, lang));
index 472f1009c0e1d4c71e0c8f3de80242e934fdfe31..6e20b1180a200561d0a6fe02c510d47b4e2f22f5 100644 (file)
@@ -43,20 +43,16 @@ namespace System.Web.Compilation
        delegate void ParseErrorHandler (ILocation location, string message);
        delegate void TextParsedHandler (ILocation location, string text);
        delegate void TagParsedHandler (ILocation location, TagType tagtype, string id, TagAttributes attributes);
-#if NET_2_0
        delegate void ParsingCompleteHandler ();
-#endif
        
        class AspParser : ILocation
        {
                static readonly object errorEvent = new object ();
                static readonly object tagParsedEvent = new object ();
                static readonly object textParsedEvent = new object ();
-#if NET_2_0
                static readonly object parsingCompleteEvent = new object();
 
                MD5 checksum;
-#endif
                AspTokenizer tokenizer;
                int beginLine, endLine;
                int beginColumn, endColumn;
@@ -86,12 +82,10 @@ namespace System.Web.Compilation
                        remove { events.RemoveHandler (textParsedEvent, value); }
                }
 
-#if NET_2_0
                public event ParsingCompleteHandler ParsingComplete {
                        add { events.AddHandler (parsingCompleteEvent, value); }
                        remove { events.RemoveHandler (parsingCompleteEvent, value); }
                }
-#endif
                
                public AspParser (string filename, TextReader input)
                {
@@ -110,7 +104,6 @@ namespace System.Web.Compilation
                        this.outer = outer;
                }
                
-#if NET_2_0
                public byte[] MD5Checksum {
                        get {
                                if (checksum == null)
@@ -119,7 +112,6 @@ namespace System.Web.Compilation
                                return checksum.Hash;
                        }
                }
-#endif
                
                public int BeginLine {
                        get {
@@ -304,15 +296,11 @@ namespace System.Web.Compilation
                                        fileReader.Close ();
                                        fileReader = null;
                                }
-#if NET_2_0
                                checksum = tokenizer.Checksum;
-#endif
                                tokenizer = null;
                        }
 
-#if NET_2_0
                        OnParsingComplete ();
-#endif
                }
 
                bool GetInclude (string str, out string pathType, out string filename)
@@ -661,14 +649,12 @@ namespace System.Web.Compilation
                                eh (this, text);
                }
 
-#if NET_2_0
                void OnParsingComplete ()
                {
                        ParsingCompleteHandler eh = events [parsingCompleteEvent] as ParsingCompleteHandler;
                        if (eh != null)
                                eh ();
                }
-#endif
        }
 }
 
index ace6ab9c2ba6b99598909f57b8fce95534905548..42f91cf7f46d77762647dcdb9b798db114e00c8f 100644 (file)
@@ -3,8 +3,10 @@
 //
 // Authors:
 //     Gonzalo Paniagua Javier (gonzalo@ximian.com)
+//      Marek Habersack <mhabersack@novell.com>
 //
 // (C) 2002,2003 Ximian, Inc (http://www.ximian.com)
+// (C) 2003-2009 Novell, Inc (http://novell.com)
 //
 
 //
@@ -49,9 +51,8 @@ namespace System.Web.Compilation
 
        class AspTokenizer
        {
-#if NET_2_0
                const int CHECKSUM_BUF_SIZE = 8192;
-#endif
+
                class PutBackItem
                {
                        public readonly string Value;
@@ -85,7 +86,6 @@ namespace System.Web.Compilation
                int unget_value;
                string val;
                Stack putBackBuffer;
-#if NET_2_0
                MD5 checksum;
                char[] checksum_buf = new char [CHECKSUM_BUF_SIZE];
                int checksum_buf_pos = -1;
@@ -93,7 +93,6 @@ namespace System.Web.Compilation
                public MD5 Checksum {
                        get { return checksum; }
                }
-#endif
                
                public AspTokenizer (TextReader reader)
                {
@@ -185,7 +184,6 @@ namespace System.Web.Compilation
                        col--;
                }
 
-#if NET_2_0
                void TransformNextBlock (int count, bool final)
                {
                        byte[] input = Encoding.UTF8.GetBytes (checksum_buf, 0, count);
@@ -213,7 +211,7 @@ namespace System.Web.Compilation
                        } else
                                TransformNextBlock (checksum_buf_pos + 1, true);
                }
-#endif
+
                int read_char ()
                {
                        int c;
@@ -222,16 +220,12 @@ namespace System.Web.Compilation
                                have_unget = false;
                        } else {
                                c = sr.Read ();
-#if NET_2_0
                                UpdateChecksum (c);
-#endif
                        }
 
                        if (c == '\r' && sr.Peek () == '\n') {
                                c = sr.Read ();
-#if NET_2_0
                                UpdateChecksum (c);
-#endif
                                position++;
                        }
 
index 1082e33178667a76a03f3ac6d57690f216bdc8fe..7efab257a8404a750eaf3a8bbebed77b94f673a1 100644 (file)
@@ -30,7 +30,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
+
 
 using System;
 using System.CodeDom;
@@ -46,7 +46,8 @@ using System.Web.Configuration;
 using System.Web.Util;
 using System.Web.Hosting;
 
-namespace System.Web.Compilation {
+namespace System.Web.Compilation
+{
        class CompileUnitPartialType
        {
                public readonly CodeCompileUnit Unit;
@@ -850,5 +851,5 @@ namespace System.Web.Compilation {
                }
        }
 }
-#endif
+
 
index 61c273371a6f06af94e1e036cb35735bbdd389ba..d149ef2f5c4ca060fb500ca391894cd341b0d6a0 100644 (file)
@@ -44,12 +44,8 @@ namespace System.Web.Compilation
        abstract class BaseCompiler
        {
                const string DEFAULT_NAMESPACE = "ASP";
-
-#if NET_2_0
                internal static Guid HashMD5 = new Guid(0x406ea660, 0x64cf, 0x4c82, 0xb6, 0xf0, 0x42, 0xd4, 0x81, 0x72, 0xa7, 0x99);
-               static BindingFlags replaceableFlags = BindingFlags.Public | BindingFlags.NonPublic |
-                                                 BindingFlags.Instance;
-#endif
+               static BindingFlags replaceableFlags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance;
 
                TemplateParser parser;
                CodeDomProvider provider;
@@ -57,17 +53,14 @@ namespace System.Web.Compilation
                CodeCompileUnit unit;
                CodeNamespace mainNS;
                CompilerParameters compilerParameters;
-#if NET_2_0
                bool isRebuilding = false;
                protected Hashtable partialNameOverride = new Hashtable();
                protected CodeTypeDeclaration partialClass;
                protected CodeTypeReferenceExpression partialClassExpr;
-#endif
                protected CodeTypeDeclaration mainClass;
                protected CodeTypeReferenceExpression mainClassExpr;
                protected static CodeThisReferenceExpression thisRef = new CodeThisReferenceExpression ();
 
-#if NET_2_0
                VirtualPath inputVirtualPath;
                
                public VirtualPath InputVirtualPath {
@@ -78,7 +71,6 @@ namespace System.Web.Compilation
                                return inputVirtualPath;
                        }
                }
-#endif
                
                protected BaseCompiler (TemplateParser parser)
                {
@@ -130,13 +122,7 @@ namespace System.Web.Compilation
                        if (parser != null && !parser.LinePragmasOn)
                                return true;
                        
-                       return String.Compare (fileName, "@@inner_string@@",
-#if NET_2_0
-                                           StringComparison.OrdinalIgnoreCase
-#else
-                                           true
-#endif
-                       ) == 0;
+                       return String.Compare (fileName, "@@inner_string@@", StringComparison.OrdinalIgnoreCase) == 0;
                }
                
                internal CodeStatement AddLinePragma (CodeStatement statement, int line, string fileName)
@@ -181,8 +167,6 @@ namespace System.Web.Compilation
                internal void ConstructType ()
                {
                        unit = new CodeCompileUnit ();
-
-#if NET_2_0
                        byte[] md5checksum = parser.MD5Checksum;
 
                        if (md5checksum != null) {
@@ -213,23 +197,18 @@ namespace System.Web.Compilation
                                partialClass.TypeAttributes = TypeAttributes.Public;
                                partialNS.Types.Add (partialClass);
                        }
-#endif
 
                        string mainclasstype = parser.ClassName;
                        string mainns = DEFAULT_NAMESPACE;
-
-#if NET_2_0
                        int maindot = mainclasstype.LastIndexOf ('.');
                        if (maindot != -1) {
                                mainns = mainclasstype.Substring (0, maindot);
                                mainclasstype = mainclasstype.Substring (maindot + 1);
                        }
-#endif
 
                        mainNS = new CodeNamespace (mainns);
                        mainClass = new CodeTypeDeclaration (mainclasstype);
                        CodeTypeReference baseTypeRef;
-#if NET_2_0
                        if (partialClass != null) {
                                baseTypeRef = new CodeTypeReference (parser.PartialClassName);
                                baseTypeRef.Options |= CodeTypeReferenceOptions.GlobalReference;
@@ -238,9 +217,6 @@ namespace System.Web.Compilation
                                if (parser.BaseTypeIsGlobal)
                                        baseTypeRef.Options |= CodeTypeReferenceOptions.GlobalReference;
                        }
-#else
-                       baseTypeRef = new CodeTypeReference (parser.BaseType.FullName);
-#endif
                        mainClass.BaseTypes.Add (baseTypeRef);
 
                        mainClassExpr = new CodeTypeReferenceExpression (mainns + "." + mainclasstype);
@@ -268,7 +244,6 @@ namespace System.Web.Compilation
                                }
                        }
 
-#if NET_2_0
                        ArrayList al = WebConfigurationManager.ExtraAssemblies;
                        if (al != null && al.Count > 0) {
                                foreach (object o in al) {
@@ -290,7 +265,7 @@ namespace System.Web.Compilation
                                                refAsm.Add (asmName);
                                }
                        }
-#endif
+
                        // Late-bound generators specifics (as for MonoBASIC/VB.NET)
                        unit.UserData["RequireVariableDeclaration"] = parser.ExplicitOn;
                        unit.UserData["AllowLateBound"] = !parser.StrictOn;
@@ -309,10 +284,8 @@ namespace System.Web.Compilation
                {
                        CodeTypeReference mainClassTypeRef;
                        mainClassTypeRef = new CodeTypeReference (mainNS.Name + "." + mainClass.Name);
-
-#if NET_2_0
                        mainClassTypeRef.Options |= CodeTypeReferenceOptions.GlobalReference;
-#endif
+
                        return new CodeFieldReferenceExpression (
                                new CodeTypeReferenceExpression (mainClassTypeRef), fieldName);
                }
@@ -328,7 +301,6 @@ namespace System.Web.Compilation
                        mainClass.Members.Add (fld);
                }
 
-#if NET_2_0
                void AssignAppRelativeVirtualPath (CodeConstructor ctor)
                {
                        if (String.IsNullOrEmpty (parser.InputFile))
@@ -353,7 +325,6 @@ namespace System.Web.Compilation
                        arvpAssign.Right = new CodePrimitiveExpression (VirtualPathUtility.RemoveTrailingSlash (InputVirtualPath.AppRelative));
                        ctor.Statements.Add (arvpAssign);
                }
-#endif
                
                protected virtual void CreateConstructor (CodeStatementCollection localVars,
                                                          CodeStatementCollection trueStmt)
@@ -365,9 +336,7 @@ namespace System.Web.Compilation
                        if (localVars != null)
                                ctor.Statements.AddRange (localVars);
 
-#if NET_2_0
                        AssignAppRelativeVirtualPath (ctor);
-#endif
 
                        CodeFieldReferenceExpression initialized = GetMainClassFieldReferenceExpression ("__initialized");
                        
@@ -414,7 +383,6 @@ namespace System.Web.Compilation
                {
                }
 
-#if NET_2_0
                void InternalCreatePageProperty (string retType, string name, string contextProperty)
                {
                        CodeMemberProperty property = new CodeMemberProperty ();
@@ -449,7 +417,6 @@ namespace System.Web.Compilation
                                retType = "System.Web.Profile.DefaultProfile";
                        InternalCreatePageProperty (retType, "Profile", "Profile");
                }
-#endif
                
                protected virtual void AddInterfaces ()
                {
@@ -643,7 +610,6 @@ namespace System.Web.Compilation
                        CodeDomProvider ret = null;
                        par = null;
                        
-#if NET_2_0
                        CompilationSection config = (CompilationSection) WebConfigurationManager.GetWebApplicationSection ("system.web/compilation");
                        Compiler comp = config.Compilers[lang];
                        
@@ -661,16 +627,6 @@ namespace System.Web.Compilation
                                par.CompilerOptions = comp.CompilerOptions;
                                par.WarningLevel = comp.WarningLevel;
                        }
-#else
-                       CompilationConfiguration config;
-
-                       config = CompilationConfiguration.GetInstance (context);
-                       ret = config.GetProvider (lang);
-
-                       par = new CompilerParameters ();
-                       par.CompilerOptions = config.GetCompilerOptions (lang);
-                       par.WarningLevel = config.GetWarningLevel (lang);
-#endif
                        tempdir = config.TempDirectory;
 
                        return ret;
@@ -694,10 +650,6 @@ namespace System.Web.Compilation
                                throw new HttpException ("Configuration error. Language not supported: " +
                                                          lang, 500);
 
-#if !NET_2_0
-                       compiler = provider.CreateCompiler ();
-#endif
-
                        CompilerParameters parameters = CompilerParameters;
                        parameters.IncludeDebugInformation = parser.Debug;
                        parameters.CompilerOptions = compilerOptions + " " + parser.CompilerOptions;
@@ -729,7 +681,6 @@ namespace System.Web.Compilation
                        results.TempFiles.Delete ();
                        Type mainClassType = assembly.GetType (MainClassType, true);
 
-#if NET_2_0
                        if (parser.IsPartial) {
                                // With the partial classes, we need to make sure we
                                // don't have any methods that should have not been
@@ -744,7 +695,6 @@ namespace System.Web.Compilation
                                        return GetCompiledType ();
                                }
                        }
-#endif
 
                        return mainClassType;
                }
@@ -758,7 +708,6 @@ namespace System.Web.Compilation
                        }
                }
                
-#if NET_2_0
                internal bool IsRebuildingPartial
                {
                        get { return isRebuilding; }
@@ -818,7 +767,6 @@ namespace System.Web.Compilation
 
                        return rebuild;
                }
-#endif
 
                internal CodeDomProvider Provider {
                        get { return provider; }
@@ -845,7 +793,6 @@ namespace System.Web.Compilation
                        get { return unit; }
                }
 
-#if NET_2_0
                internal CodeTypeDeclaration DerivedType {
                        get { return mainClass; }
                }
@@ -857,7 +804,6 @@ namespace System.Web.Compilation
                                return partialClass;
                        }
                }
-#endif
 
                internal TemplateParser Parser {
                        get { return parser; }
index 7f969d3ff42ee808ba004eecdf88f9f13f407562..b85812397afc26f2ec1583043126082b723034c7 100644 (file)
@@ -28,7 +28,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
+
 
 using System;
 using System.Collections;
@@ -58,4 +58,4 @@ namespace System.Web.Compilation {
 
 }
 
-#endif
+
index 0df83256385b8d535879c789a0c071515b7230dd..6659f1ce0c18a7d70985c5a946e0ca31a1186a83 100644 (file)
@@ -30,8 +30,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
-
 using System;
 using System.CodeDom;
 using System.CodeDom.Compiler;
@@ -50,7 +48,8 @@ using System.Web.Configuration;
 using System.Web.Hosting;
 using System.Web.Util;
 
-namespace System.Web.Compilation {
+namespace System.Web.Compilation
+{
        public sealed class BuildManager
        {
                internal const string FAKE_VIRTUAL_PATH_PREFIX = "/@@MonoFakeVirtualPath@@";
@@ -1206,4 +1205,4 @@ namespace System.Web.Compilation {
                }
        }
 }
-#endif
+
index 20bc671869c30acf7871d671be0fb4ca0b010f77..f0948133b5a3ff15d53dbb76b5cd4f976b78414b 100644 (file)
@@ -28,7 +28,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
 using System;
 using System.CodeDom.Compiler;
 using System.Reflection;
@@ -62,12 +61,12 @@ namespace System.Web.Compilation
                        }
                                
                        if (BuiltAssembly != null) {
-                               sb.Append ((first ? "" : "; ") + "assembly: " + BuiltAssembly.ToString ());
+                               sb.Append ((first ? String.Empty : "; ") + "assembly: " + BuiltAssembly.ToString ());
                                first = false;
                        }
 
                        if (!String.IsNullOrEmpty (VirtualPath)) {
-                               sb.Append ((first ? "" : "; ") + "virtualPath: " + VirtualPath);
+                               sb.Append ((first ? String.Empty : "; ") + "virtualPath: " + VirtualPath);
                                first = false;
                        }
 
@@ -78,4 +77,3 @@ namespace System.Web.Compilation
        }
 }
 
-#endif
\ No newline at end of file
index 00402540947b198dc84fe7ae7c1db1ff78fc01bd..a18d533d27d09016feb2d0963c15690e584b360b 100644 (file)
@@ -28,7 +28,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
 using System;
 using System.Collections.Generic;
 using System.Reflection;
@@ -440,4 +439,4 @@ namespace System.Web.Compilation
                }
        }
 }
-#endif
+
index ee79de7ca35823b0b3d6c20a058bb116612cc4a2..d27788d9327812933822d75e4afd1a163a8afb5f 100644 (file)
@@ -28,8 +28,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
-
 using System;
 using System.Web;
 
@@ -52,4 +50,4 @@ namespace System.Web.Compilation {
 
 }
 
-#endif
+
index 7e401bbe89924eee30d153078ce042f7a6e7d01d..395ab8266d474be0871f5b54b0819586b5787224 100644 (file)
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
+
 
 namespace System.Web.Compilation {
        public delegate void BuildManagerHostUnloadEventHandler(object sender, BuildManagerHostUnloadEventArgs e);
 }
 
-#endif
+
index 9100ae108710df714febb240b6e1a3d52f64a62c..db5d868cbd9070b355698fd0647bcdfe1a52c1ed 100644 (file)
@@ -4,7 +4,7 @@
 // Authors:
 //      Marek Habersack (mhabersack@novell.com)
 //
-// (C) 2008 Novell, Inc (http://www.novell.com)
+// (C) 2008-2009 Novell, Inc (http://www.novell.com)
 //
 
 //
@@ -28,7 +28,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
 using System;
 using System.Web;
 
@@ -36,7 +35,7 @@ namespace System.Web.Compilation
 {
        internal delegate void BuildManagerRemoveEntryEventHandler (BuildManagerRemoveEntryEventArgs args);
 
-       internal class BuildManagerRemoveEntryEventArgs : EventArgs
+       class BuildManagerRemoveEntryEventArgs : EventArgs
        {
                public string EntryName {
                        get;
@@ -55,4 +54,4 @@ namespace System.Web.Compilation
                }
        }
 }
-#endif
+
index f96979b5eb52fa5be374ad998c0a60d49d54f8ac..a7f9ed3a8d5de663ff72a2f88e033d96466c9b47 100644 (file)
@@ -5,7 +5,7 @@
 //     Chris Toshok (toshok@ximian.com)
 //     Gonzalo Paniagua Javier (gonzalo@ximian.com)
 //
-// (C) 2006 Novell, Inc (http://www.novell.com)
+// (C) 2006-2009 Novell, Inc (http://www.novell.com)
 //
 
 //
@@ -29,8 +29,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
-
 using System;
 using System.CodeDom;
 using System.CodeDom.Compiler;
@@ -203,5 +201,5 @@ namespace System.Web.Compilation
                }
        }
 }
-#endif
+
 
index 89357f7b936b66152d7b41f9ba1e9ecb6f17f603..f49eedf6d29f1f142e44228099b62731cfd9fc0e 100644 (file)
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
-
-namespace System.Web.Compilation {
-
+namespace System.Web.Compilation
+{
        [Flags]
        public enum BuildProviderAppliesTo
        {
@@ -43,4 +41,4 @@ namespace System.Web.Compilation {
        }
 }
 
-#endif
+
index b9302aad859c80341005532837393a338a713a5d..3ec58fefcc369d9a15685f44f04c5b72c870a51a 100644 (file)
@@ -4,7 +4,7 @@
 // Authors:
 //     Chris Toshok (toshok@ximian.com)
 //
-// (C) 2006 Novell, Inc (http://www.novell.com)
+// (C) 2006-2009 Novell, Inc (http://www.novell.com)
 //
 
 //
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
-
-namespace System.Web.Compilation {
-
+namespace System.Web.Compilation
+{
        [AttributeUsage (AttributeTargets.Class)]
        public sealed class BuildProviderAppliesToAttribute : Attribute
        {
@@ -49,4 +47,4 @@ namespace System.Web.Compilation {
 
 }
 
-#endif
+
index ccf2da82950c1e80b17176aa7d4ddcc2fe3e248f..ad5fd1f0363e442b38267b30f93be2dd08890da6 100644 (file)
@@ -28,7 +28,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
 using System;
 using System.Collections.Generic;
 
@@ -91,4 +90,3 @@ namespace System.Web.Compilation
                }
        }
 }
-#endif
\ No newline at end of file
index f11f21185ff610ce6a897f7cf2bb2bf8742403c1..1101cdabd6c3035043424cf86acf328e65f1db05 100644 (file)
@@ -28,7 +28,6 @@
 
 using System.Resources;
 
-#if NET_2_0
 
 namespace System.Web.Compilation
 {
@@ -39,4 +38,4 @@ namespace System.Web.Compilation
                 ShutdownAppDomainOnChange = 1
         }
 }
-#endif
+
index 249333306fd93274e7795bb397b5d160dde1a4e5..c991b79d99074b565bee38e03a48d7e85a321c3e 100644 (file)
@@ -73,11 +73,9 @@ namespace System.Web.Compilation
                        string key = cachePrefix + compiler.Parser.InputFile;
                        CompilerResults results = (CompilerResults) cache [key];
 
-#if NET_2_0
                        if (!compiler.IsRebuildingPartial)
-#endif
-                       if (results != null)
-                               return results;
+                               if (results != null)
+                                       return results;
 
                        object ticket;
                        bool acquired = AcquireCompilationTicket (key, out ticket);
@@ -85,17 +83,11 @@ namespace System.Web.Compilation
                        try {
                                Monitor.Enter (ticket);
                                results = (CompilerResults) cache [key];
-#if NET_2_0
                                if (!compiler.IsRebuildingPartial)
-#endif
-                               if (results != null)
-                                       return results;
+                                       if (results != null)
+                                               return results;
 
-#if NET_2_0
                                CodeDomProvider comp = compiler.Provider;
-#else
-                               ICodeCompiler comp = compiler.Compiler;
-#endif
                                CompilerParameters options = compiler.CompilerParameters;
                                GetExtraAssemblies (options);
                                results = comp.CompileAssemblyFromDom (options, compiler.CompileUnit);
@@ -139,11 +131,7 @@ namespace System.Web.Compilation
                                if (results != null)
                                        return results;
 
-#if NET_2_0
                                CodeDomProvider comp = compiler.Provider;
-#else
-                               ICodeCompiler comp = compiler.Compiler;
-#endif
                                CompilerParameters options = compiler.CompilerParameters;
 
                                GetExtraAssemblies (options);
@@ -205,12 +193,7 @@ namespace System.Web.Compilation
                                if (provider == null)
                                        throw new HttpException ("Configuration error. Language not supported: " +
                                                                  language, 500);
-#if !NET_2_0
-                               ICodeCompiler compiler = provider.CreateCompiler ();
-#else
                                CodeDomProvider compiler = provider;
-#endif
-                               
                                CompilerParameters options = GetOptions (assemblies);
                                options.IncludeDebugInformation = debug;
                                options.WarningLevel = warningLevel;
@@ -265,8 +248,6 @@ namespace System.Web.Compilation
                {
                        StringCollection refAsm = options.ReferencedAssemblies;
                        string asmLocation;
-                       
-#if NET_2_0
                        string asmName;
                        ArrayList al = WebConfigurationManager.ExtraAssemblies;
                        
@@ -316,21 +297,6 @@ namespace System.Web.Compilation
                                        continue;
                                refAsm.Add (asmLocation);
                        }
-#else
-                       CompilationConfiguration cfg = CompilationConfiguration.GetInstance (HttpContext.Current);
-                       ArrayList asmcoll = cfg != null ? cfg.Assemblies : null;
-
-                       if (asmcoll == null)
-                               return;
-
-                       foreach (string asm in asmcoll) {
-                               asmLocation = GetAssemblyLocationFromName (asm);
-                               
-                               if (asmLocation == null || refAsm.Contains (asmLocation))
-                                       continue;
-                               refAsm.Add (asmLocation);
-                       }
-#endif
                }
 
                static string GetAssemblyLocationFromName (string name)
index d1a6a2e4345a916be9d534fd71fda2131a19fd87..aaa491e9aec00d1a1f905c04ea7dee8ed0220d8f 100644 (file)
@@ -5,7 +5,7 @@
 //     Chris Toshok (toshok@ximian.com)
 //     Gonzalo Paniagua Javier (gonzalo@ximian.com)
 //
-// (C) 2006 Novell, Inc (http://www.novell.com)
+// (C) 2006-2009 Novell, Inc (http://www.novell.com)
 //
 
 //
@@ -29,7 +29,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
 using System;
 using System.CodeDom;
 using System.CodeDom.Compiler;
@@ -41,8 +40,10 @@ using System.Web;
 using System.Web.Hosting;
 using System.Web.Util;
 
-namespace System.Web.Compilation {
-       public sealed class ClientBuildManager : MarshalByRefObject, IDisposable {
+namespace System.Web.Compilation
+{
+       public sealed class ClientBuildManager : MarshalByRefObject, IDisposable
+       {
                static readonly object appDomainShutdownEvent = new object ();
                static readonly object appDomainStartedEvent = new object ();
                static readonly object appDomainUnloadedEvent = new object ();
@@ -343,5 +344,5 @@ namespace System.Web.Compilation {
        }
 
 }
-#endif
+
 
index e390c4043a837bc8d189bd92dcb60042baa08479..c09fa1675a0dec586baa7ea031b8c511ddd81b07 100644 (file)
@@ -28,7 +28,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
+
 
 using System;
 using System.CodeDom.Compiler;
@@ -55,4 +55,4 @@ namespace System.Web.Compilation {
        }
 }
 
-#endif
+
index 054c7db33885878251f3c754cc0905258584896c..772c99fd46c2a00ffe9e55df0fed87849895bf6d 100644 (file)
@@ -28,8 +28,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
-
 using System;
 using System.CodeDom.Compiler;
 using System.Web;
@@ -64,4 +62,4 @@ namespace System.Web.Compilation {
        }
 }
 
-#endif
+
index 4fdd5a50f9a40124de1b2763a98e421cb69608cc..4acce3f6d74f095b7098848e2b908d53486d1808 100644 (file)
@@ -116,7 +116,6 @@ namespace System.Web.Compilation
                public override string ErrorMessage {
                        get {
                                if (errmsg == null && errors != null) {
-#if NET_2_0
                                        CompilerError firstError = null;
                                        
                                        foreach (CompilerError err in errors) {
@@ -130,14 +129,6 @@ namespace System.Web.Compilation
                                        int idx = errmsg.IndexOf (" : error ");
                                        if (idx > -1)
                                                errmsg = errmsg.Substring (idx + 9);
-#else
-                                       StringBuilder sb = new StringBuilder ();
-                                       foreach (CompilerError err in errors) {
-                                               sb.Append (err);
-                                               sb.Append ("\n");
-                                       }
-                                       errmsg = sb.ToString ();
-#endif
                                }
 
                                return errmsg;
index 255f0f00b4e547ea3d38108a0b8a310b0d6d3449..ecce6464593790a954a85c6455bf0cb7d3b2cd50 100644 (file)
@@ -29,7 +29,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
 
 using System;
 using System.CodeDom.Compiler;
@@ -70,5 +69,5 @@ namespace System.Web.Compilation {
                }
        }
 }
-#endif
+
 
index cb925a01d1a8af43e9c27eaa52f75fc67bd7cdd2..20169411de189580e3aad9ad0a12584e4a326627 100644 (file)
@@ -28,7 +28,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
 
 using System;
 using System.CodeDom;
@@ -104,6 +103,6 @@ namespace System.Web.Compilation {
 
 }
 
-#endif
+
 
 
index 9f286a0847df95e148360926d5579486f95a1e1a..46c7223a2966fe4b5fd262e75c01371addd6cfb8 100644 (file)
@@ -25,7 +25,7 @@
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-#if NET_2_0
+
 using System;
 using System.Collections.Generic;
 using System.Globalization;
@@ -176,4 +176,4 @@ namespace System.Web.Compilation
                }
        }
 }
-#endif
+
index 60644eb1499012ada4cbcc6262b8edafa89e7221..7a0b03c3986e10e65d6a153d154471f16df03617 100644 (file)
@@ -26,7 +26,7 @@
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-#if NET_2_0
+
 using System;
 using System.Resources;
 using System.Web;
@@ -46,4 +46,3 @@ namespace System.Web.Compilation
                }
        }
 }
-#endif
\ No newline at end of file
index 9204cad1066f66f881d19450ea7ce3c056d7df80..4992586135f4b1f81f717ad089b2787f3f5a55c6 100644 (file)
@@ -28,7 +28,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
+
 
 using System;
 using System.CodeDom;
@@ -64,4 +64,4 @@ namespace System.Web.Compilation {
 
 }
 
-#endif
+
index 95f6e7b6776f65ba8695bd3576f92b8c9ffa9d35..aeec02d0686b6a11e78147d289e1c82a788c79df 100644 (file)
@@ -42,9 +42,7 @@ namespace System.Web.Compilation
                                                "ClassName", "ClientTarget", "CodePage",
                                                "CompilerOptions", "ContentType", "Culture", "Debug",
                                                "Description",
-#if NET_2_0
                                                "EnableEventValidation", "MaintainScrollPositionOnPostBack",
-#endif
                                                "EnableSessionState", "EnableViewState",
                                                "EnableViewStateMac", "ErrorPage", "Explicit",
                                                "Inherits", "Language", "LCID", "ResponseEncoding",
@@ -71,10 +69,8 @@ namespace System.Web.Compilation
 
                static string [] application_atts = { "description", "inherits", "codebehind" };
 
-#if NET_2_0
                static string [] mastertype_atts = { "virtualpath", "typename" };
                static string [] previouspagetype_atts = { "virtualpath", "typename" };
-#endif
                
                static Directive ()
                {
@@ -83,107 +79,55 @@ namespace System.Web.Compilation
                
                static void InitHash ()
                {
-#if NET_2_0
                        StringComparer comparer = StringComparer.InvariantCultureIgnoreCase;
                        directivesHash = new Hashtable (comparer);
-#else
-                       CaseInsensitiveHashCodeProvider provider = new CaseInsensitiveHashCodeProvider (Helpers.InvariantCulture);
-                       CaseInsensitiveComparer comparer =  new CaseInsensitiveComparer (Helpers.InvariantCulture);
-
-                       directivesHash = new Hashtable (provider, comparer); 
-#endif
 
                        // Use Hashtable 'cause is O(1) in Contains (ArrayList is O(n))
-#if NET_2_0
                        Hashtable valid_attributes = new Hashtable (comparer);
-#else
-                       Hashtable valid_attributes = new Hashtable (provider, comparer);
-#endif
                        foreach (string att in page_atts) valid_attributes.Add (att, null);
                        directivesHash.Add ("PAGE", valid_attributes);
 
-#if NET_2_0
                        valid_attributes = new Hashtable (comparer);
-#else
-                       valid_attributes = new Hashtable (provider, comparer);
-#endif
                        foreach (string att in control_atts) valid_attributes.Add (att, null);
                        directivesHash.Add ("CONTROL", valid_attributes);
 
-#if NET_2_0
                        valid_attributes = new Hashtable (comparer);
-#else
-                       valid_attributes = new Hashtable (provider, comparer);
-#endif
                        foreach (string att in import_atts) valid_attributes.Add (att, null);
                        directivesHash.Add ("IMPORT", valid_attributes);
 
-#if NET_2_0
                        valid_attributes = new Hashtable (comparer);
-#else
-                       valid_attributes = new Hashtable (provider, comparer);
-#endif
                        foreach (string att in implements_atts) valid_attributes.Add (att, null);
                        directivesHash.Add ("IMPLEMENTS", valid_attributes);
 
-#if NET_2_0
                        valid_attributes = new Hashtable (comparer);
-#else
-                       valid_attributes = new Hashtable (provider, comparer);
-#endif
                        foreach (string att in register_atts) valid_attributes.Add (att, null);
                        directivesHash.Add ("REGISTER", valid_attributes);
 
-#if NET_2_0
                        valid_attributes = new Hashtable (comparer);
-#else
-                       valid_attributes = new Hashtable (provider, comparer);
-#endif
                        foreach (string att in assembly_atts) valid_attributes.Add (att, null);
                        directivesHash.Add ("ASSEMBLY", valid_attributes);
 
-#if NET_2_0
                        valid_attributes = new Hashtable (comparer);
-#else
-                       valid_attributes = new Hashtable (provider, comparer);
-#endif
                        foreach (string att in outputcache_atts) valid_attributes.Add (att, null);
                        directivesHash.Add ("OUTPUTCACHE", valid_attributes);
 
-#if NET_2_0
                        valid_attributes = new Hashtable (comparer);
-#else
-                       valid_attributes = new Hashtable (provider, comparer);
-#endif
                        foreach (string att in reference_atts) valid_attributes.Add (att, null);
                        directivesHash.Add ("REFERENCE", valid_attributes);
 
-#if NET_2_0
                        valid_attributes = new Hashtable (comparer);
-#else
-                       valid_attributes = new Hashtable (provider, comparer);
-#endif
                        foreach (string att in webservice_atts) valid_attributes.Add (att, null);
                        directivesHash.Add ("WEBSERVICE", valid_attributes);
 
-#if NET_2_0
                        valid_attributes = new Hashtable (comparer);
-#else
-                       valid_attributes = new Hashtable (provider, comparer);
-#endif
                        // same attributes as webservice
                        foreach (string att in webservice_atts) valid_attributes.Add (att, null);
                        directivesHash.Add ("WEBHANDLER", valid_attributes);
 
-#if NET_2_0
                        valid_attributes = new Hashtable (comparer);
-#else
-                       valid_attributes = new Hashtable (provider, comparer);
-#endif
                        foreach (string att in application_atts) valid_attributes.Add (att, null);
                        directivesHash.Add ("APPLICATION", valid_attributes);
 
-#if NET_2_0
                        valid_attributes = new Hashtable (comparer);
                        foreach (string att in mastertype_atts) valid_attributes.Add (att, null);
                        directivesHash.Add ("MASTERTYPE", valid_attributes);
@@ -195,7 +139,6 @@ namespace System.Web.Compilation
                        valid_attributes = new Hashtable (comparer);
                        foreach (string att in previouspagetype_atts) valid_attributes.Add (att, null);
                        directivesHash.Add ("PREVIOUSPAGETYPE", valid_attributes);
-#endif
                }
                
                Directive () { }
index 4863f9be199ff123c71828bc617aa36cd1764b77..88437b65c1dc8c676b54b81a802e3ccba24be180 100644 (file)
@@ -27,7 +27,7 @@
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-#if NET_2_0
+
 using System.CodeDom;
 using System.Web.UI;
 
@@ -58,5 +58,5 @@ namespace System.Web.Compilation
        }
        
 }
-#endif // NET_2_0
+
 
index 585c2519360730b27d61d9591fd0e767bd3e6f4f..6cf07ca9f89d457b6caa02bf5bb599c006ebbc29 100644 (file)
@@ -4,7 +4,7 @@
 // Authors:
 //     Gonzalo Paniagua Javier (gonzalo@ximian.com)
 //
-// Copyright (c) 2005 Novell, Inc (http://www.novell.com)
+// Copyright (c) 2005-2009 Novell, Inc (http://www.novell.com)
 //
 
 //
@@ -27,7 +27,7 @@
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-#if NET_2_0
+
 using System.CodeDom;
 using System.Web.UI;
 
@@ -57,5 +57,5 @@ namespace System.Web.Compilation
        }
        
 }
-#endif // NET_2_0
+
 
index fc2282b2bc09823b460ef451f57788ad9eb70ecd..9234a6b42b7c473d8c4ac6aaf5ba5e251a682847 100644 (file)
@@ -28,7 +28,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
+
 
 namespace System.Web.Compilation {
 
@@ -66,4 +66,4 @@ namespace System.Web.Compilation {
        }
 }
 
-#endif
+
index 47f2732684ad89d651046e8ca99348cfab337f04..edea592bc398cf21a8c6faac806fc38f3c0dbfa4 100644 (file)
@@ -28,7 +28,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
+
 
 namespace System.Web.Compilation {
 
@@ -48,4 +48,4 @@ namespace System.Web.Compilation {
        }
 }
 
-#endif
+
index 5b887fc7dfe3b6fc1602da85fe4a5e7a8a626e63..b99ede498f5c32fa9a131d2609e7fae83d1f2412 100644 (file)
@@ -27,7 +27,7 @@
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-#if NET_2_0
+
 using System;
 
 namespace System.Web.Compilation
@@ -44,4 +44,4 @@ namespace System.Web.Compilation
         {
         }
 }
-#endif
+
index 65e3bb2bca053b9f766a79719f9b1854e95eaaae..a13a768d621793defe4c0d10a2d2366e336fded0 100644 (file)
@@ -27,7 +27,7 @@
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-#if NET_2_0
+
 using System;
 using System.CodeDom;
 using System.CodeDom.Compiler;
@@ -232,4 +232,3 @@ namespace System.Web.Compilation
                }
        }
 }
-#endif
\ No newline at end of file
index 5f729c1d1d45860187ee8c71cf6d11b5ee0ce851..621f135aa91fd9900932346112208a44477d0c57 100644 (file)
@@ -59,10 +59,7 @@ namespace System.Web.Compilation
                protected internal override void CreateMethods ()
                {
                        base.CreateMethods ();
-#if NET_2_0
                        CreateProfileProperty ();
-#endif
-                       
                        ProcessObjects (parser.RootBuilder);
                }
 
index 9b2797608c4c813b3fdbcfa33ec1cc136c40c397..5c1d4fc758461782fb8f41ad3a53784f1ab018b6 100644 (file)
@@ -4,7 +4,7 @@
 // Authors:
 //     Chris Toshok (toshok@ximian.com)
 //
-// (C) 2006 Novell, Inc (http://www.novell.com)
+// (C) 2006-2009 Novell, Inc (http://www.novell.com)
 //
 
 //
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
-
-namespace System.Web.Compilation {
-
+namespace System.Web.Compilation
+{
        public interface IAssemblyPostProcessor : IDisposable
        {
                void PostProcessAssembly (string path);
        }
 }
 
-#endif
+
index eb27062de54242fa0bc0b0e42de8b7c11e50c232..bb204bd5ed1c3e8d5d867f228d977b545d84ad15 100644 (file)
@@ -26,7 +26,7 @@
 // Copyright (C) 2004 Novell, Inc (http://www.novell.com)
 //
 
-#if NET_2_0
+
 
 using System.Collections;
 using System.Globalization;
@@ -39,4 +39,4 @@ namespace System.Web.Compilation
                ICollection GetImplicitResourceKeys (string keyPrefix);
         }
 }
-#endif
+
index 212c9e0dd3ee6d9355d64470d1f5dba5ee0171b5..859d7fdc8dc619fcde636513c7367a6199df0c03 100644 (file)
@@ -29,7 +29,6 @@
 using System.Resources;
 using System.Globalization;
 
-#if NET_2_0
 namespace System.Web.Compilation
 {
         public interface IResourceProvider
@@ -38,4 +37,4 @@ namespace System.Web.Compilation
                 IResourceReader ResourceReader { get; }
         }
 }
-#endif
+
index 5f43f4ece89edf397a9533f7b46001e4b8ed9a15..b12e10a1df9e66ec860a368133174ea09500970d 100644 (file)
@@ -28,7 +28,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
+
 
 namespace System.Web.Compilation {
        [BuildProviderAppliesTo (BuildProviderAppliesTo.All)]
@@ -42,4 +42,4 @@ namespace System.Web.Compilation {
 
 }
 
-#endif
+
index d829134fd82ff8d87179f153dc198e13a7c6931d..4f3357a51293251675253780d95bebaf74967af3 100644 (file)
@@ -26,7 +26,6 @@
 // Copyright (C) 2004 Novell, Inc (http://www.novell.com)
 //
 
-#if NET_2_0
 namespace System.Web.Compilation
 {
         public sealed class ImplicitResourceKey
@@ -62,4 +61,4 @@ namespace System.Web.Compilation
                }
         }
 }
-#endif
+
index 902776ec13c05762febdaa058ba95b0fa239509d..2126fcdc22cb234723ba6eedfe25085d3f1a65e0 100644 (file)
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
-
-namespace System.Web.Compilation {
 
+namespace System.Web.Compilation
+{
        [Serializable]
-       public sealed class LinePragmaCodeInfo {
-
+       public sealed class LinePragmaCodeInfo
+       {
                public LinePragmaCodeInfo ()
                {
                }
@@ -77,4 +76,4 @@ namespace System.Web.Compilation {
 
 }
 
-#endif
+
index 41d22f21a161fe945c6b4f9ac9fc0e1b678083cc..3be906f42b19b6edb00a86e9dde0acd56b1d7a43 100644 (file)
@@ -28,7 +28,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
 
 using System;
 using System.CodeDom;
@@ -63,5 +62,5 @@ namespace System.Web.Compilation {
                }
        }
 }
-#endif
+
 
index e3a5b15ecb34c0bd5dc96df2d21d8d480b099d87..26864b5409e6e18994a6f05d1a6d56c0cba64818 100644 (file)
@@ -27,8 +27,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
-
 using System;
 using System.CodeDom;
 using System.Web.UI;
@@ -65,5 +63,5 @@ namespace System.Web.Compilation
        }
 }
 
-#endif
+
 
index 35ff70d8b6dfbefa84d28bb226e26b5f67cef3f5..66d84380667375436c7006591ced6b4c32d9a40e 100644 (file)
@@ -29,7 +29,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
 
 using System;
 using System.CodeDom;
@@ -86,5 +85,5 @@ namespace System.Web.Compilation {
                }
        }
 }
-#endif
+
 
index 2a4642e9ea53e2cc873ef5384d90a390756aa83a..04944d9ed561dbeffc3953f33719810b4f1f0b4d 100644 (file)
@@ -30,6 +30,7 @@
 using System;
 using System.CodeDom;
 using System.Collections;
+using System.Collections.Generic;
 using System.IO;
 using System.Reflection;
 using System.Text;
@@ -37,10 +38,7 @@ using System.Web.Configuration;
 using System.Web.UI;
 using System.Web.SessionState;
 using System.Web.Util;
-#if NET_2_0
-using System.Collections.Generic;
 using System.Web.Profile;
-#endif
 
 namespace System.Web.Compilation
 {
@@ -59,36 +57,27 @@ namespace System.Web.Compilation
                {
                        base.CreateStaticFields ();
                        
-                       CodeMemberField fld = new CodeMemberField (
-#if NET_2_0
-                               typeof (object),
-#else
-                               typeof (ArrayList),
-#endif
-                               "__fileDependencies");
+                       CodeMemberField fld = new CodeMemberField (typeof (object), "__fileDependencies");
                        fld.Attributes = MemberAttributes.Private | MemberAttributes.Static;
                        fld.InitExpression = new CodePrimitiveExpression (null);
                        mainClass.Members.Add (fld);
 
-#if NET_2_0
                        if (pageParser.OutputCache) {
                                fld = new CodeMemberField (typeof (OutputCacheParameters), "__outputCacheSettings");
                                fld.Attributes = MemberAttributes.Private | MemberAttributes.Static;
                                fld.InitExpression = new CodePrimitiveExpression (null);
                                mainClass.Members.Add (fld);
                        }
-#endif
                }
                
                protected override void CreateConstructor (CodeStatementCollection localVars,
                                                           CodeStatementCollection trueStmt)
                {
-#if NET_2_0
                        if (!String.IsNullOrEmpty (pageParser.MasterPageFile))
                                // This is here just to trigger master page build, so that its type
                                // is available when compiling the page itself.
                                BuildManager.GetCompiledType (pageParser.MasterPageFile);
-#endif
+
                        if (pageParser.ClientTarget != null) {
                                CodeExpression prop;
                                prop = new CodePropertyReferenceExpression (thisRef, "ClientTarget");
@@ -108,7 +97,6 @@ namespace System.Web.Compilation
                                        trueStmt = new CodeStatementCollection ();
 
                                CodeAssignStatement assign;
-#if NET_2_0
                                localVars.Add (
                                        new CodeVariableDeclarationStatement (
                                                typeof (string[]),
@@ -136,24 +124,6 @@ namespace System.Web.Compilation
                                        new CodeExpression[] {dependencies}
                                );
                                assign = new CodeAssignStatement (GetMainClassFieldReferenceExpression ("__fileDependencies"), getDepsCall);
-#else
-                               localVars.Add (new CodeVariableDeclarationStatement (
-                                               typeof (ArrayList),
-                                               "dependencies")
-                               );
-
-                               CodeVariableReferenceExpression dependencies = new CodeVariableReferenceExpression ("dependencies");
-                               trueStmt.Add (
-                                       new CodeAssignStatement (dependencies, new CodeObjectCreateExpression (typeof (ArrayList), new CodeExpression[] {new CodePrimitiveExpression (depsCount)}))
-                               );
-
-                               CodeMethodInvokeExpression invoke;
-                               for (int i = 0; i < depsCount; i++) {
-                                       invoke = new CodeMethodInvokeExpression (dependencies, "Add", new CodeExpression[] {new CodePrimitiveExpression (deps [i])});
-                                       trueStmt.Add (invoke);
-                               }
-                               assign = new CodeAssignStatement (GetMainClassFieldReferenceExpression ("__fileDependencies"), dependencies);
-#endif
 
                                trueStmt.Add (assign);
                        }
@@ -168,30 +138,24 @@ namespace System.Web.Compilation
                        
                        if (pageParser.EnableSessionState) {
                                cref = new CodeTypeReference (typeof (IRequiresSessionState));
-#if NET_2_0
                                if (partialClass != null)
                                        partialClass.BaseTypes.Add (cref);
                                else
-#endif
                                        mainClass.BaseTypes.Add (cref);
                        }
                        
                        if (pageParser.ReadOnlySessionState) {
                                cref = new CodeTypeReference (typeof (IReadOnlySessionState));
-#if NET_2_0
                                if (partialClass != null)
                                        partialClass.BaseTypes.Add (cref);                                      
                                else
-#endif
                                        mainClass.BaseTypes.Add (cref);
                        }
 
-#if NET_2_0
                        if (pageParser.Async)
                                mainClass.BaseTypes.Add (new CodeTypeReference (typeof (System.Web.IHttpAsyncHandler)));
                        
                        mainClass.BaseTypes.Add (new CodeTypeReference (typeof (System.Web.IHttpHandler)));
-#endif
                }
 
                void CreateGetTypeHashCode () 
@@ -232,17 +196,6 @@ namespace System.Web.Compilation
                        string contentType = pageParser.ContentType;
                        if (contentType != null)
                                method.Statements.Add (CreatePropertyAssign ("ContentType", contentType));
-
-#if !NET_2_0
-                       if (pageParser.OutputCache) {
-                               CodeMethodReferenceExpression init = new CodeMethodReferenceExpression (null,
-                                               "InitOutputCache");
-                               CodeMethodInvokeExpression invoke = new CodeMethodInvokeExpression (init,
-                                               OutputCacheParams ());
-                               method.Statements.Add (invoke);
-
-                       }
-#endif
                        
                        int lcid = pageParser.LCID;
                        if (lcid != -1)
@@ -282,7 +235,6 @@ namespace System.Web.Compilation
                                 method.Statements.Add (stmt);
                         }
 
-#if NET_2_0
                        if (!pageParser.EnableEventValidation) {
                                 CodeAssignStatement stmt = new CodeAssignStatement ();
                                 CodePropertyReferenceExpression prop;
@@ -300,21 +252,17 @@ namespace System.Web.Compilation
                                stmt.Right = new CodePrimitiveExpression (pageParser.MaintainScrollPositionOnPostBack);
                                method.Statements.Add (stmt);
                        }
-#endif
                }
 
-#if NET_2_0
                protected override void AddStatementsToConstructor (CodeConstructor ctor)
                {
                        base.AddStatementsToConstructor (ctor);
                        if (pageParser.OutputCache)
                                OutputCacheParamsBlock (ctor);
                }
-#endif
                
                protected override void AddStatementsToInitMethod (CodeMemberMethod method)
                {
-#if NET_2_0
                        AddStatementsFromDirective (method);
                        ILocation directiveLocation = pageParser.DirectiveLocation;
 
@@ -340,18 +288,14 @@ namespace System.Web.Compilation
 
                        CodeMethodInvokeExpression expr = new CodeMethodInvokeExpression (thisRef, "InitializeCulture");
                        method.Statements.Add (AddLinePragma (new CodeExpressionStatement (expr), directiveLocation));
-#endif
                }
 
                protected override void PrependStatementsToFrameworkInitialize (CodeMemberMethod method)
                {
                        base.PrependStatementsToFrameworkInitialize (method);
-#if NET_2_0
                        if (pageParser.StyleSheetTheme != null)
                                method.Statements.Add (CreatePropertyAssign ("StyleSheetTheme", pageParser.StyleSheetTheme));
-#endif
                }
-
                
                protected override void AppendStatementsToFrameworkInitialize (CodeMemberMethod method)
                {
@@ -364,34 +308,20 @@ namespace System.Web.Compilation
                                CodeFieldReferenceExpression fileDependencies = GetMainClassFieldReferenceExpression ("__fileDependencies");
 
                                method.Statements.Add (
-#if NET_2_0
                                        new CodeMethodInvokeExpression (
                                                thisRef,
                                                "AddWrappedFileDependencies",
                                                new CodeExpression[] {fileDependencies})
-#else
-                                       new CodeAssignStatement (
-                                               new CodeFieldReferenceExpression (thisRef, "FileDependencies"),
-                                               fileDependencies
-                                       )
-#endif
                                );
 
                        }
 
-#if NET_2_0
                        if (pageParser.OutputCache) {
                                CodeMethodReferenceExpression init = new CodeMethodReferenceExpression (thisRef, "InitOutputCache");
                                CodeMethodInvokeExpression invoke = new CodeMethodInvokeExpression (init, GetMainClassFieldReferenceExpression ("__outputCacheSettings"));
                                method.Statements.Add (invoke);
                        }
-#endif
 
-#if ONLY_1_1
-                       AddStatementsFromDirective (method);
-#endif
-                       
-#if NET_1_1
                        if (pageParser.ValidateRequest) {
                                CodeMethodInvokeExpression expr = new CodeMethodInvokeExpression ();
                                 CodePropertyReferenceExpression prop;
@@ -399,10 +329,8 @@ namespace System.Web.Compilation
                                expr.Method = new CodeMethodReferenceExpression (prop, "ValidateInput");
                                method.Statements.Add (expr);
                        }
-#endif
                }
 
-#if NET_2_0
                CodeAssignStatement AssignOutputCacheParameter (CodeVariableReferenceExpression variable, string propName, object value)
                {
                        var ret = new CodeAssignStatement ();
@@ -467,21 +395,7 @@ namespace System.Web.Compilation
 
                        method.Statements.Add (cond);
                }
-#else
-               CodeExpression[] OutputCacheParams ()
-               {
-                       return new CodeExpression [] {
-                               new CodePrimitiveExpression (pageParser.OutputCacheDuration),
-                               new CodePrimitiveExpression (pageParser.OutputCacheVaryByHeader),
-                               new CodePrimitiveExpression (pageParser.OutputCacheVaryByCustom),
-                               new CodeSnippetExpression (typeof (OutputCacheLocation).ToString () +
-                                               "." + pageParser.OutputCacheLocation.ToString ()),
-                               new CodePrimitiveExpression (pageParser.OutputCacheVaryByParam)
-                               };
-               }
-#endif
-               
-#if NET_2_0
+
                void CreateStronglyTypedProperty (Type type, string name)
                {
                        if (type == null)
@@ -501,27 +415,20 @@ namespace System.Web.Compilation
 
                        AddReferencedAssembly (type.Assembly);
                }
-#endif
                
                protected internal override void CreateMethods ()
                {
                        base.CreateMethods ();
 
-#if NET_2_0
                        CreateProfileProperty ();
                        CreateStronglyTypedProperty (pageParser.MasterType, "Master");
                        CreateStronglyTypedProperty (pageParser.PreviousPageType, "PreviousPage");
-#endif
-                       
                        CreateGetTypeHashCode ();
 
-#if NET_2_0
                        if (pageParser.Async)
                                CreateAsyncMethods ();
-#endif
                }
 
-#if NET_2_0
                void CreateAsyncMethods ()
                {
                        CodeMemberMethod method = new CodeMemberMethod ();
@@ -590,7 +497,6 @@ namespace System.Web.Compilation
                        method.Statements.Add (invoke);
                        mainClass.Members.Add (method);
                }
-#endif
                
                public static Type CompilePageType (PageParser pageParser)
                {
@@ -599,5 +505,3 @@ namespace System.Web.Compilation
                }
        }
 }
-
-
index d4c2b0a9a449c33513b4e013801a578617828651..20463ce9e3d6c812493c8f06b1d74d8b235edfd5 100644 (file)
@@ -4,7 +4,7 @@
 // Authors:
 //     Chris Toshok (toshok@ximian.com)
 //
-// (C) 2006 Novell, Inc (http://www.novell.com/)
+// (C) 2006-2009 Novell, Inc (http://www.novell.com/)
 //
 
 //
@@ -28,7 +28,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
 
 using System;
 using System.CodeDom;
@@ -280,4 +279,4 @@ namespace System.Web.Compilation
        }
 }
 
-#endif
+
index 5e2981326f952f399c8980268057153cded5294b..586f19d8525914ea790add70933c41b3b56730cd 100644 (file)
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
-
-namespace System.Web.Compilation {
 
+namespace System.Web.Compilation
+{
        [Flags]
        public enum PrecompilationFlags
        {
@@ -48,4 +47,4 @@ namespace System.Web.Compilation {
 
 }
 
-#endif
+
index 611185c66fa6a176bb23a3000a847844fd3c3e6a..6529c011bd31ac4751a1e11834cc103febdb3dff 100644 (file)
@@ -27,7 +27,7 @@
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-#if NET_2_0
+
 using System;
 using System.Collections.Generic;
 using System.IO;
@@ -51,7 +51,7 @@ namespace System.Web.Compilation
        //
        // http://msdn.microsoft.com/msdnmag/issues/07/01/cuttingedge/default.aspx?loc=&fig=true#fig3
        //
-       internal class PreservationFile
+       class PreservationFile
        {
                string _filePath;
                string _assembly;
@@ -234,4 +234,4 @@ namespace System.Web.Compilation
                 }
        }
 }
-#endif
+
index ac821aede529c66e496e83584e8338c701625cd4..c1a21991f01a61194edf16365cc8c9d281a7f8e8 100644 (file)
@@ -28,7 +28,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
 
 using System;
 using System.CodeDom;
@@ -37,12 +36,12 @@ using System.Reflection;
 using System.Web;
 using System.Web.UI;
 
-namespace System.Web.Compilation {
-
+namespace System.Web.Compilation
+{
        [ExpressionEditor("System.Web.UI.Design.ResourceExpressionEditor, " + Consts.AssemblySystem_Design)]
        [ExpressionPrefix("Resources")]
-       public class ResourceExpressionBuilder : ExpressionBuilder {
-
+       public class ResourceExpressionBuilder : ExpressionBuilder
+       {
                public ResourceExpressionBuilder ()
                {
                }
@@ -169,6 +168,6 @@ namespace System.Web.Compilation {
 
 }
 
-#endif
+
 
 
index 2ec4efcf3b29c081631c045443d75a202b7c0909..8d379b3137851a57988ff8aef8330ea928a7a0f8 100644 (file)
@@ -4,7 +4,7 @@
 // Authors:
 //     Chris Toshok (toshok@ximian.com)
 //
-// (C) 2006 Novell, Inc (http://www.novell.com)
+// (C) 2006-2009 Novell, Inc (http://www.novell.com)
 //
 
 //
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
-
-namespace System.Web.Compilation {
-
-       public sealed class ResourceExpressionFields {
-
+namespace System.Web.Compilation
+{
+       public sealed class ResourceExpressionFields
+       {
                internal ResourceExpressionFields (string classKey, string resourceKey)
                {
                        this.classKey = classKey;
@@ -58,4 +56,3 @@ namespace System.Web.Compilation {
 
 }
 
-#endif
index 2e97a8c758a402b37e274a4ccb812a20cbdd8fe3..6ad322b7ed6e66f436ad484b51aa5a6483d03a64 100644 (file)
@@ -4,7 +4,7 @@
 // Authors:
 //     Chris Toshok (toshok@ximian.com)
 //
-// (C) 2006 Novell, Inc (http://www.novell.com)
+// (C) 2006-2009 Novell, Inc (http://www.novell.com)
 //
 
 //
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
-
-namespace System.Web.Compilation {
-
+namespace System.Web.Compilation
+{
        public abstract class ResourceProviderFactory
        {
                protected ResourceProviderFactory() { }
@@ -42,4 +40,4 @@ namespace System.Web.Compilation {
 
 }
 
-#endif
+
index d9e385530e64abc76110e139c06118251741d0be..507808d38300417c29bdf626b8bbb55d382f6540 100644 (file)
@@ -27,7 +27,7 @@
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-#if NET_2_0
+
 using System;
 using System.CodeDom;
 using System.CodeDom.Compiler;
@@ -40,7 +40,7 @@ using System.Web.UI;
 
 namespace System.Web.Compilation
 {
-       internal abstract class SimpleBuildProvider : GenericBuildProvider <SimpleWebHandlerParser>
+       abstract class SimpleBuildProvider : GenericBuildProvider <SimpleWebHandlerParser>
        {
                bool _parsed;
                bool _needLoadFromBin;
@@ -151,4 +151,3 @@ namespace System.Web.Compilation
                }
        }
 }
-#endif
\ No newline at end of file
index fd0b17c183b6b6051c9dccd4e463321df568c6d2..b010bf1d2520a774131439fa9d16e972c3836c17 100644 (file)
@@ -5,6 +5,7 @@
 //     Gonzalo Paniagua Javier (gonzalo@ximian.com)
 //
 // (C) 2003 Ximian, Inc (http://www.ximian.com)
+// (C) 2003-2009 Novell, Inc (http://novell.com/)
 //
 
 //
@@ -53,12 +54,7 @@ namespace System.Web.Compilation
 
                void MakeHash ()
                {
-#if NET_2_0
                        atts_hash = new Hashtable (StringComparer.InvariantCultureIgnoreCase);
-#else
-                       atts_hash = new Hashtable (CaseInsensitiveHashCodeProvider.DefaultInvariant,
-                                                  CaseInsensitiveComparer.DefaultInvariant);
-#endif
                        for (int i = 0; i < keys.Count; i++) {
                                CheckServerKey (keys [i]);
                                atts_hash.Add (keys [i], values [i]);
@@ -164,12 +160,7 @@ namespace System.Web.Compilation
                                return atts_hash;
 
                        if (tmp_hash == null)
-#if NET_2_0
                                tmp_hash = new Hashtable (StringComparer.InvariantCultureIgnoreCase);
-#else
-                               tmp_hash = new Hashtable (CaseInsensitiveHashCodeProvider.DefaultInvariant,
-                                                         CaseInsensitiveComparer.DefaultInvariant);
-#endif
                        
                        tmp_hash.Clear ();
                        for (int i = keys.Count - 1; i >= 0; i--)
index 8c7ae8094fa1a7645c30d7d31df2274f99e85e61..9da8cef6550196596257f87759de41cd50aca9cd 100644 (file)
@@ -27,7 +27,7 @@
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-#if NET_2_0
+
 using System;
 using System.CodeDom;
 using System.CodeDom.Compiler;
@@ -43,7 +43,7 @@ using System.Web.Util;
 
 namespace System.Web.Compilation
 {
-       internal abstract class TemplateBuildProvider : GenericBuildProvider <TemplateParser>
+       abstract class TemplateBuildProvider : GenericBuildProvider <TemplateParser>
        {
                delegate void ExtractDirectiveDependencies (string baseDirectory, CaptureCollection names, CaptureCollection values, TemplateBuildProvider bp);
                
@@ -369,4 +369,3 @@ namespace System.Web.Compilation
                }
        }
 }
-#endif
\ No newline at end of file
index 5ea8403a6cc1f9f98174d80fe4fbcb767259f196..28df3b7eb494f39d09e0077816134dd11468e30b 100644 (file)
@@ -32,23 +32,21 @@ using System;
 using System.CodeDom;
 using System.Collections;
 using System.ComponentModel;
+using System.Configuration;
+using System.Collections.Specialized;
+using System.Collections.Generic;
 using System.Drawing;
 using System.Globalization;
 using System.Reflection;
+using System.Resources;
 using System.Text;
 using System.Web;
+using System.Web.Configuration;
 using System.Web.UI;
 using System.Web.UI.WebControls;
 using System.Web.Util;
 using System.ComponentModel.Design.Serialization;
 using System.Text.RegularExpressions;
-#if NET_2_0
-using System.Configuration;
-using System.Collections.Specialized;
-using System.Collections.Generic;
-using System.Web.Configuration;
-using System.Resources;
-#endif
 
 namespace System.Web.Compilation
 {
@@ -66,17 +64,14 @@ namespace System.Web.Compilation
 
                internal static CodeVariableReferenceExpression ctrlVar = new CodeVariableReferenceExpression ("__ctrl");
                
-#if NET_2_0
                List <string> masterPageContentPlaceHolders;
                static Regex startsWithBindRegex = new Regex (@"^Bind\s*\(", RegexOptions.Compiled | RegexOptions.IgnoreCase);
                // When modifying those, make sure to look at the SanitizeBindCall to make sure it
                // picks up correct groups.
                static Regex bindRegex = new Regex (@"Bind\s*\(\s*[""']+(.*?)[""']+((\s*,\s*[""']+(.*?)[""']+)?)\s*\)\s*%>", RegexOptions.Compiled | RegexOptions.IgnoreCase);
                static Regex bindRegexInValue = new Regex (@"Bind\s*\(\s*[""']+(.*?)[""']+((\s*,\s*[""']+(.*?)[""']+)?)\s*\)\s*$", RegexOptions.Compiled | RegexOptions.IgnoreCase);
-#endif
                static Regex evalRegexInValue = new Regex (@"(.*)Eval\s*\(\s*[""']+(.*?)[""']+((\s*,\s*[""']+(.*?)[""']+)?)\s*\)(.*)", RegexOptions.Compiled | RegexOptions.IgnoreCase);
 
-#if NET_2_0
                List <string> MasterPageContentPlaceHolders {
                        get {
                                if (masterPageContentPlaceHolders == null)
@@ -84,7 +79,7 @@ namespace System.Web.Compilation
                                return masterPageContentPlaceHolders;
                        }
                }
-#endif
+
                public TemplateControlCompiler (TemplateControlParser parser)
                        : base (parser)
                {
@@ -101,10 +96,9 @@ namespace System.Web.Compilation
                {
                        if (builder == null || builder.ID == null || builder.ControlType == null)
                                return;
-#if NET_2_0
+
                        if (partialNameOverride [builder.ID] != null)
                                return;
-#endif
 
                        MemberAttributes ma = MemberAttributes.Family;
                        currentLocation = builder.Location;
@@ -114,13 +108,11 @@ namespace System.Web.Compilation
                        CodeMemberField field;
                        field = new CodeMemberField (builder.ControlType.FullName, builder.ID);
                        field.Attributes = ma;
-#if NET_2_0
                        field.Type.Options |= CodeTypeReferenceOptions.GlobalReference;
 
                        if (partialClass != null)
                                partialClass.Members.Add (AddLinePragma (field, builder));
                        else
-#endif
                                mainClass.Members.Add (AddLinePragma (field, builder));
                }
 
@@ -144,15 +136,8 @@ namespace System.Web.Compilation
                                return false;
 
                        if (!other.IsAssignableFrom (type)) {
-#if NET_2_0
                                ma |= MemberAttributes.New;
                                return false;
-#else
-                               string msg = String.Format ("The base class includes the field '{0}', but its " +
-                                                           "type '{1}' is not compatible with {2}",
-                                                           id, other, type);
-                               throw new ParseException (currentLocation, msg);
-#endif
                        }
 
                        return true;
@@ -192,9 +177,7 @@ namespace System.Web.Compilation
                         * method, allow subclasses to insert control
                         * specific code. */
                        if (builder is RootBuilder) {
-#if NET_2_0
                                SetCustomAttributes (method);
-#endif
                                AddStatementsToInitMethod (method);
                        }
                        
@@ -272,7 +255,6 @@ namespace System.Web.Compilation
                                        method.Statements.Add (initAsControl);
                                }
 
-#if NET_2_0
                                if (builder.ParentTemplateBuilder is System.Web.UI.WebControls.ContentBuilderInternal) {
                                        PropertyInfo pi;
 
@@ -313,7 +295,6 @@ namespace System.Web.Compilation
                                                applyStyleSheetSkin.Parameters.Add (new CodePropertyReferenceExpression (thisRef, "Page"));
                                        method.Statements.Add (applyStyleSheetSkin);
                                }
-#endif
 
                                // Process template children before anything else
                                ProcessTemplateChildren (builder);
@@ -324,9 +305,7 @@ namespace System.Web.Compilation
                                string ctl_id = builder.GetAttribute ("id");
                                if (ctl_id != null && ctl_id.Length != 0)
                                        CreateAssignStatementFromAttribute (builder, "id");
-
                                
-#if NET_2_0
                                if (typeof (ContentPlaceHolder).IsAssignableFrom (type)) {
                                        List <string> placeHolderIds = MasterPageContentPlaceHolders;
                                        string cphID = builder.ID;
@@ -395,7 +374,6 @@ namespace System.Web.Compilation
                                        // this is the bit that causes the following stuff to end up in the else { }
                                        builder.MethodStatements = condStatement.FalseStatements;
                                }
-#endif
                        }
                        
                        mainClass.Members.Add (method);
@@ -407,18 +385,15 @@ namespace System.Web.Compilation
                        if (templates != null && templates.Count > 0) {
                                foreach (TemplateBuilder tb in templates) {
                                        CreateControlTree (tb, true, false);
-#if NET_2_0
                                        if (tb.BindingDirection == BindingDirection.TwoWay) {
                                                string extractMethod = CreateExtractValuesMethod (tb);
                                                AddBindableTemplateInvocation (builder, tb.TagName, tb.Method.Name, extractMethod);
                                        } else
-#endif
                                                AddTemplateInvocation (builder, tb.TagName, tb.Method.Name);
                                }
                        }
                }
                
-#if NET_2_0
                void SetCustomAttribute (CodeMemberMethod method, UnknownAttributeDescriptor uad)
                {
                        CodeAssignStatement assign = new CodeAssignStatement ();
@@ -443,7 +418,6 @@ namespace System.Web.Compilation
                        foreach (UnknownAttributeDescriptor uad in attrs)
                                SetCustomAttribute (method, uad);
                }
-#endif
                
                protected virtual void AddStatementsToInitMethod (CodeMemberMethod method)
                {
@@ -483,10 +457,8 @@ namespace System.Web.Compilation
                {
                        Match match = regex.Match (value);
                        if (!match.Success) {
-#if NET_2_0
                                if (isBind)
                                        throw new HttpParseException ("Bind invocation wasn't formatted properly.");
-#endif
                                return null;
                        }
                        
@@ -522,14 +494,12 @@ namespace System.Web.Compilation
                        CodeExpression valueExpression = null;
                        value = value.Trim ();
                        
-#if NET_2_0
                        bool need_if = false;
                        if (startsWithBindRegex.Match (value).Success) {
                                valueExpression = CreateEvalInvokeExpression (bindRegexInValue, value, true);
                                if (valueExpression != null)
                                        need_if = true;
                        } else
-#endif
                                if (StrUtils.StartsWith (value, "Eval", true))
                                        valueExpression = CreateEvalInvokeExpression (evalRegexInValue, value, false);
                        
@@ -553,16 +523,13 @@ namespace System.Web.Compilation
                                expr = new CodeCastExpression (type, valueExpression);
 
                        CodeAssignStatement assign = new CodeAssignStatement (field, expr);
-#if NET_2_0
                        if (need_if) {
                                CodeExpression page = new CodePropertyReferenceExpression (thisRef, "Page");
                                CodeExpression left = new CodeMethodInvokeExpression (page, "GetDataItem");
                                CodeBinaryOperatorExpression ce = new CodeBinaryOperatorExpression (left, CodeBinaryOperatorType.IdentityInequality, new CodePrimitiveExpression (null));
                                CodeConditionStatement ccs = new CodeConditionStatement (ce, assign);
                                method.Statements.Add (ccs);
-                       }
-                       else
-#endif
+                       } else
                                method.Statements.Add (assign);
 
                        mainClass.Members.Add (method);
@@ -578,13 +545,10 @@ namespace System.Web.Compilation
                                string dbMethodName = DataBoundProperty (builder, type, var_name, att);
                                AddEventAssign (method, builder, "DataBinding", typeof (EventHandler), dbMethodName);
                                return;
-                       }
-#if NET_2_0
-                       else if (isExpression && isWritable) {
+                       } else if (isExpression && isWritable) {
                                AddExpressionAssign (method, builder, member, type, var_name, att);
                                return;
                        }
-#endif
 
                        CodeAssignStatement assign = new CodeAssignStatement ();
                        assign.Left = new CodePropertyReferenceExpression (ctrlVar, var_name);
@@ -625,7 +589,6 @@ namespace System.Web.Compilation
                        return IsDirective (value, '#');
                }
 
-#if NET_2_0
                bool IsExpression (string value)
                {
                        return IsDirective (value, '$');
@@ -654,7 +617,6 @@ namespace System.Web.Compilation
                                }
                        }
                }
-#endif
 
                /*
                static bool InvariantCompare (string a, string b)
@@ -702,11 +664,7 @@ namespace System.Web.Compilation
                        int hyphen = id.IndexOf ('-');
                        bool isPropertyInfo = (member is PropertyInfo);
                        bool isDataBound = IsDataBound (attValue);
-#if NET_2_0
                        bool isExpression = !isDataBound && IsExpression (attValue);
-#else
-                       bool isExpression = false;
-#endif
                        Type type;
                        if (isPropertyInfo) {
                                type = ((PropertyInfo) member).PropertyType;
@@ -715,11 +673,9 @@ namespace System.Web.Compilation
                        }
 
                        if (InvariantCompareNoCase (member.Name, id)) {
-#if NET_2_0
                                if (isDataBound)
-                                       RegisterBindingInfo (builder, member.Name, ref attValue);
-                               
-#endif
+                                       RegisterBindingInfo (builder, member.Name, ref attValue);                               
+
                                if (!IsWritablePropertyOrField (member))
                                        return false;
                                
@@ -762,10 +718,10 @@ namespace System.Web.Compilation
                        string val = attValue;
                        if (attValue == null && is_bool)
                                val = "true"; // Font-Bold <=> Font-Bold="true"
-#if NET_2_0
+
                        if (isDataBound)
                                RegisterBindingInfo (builder, prefix + member.Name + "." + subprop.Name, ref attValue);
-#endif
+
                        AddCodeForPropertyOrField (builder, subprop.PropertyType,
                                                   prefix + member.Name + "." + subprop.Name,
                                                   val, subprop, isDataBound, isExpression);
@@ -773,7 +729,6 @@ namespace System.Web.Compilation
                        return true;
                }
 
-#if NET_2_0
                CodeExpression CompileExpression (MemberInfo member, Type type, string value, bool useSetAttribute)
                {
                        // First let's find the correct expression builder
@@ -957,7 +912,6 @@ namespace System.Web.Compilation
 
                        AssignPropertiesFromResources (builder, controlType, attvalue);
                }
-#endif
                
                void AddEventAssign (CodeMemberMethod method, ControlBuilder builder, string name, Type type, string value)
                {
@@ -996,12 +950,10 @@ namespace System.Web.Compilation
 
                        }
 
-#if NET_2_0
                        if (String.Compare (id, "meta:resourcekey", StringComparison.OrdinalIgnoreCase) == 0) {
                                AssignPropertiesFromResources (builder, attvalue);
                                return;
                        }
-#endif
                        
                        int hyphen = id.IndexOf ('-');
                        string alt_id = id;
@@ -1019,20 +971,16 @@ namespace System.Web.Compilation
 
                        CodeMemberMethod method = builder.Method;
                        bool isDatabound = IsDataBound (attvalue);
-#if NET_2_0
                        bool isExpression = !isDatabound && IsExpression (attvalue);
-#endif
 
                        if (isDatabound) {
                                string value = attvalue.Substring (3, attvalue.Length - 5).Trim ();
                                CodeExpression valueExpression = null;
-#if NET_2_0
                                if (startsWithBindRegex.Match (value).Success)
                                        valueExpression = CreateEvalInvokeExpression (bindRegexInValue, value, true);
                                else
-#endif
-                               if (StrUtils.StartsWith (value, "Eval", true))
-                                       valueExpression = CreateEvalInvokeExpression (evalRegexInValue, value, false);
+                                       if (StrUtils.StartsWith (value, "Eval", true))
+                                               valueExpression = CreateEvalInvokeExpression (evalRegexInValue, value, false);
                                
                                if (valueExpression == null && value != null && value.Trim () != String.Empty)
                                        valueExpression = new CodeSnippetExpression (value);
@@ -1049,12 +997,10 @@ namespace System.Web.Compilation
                                expr.Parameters.Add (new CodePrimitiveExpression (id));
 
                                CodeExpression valueExpr = null;
-#if NET_2_0
                                if (isExpression)
                                        valueExpr = CompileExpression (null, typeof (string), attvalue, true);
 
                                if (valueExpr == null)
-#endif
                                        valueExpr = new CodePrimitiveExpression (attvalue);
                                
                                expr.Parameters.Add (valueExpr);
@@ -1074,16 +1020,14 @@ namespace System.Web.Compilation
                                        continue;
                                // ID is assigned in BuildControltree
                                if (InvariantCompareNoCase (id, "id"))
-                                       continue;
-                               
-#if NET_2_0
+                                       continue;                               
+
                                /* we skip SkinID here as it's assigned in BuildControlTree */
                                if (InvariantCompareNoCase (id, "skinid"))
                                        continue;
                                if (InvariantCompareNoCase (id, "meta:resourcekey"))
                                        continue; // ignore, this one's processed at the very end of
                                                  // the method
-#endif
                                CreateAssignStatementFromAttribute (builder, id);
                        }
                }
@@ -1099,9 +1043,8 @@ namespace System.Web.Compilation
                        AddEventAssign (method, builder, "DataBinding", typeof (EventHandler), dbMethodName);
 
                        method = CreateDBMethod (builder, dbMethodName, GetContainerType (builder), builder.ControlType);
-#if NET_2_0
                        builder.DataBindingMethod = method;
-#endif
+
                        CodeCastExpression cast;
                        CodeMethodReferenceExpression methodExpr;
                        CodeMethodInvokeExpression expr;
@@ -1210,7 +1153,6 @@ namespace System.Web.Compilation
                        builder.Method.Statements.Add (AddLinePragma (assign, builder));
                }
 
-#if NET_2_0
                void AddBindableTemplateInvocation (ControlBuilder builder, string name, string methodName, string extractMethodName)
                {
                        CodePropertyReferenceExpression prop = new CodePropertyReferenceExpression (ctrlVar, name);
@@ -1303,7 +1245,6 @@ namespace System.Web.Compilation
 
                        method.Statements.Add (AddLinePragma (invoke, cbuilder));
                }
-#endif
 
                void AddCodeRender (ControlBuilder parent, CodeRenderBuilder cr)
                {
@@ -1324,46 +1265,10 @@ namespace System.Web.Compilation
                        expr.Parameters.Add (new CodeSnippetExpression (cr.Code));
                        parent.RenderMethod.Statements.Add (AddLinePragma (expr, cr));
                }
-
-#if !NET_2_0
-               static PropertyInfo GetContainerProperty (Type type, string[] propNames)
-               {
-                       PropertyInfo prop;
-                       
-                       foreach (string name in propNames) {
-                               prop = type.GetProperty (name, noCaseFlags & ~BindingFlags.NonPublic);
-                               if (prop != null)
-                                       return prop;
-                       }
-
-                       return null;
-               }
-
-               static string[] containerPropNames = {"Items", "Rows"};
-#endif
                
                static Type GetContainerType (ControlBuilder builder)
                {
-                       Type type = builder.BindingContainerType;
-                       
-#if NET_2_0
-                       return type;
-#else
-                       
-                       PropertyInfo prop = GetContainerProperty (type, containerPropNames);
-                       if (prop == null)
-                               return type;
-
-                       Type ptype = prop.PropertyType;
-                       if (!typeof (ICollection).IsAssignableFrom (ptype))
-                               return type;
-
-                       prop = ptype.GetProperty ("Item", noCaseFlags & ~BindingFlags.NonPublic);
-                       if (prop == null)
-                               return type;
-
-                       return prop.PropertyType;
-#endif
+                       return builder.BindingContainerType;
                }
                
                CodeMemberMethod CreateDBMethod (ControlBuilder builder, string name, Type container, Type target)
@@ -1419,9 +1324,8 @@ namespace System.Web.Compilation
 
                        // Add the DataBind handler
                        method = CreateDBMethod (builder, dbMethodName, GetContainerType (builder), typeof (DataBoundLiteralControl));
-#if NET_2_0
                        builder.DataBindingMethod = method;
-#endif
+
                        CodeVariableReferenceExpression targetExpr = new CodeVariableReferenceExpression ("target");
                        CodeMethodInvokeExpression invoke = new CodeMethodInvokeExpression ();
                        invoke.Method = new CodeMethodReferenceExpression (targetExpr, "SetDataBoundString");
@@ -1456,9 +1360,7 @@ namespace System.Web.Compilation
                        if (!isTemplate && !inTemplate) {
                                CreateField (builder, true);
                        } else if (!isTemplate) {
-                               bool doCheck = false;
-                               
-#if NET_2_0
+                               bool doCheck = false;                           
                                bool singleInstance = false;
                                ControlBuilder pb = builder.ParentBuilder;
                                TemplateBuilder tpb;
@@ -1475,12 +1377,10 @@ namespace System.Web.Compilation
                                }
                                
                                if (!singleInstance)
-#endif
                                        builder.ID = builder.GetNextID (null);
-#if NET_2_0
                                else
                                        doCheck = true;
-#endif
+
                                CreateField (builder, doCheck);
                        }
 
@@ -1511,15 +1411,13 @@ namespace System.Web.Compilation
                                                        assign.Right = new CodePrimitiveExpression (asb.ToString ());
                                                        method.Statements.Add (AddLinePragma (assign, builder));
                                                }
-                                       }
-#if NET_2_0
-                                       else if (b is ContentBuilderInternal) {
+                                       } else if (b is ContentBuilderInternal) {
                                                ContentBuilderInternal cb = (ContentBuilderInternal) b;
                                                CreateControlTree (cb, false, true);
                                                AddContentTemplateInvocation (cb, builder.Method, cb.Method.Name);
                                                continue;
                                        }
-#endif
+
                                        // Ignore TemplateBuilders - they are processed in InitMethod
                                        else if (b is TemplateBuilder) {
                                        } else if (b is CodeRenderBuilder) {
@@ -1534,10 +1432,8 @@ namespace System.Web.Compilation
                                        } else
                                                throw new Exception ("???");
 
-#if NET_2_0
                                        ControlBuilder bldr = b as ControlBuilder;
                                        bldr.ProcessGeneratedCode (CompileUnit, BaseType, DerivedType, bldr.Method, bldr.DataBindingMethod);
-#endif
                                }
 
                                FlushText (builder, sb);
@@ -1567,24 +1463,19 @@ namespace System.Web.Compilation
                                builder.MethodStatements.Add (invoke);
                        }
 
-#if NET_2_0
                        if (builder is RootBuilder)
                                if (!String.IsNullOrEmpty (parser.MetaResourceKey))
                                        AssignPropertiesFromResources (builder, parser.BaseType, parser.MetaResourceKey);
                        
                        if ((!isTemplate || builder is RootBuilder) && !String.IsNullOrEmpty (builder.GetAttribute ("meta:resourcekey")))
                                CreateAssignStatementFromAttribute (builder, "meta:resourcekey");
-#endif
 
                        if (!childrenAsProperties && typeof (Control).IsAssignableFrom (builder.ControlType))
                                builder.Method.Statements.Add (new CodeMethodReturnStatement (ctrlVar));
 
-#if NET_2_0
                        builder.ProcessGeneratedCode (CompileUnit, BaseType, DerivedType, builder.Method, builder.DataBindingMethod);
-#endif
                }
 
-#if NET_2_0
                protected override void AddStatementsToConstructor (CodeConstructor ctor)
                {
                        if (masterPageContentPlaceHolders == null || masterPageContentPlaceHolders.Count == 0)
@@ -1606,7 +1497,6 @@ namespace System.Web.Compilation
                                statements.Add (mcall);
                        }
                }
-#endif
                
                protected internal override void CreateMethods ()
                {
@@ -1617,7 +1507,6 @@ namespace System.Web.Compilation
                        CreateFrameworkInitializeMethod ();
                }
 
-#if NET_2_0
                protected override void InitializeType ()
                {
                        List <string> registeredTagNames = parser.RegisteredTagNames;
@@ -1642,7 +1531,6 @@ namespace System.Web.Compilation
                        CodeMethodInvokeExpression invoke = new CodeMethodInvokeExpression (baseRef, "FrameworkInitialize");
                        method.Statements.Add (invoke);
                }
-#endif
                
                void CallSetStringResourcePointer (CodeMemberMethod method)
                {
@@ -1661,9 +1549,7 @@ namespace System.Web.Compilation
                        method.Name = "FrameworkInitialize";
                        method.Attributes = MemberAttributes.Family | MemberAttributes.Override;
                        PrependStatementsToFrameworkInitialize (method);
-#if NET_2_0
                        CallBaseFrameworkInitialize (method);
-#endif
                        CallSetStringResourcePointer (method);
                        AppendStatementsToFrameworkInitialize (method);
                        mainClass.Members.Add (method);
@@ -1741,15 +1627,12 @@ namespace System.Web.Compilation
 
                        CodeCastExpression cast = new CodeCastExpression (appType.FullName, propRef);
                        prop.GetStatements.Add (new CodeMethodReturnStatement (cast));
-#if NET_2_0
                        if (partialClass != null)
                                partialClass.Members.Add (prop);
                        else
-#endif
-                       mainClass.Members.Add (prop);
+                               mainClass.Members.Add (prop);
                }
 
-#if NET_2_0
                void CreateContentPlaceHolderTemplateProperty (string backingField, string name)
                {
                        CodeMemberProperty prop = new CodeMemberProperty ();
@@ -1778,7 +1661,6 @@ namespace System.Web.Compilation
 
                        mainClass.Members.Add (prop);
                }
-#endif
                
                void CreateAutoHandlers ()
                {
@@ -1795,11 +1677,8 @@ namespace System.Web.Compilation
                        prop.GetStatements.Add (ret);
                        prop.SetStatements.Add (new CodeAssignStatement (fldRef, new CodePropertySetValueReferenceExpression ()));
 
-#if NET_2_0
                        CodeAttributeDeclaration attr = new CodeAttributeDeclaration ("System.Obsolete");
-                       prop.CustomAttributes.Add (attr);
-#endif
-                       
+                       prop.CustomAttributes.Add (attr);                       
                        mainClass.Members.Add (prop);
 
                        // Add the __autoHandlers field
@@ -1819,32 +1698,19 @@ namespace System.Web.Compilation
                        mainClass.Members.Add (prop);
                }
 
-#if NET_2_0
                protected virtual string HandleUrlProperty (string str, MemberInfo member)
                {
                        return str;
                }
-#endif
 
                TypeConverter GetConverterForMember (MemberInfo member)
                {
                        TypeConverterAttribute tca = null;
                        object[] attrs;
                        
-#if NET_2_0
                        attrs = member.GetCustomAttributes (typeof (TypeConverterAttribute), true);
                        if (attrs.Length > 0)
                                tca = attrs [0] as TypeConverterAttribute;
-#else
-                       attrs = member.GetCustomAttributes (true);
-                       
-                       foreach (object attr in attrs) {
-                               tca = attr as TypeConverterAttribute;
-                               
-                               if (tca != null)
-                                       break;
-                       }
-#endif
 
                        if (tca == TypeConverterAttribute.Default)
                                tca = null;
@@ -1871,17 +1737,10 @@ namespace System.Web.Compilation
                
                CodeExpression CreateNullableExpression (Type type, CodeExpression inst, bool nullable)
                {
-#if NET_2_0
                        if (!nullable)
                                return inst;
                        
-                       return new CodeObjectCreateExpression (
-                               type,
-                               new CodeExpression[] {inst}
-                       );
-#else
-                       return inst;
-#endif
+                       return new CodeObjectCreateExpression (type, new CodeExpression[] {inst});
                }
 
                bool SafeCanConvertFrom (Type type, TypeConverter cvt)
@@ -1920,25 +1779,24 @@ namespace System.Web.Compilation
 
                        bool wasNullable = false;
                        Type originalType = type;
-#if NET_2_0
+
                        if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>)) {
                                Type[] types = type.GetGenericArguments();
                                originalType = type;
                                type = types[0]; // we're interested only in the first type here
                                wasNullable = true;
                        }
-#endif
+
                        if (type == typeof (string)) {
                                if (preConverted)
                                        return CreateNullableExpression (originalType,
                                                                         new CodePrimitiveExpression ((string) convertedFromAttr),
                                                                         wasNullable);
-                               
-#if NET_2_0
+
                                object[] urlAttr = member.GetCustomAttributes (typeof (UrlPropertyAttribute), true);
                                if (urlAttr.Length != 0)
                                        str = HandleUrlProperty (str, member);
-#endif
+
                                return CreateNullableExpression (originalType, new CodePrimitiveExpression (str), wasNullable);
                        } else if (type == typeof (bool)) {
                                if (preConverted)
@@ -1950,10 +1808,8 @@ namespace System.Web.Compilation
                                        return CreateNullableExpression (originalType, new CodePrimitiveExpression (true), wasNullable);
                                else if (InvariantCompareNoCase (str, "false"))
                                        return CreateNullableExpression (originalType, new CodePrimitiveExpression (false), wasNullable);
-#if NET_2_0
                                else if (wasNullable && InvariantCompareNoCase(str, "null"))
                                        return new CodePrimitiveExpression (null);
-#endif
                                else
                                        throw new ParseException (currentLocation,
                                                        "Value '" + str  + "' is not a valid boolean.");
index bcbd8617d4ded33e5712150212700f3d74c5894d..4c733e16b27220bb4245ada97cd1f8307b8ae6d6 100644 (file)
@@ -28,7 +28,7 @@
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-#if NET_2_0
+
 using System;
 using System.CodeDom;
 using System.CodeDom.Compiler;
@@ -117,4 +117,4 @@ namespace System.Web.Compilation
                }
        }
 }
-#endif
+
index 5c9fd4440d6d5c910aa0fba99b072b8cd8ba7413..ebf3d36d7f3d85f6814a2ff2c334d0eed6b0c168 100644 (file)
@@ -4,7 +4,7 @@
 // Authors:
 //   Chris Toshok (toshok@ximian.com)
 //
-// (C) 2006 Novell, Inc. (http://www.novell.com)
+// (C) 2006-2009 Novell, Inc. (http://www.novell.com)
 //
 
 //
@@ -28,8 +28,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
-
 using System;
 using System.Collections;
 using System.IO;
@@ -39,7 +37,7 @@ using System.Web.Util;
 
 namespace System.Web.UI
 {
-       internal sealed class ThemeDirectoryCompiler
+       sealed class ThemeDirectoryCompiler
        {
                public static Type GetCompiledType (string theme, HttpContext context)
                {
@@ -102,4 +100,3 @@ namespace System.Web.UI
        }
 }
 
-#endif
index 190d400c2448372718d567eccc79544449970f55..fe5d3298cf294138975daadcc695594b61dd8ffb 100644 (file)
@@ -28,7 +28,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
 
 using System;
 using System.CodeDom;
@@ -61,5 +60,5 @@ namespace System.Web.Compilation {
                }
        }
 }
-#endif
+
 
index 1e95ef7c2c722e3b00be6c9d4d3478bf16c5a673..18d616209ce5751faa7ae5157dd0316308e5b28d 100644 (file)
@@ -55,13 +55,11 @@ namespace System.Web.Compilation
                                AddOutputCacheAttribute ();
                }
 
-#if NET_2_0
                protected internal override void CreateMethods ()
                {
                        base.CreateMethods ();
                        CreateProfileProperty ();
                }
-#endif
                
                void AddOutputCacheAttribute ()
                {
@@ -82,14 +80,12 @@ namespace System.Web.Compilation
 
                protected override void AddStatementsToInitMethod (CodeMemberMethod method)
                {
-#if NET_2_0
                        if (parser.MasterPageFile != null) {
                                CodeExpression prop;
                                prop = new CodePropertyReferenceExpression (new CodeArgumentReferenceExpression("__ctrl"), "MasterPageFile");
                                CodeExpression ct = new CodePrimitiveExpression (parser.MasterPageFile);
                                method.Statements.Add (AddLinePragma (new CodeAssignStatement (prop, ct), parser.DirectiveLocation));
                        }
-#endif
                }
        }
 }
index 6ce9fd34937d98bec4a95a1fe9678bbe9a3f559b..5a344f95be37ce4c43368df1a7e718264683b603 100644 (file)
@@ -28,7 +28,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
+
 
 using System;
 using System.CodeDom;
@@ -57,5 +57,5 @@ namespace System.Web.Compilation {
                }
        }
 }
-#endif
+
 
index ac76d6aefde656bd04b0b6da3643782e3cf3c026..1820e22f9156a0a656acc632c86556b6ad198c2f 100644 (file)
@@ -29,7 +29,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
+
 
 using System;
 using System.CodeDom;
@@ -58,5 +58,5 @@ namespace System.Web.Compilation {
                }
        }
 }
-#endif
+
 
index 443688003ed6094c6dc4c157c0be85e5d45e0674..40c99fcfe87359a0499f512d35a697c9577eee8d 100644 (file)
@@ -79,10 +79,6 @@ namespace System.Web.Compilation
                                throw new HttpException ("Configuration error. Language not supported: " +
                                                          lang, 500);
 
-#if !NET_2_0
-                       Compiler = provider.CreateCompiler ();
-#endif
-
                        CompilerParameters compilerParameters;
                        CompilerParameters = compilerParameters = CachingCompiler.GetOptions (parser.Assemblies);
                        compilerParameters.IncludeDebugInformation = parser.Debug;
index 5938a929ba056ae8691121e841c2b74f85f448bd..88629f917dae0ad6dcf49b1ca14974f8d93e5ecc 100644 (file)
@@ -28,7 +28,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0 && WEBSERVICES_DEP
+#if WEBSERVICES_DEP
 
 using System;
 using System.CodeDom;
index 0a929cbdbce351b536fd339d373b32125debc0f7..86a6746c6b6be237164bb680a171b1d928100fdf 100644 (file)
@@ -28,7 +28,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
+
 using System;
 using System.CodeDom;
 using System.CodeDom.Compiler;
@@ -64,5 +64,5 @@ namespace System.Web.Compilation {
                }
        }
 }
-#endif
+