The Labs \ Source Viewer \ SSCLI \ Microsoft.JScript \ JSField

  1. // ==++==
  2. //
  3. //
  4. // Copyright (c) 2006 Microsoft Corporation. All rights reserved.
  5. //
  6. // The use and distribution terms for this software are contained in the file
  7. // named license.txt, which can be found in the root of this distribution.
  8. // By using this software in any fashion, you are agreeing to be bound by the
  9. // terms of this license.
  10. //
  11. // You must not remove this notice, or any other, from this software.
  12. //
  13. //
  14. // ==--==
  15. /*
  16. A base class for all fields defined by JScript. Provides dummy implementations for stuff were not interested in.
  17. */
  18. namespace Microsoft.JScript
  19. {
  20.    
  21.     using System;
  22.     using System.Collections;
  23.     using System.Reflection;
  24.    
  25.     public abstract class JSField : FieldInfo
  26.     {
  27.        
  28.         public override FieldAttributes Attributes {
  29.             get { return (FieldAttributes)0; }
  30.         }
  31.        
  32.         public override Type DeclaringType {
  33.             get { return null; }
  34.         }
  35.        
  36.         public override RuntimeFieldHandle FieldHandle {
  37.             get { return ((FieldInfo)this.GetMetaData()).FieldHandle; }
  38.         }
  39.        
  40.         public override Type FieldType {
  41.             get { return Typeob.Object; }
  42.         }
  43.        
  44.         public override object[] GetCustomAttributes(Type t, bool inherit)
  45.         {
  46.             return new FieldInfo[0];
  47.         }
  48.        
  49.         public override object[] GetCustomAttributes(bool inherit)
  50.         {
  51.             return new FieldInfo[0];
  52.         }
  53.        
  54.         internal virtual object GetMetaData()
  55.         {
  56.             throw new JScriptException(JSError.InternalError);
  57.         }
  58.        
  59.         internal virtual string GetClassFullName()
  60.         {
  61.             throw new JScriptException(JSError.InternalError);
  62.         }
  63.        
  64.         internal virtual PackageScope GetPackage()
  65.         {
  66.             throw new JScriptException(JSError.InternalError);
  67.         }
  68.        
  69.         public override bool IsDefined(Type type, bool inherit)
  70.         {
  71.             return false;
  72.         }
  73.        
  74.         public override MemberTypes MemberType {
  75.             get { return MemberTypes.Field; }
  76.         }
  77.        
  78.         public override string Name {
  79.             get { return ""; }
  80.         }
  81.        
  82.         public override Type ReflectedType {
  83.             get { return this.DeclaringType; }
  84.         }
  85.     }
  86. }

Developer Fusion