public static KeywordModel AddKeyword(this EventSourceModel that, string keywordName)
        {
            var maxKeywordValue = that.Keywords.Max(k => k.Value) ?? 0;
            var newKeyword      = new KeywordModel()
            {
                Name  = "Error",
                Value = (maxKeywordValue == 0 ? 1 : maxKeywordValue * 2)
            };
            var keywords = new List <KeywordModel>(that.Keywords)
            {
                newKeyword
            };

            that.Keywords = that.Keywords.Add(newKeyword);

            return(newKeyword);
        }
 public static KeywordModel GetKeyword(this EventSourceModel that, string keywordName)
 {
     return(that.Keywords.GetKeyword(keywordName));
 }
示例#3
0
 public static ProjectItem GetItemForContent(this Project that, EventSourceModel eventSource)
 {
     return(that.ProjectItems.FirstOrDefault(item => (item.Content as EventSourceModel)?.Include == eventSource.Include));
 }