public EventKeyword CreateKeywordElement(string idEvent, string keywordValues)
        {
            string       keywordsParsed = keywordValues.Replace(",,", ",");
            EventKeyword newKeyword     = new EventKeyword(idEvent, keywordsParsed);

            return(newKeyword);
        }
        public List <EventKeyword> ReadAdfOutputFile(List <TeamSynonym> synonymsList)
        {
            List <EventKeyword> result = new List <EventKeyword>();

            try {
                using (var reader = new StreamReader(keywordPath, Encoding.Default))
                    using (var csv = new CsvReader(reader, System.Globalization.CultureInfo.CurrentCulture)) {
                        csv.Configuration.RegisterClassMap <AdfOutputMap>();
                        csv.Configuration.HeaderValidated   = null;
                        csv.Configuration.MissingFieldFound = null;
                        var records = csv.GetRecords <AdfOutput>().ToList();

                        foreach (AdfOutput elem in records)
                        {
                            string       keywordsMerged = MergeSynonymsListToKeywordsList(synonymsList, elem.Keywords);
                            EventKeyword currentKeyword = CreateKeywordElement(elem.IdEvent, keywordsMerged);
                            result.Add(currentKeyword);
                        }

                        return(result);
                    }
            } catch (Exception e) {
                throw new Exception(e.Message);
            }
        }
        public void 事件关键字()
        {
            EventKeyword eventKeyword = EventKeyword.Virtual;
            var          output       = EnumCache.GetEventKeyword(eventKeyword);

            Assert.Equal("virtual", output);

            output = EnumCache.GetValue(eventKeyword);
            Assert.Equal("virtual", output);
        }
示例#4
0
 public static string GetEventKeyword(EventKeyword value)
 {
     return(_EventKeyword.Value[value]);
 }
示例#5
0
 /// <summary>
 /// 事件关键字
 /// </summary>
 /// <param name="keyword"><see cref="EventKeyword"/></param>
 /// <returns></returns>
 public TBuilder WithKeyword(EventKeyword keyword)
 {
     _variable.Keyword = RoslynHelper.GetName(keyword);
     return(_TBuilder);
 }
示例#6
0
 /// <summary>
 /// 事件关键字
 /// </summary>
 /// <param name="keyword"><see cref="EventKeyword"/></param>
 /// <returns></returns>
 public TBuilder WithKeyword(EventKeyword keyword)
 {
     _variable.Keyword = EnumCache.GetValue(keyword);
     return(_TBuilder);
 }