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

  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. namespace Microsoft.JScript
  16. {
  17.    
  18.     using System;
  19.    
  20.     public sealed class LenientDatePrototype : DatePrototype
  21.     {
  22.         public new object constructor;
  23.         public new object getTime;
  24.         [NotRecommended("getYear")]
  25.         public new object getYear;
  26.         public new object getFullYear;
  27.         public new object getUTCFullYear;
  28.         public new object getMonth;
  29.         public new object getUTCMonth;
  30.         public new object getDate;
  31.         public new object getUTCDate;
  32.         public new object getDay;
  33.         public new object getUTCDay;
  34.         public new object getHours;
  35.         public new object getUTCHours;
  36.         public new object getMinutes;
  37.         public new object getUTCMinutes;
  38.         public new object getSeconds;
  39.         public new object getUTCSeconds;
  40.         public new object getMilliseconds;
  41.         public new object getUTCMilliseconds;
  42.         public new object getVarDate;
  43.         public new object getTimezoneOffset;
  44.         public new object setTime;
  45.         public new object setMilliseconds;
  46.         public new object setUTCMilliseconds;
  47.         public new object setSeconds;
  48.         public new object setUTCSeconds;
  49.         public new object setMinutes;
  50.         public new object setUTCMinutes;
  51.         public new object setHours;
  52.         public new object setUTCHours;
  53.         public new object setDate;
  54.         public new object setUTCDate;
  55.         public new object setMonth;
  56.         public new object setUTCMonth;
  57.         public new object setFullYear;
  58.         public new object setUTCFullYear;
  59.         [NotRecommended("setYear")]
  60.         public new object setYear;
  61.         [NotRecommended("toGMTString")]
  62.         public new object toGMTString;
  63.         public new object toDateString;
  64.         public new object toLocaleDateString;
  65.         public new object toLocaleString;
  66.         public new object toLocaleTimeString;
  67.         public new object toString;
  68.         public new object toTimeString;
  69.         public new object toUTCString;
  70.         public new object valueOf;
  71.        
  72.         internal LenientDatePrototype(LenientFunctionPrototype funcprot, LenientObjectPrototype parent) : base(parent)
  73.         {
  74.             this.noExpando = false;
  75.            
  76.             //this.constructor is given a value by the proper constructor class
  77.             Type super = typeof(DatePrototype);
  78.             this.getTime = new BuiltinFunction("getTime", this, super.GetMethod("getTime"), funcprot);
  79.             this.getYear = new BuiltinFunction("getYear", this, super.GetMethod("getYear"), funcprot);
  80.             this.getFullYear = new BuiltinFunction("getFullYear", this, super.GetMethod("getFullYear"), funcprot);
  81.             this.getUTCFullYear = new BuiltinFunction("getUTCFullYear", this, super.GetMethod("getUTCFullYear"), funcprot);
  82.             this.getMonth = new BuiltinFunction("getMonth", this, super.GetMethod("getMonth"), funcprot);
  83.             this.getUTCMonth = new BuiltinFunction("getUTCMonth", this, super.GetMethod("getUTCMonth"), funcprot);
  84.             this.getDate = new BuiltinFunction("getDate", this, super.GetMethod("getDate"), funcprot);
  85.             this.getUTCDate = new BuiltinFunction("getUTCDate", this, super.GetMethod("getUTCDate"), funcprot);
  86.             this.getDay = new BuiltinFunction("getDay", this, super.GetMethod("getDay"), funcprot);
  87.             this.getUTCDay = new BuiltinFunction("getUTCDay", this, super.GetMethod("getUTCDay"), funcprot);
  88.             this.getHours = new BuiltinFunction("getHours", this, super.GetMethod("getHours"), funcprot);
  89.             this.getUTCHours = new BuiltinFunction("getUTCHours", this, super.GetMethod("getUTCHours"), funcprot);
  90.             this.getMinutes = new BuiltinFunction("getMinutes", this, super.GetMethod("getMinutes"), funcprot);
  91.             this.getUTCMinutes = new BuiltinFunction("getUTCMinutes", this, super.GetMethod("getUTCMinutes"), funcprot);
  92.             this.getSeconds = new BuiltinFunction("getSeconds", this, super.GetMethod("getSeconds"), funcprot);
  93.             this.getUTCSeconds = new BuiltinFunction("getUTCSeconds", this, super.GetMethod("getUTCSeconds"), funcprot);
  94.             this.getMilliseconds = new BuiltinFunction("getMilliseconds", this, super.GetMethod("getMilliseconds"), funcprot);
  95.             this.getUTCMilliseconds = new BuiltinFunction("getUTCMilliseconds", this, super.GetMethod("getUTCMilliseconds"), funcprot);
  96.             this.getVarDate = new BuiltinFunction("getVarDate", this, super.GetMethod("getVarDate"), funcprot);
  97.             this.getTimezoneOffset = new BuiltinFunction("getTimezoneOffset", this, super.GetMethod("getTimezoneOffset"), funcprot);
  98.             this.setTime = new BuiltinFunction("setTime", this, super.GetMethod("setTime"), funcprot);
  99.             this.setMilliseconds = new BuiltinFunction("setMilliseconds", this, super.GetMethod("setMilliseconds"), funcprot);
  100.             this.setUTCMilliseconds = new BuiltinFunction("setUTCMilliseconds", this, super.GetMethod("setUTCMilliseconds"), funcprot);
  101.             this.setSeconds = new BuiltinFunction("setSeconds", this, super.GetMethod("setSeconds"), funcprot);
  102.             this.setUTCSeconds = new BuiltinFunction("setUTCSeconds", this, super.GetMethod("setUTCSeconds"), funcprot);
  103.             this.setMinutes = new BuiltinFunction("setMinutes", this, super.GetMethod("setMinutes"), funcprot);
  104.             this.setUTCMinutes = new BuiltinFunction("setUTCMinutes", this, super.GetMethod("setUTCMinutes"), funcprot);
  105.             this.setHours = new BuiltinFunction("setHours", this, super.GetMethod("setHours"), funcprot);
  106.             this.setUTCHours = new BuiltinFunction("setUTCHours", this, super.GetMethod("setUTCHours"), funcprot);
  107.             this.setDate = new BuiltinFunction("setDate", this, super.GetMethod("setDate"), funcprot);
  108.             this.setUTCDate = new BuiltinFunction("setUTCDate", this, super.GetMethod("setUTCDate"), funcprot);
  109.             this.setMonth = new BuiltinFunction("setMonth", this, super.GetMethod("setMonth"), funcprot);
  110.             this.setUTCMonth = new BuiltinFunction("setUTCMonth", this, super.GetMethod("setUTCMonth"), funcprot);
  111.             this.setFullYear = new BuiltinFunction("setFullYear", this, super.GetMethod("setFullYear"), funcprot);
  112.             this.setUTCFullYear = new BuiltinFunction("setUTCFullYear", this, super.GetMethod("setUTCFullYear"), funcprot);
  113.             this.setYear = new BuiltinFunction("setYear", this, super.GetMethod("setYear"), funcprot);
  114.             this.toDateString = new BuiltinFunction("toDateString", this, super.GetMethod("toDateString"), funcprot);
  115.             this.toLocaleDateString = new BuiltinFunction("toLocaleDateString", this, super.GetMethod("toLocaleDateString"), funcprot);
  116.             this.toLocaleString = new BuiltinFunction("toLocaleString", this, super.GetMethod("toLocaleString"), funcprot);
  117.             this.toLocaleTimeString = new BuiltinFunction("toLocaleTimeString", this, super.GetMethod("toLocaleTimeString"), funcprot);
  118.             this.toGMTString = new BuiltinFunction("toUTCString", this, super.GetMethod("toUTCString"), funcprot);
  119.             this.toString = new BuiltinFunction("toString", this, super.GetMethod("toString"), funcprot);
  120.             this.toTimeString = new BuiltinFunction("toTimeString", this, super.GetMethod("toTimeString"), funcprot);
  121.             this.toUTCString = new BuiltinFunction("toUTCString", this, super.GetMethod("toUTCString"), funcprot);
  122.             this.valueOf = new BuiltinFunction("valueOf", this, super.GetMethod("valueOf"), funcprot);
  123.         }
  124.     }
  125. }

Developer Fusion