当前位置: 首页>>代码示例>>C#>>正文


C# Sequence.IndexOf方法代码示例

本文整理汇总了C#中Sequence.IndexOf方法的典型用法代码示例。如果您正苦于以下问题:C# Sequence.IndexOf方法的具体用法?C# Sequence.IndexOf怎么用?C# Sequence.IndexOf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Sequence的用法示例。


在下文中一共展示了Sequence.IndexOf方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: VerifySongData

        List<string> VerifySongData(string midiTrackName, Sequence midiSequence, SongCacheItem songCacheItem)
        {
            var fileErrors = new List<string>();
            try
            {
                if (midiSequence.FirstOrDefault() == null)
                {
                    fileErrors.Add("No Tracks");
                }
                else
                {
                    var proTracks = midiSequence.Skip(1).ToList();
                    foreach (var track in proTracks)
                    {
                        if (track.Name != null && track.Name == "(no name)")
                        {
                            fileErrors.Add("******** Missing Track Name: " + (track.Name ?? ""));
                        }
                        else if (track.Name.IsProTrackName() == false)
                        {
                            fileErrors.Add("Invalid Track Name: " + (track.Name ?? ""));
                        }
                    }
                }
                foreach (var track in midiSequence)
                {
                    if (track.Name.IsEmpty())
                    {
                        fileErrors.Add("Null track name");
                    }
                    else if (track.Name.IsProTrackName() && midiSequence.IndexOf(track) == 0)
                    {
                        fileErrors.Add("Tempo must be first track");
                    }
                }

                var tracks = midiSequence.GetGuitarBassTracks().ToList();
                bool foundGuitarTrack = tracks.Any(x => x.Name.IsGuitarTrackName());
                bool foundBassTrack = tracks.Any(x => x.Name.IsBassTrackName());
                bool foundGuitar22 = tracks.Any(x => x.Name.IsGuitarTrackName22());
                bool foundBass22 = tracks.Any(x => x.Name.IsBassTrackName22());
                bool foundGuitar17 = tracks.Any(x => x.Name.IsGuitarTrackName17());
                bool foundBass17 = tracks.Any(x => x.Name.IsBassTrackName17());

                if (foundGuitarTrack == false)
                {
                    fileErrors.Add("No pro guitar track in midi file: " + midiTrackName);
                }
                if (foundBassTrack == false && (songCacheItem != null && songCacheItem.HasBass == true))
                {
                    fileErrors.Add("No pro bass track in midi file: " + midiTrackName);
                }

                if (foundGuitar22 == true && foundGuitar17 == false)
                {
                    fileErrors.Add("No 17 fret pro guitar track in file: " + midiTrackName);
                }
                if (foundBass22 == true && foundBass17 == false)
                {
                    fileErrors.Add("No 17 fret pro bass track in file: " + midiTrackName);
                }

                foreach (var currentTrack in tracks)
                {

                    var currentTrackName = currentTrack.Name ?? "(no name)";

                    if (!EditorPro.SetTrack6(midiSequence, currentTrack, GuitarDifficulty.Expert))
                    {
                        fileErrors.Add(currentTrackName + " Failed to set track ");
                        continue;
                    }

                    var metaNames = currentTrack.Meta.Where(x => x.MetaType == MetaType.TrackName).ToList();

                    if (!metaNames.Any())
                    {
                        fileErrors.Add("Contains Invalid track with no name");
                    }
                    else if (metaNames.Count() > 1)
                    {
                        fileErrors.Add(metaNames.First().Text + " Contains Extra track names:");
                        foreach (var en in metaNames)
                        {
                            fileErrors.Add(en.Text);
                        }
                    }

                    foreach (var diff in Utility.GetDifficultyIter())
                    {

                        EditorPro.CurrentDifficulty = diff;

                        var chords = EditorPro.Messages.Chords.ToList();
                        if (!chords.Any())
                        {
                            fileErrors.Add(currentTrackName + " No Chords Created !! " + diff);
                            continue;
                        }
                        if (diff.IsExpert())
//.........这里部分代码省略.........
开发者ID:BGCX261,项目名称:ziggy-pro-editor-svn-to-git,代码行数:101,代码来源:MainFormBatchMethods.cs


注:本文中的Sequence.IndexOf方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。