当前位置: 首页>>代码示例>>C#>>正文


C# Entry.PostCreation方法代码示例

本文整理汇总了C#中Entry.PostCreation方法的典型用法代码示例。如果您正苦于以下问题:C# Entry.PostCreation方法的具体用法?C# Entry.PostCreation怎么用?C# Entry.PostCreation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Entry的用法示例。


在下文中一共展示了Entry.PostCreation方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ParseTextLine

        private Entry ParseTextLine(string line, Entry lastEntry, bool enable_format_detection)
        {
            Match m = textlineReg.Match(line);

            if (!m.Success && enable_format_detection)
            {
                int i = textLinePatterns.IndexOf(textlineReg) + 1;
                if (i > 0 && i < textLinePatterns.Count)
                {
                    textlineReg = textLinePatterns[i];
                    m = textlineReg.Match(line);
                }
            }

            Entry test = null;
            if (m.Success)
            {
                test = new Entry();
                string[] gn = textlineReg.GetGroupNames();
                if (gn.Contains("y") && gn.Contains("m") && gn.Contains("d") && gn.Contains("h") && gn.Contains("i") && gn.Contains("s"))
                {
                    test.Created = new DateTime(
                        int.Parse(m.Groups["y"].Value), txtToMonth(m.Groups["m"].Value), int.Parse(m.Groups["d"].Value),
                        int.Parse(m.Groups["h"].Value), int.Parse(m.Groups["i"].Value), int.Parse(m.Groups["s"].Value)
                        );
                }
                else if (gn.Contains("date"))
                    test.Created = DateTime.Parse(m.Groups["date"].Value);

                test.Severity = gn.Contains("sev")?m.Groups["sev"].Value:"";
                test.Categories = gn.Contains("cat") ? new List<string>(m.Groups["cat"].Value.Split(categorySplitter)) : new List<string>();
                test.Message = gn.Contains("msg")?m.Groups["msg"].Value:"";
                return test;
            }

            if (lastEntry == null)
            {
                lastEntry.Message += "\n" + line;
                lastEntry.PostCreation();
            }
            return null;
        }
开发者ID:rtoi,项目名称:WebFramework,代码行数:42,代码来源:LogView.cs

示例2: AddToBuffer

        private void AddToBuffer(Entry o)
        {
            if (InvokeRequired)
            {
                Invoke(new AddEntryDelegate(AddToBuffer), new object[] { o });
                return;
            }
            o.PostCreation();
            buffer.Add(o);
            foreach (string c in o.Categories)
            {
                if (!knownCategories.Contains(c))
                    knownCategories.Add(c);
            }

            if (!knownSeverities.Contains(o.Severity))
                knownSeverities.Add(o.Severity);

            if (parser != null || IsVisibleItem(o))
            {
                visibleItems.Add(o);
                autoScrollNeeded = true;
            }
        }
开发者ID:rtoi,项目名称:WebFramework,代码行数:24,代码来源:LogView.cs

示例3: ParseTextLine

        private Entry ParseTextLine(string line, Entry lastEntry, bool enable_format_detection)
        {
            Match m = textlineReg.Match(line);

            if (!m.Success && enable_format_detection)
            {
                textlineReg = textlineReg2;
                m = textlineReg.Match(line);
            }

            Entry test = null;
            if (m.Success)
            {
                test = new Entry();
                test.Created = DateTime.Parse(m.Groups[1].Value);
                if (m.Groups.Count < 4)
                {
                    test.Severity = "";
                    test.Categories = new List<string>();
                    test.Message = m.Groups[2].Value;
                }
                else
                {
                    test.Severity = m.Groups[2].Value;
                    test.Categories = new List<string>(m.Groups[3].Value.Split(categorySplitter));
                    test.Message = m.Groups[4].Value;
                }
                return test;
            }

            if (lastEntry == null)
            {
                lastEntry.Message += "\n" + line;
                lastEntry.PostCreation();
            }
            return null;
        }
开发者ID:rituraj64,项目名称:WebFramework,代码行数:37,代码来源:LogView.cs


注:本文中的Entry.PostCreation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。