Example #1
0
        // 通过字符串构造对象
        public static TFSRecord GetObjectFormString(string strTFS)
        {
            // 【需求:AAAA】BALABALABALABALA
            // 【走查者】赵利平
            // 【走查时间】2018年2月28日
            // 【走查行数】100
            // 【1】[类型]实现逻辑[级别]严重[状态]Open[模块]硬件配置[位置]AutoThink.cpp Line:21[问题说明]内存泄露[修改说明]请补充
            // 【走查者】赵利平
            // 【走查时间】2018年2月28日
            // 【走查行数】100
            // 【走查结果】通过
            // strTFS = @"【需求:AAAA】BALABALABALABALA
            //          【走查者】赵利平
            //          【走查时间】2018年2月28日
            //          【走查行数】100
            //          【1】[类型]实现逻辑[级别]严重[状态]Open[模块]硬件配置[位置]AutoThink.cpp Line:21[问题说明]内存泄露[修改说明]请补充
            //          【走查者】赵利平
            //          【走查时间】2018年2月28日
            //          【走查行数】100
            //          【走查结果】通过";
            TFSRecord obj = new TFSRecord();

            string[] sArray = Regex.Split(strTFS, @"【走查者】", RegexOptions.IgnoreCase);

            // 解析签入信息
            string        strCheckin = sArray[0].Trim();
            CheckinRecord checkinObj = CheckinRecord.GetObjectFormString(strCheckin);

            if (checkinObj == null)
            { // 格式出错
                return(null);
            }

            obj.checkinObj = checkinObj;

            if (sArray.Count() > 1)
            { // 有Review信息
                int iCount = TFSRecord.GetSReviewCount(strTFS);
                for (int iIdx = 0; iIdx < iCount; ++iIdx)
                {
                    string       strReview = TFSRecord.GetReviewStringAt(strTFS, iIdx);
                    ReviewRecord reviewObj = ReviewRecord.GetObjectFormString(strReview);
                    if (reviewObj == null)
                    { // 格式出错
                        return(null);
                    }

                    obj.reviewObjList.Add(reviewObj);
                }
            }

            return(obj);
        }
Example #2
0
        /// <summary>
        /// 初始化界面数据
        /// </summary>
        private void InitData()
        {
            // 【需求:AAAA】BALABALABALABALA
            string    strContent = MainForm.m_tagTFSWindowInfo.m_strContent;
            TFSRecord obj        = TFSRecord.GetObjectFormString(strContent);

            if (obj != null)
            {
                // 将解析的结果赋值给控件
                code_type_comboBox.Text = obj.checkinObj.m_strType;
                code_info_textBox.Text  = obj.checkinObj.m_strTypeInfo;
                code_textBox.Text       = obj.checkinObj.m_strContent;

                // 根据解析信息更新数据
                GeneralCodeInfo();
            }
        }
Example #3
0
        // 通过对象生成格式化字符串
        public static string GetStringFormObject(TFSRecord obj)
        {
            string strRet = "";

            if (obj == null)
            {
                return(strRet);
            }

            strRet += CheckinRecord.GetStringFormObject(obj.checkinObj);
            for (int iIdx = 0; iIdx < obj.reviewObjList.Count(); ++iIdx)
            {
                ReviewRecord reviewObj = obj.reviewObjList[iIdx];
                strRet += "\r\n";

                strRet += ReviewRecord.GetStringFormObject(reviewObj);
            }

            return(strRet);
        }