本文整理汇总了C#中BlamVersion.HasFlag方法的典型用法代码示例。如果您正苦于以下问题:C# BlamVersion.HasFlag方法的具体用法?C# BlamVersion.HasFlag怎么用?C# BlamVersion.HasFlag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BlamVersion
的用法示例。
在下文中一共展示了BlamVersion.HasFlag方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: cbEngineVersionPopulate
void cbEngineVersionPopulate(BlamVersion valid_vers, BlamVersion[] invalid_versions)
{
cbEngineVersion.BeginUpdate();
var platform = valid_vers.ToPlatform();
bool has_platform = platform != BlamPlatform.Unknown;
var items = cbEngineVersion.Items;
#region Halo1
if (!has_platform)
{ if (valid_vers.HasFlag(BlamVersion.Halo1)) items.Add(BlamVersion.Halo1); }
else
{
if (valid_vers.HasFlag(BlamVersion.Halo1_Xbox)) items.Add(BlamVersion.Halo1_Xbox);
if (valid_vers.HasFlag(BlamVersion.Halo1_CE)) items.Add(BlamVersion.Halo1_CE); // CE is an extended version so it will always be added with Halo1_PC flags
if (valid_vers.HasFlag(BlamVersion.Halo1_PC)) items.Add(BlamVersion.Halo1_PC);
if (valid_vers.HasFlag(BlamVersion.Halo1_Mac)) items.Add(BlamVersion.Halo1_Mac);
}
#endregion
#region Halo2
if (!has_platform)
{ if (valid_vers.HasFlag(BlamVersion.Halo2)) items.Add(BlamVersion.Halo2); }
else
{
if (valid_vers.HasFlag(BlamVersion.Halo2_Alpha))items.Add(BlamVersion.Halo2_Alpha);
if (valid_vers.HasFlag(BlamVersion.Halo2_Xbox)) items.Add(BlamVersion.Halo2_Xbox);
if (valid_vers.HasFlag(BlamVersion.Halo2_PC)) items.Add(BlamVersion.Halo2_PC);
}
#endregion
#region Halo3
if (!has_platform)
{ if (valid_vers.HasFlag(BlamVersion.Halo3)) items.Add(BlamVersion.Halo3); }
else
{
if (valid_vers.HasFlag(BlamVersion.Halo3_Beta)) items.Add(BlamVersion.Halo3_Beta);
if (valid_vers.HasFlag(BlamVersion.Halo3_Xbox)) items.Add(BlamVersion.Halo3_Xbox);
//if (valid_vers.HasFlag(BlamVersion.Halo3_PC)) items.Add(BlamVersion.Halo3_PC);
}
#endregion
#region HaloOdst
if (!has_platform)
{ if (valid_vers.HasFlag(BlamVersion.HaloOdst)) items.Add(BlamVersion.HaloOdst); }
else
{
if (valid_vers.HasFlag(BlamVersion.HaloOdst_Xbox)) items.Add(BlamVersion.HaloOdst_Xbox);
//if (valid_vers.HasFlag(BlamVersion.HaloOdst_PC)) items.Add(BlamVersion.HaloOdst_PC);
}
#endregion
#region HaloReach
if (!has_platform)
{ if (valid_vers.HasFlag(BlamVersion.HaloReach)) items.Add(BlamVersion.HaloReach); }
else
{
if (valid_vers.HasFlag(BlamVersion.HaloReach_Beta)) items.Add(BlamVersion.HaloReach_Beta);
if (valid_vers.HasFlag(BlamVersion.HaloReach_Xbox)) items.Add(BlamVersion.HaloReach_Xbox);
//if (valid_vers.HasFlag(BlamVersion.HaloReach_PC)) items.Add(BlamVersion.HaloReach_PC);
}
#endregion
#region Stubbs
if (!has_platform)
{ if (valid_vers.HasFlag(BlamVersion.Stubbs)) items.Add(BlamVersion.Stubbs); }
else
{
if (valid_vers.HasFlag(BlamVersion.Stubbs_Xbox))items.Add(BlamVersion.Stubbs_Xbox);
if (valid_vers.HasFlag(BlamVersion.Stubbs_PC)) items.Add(BlamVersion.Stubbs_PC);
if (valid_vers.HasFlag(BlamVersion.Stubbs_Mac)) items.Add(BlamVersion.Stubbs_Mac);
}
#endregion
foreach (var ver in invalid_versions)
{
object verobj = ver;
if (items.Contains(verobj))
items.Remove(verobj);
}
cbEngineVersion.EndUpdate();
}