Here are the examples of the csharp api System.Collections.Generic.ICollection.Contains(RecordType) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
3 Examples
19
Source : HeaderExt.cs
with GNU General Public License v3.0
from Mutagen-Modding
with GNU General Public License v3.0
from Mutagen-Modding
internal static IEnumerable<SubrecordPinFrame> EnumerateSubrecords(ReadOnlyMemorySlice<byte> span, GameConstants meta, int loc, ICollection<RecordType> lengthOverflowTypes)
{
while (loc < span.Length)
{
var subFrame = new SubrecordPinFrame(meta, span.Slice(loc), loc);
if (lengthOverflowTypes.Contains(subFrame.RecordType))
{ // Length overflow record
var nextLen = subFrame.AsUInt32();
loc += subFrame.TotalLength;
var nextSpan = span.Slice(loc, checked((int)(nextLen + meta.SubConstants.HeaderLength)));
var subHeader = new SubrecordHeader(meta, nextSpan);
yield return SubrecordPinFrame.FactoryNoTrim(subHeader, nextSpan, loc);
loc += checked((int)(subHeader.HeaderLength + nextLen));
continue;
}
yield return subFrame;
loc += subFrame.TotalLength;
}
}
19
Source : HeaderExt.cs
with GNU General Public License v3.0
from Mutagen-Modding
with GNU General Public License v3.0
from Mutagen-Modding
public static IEnumerable<SubrecordPinFrame> EnumerateSubrecords(this MajorRecordFrame majorFrame, ICollection<RecordType> lengthOverflowTypes)
{
int loc = majorFrame.HeaderLength;
while (loc < majorFrame.HeaderAndContentData.Length)
{
var subFrame = new SubrecordPinFrame(majorFrame.Meta, majorFrame.HeaderAndContentData.Slice(loc), loc);
if (lengthOverflowTypes.Contains(subFrame.RecordType))
{ // Length overflow record
var nextLen = subFrame.AsUInt32();
loc += subFrame.TotalLength;
var span = majorFrame.HeaderAndContentData.Slice(loc, checked((int)(nextLen + majorFrame.Meta.SubConstants.HeaderLength)));
var subHeader = new SubrecordHeader(majorFrame.Meta, span);
yield return SubrecordPinFrame.FactoryNoTrim(subHeader, span, loc);
continue;
}
yield return subFrame;
loc += subFrame.TotalLength;
}
}
19
Source : RecordInterest.cs
with GNU General Public License v3.0
from Mutagen-Modding
with GNU General Public License v3.0
from Mutagen-Modding
public bool IsInterested(RecordType type)
{
if (InterestingTypes?.Count > 0)
{
if (!InterestingTypes.Contains(type)) return false;
}
else if (UninterestingTypes?.Count <= 0)
{
return this.EmptyMeansInterested;
}
return !UninterestingTypes?.Contains(type) ?? true;
}