Ejemplo n.º 1
0
        public bool ReadLogFile(string filePath)
        {
            System.IO.BinaryReader r = null;
            if (System.IO.File.Exists(filePath))
            {
                try
                {
                    r = new System.IO.BinaryReader(System.IO.File.OpenRead(filePath));
                }
                catch (UnauthorizedAccessException) { r = null; }
            }
            if (r == null)
            {
                return(false);
            }
            //uSlId = r.ReadUInt32();
            int x;

            if (Enum.IsDefined(typeof(Level), x = r.ReadInt32()))
            {
                Lv = (Level)x;
            }
            uId = r.ReadInt32();
            if (Enum.IsDefined(typeof(ExamineePhase), x = r.ReadInt32()))
            {
                mPhase = (ExamineePhase)x;
            }
            mAnsSheet.uQSLvId = r.ReadInt32();
            mAnsSheet.aAns    = r.ReadBytes(AnsSheet.LEN);
            int h, m;

            if (mPhase == ExamineePhase.Finished)
            {
                h = r.ReadInt32();
                m = r.ReadInt32();
                DT.Toh(h.ToString() + ':' + m, DT.h, out dtTim1);
                h = r.ReadInt32();
                m = r.ReadInt32();
                DT.Toh(h.ToString() + ':' + m, DT.h, out dtTim2);
            }
            else
            {
                h           = r.ReadInt32();
                m           = r.ReadInt32();
                kDtDuration = new TimeSpan(0, h, m);
            }
            bLog = true;
            return(true);
        }
Ejemplo n.º 2
0
 void Reset()
 {
     mDt         = DT.INV_H;
     Lv          = Level.A;
     uId         = (int)Level.MAX_COUNT_EACH_LEVEL;
     tName       = null;
     tBirdate    = null;
     tBirthplace = null;
     mPhase      = ExamineePhase.Signing;
     uGrade      = (int)Level.MAX_COUNT_EACH_LEVEL;
     dtTim1      = dtTim2 = DT.INV_;
     tComp       = string.Empty;
     mAnsSheet   = new AnsSheet();
     kDtDuration = new TimeSpan(0, 30, 0);
     tLog        = new StringBuilder();
 }