Пример #1
0
        //public static JSImplGuid NewGuid()
        //{
        //  JSImplGuid guid = new JSImplGuid();
        //  char[] s = new char[36];
        //  string hexDigits = "0123456789abcdef";
        //  for (var i = 0; i < 36; i++)
        //  {
        //    //int k = (int) Math.Floor(_random.Next(16));
        //    int k = _random.Next(16);
        //    s[i] = hexDigits[k];
        //  }
        //  s[14] = '4';  // bits 12-15 of the time_hi_and_version field to 0010
        //  s[19] = hexDigits[((s[19] & 0x3) | 0x8)];  // bits 6-7 of the clock_seq_hi_and_reserved to 01
        //  s[8] = s[13] = s[18] = s[23] = '-';

        //  string uuid = new string(s);
        //  return uuid;
        //}

#if false
        public JSImplGuid(string g)
        {
            JSImplGuid.CheckNull(g);
            g = g.Trim();
            JSImplGuid.GuidParser guidParser = new JSImplGuid.GuidParser(g);
            JSImplGuid            guid;

            if (!guidParser.Parse(out guid))
            {
                throw JSImplGuid.CreateFormatException(g);
            }
            @ @tb the following line produces invalid js code(FireFox is reports it while loading the jsclr.js file)
            this = guid;
        }
Пример #2
0
 private static void CheckArray(byte[] o, int l)
 {
     JSImplGuid.CheckNull(o);
     JSImplGuid.CheckLength(o, l);
 }