コード例 #1
0
        protected RiffChunk Chunk(IEnumerable <RiffChunk> chunks, string id)
        {
            RiffChunk chunk = null;

            foreach (var riffChunk in chunks)
            {
                if (riffChunk.Type == id)
                {
                    chunk = riffChunk;
                    break;
                }
            }
            if (chunk == null || chunk.Type != id)
            {
                throw new InvalidOperationException("Invalid " + FileFormatName + " file format");
            }
            return(chunk);
        }
コード例 #2
0
        protected RiffChunk Chunk(IEnumerable <RiffChunk> chunks, string id)
        {
            RiffChunk riffChunk1 = (RiffChunk)null;

            foreach (RiffChunk riffChunk2 in chunks)
            {
                if (riffChunk2.Type == (FourCC)id)
                {
                    riffChunk1 = riffChunk2;
                    break;
                }
            }
            if (riffChunk1 == null || riffChunk1.Type != (FourCC)id)
            {
                throw new InvalidOperationException("Invalid " + this.FileFormatName + " file format");
            }
            else
            {
                return(riffChunk1);
            }
        }