edit: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/FileOps.cs;C1561136
File: FileOps.cs
===================================================================
--- $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/FileOps.cs;C1561136  (server)    3/28/2010 12:17 PM
+++ Shelved Change: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/FileOps.cs;asm-gettypes
@@ -485,7 +485,6 @@
         #endregion
 
 #if !SILVERLIGHT
-
         [RubyMethod("expand_path", RubyMethodAttributes.PublicSingleton, BuildConfig = "!SILVERLIGHT")]
         public static MutableString/*!*/ ExpandPath(
             RubyClass/*!*/ self, 
@@ -731,9 +730,11 @@
                 if (pal.FileExists(path)) {
                     result = new FileInfo(path);                    
                 } else if (pal.DirectoryExists(path)) {
-                    result = new DirectoryInfo(path);                    
+                    result = new DirectoryInfo(path);
+#if !SILVERLIGHT
                 } else if (path.ToUpperInvariant().Equals(NUL_VALUE)) {
                     result = new DeviceInfo(NUL_VALUE);
+#endif
                 } else {
                     return false;
                 }
@@ -913,9 +914,11 @@
 
             [RubyMethod("size")]
             public static int Size(FileSystemInfo/*!*/ self) {
+#if !SILVERLIGHT
                 if (self is DeviceInfo) {
                     return 0;
                 }
+#endif
 
                 FileInfo info = (self as FileInfo);
                 return (info == null) ? 0 : (int)info.Length;
@@ -923,9 +926,11 @@
 
             [RubyMethod("size?")]
             public static object NullableSize(FileSystemInfo/*!*/ self) {
+#if !SILVERLIGHT
                 if (self is DeviceInfo) {
                     return 0;
                 }
+#endif
 
                 FileInfo info = (self as FileInfo);
                 if (info == null) {
@@ -964,14 +969,19 @@
 
             [RubyMethod("zero?")]
             public static bool IsZeroLength(FileSystemInfo/*!*/ self) {
+#if !SILVERLIGHT
                 if (self is DeviceInfo) {
                     return true;
                 }
+#endif
 
                 FileInfo info = (self as FileInfo);
                 return (info == null) ? false : info.Length == 0;
             }
 
+#if !SILVERLIGHT
+            // cannot inherit from FileSystemInfo in Silverlight because the
+            // constructor is SecurityCritical
             internal class DeviceInfo : FileSystemInfo {
                 
                 private string/*!*/ _name;
@@ -992,8 +1002,8 @@
                     get { return _name; }
                 }
             }
+#endif
         }
-
         #endregion
     }
 }
===================================================================
