コード例 #1
0
        public static TdrError.ErrorType tdrTime2Str(ref TdrVisualBuf buf, UInt32 time)
        {
            TdrError.ErrorType ret = TdrError.ErrorType.TDR_NO_ERROR;
            TdrTime            tm  = new TdrTime();

            ret = tm.parse(time);
            if (TdrError.ErrorType.TDR_NO_ERROR == ret)
            {
                ret = buf.sprintf("{0:d2}:{1:d2}:{2:d2}", tm.nHour, tm.bMin, tm.bSec);
            }
            else
            {
#if (DEBUG)
                StackTrace st = new StackTrace(true);
                for (int i = 0; i < st.FrameCount; i++)
                {
                    if (null != st.GetFrame(i).GetFileName())
                    {
                        Console.WriteLine(st.GetFrame(i).ToString());
                    }
                }
#endif
                ret = TdrError.ErrorType.TDR_ERR_INVALID_TDRTIME_VALUE;
            }

            return(ret);
        }
コード例 #2
0
ファイル: TdrTypeUtil.cs プロジェクト: isoundy000/wzry-1
        public static TdrError.ErrorType tdrTime2Str(ref TdrVisualBuf buf, uint time)
        {
            TdrTime time2 = new TdrTime();

            if (time2.parse(time) == TdrError.ErrorType.TDR_NO_ERROR)
            {
                object[] args = new object[] { time2.nHour, time2.bMin, time2.bSec };
                return(buf.sprintf("{0:d2}:{1:d2}:{2:d2}", args));
            }
            return(TdrError.ErrorType.TDR_ERR_INVALID_TDRTIME_VALUE);
        }
コード例 #3
0
ファイル: TdrTime.cs プロジェクト: ghrguse/ss
        public TdrError.ErrorType parse(ulong datetime)
        {
            TdrError.ErrorType ret = TdrError.ErrorType.TDR_NO_ERROR;

            uint date = (uint)(datetime & 0xFFFFFFFF);
            uint time = (uint)((datetime >> 32) & 0xFFFFFFFF);

            ret = tdrDate.parse(date);
            if (ret == TdrError.ErrorType.TDR_NO_ERROR)
            {
                ret = tdrTime.parse(time);
            }

            return(ret);
        }
コード例 #4
0
        public static TdrError.ErrorType tdrTime2Str(ref TdrVisualBuf buf, uint time)
        {
            TdrTime tdrTime = new TdrTime();

            TdrError.ErrorType result;
            if (tdrTime.parse(time) == TdrError.ErrorType.TDR_NO_ERROR)
            {
                result = buf.sprintf("{0:d2}:{1:d2}:{2:d2}", new object[]
                {
                    tdrTime.nHour,
                    tdrTime.bMin,
                    tdrTime.bSec
                });
            }
            else
            {
                result = TdrError.ErrorType.TDR_ERR_INVALID_TDRTIME_VALUE;
            }
            return(result);
        }