本文整理汇总了C#中WikiFunctions.DBScanner.ArticleInfo类的典型用法代码示例。如果您正苦于以下问题:C# ArticleInfo类的具体用法?C# ArticleInfo怎么用?C# ArticleInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ArticleInfo类属于WikiFunctions.DBScanner命名空间,在下文中一共展示了ArticleInfo类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Check
public override bool Check(ArticleInfo article)
{
foreach (Regex r in Contains)
{
if (!r.IsMatch(article.Text))
return false;
}
return true;
}
开发者ID:svn2github,项目名称:autowikibrowser,代码行数:10,代码来源:Scanners.cs
示例2: Process
private void Process()
{
string articleTitle = "";
try
{
using (XmlTextReader reader = new XmlTextReader(stream))
{
reader.WhitespaceHandling = WhitespaceHandling.None;
if (From.Length > 0)
{
//move to start from article
while (reader.Read() && mRun)
{
if (reader.Name == "page")
{
reader.ReadToFollowing("title");
articleTitle = reader.ReadString();
if (From == articleTitle)
break;
}
}
}
while (reader.Read() && mRun)
{
if (reader.Name == "page")
{
ArticleInfo ai = new ArticleInfo();
reader.ReadToFollowing("title");
ai.Title = articleTitle = reader.ReadString();
//reader.ReadToFollowing(restriction); //TODO:This is wrong. Only want to read the restriction if in that <page></page>
if (reader.Name == "restrictions")
ai.Restrictions = reader.ReadString();
else
ai.Restrictions = "";
reader.ReadToFollowing("timestamp");
ai.Timestamp = reader.ReadString();
reader.ReadToFollowing("text");
ai.Text = reader.ReadString();
if (IgnoreComments)
ai.Text = WikiRegexes.Comments.Replace(ai.Text, "");
if (MultiThreaded)
{
if (PendingArticles.Count < ProcessorCount * 4 + 5)
{
PendingArticles.Add(ai);
}
else
{
ScanArticle(ai);
}
}
else
{
ScanArticle(ai);
}
}
}
lock (ScanThread)
{
stream = null;
}
if (MultiThreaded)
{
while (PendingArticles.Count > 0)
Thread.Sleep(10);
mRun = false;
foreach (Thread thr in SecondaryThreads)
thr.Join();
}
}
}
catch (ThreadAbortException) { }
catch (Exception ex)
{
if (boolMessage)
//System.Windows.Forms.MessageBox.Show("Problem on " + articleTitle + "\r\n\r\n" + ex.Message);
ErrorHandler.Handle(ex);
}
finally
{
if (boolMessage)
context.Post(SOPCstopped, articleTitle);
}
}
开发者ID:svn2github,项目名称:autowikibrowser,代码行数:98,代码来源:MainProcess.cs
示例3: ReadArticle
/// <summary>
/// Reads a page from the reader, returns ArticleInfo or null if EOF
/// </summary>
private ArticleInfo ReadArticle(XmlReader reader)
{
do
if (!reader.ReadToFollowing("page")) return null;
while (!reader.IsStartElement());
ArticleInfo ai = new ArticleInfo();
while (reader.Read() && reader.Name != "page") // stop on closing element
{
if (!reader.IsStartElement()) continue;
switch (reader.Name)
{
case "title":
ai.Title = reader.ReadString();
break;
case "timestamp":
ai.Timestamp = reader.ReadString();
break;
case "restrictions":
ai.Restrictions = reader.ReadString();
break;
case "text":
ai.Text = reader.ReadString();
break;
}
}
return ai.IsFullyRead ? ai : null;
}
开发者ID:reedy,项目名称:AutoWikiBrowser,代码行数:32,代码来源:MainProcess.cs
示例4: Check
public override bool Check(ArticleInfo article)
{
return Parsers.MissingDefaultSort(article.Text, article.Title);
}
开发者ID:svn2github,项目名称:awb,代码行数:4,代码来源:Scanners.cs
示例5: Check
public override bool Check(ArticleInfo article)
{
if (WikiRegexes.Category.IsMatch(article.Text))
return false;
foreach (Match m in WikiRegexes.Template.Matches(article.Text))
{
if (!m.Value.Contains("stub"))
return false;
}
return true;
}
开发者ID:svn2github,项目名称:autowikibrowser,代码行数:13,代码来源:Scanners.cs
示例6: ScanArticle
private void ScanArticle(ArticleInfo ai)
{
if (IgnoreComments)
ai.Text = WikiRegexes.Comments.Replace(ai.Text, "");
foreach (Scan z in Scanners)
{
if (!z.Check(ai))
{
return;
}
}
OutputQueue.Add(ai.Title);
}
开发者ID:reedy,项目名称:AutoWikiBrowser,代码行数:15,代码来源:MainProcess.cs
示例7: ScanArticle
private void ScanArticle(ArticleInfo ai)
{
foreach (Scan z in Scanners)
{
if (!z.Check(ref ai.Text, ref ai.Title, ai.Timestamp, ai.Restrictions))
{
return;
}
}
OutputQueue.Add(ai.Title);
}
开发者ID:svn2github,项目名称:autowikibrowser,代码行数:12,代码来源:MainProcess.cs
注:本文中的WikiFunctions.DBScanner.ArticleInfo类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论