public TabModel[] GetTabsByType(MyCommon.TabUsageType tabType) { lock (LockObj) { return(this._tabs.Values .Where(x => x.TabType.HasFlag(tabType)) .ToArray()); } }
public TabModel GetTabByType(MyCommon.TabUsageType tabType) { //Home,Mentions,DM,Favは1つに制限する //その他のタイプを指定されたら、最初に合致したものを返す //合致しなければnullを返す lock (LockObj) { return(this._tabs.Values .FirstOrDefault(x => x.TabType.HasFlag(tabType))); } }
private void ComboUsage_SelectedIndexChanged(object sender, EventArgs e) { switch (ComboUsage.SelectedIndex) { case 0: _usage = MyCommon.TabUsageType.UserDefined; break; case 1: _usage = MyCommon.TabUsageType.Lists; break; case 2: _usage = MyCommon.TabUsageType.PublicSearch; break; default: _usage = MyCommon.TabUsageType.Undefined; break; } }
public void IsInnerStorage_Test(MyCommon.TabUsageType tabType, bool expected) { Assert.Equal(expected, tabType.IsInnerStorage()); }
public void IsDistributable_Test(MyCommon.TabUsageType tabType, bool expected) { Assert.Equal(expected, tabType.IsDistributable()); }
public void IsDefault_Test(MyCommon.TabUsageType tabType, bool expected) { Assert.Equal(expected, tabType.IsDefault()); }
private void ComboUsage_SelectedIndexChanged(object sender, EventArgs e) { switch (ComboUsage.SelectedIndex) { case 0: _usage = MyCommon.TabUsageType.UserDefined; break; case 1: _usage = MyCommon.TabUsageType.Lists; break; case 2: _usage = MyCommon.TabUsageType.PublicSearch; break; default: _usage = MyCommon.TabUsageType.Undefined; break; } }
public TabClass() { _innerPosts = new Dictionary<long, PostClass>(); Posts = _innerPosts; SoundFile = ""; TabName = ""; _filters = new List<PostFilterRule>(); Protected = false; Notify = true; SoundFile = ""; UnreadManage = true; _ids = new List<long>(); _tabType = MyCommon.TabUsageType.Undefined; _listInfo = null; }
public static bool IsInnerStorage(this MyCommon.TabUsageType tabType) => (tabType & InnerStorageTabTypeMask) != 0;
public static bool IsDistributable(this MyCommon.TabUsageType tabType) => (tabType & DistributableTabTypeMask) != 0;
public static bool IsDefault(this MyCommon.TabUsageType tabType) => (tabType & DefaultTabTypeMask) != 0;
/// <summary> /// デフォルトタブかどうかを示す値を取得します。 /// </summary> public static bool IsDefault(this MyCommon.TabUsageType tabType) { return((tabType & DefaultTabTypeMask) != 0); }