本文整理汇总了C#中BindingList.IsFilled方法的典型用法代码示例。如果您正苦于以下问题:C# BindingList.IsFilled方法的具体用法?C# BindingList.IsFilled怎么用?C# BindingList.IsFilled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BindingList
的用法示例。
在下文中一共展示了BindingList.IsFilled方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ScrapeWriters
/// <summary>
/// Scrapes the writers value
/// </summary>
/// <param name="id">The MovieUniqueId for the scraper.</param>
/// <param name="threadID">The thread MovieUniqueId.</param>
/// <param name="output">The scraped runtime value.</param>
/// <param name="logCatagory">The log catagory.</param>
/// <returns>Scrape succeeded [true/false]</returns>
public new bool ScrapeWriters(string id, int threadID, out BindingList<PersonModel> output, string logCatagory)
{
output = new BindingList<PersonModel>();
try
{
output = YRegex.MatchesToPersonList(
"сценарий(?<writers>.*?)</td></tr>",
this.GetHtml("main", threadID, id),
"writers",
true);
return output.IsFilled();
}
catch (Exception ex)
{
Log.WriteToLog(LogSeverity.Error, threadID, logCatagory, ex.Message);
return false;
}
}
示例2: ScrapeCast
/// <summary>
/// Scrapes the Cast collection.
/// </summary>
/// <param name="id">The MovieUniqueId for the scraper.</param>
/// <param name="threadID">The thread MovieUniqueId.</param>
/// <param name="output">The scraped Cast value.</param>
/// <param name="logCatagory">The log catagory.</param>
/// <returns>Scrape succeeded [true/false]</returns>
public new bool ScrapeCast(string id, int threadID, out BindingList<PersonModel> output, string logCatagory)
{
output = new BindingList<PersonModel>();
try
{
var html = this.GetHtml("main", threadID, id);
output = YRegex.MatchDelimitedToList(
"Cast.*?=\"2\">(?<cast>.*?)</f",
html,
"cast",
',',
true)
.ToPersonList();
return output.IsFilled();
}
catch (Exception ex)
{
Log.WriteToLog(LogSeverity.Error, threadID, logCatagory, ex.Message);
return false;
}
}
示例3: ScrapeCountry
/// <summary>
/// Scrapes the Country copllection
/// </summary>
/// <param name="id">The Id for the scraper.</param>
/// <param name="threadID">The thread MovieUniqueId.</param>
/// <param name="output">The scraped Country collection.</param>
/// <param name="logCatagory">The log catagory.</param>
/// <returns>
/// Scrape succeeded [true/false]
/// </returns>
public new bool ScrapeCountry(string id, int threadID, out BindingList<string> output, string logCatagory)
{
output = new BindingList<string>();
try
{
output = YRegex.MatchDelimitedToList(
"Nazione:(?<country>.*?)Anno", this.GetHtml("main", threadID, id), "country", ',', true);
return output.IsFilled();
}
catch (Exception ex)
{
Log.WriteToLog(LogSeverity.Error, threadID, logCatagory, ex.Message);
return false;
}
}
示例4: ScrapeCountry
/// <summary>
/// Scrapes the Country copllection
/// </summary>
/// <param name="id">The MovieUniqueId for the scraper.</param>
/// <param name="threadID">The thread MovieUniqueId.</param>
/// <param name="output">The scraped Country collection.</param>
/// <param name="logCatagory">The log catagory.</param>
/// <returns>Scrape succeeded [true/false]</returns>
public new bool ScrapeCountry(string id, int threadID, out BindingList<string> output, string logCatagory)
{
output = new BindingList<string>();
try
{
var html = this.GetHtml("main", threadID, id);
output = YRegex.MatchesToList("Kat=Land&Text=(?<country>.*?)\"", html, "country", true);
return output.IsFilled();
}
catch (Exception ex)
{
Log.WriteToLog(LogSeverity.Error, threadID, logCatagory, ex.Message);
return false;
}
}
示例5: ScrapeDirector
/// <summary>
/// Scrapes the Director value
/// </summary>
/// <param name="id">The MovieUniqueId for the scraper.</param>
/// <param name="threadID">The thread MovieUniqueId.</param>
/// <param name="output">The scraped Director value.</param>
/// <param name="logCatagory">The log catagory.</param>
/// <returns>Scrape succeeded [true/false]</returns>
public new bool ScrapeDirector(string id, int threadID, out BindingList<PersonModel> output, string logCatagory)
{
output = new BindingList<PersonModel>();
try
{
output = YRegex.MatchDelimitedToList(
@"Regia:.*?=""2"">(?<director>.*?)</font",
this.GetHtml("main", threadID, id),
"director",
',', true).ToPersonList();
return output.IsFilled();
}
catch (Exception ex)
{
Log.WriteToLog(LogSeverity.Error, threadID, logCatagory, ex.Message);
return false;
}
}
示例6: ScrapeWriters
/// <summary>
/// Scrapes the writers value
/// </summary>
/// <param name="id">The MovieUniqueId for the scraper.</param>
/// <param name="threadID">The thread MovieUniqueId.</param>
/// <param name="output">The scraped runtime value.</param>
/// <param name="logCatagory">The log catagory.</param>
/// <returns>Scrape succeeded [true/false]</returns>
public new bool ScrapeWriters(string id, int threadID, out BindingList<PersonModel> output, string logCatagory)
{
output = new BindingList<PersonModel>();
try
{
output = YRegex.MatchesToPersonList(
@"reżyseria(?<director>.*?)scenariusz",
this.GetHtml("main", threadID, id),
"runtime",
true);
return output.IsFilled();
}
catch (Exception ex)
{
Log.WriteToLog(LogSeverity.Error, threadID, logCatagory, ex.Message);
return false;
}
}
示例7: ScrapeTrailer
//.........这里部分代码省略.........
if (atsm != null && !atsm.error)
{
for (int i = 0; i < atsm.results.Count; i++)
{
if (atsm.results[i].title.ToLower() == id.ToLower())
{
if ((itmsIndex = atsm.results[i].location.IndexOf("itms://")) != -1)
{
moviePage = "http" + atsm.results[i].location.Substring(itmsIndex + 4);
}
else
{
moviePage = this.GetAbsoluteURL(
"http://trailers.apple.com/trailers/", atsm.results[i].location);
}
string moviePlaylist = this.GetAbsoluteURL(moviePage, "includes/playlists/web.inc");
html = Downloader.ProcessDownload(moviePage, DownloadType.Html, Section.Movies);
matchCollection = trailerRegex.Matches(html);
if (matchCollection.Count != 0)
{
foreach (Match trailerMatch in matchCollection)
{
int lastUnderscore = trailerMatch.Value.LastIndexOf('_');
if (lastUnderscore == -1) continue;
if (trailerMatch.Value[lastUnderscore+1] != 'h')
{
output.Add(
new TrailerDetailsModel(
trailerMatch.Value.Insert(lastUnderscore + 1, "h"),
"0",
"Unk",
atsm.results[i].title));
}
else
{
if (trailerMatch.Value[lastUnderscore + 2] == '.')
output.Add(
new TrailerDetailsModel(
trailerMatch.Value.Remove(lastUnderscore + 2, 1),
"0",
"Unk",
atsm.results[i].title));
else
output.Add(new TrailerDetailsModel(trailerMatch.Value, "0", "Unk", atsm.results[i].title));
}
}
continue;
}
html = Downloader.ProcessDownload(moviePlaylist, DownloadType.Html, Section.Movies);
matchCollection = trailerRegex.Matches(html);
if (matchCollection.Count != 0)
{
foreach (Match trailerMatch in matchCollection)
{
int lastUnderscore = trailerMatch.Value.LastIndexOf('_');
if (lastUnderscore == -1) continue;
if (trailerMatch.Value[lastUnderscore + 1] != 'h')
{
output.Add(
new TrailerDetailsModel(
trailerMatch.Value.Insert(lastUnderscore + 1, "h"),
"0",
"Unk",
atsm.results[i].title));
}
else
{
if (trailerMatch.Value[lastUnderscore + 2] == '.')
output.Add(
new TrailerDetailsModel(
trailerMatch.Value.Remove(lastUnderscore + 2, 1),
"0",
"Unk",
atsm.results[i].title));
else
output.Add(new TrailerDetailsModel(trailerMatch.Value, "0", "Unk", atsm.results[i].title));
}
}
continue;
}
}
}
return output.IsFilled();
}
return false;
}
catch (Exception ex)
{
Log.WriteToLog(LogSeverity.Error, threadID, logCatagory, ex.Message);
return false;
}
}
示例8: ScrapeDirector
/// <summary>
/// Scrapes the Director value
/// </summary>
/// <param name="id">The MovieUniqueId for the scraper.</param>
/// <param name="threadID">The thread MovieUniqueId.</param>
/// <param name="output">The scraped Director value.</param>
/// <param name="logCatagory">The log catagory.</param>
/// <returns>Scrape succeeded [true/false]</returns>
public new bool ScrapeDirector(string id, int threadID, out BindingList<PersonModel> output, string logCatagory)
{
output = new BindingList<PersonModel>();
try
{
var directors = YRegex.Match(
@"Directed By (?<director>.*?)\.",
this.GetHtml("main", threadID, id),
"director",
true);
directors = Tools.Clean.Text.ValidizeResult(directors);
output = directors
.Split(',')
.ToPersonList();
return output.IsFilled();
}
catch (Exception ex)
{
Log.WriteToLog(LogSeverity.Error, threadID, logCatagory, ex.Message);
return false;
}
}
示例9: ScrapeCountry
/// <summary>
/// Scrapes the Country copllection
/// </summary>
/// <param name="id">The MovieUniqueId for the scraper.</param>
/// <param name="threadID">The thread MovieUniqueId.</param>
/// <param name="output">The scraped Country collection.</param>
/// <param name="logCatagory">The log catagory.</param>
/// <returns>Scrape succeeded [true/false]</returns>
public new bool ScrapeCountry(string id, int threadID, out BindingList<string> output, string logCatagory)
{
output = new BindingList<string>();
try
{
var match = YRegex.MatchesToList(
"<a href=\"/country/.{0,30}?\">(?<country>.*?)</a>",
this.GetHtml("main", threadID, id),
"country",
true);
foreach (var country in match)
{
if (Equals(country, "UK"))
{
output.Add("United Kingdom");
}
else if (!country.ToLower(CultureInfo.CurrentCulture).Contains("imdb"))
{
output.Add(Tools.Clean.Text.ValidizeResult(country));
}
}
return output.IsFilled();
}
catch (Exception ex)
{
Log.WriteToLog(LogSeverity.Error, threadID, logCatagory, ex.Message);
return false;
}
}
示例10: ScrapeCast
/// <summary>
/// Scrapes the Cast collection.
/// </summary>
/// <param name="id">The MovieUniqueId for the scraper.</param>
/// <param name="threadID">The thread MovieUniqueId.</param>
/// <param name="output">The scraped Cast value.</param>
/// <param name="logCatagory">The log catagory.</param>
/// <returns>Scrape succeeded [true/false]</returns>
public new bool ScrapeCast(string id, int threadID, out BindingList<PersonModel> output, string logCatagory)
{
output = new BindingList<PersonModel>();
try
{
output = YRegex.MatchesToPersonList(
@"<img width=38 height=50 src=""(?<thumb>.{30,50})"" alt="".*?""></span>\s(?<name>.*?)\s</a></h3><div>\s(?<role>.*?)\s</div>",
this.GetHtml("main", threadID, id),
"name",
"role",
"thumb");
return output.IsFilled();
}
catch (Exception ex)
{
Log.WriteToLog(LogSeverity.Error, threadID, logCatagory, ex.Message);
return false;
}
}
示例11: ScrapePoster
/// <summary>
/// Scrapes the poster image collection.
/// </summary>
/// <param name="id">The MovieUniqueId for the scraper.</param>
/// <param name="threadID">The thread MovieUniqueId.</param>
/// <param name="output">The scraped poster image collection.</param>
/// <param name="logCatagory">The log catagory.</param>
/// <returns>Scrape succeeded [true/false]</returns>
public new bool ScrapePoster(string id, int threadID, out BindingList<ImageDetailsModel> output, string logCatagory)
{
output = new BindingList<ImageDetailsModel>();
try
{
var posterSmall = YRegex.Match(
@"<div\sclass=posterLightbox><a\srel=""v:image""\shref=""(?<poster>.*?)""\sclass=film_mini>",
this.GetHtml("main", threadID, id),
"poster");
var posterBig = posterSmall.Replace(".2.jpg", ".3.jpg");
output.Add(new ImageDetailsModel { UriFull = new Uri(posterBig), UriThumb = new Uri(posterSmall) });
return output.IsFilled();
}
catch (Exception ex)
{
Log.WriteToLog(LogSeverity.Error, threadID, logCatagory, ex.Message);
return false;
}
}
示例12: ScrapeGenre
/// <summary>
/// Scrapes the Genre collection
/// </summary>
/// <param name="id">The MovieUniqueId for the scraper.</param>
/// <param name="threadID">The thread MovieUniqueId.</param>
/// <param name="output">The scraped Year collection.</param>
/// <param name="logCatagory">The log catagory.</param>
/// <returns>Scrape succeeded [true/false]</returns>
public new bool ScrapeGenre(string id, int threadID, out BindingList<string> output, string logCatagory)
{
output = new BindingList<string>();
try
{
output = YRegex.MatchesToList(
@"<a href=""/search/film\?genreIds=\d{1,2}"">(?<genre>.*?)</a",
this.GetHtml("main", threadID, id),
"genre",
true);
return output.IsFilled();
}
catch (Exception ex)
{
Log.WriteToLog(LogSeverity.Error, threadID, logCatagory, ex.Message);
return false;
}
}
示例13: ScrapeFanart
/// <summary>
/// Scrapes the fanart image collection.
/// </summary>
/// <param name="id">The MovieUniqueId for the scraper.</param>
/// <param name="threadID">The thread MovieUniqueId.</param>
/// <param name="output">The scraped fanart image collection.</param>
/// <param name="logCatagory">The log catagory.</param>
/// <returns>Scrape succeeded [true/false]</returns>
public new bool ScrapeFanart(string id, int threadID, out BindingList<ImageDetailsModel> output, string logCatagory)
{
output = new BindingList<ImageDetailsModel>();
try
{
var fanartDownloadHtml =
Downloader.ProcessDownload(string.Format("http://www.kinopoisk.ru/level/12/film/{0}/", id), DownloadType.Html, Section.Movies).
RemoveCharacterReturn();
var fanartMatches = YRegex.Matches(
@"/picture/(?<fanart>\d*?)/w_size/1024/",
fanartDownloadHtml,
"fanart");
foreach (var s in fanartMatches)
{
var downloadFanartHtml =
Downloader.ProcessDownload(string.Format("http://www.kinopoisk.ru/picture/{0}/w_size/1024/", s), DownloadType.Html, Section.Movies).
RemoveCharacterReturn();
var match = Regex.Match(
downloadFanartHtml,
" src='(?<url>http://st.*?)' width='1024'");
if (match.Success)
{
output.Add(new ImageDetailsModel { UriFull = new Uri(match.Groups["url"].Value) });
}
}
return output.IsFilled();
}
catch (Exception ex)
{
Log.WriteToLog(LogSeverity.Error, threadID, logCatagory, ex.Message);
return false;
}
}
示例14: ScrapePoster
/// <summary>
/// Scrapes the poster image collection.
/// </summary>
/// <param name="id">The MovieUniqueId for the scraper.</param>
/// <param name="threadID">The thread MovieUniqueId.</param>
/// <param name="output">The scraped poster image collection.</param>
/// <param name="logCatagory">The log catagory.</param>
/// <returns>Scrape succeeded [true/false]</returns>
public new bool ScrapePoster(string id, int threadID, out BindingList<ImageDetailsModel> output, string logCatagory)
{
output = new BindingList<ImageDetailsModel>();
try
{
var posterDownloadHtml =
Downloader.ProcessDownload(string.Format("http://www.kinopoisk.ru/level/17/film/{0}/page/1/", id), DownloadType.Html, Section.Movies).
RemoveCharacterReturn();
var posterDownloadHtml2 =
Downloader.ProcessDownload(string.Format("http://www.kinopoisk.ru/level/17/film/{0}/page/2/", id), DownloadType.Html, Section.Movies).
RemoveCharacterReturn();
if (Regex.Match(posterDownloadHtml2, "#ff6600\"><b style=\"color:#ffffff\">2</b>").Success)
{
posterDownloadHtml += posterDownloadHtml2;
}
var matches =
Regex.Matches(
@"<a href=""/picture/(?<number>\d*)/"" target=""_blank"" title="".*?""></a>",
posterDownloadHtml);
foreach (string m in matches)
{
var posterDownloadHtml3 =
Downloader.ProcessDownload(string.Format("http://www.kinopoisk.ru/picture/{0}/", m), DownloadType.Html, Section.Movies).
RemoveCharacterReturn();
var match = Regex.Match(posterDownloadHtml3, @"<tr><td width=\d*><a href="".*?""><img alt="".*?"" src='(?<imageurl>.*?)' width='\d*' height='\d*' style="".*?"" onload=''></a></td></tr>");
if (match.Success)
{
output.Add(new ImageDetailsModel { UriFull = new Uri(match.Groups["imageurl"].Value) });
}
}
return output.IsFilled();
}
catch (Exception ex)
{
Log.WriteToLog(LogSeverity.Error, threadID, logCatagory, ex.Message);
return false;
}
}
示例15: ScrapeCast
/// <summary>
/// Scrapes the Cast collection.
/// </summary>
/// <param name="id">The MovieUniqueId for the scraper.</param>
/// <param name="threadID">The thread MovieUniqueId.</param>
/// <param name="output">The scraped Cast value.</param>
/// <param name="logCatagory">The log catagory.</param>
/// <returns>Scrape succeeded [true/false]</returns>
public new bool ScrapeCast(string id, int threadID, out BindingList<PersonModel> output, string logCatagory)
{
output = new BindingList<PersonModel>();
try
{
var htmlBlock = YRegex.Match(
@"<th scope=""col"">Bohater</th>(?<actorblock>.*?)zobacz więcej",
this.GetHtml("main", threadID, id),
"actorblock");
htmlBlock = Regex.Replace(htmlBlock.Replace("\t", string.Empty), @"\s{2,}", " ");
output = YRegex.MatchesToPersonList(
@"<img.*?rc=""(?<thumb>.*?)""\stitle="".*?""\salt=.*?>\s(?<name>.*?)</a></td>\s<td.*?>\s(?<role>.*?)\s<s.*?</tr>",
htmlBlock,
"name",
"role",
"thumb");
return output.IsFilled();
}
catch (Exception ex)
{
Log.WriteToLog(LogSeverity.Error, threadID, logCatagory, ex.Message);
return false;
}
}