本文整理汇总了C#中OpenTween.TabClass.Contains方法的典型用法代码示例。如果您正苦于以下问题:C# TabClass.Contains方法的具体用法?C# TabClass.Contains怎么用?C# TabClass.Contains使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OpenTween.TabClass
的用法示例。
在下文中一共展示了TabClass.Contains方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreatePostsFromJson
private string CreatePostsFromJson(string content, MyCommon.WORKERTYPE gType, TabClass tab, bool read, ref long minimumId)
{
TwitterStatus[] items;
try
{
items = TwitterStatus.ParseJsonArray(content);
}
catch(SerializationException ex)
{
MyCommon.TraceOut(ex.Message + Environment.NewLine + content);
return "Json Parse Error(DataContractJsonSerializer)";;
}
catch(Exception ex)
{
MyCommon.TraceOut(ex, MethodBase.GetCurrentMethod().Name + " " + content);
return "Invalid Json!";
}
foreach (var status in items)
{
PostClass post = null;
post = CreatePostsFromStatusData(status);
if (post == null) continue;
if (minimumId > post.StatusId) minimumId = post.StatusId;
//二重取得回避
lock (LockObj)
{
if (tab == null)
{
if (TabInformations.GetInstance().ContainsKey(post.StatusId)) continue;
}
else
{
if (tab.Contains(post.StatusId)) continue;
}
}
//RT禁止ユーザーによるもの
if (gType != MyCommon.WORKERTYPE.UserTimeline &&
post.RetweetedByUserId != null && this.noRTId.Contains(post.RetweetedByUserId.Value)) continue;
post.IsRead = read;
if (post.IsMe && !read && _readOwnPost) post.IsRead = true;
if (tab != null) post.RelTabName = tab.TabName;
//非同期アイコン取得&StatusDictionaryに追加
TabInformations.GetInstance().AddPost(post);
}
return "";
}
示例2: CreatePostsFromSearchJson
private string CreatePostsFromSearchJson(string content, TabClass tab, bool read, int count, ref long minimumId, bool more)
{
TwitterSearchResult items;
try
{
items = TwitterSearchResult.ParseJson(content);
}
catch (SerializationException ex)
{
MyCommon.TraceOut(ex.Message + Environment.NewLine + content);
return "Json Parse Error(DataContractJsonSerializer)";
}
catch (Exception ex)
{
MyCommon.TraceOut(ex, MethodBase.GetCurrentMethod().Name + " " + content);
return "Invalid Json!";
}
foreach (var result in items.Statuses)
{
PostClass post = null;
post = CreatePostsFromStatusData(result);
if (post == null)
{
// Search API は相変わらずぶっ壊れたデータを返すことがあるため、必要なデータが欠如しているものは取得し直す
var ret = this.GetStatusApi(read, result.Id, ref post);
if (!string.IsNullOrEmpty(ret)) continue;
}
if (minimumId > post.StatusId) minimumId = post.StatusId;
if (!more && post.StatusId > tab.SinceId) tab.SinceId = post.StatusId;
//二重取得回避
lock (LockObj)
{
if (tab == null)
{
if (TabInformations.GetInstance().ContainsKey(post.StatusId)) continue;
}
else
{
if (tab.Contains(post.StatusId)) continue;
}
}
post.IsRead = read;
if ((post.IsMe && !read) && this._readOwnPost) post.IsRead = true;
if (tab != null) post.RelTabName = tab.TabName;
//非同期アイコン取得&StatusDictionaryに追加
TabInformations.GetInstance().AddPost(post);
}
return "";
}
示例3: CreatePostsFromSearchJson
private long? CreatePostsFromSearchJson(string content, TabClass tab, bool read, int count, bool more)
{
TwitterSearchResult items;
try
{
items = TwitterSearchResult.ParseJson(content);
}
catch (SerializationException ex)
{
MyCommon.TraceOut(ex.Message + Environment.NewLine + content);
throw new WebApiException("Json Parse Error(DataContractJsonSerializer)", content, ex);
}
catch (Exception ex)
{
MyCommon.TraceOut(ex, MethodBase.GetCurrentMethod().Name + " " + content);
throw new WebApiException("Invalid Json!", content, ex);
}
long? minimumId = null;
foreach (var result in items.Statuses)
{
PostClass post = null;
post = CreatePostsFromStatusData(result);
if (post == null)
{
// Search API は相変わらずぶっ壊れたデータを返すことがあるため、必要なデータが欠如しているものは取得し直す
try
{
post = this.GetStatusApi(read, result.Id);
}
catch (WebApiException)
{
continue;
}
}
if (minimumId == null || minimumId.Value > post.StatusId)
minimumId = post.StatusId;
if (!more && post.StatusId > tab.SinceId) tab.SinceId = post.StatusId;
//二重取得回避
lock (LockObj)
{
if (tab == null)
{
if (TabInformations.GetInstance().ContainsKey(post.StatusId)) continue;
}
else
{
if (tab.Contains(post.StatusId)) continue;
}
}
post.IsRead = read;
if ((post.IsMe && !read) && this._readOwnPost) post.IsRead = true;
//非同期アイコン取得&StatusDictionaryに追加
if (tab != null && tab.IsInnerStorageTabType)
tab.AddPostToInnerStorage(post);
else
TabInformations.GetInstance().AddPost(post);
}
return minimumId;
}