Beispiel #1
0
        public void SetArrangement(RVPresentation presentation, PcoSongArrangement arrangement)
        {
            RVGroupArrangement group;

            group = presentation.GroupArrangements.FirstOrDefault(x => x.Label.Label == arrangement.Name);

            if (group == null)
            {
                group = presentation.AddNewGroupArrangement(arrangement.Name);
            }

            if (!arrangement.Sequence.Any())
            {
                return;
            }

            group.SlideGroups.Clear();

            foreach (string seq in arrangement.Sequence)
            {
                RVSlideGroup selected = null;

                if (seq.First() == 'v')
                {
                    if (seq.Length > 1)
                    {
                        selected = presentation.SlideGroups.FirstOrDefault(g => g.Label.Label.Equals("verse " + seq.Substring(1), StringComparison.OrdinalIgnoreCase));
                    }

                    if (selected == null)
                    {
                        selected = presentation.SlideGroups.FirstOrDefault(g => g.Label.Label.StartsWith("verse", StringComparison.OrdinalIgnoreCase));
                    }
                }
                else if (seq.First() == 'c')
                {
                    if (seq.Length > 1)
                    {
                        selected = presentation.SlideGroups.FirstOrDefault(g => g.Label.Label.Equals("chorus " + seq.Substring(1), StringComparison.OrdinalIgnoreCase));
                    }

                    if (selected == null)
                    {
                        selected = presentation.SlideGroups.FirstOrDefault(g => g.Label.Label.StartsWith("chorus", StringComparison.OrdinalIgnoreCase));
                    }
                }
                else if (seq.First() == 'b')
                {
                    if (seq.Length > 1)
                    {
                        selected = presentation.SlideGroups.FirstOrDefault(g => g.Label.Label.Equals("bridge " + seq.Substring(1), StringComparison.OrdinalIgnoreCase));
                    }

                    if (selected == null)
                    {
                        selected = presentation.SlideGroups.FirstOrDefault(g => g.Label.Label.StartsWith("bridge", StringComparison.OrdinalIgnoreCase));
                    }
                }
                else if (seq.StartsWith("pc"))
                {
                    if (seq.Length > 2)
                    {
                        selected = presentation.SlideGroups.FirstOrDefault(g => g.Label.Label.Equals("pre-chorus " + seq.Substring(2), StringComparison.OrdinalIgnoreCase));
                    }

                    if (selected == null)
                    {
                        selected = presentation.SlideGroups.FirstOrDefault(g => g.Label.Label.StartsWith("pre-chorus", StringComparison.OrdinalIgnoreCase));
                    }
                }
                else if (seq.StartsWith("misc"))
                {
                    if (seq.Length > 4)
                    {
                        selected = presentation.SlideGroups.FirstOrDefault(g => g.Label.Label.Equals("misc " + seq.Substring(4), StringComparison.OrdinalIgnoreCase));
                    }

                    if (selected == null)
                    {
                        selected = presentation.SlideGroups.FirstOrDefault(g => g.Label.Label.StartsWith("misc", StringComparison.OrdinalIgnoreCase));
                    }
                }

                if (selected != null)
                {
                    group.SlideGroups.Add(selected);
                }
            }
        }
        public void SetArrangement(RVPresentation presentation, PcoSongArrangement arrangement)
        {
            RVGroupArrangement group;

            group = presentation.GroupArrangements.FirstOrDefault(x => x.Label.Label == arrangement.Name);

            if (group == null)
            {
                group = presentation.AddNewGroupArrangement(arrangement.Name);
            }

            if (!arrangement.Sequence.Any())
                return;

            group.SlideGroups.Clear();

            foreach (string seq in arrangement.Sequence)
            {
                RVSlideGroup selected = null;

                if (seq.First() == 'v')
                {
                    if (seq.Length > 1)
                        selected = presentation.SlideGroups.FirstOrDefault(g => g.Label.Label.Equals("verse " + seq.Substring(1), StringComparison.OrdinalIgnoreCase));

                    if (selected == null)
                        selected = presentation.SlideGroups.FirstOrDefault(g => g.Label.Label.StartsWith("verse", StringComparison.OrdinalIgnoreCase));
                }
                else if (seq.First() == 'c')
                {
                    if (seq.Length > 1)
                        selected = presentation.SlideGroups.FirstOrDefault(g => g.Label.Label.Equals("chorus " + seq.Substring(1), StringComparison.OrdinalIgnoreCase));

                    if (selected == null)
                        selected = presentation.SlideGroups.FirstOrDefault(g => g.Label.Label.StartsWith("chorus", StringComparison.OrdinalIgnoreCase));
                }
                else if (seq.First() == 'b')
                {
                    if (seq.Length > 1)
                        selected = presentation.SlideGroups.FirstOrDefault(g => g.Label.Label.Equals("bridge " + seq.Substring(1), StringComparison.OrdinalIgnoreCase));

                    if (selected == null)
                        selected = presentation.SlideGroups.FirstOrDefault(g => g.Label.Label.StartsWith("bridge", StringComparison.OrdinalIgnoreCase));
                }
                else if (seq.StartsWith("pc"))
                {
                    if (seq.Length > 2)
                        selected = presentation.SlideGroups.FirstOrDefault(g => g.Label.Label.Equals("pre-chorus " + seq.Substring(2), StringComparison.OrdinalIgnoreCase));

                    if (selected == null)
                        selected = presentation.SlideGroups.FirstOrDefault(g => g.Label.Label.StartsWith("pre-chorus", StringComparison.OrdinalIgnoreCase));
                }
                else if (seq.StartsWith("misc"))
                {
                    if (seq.Length > 4)
                        selected = presentation.SlideGroups.FirstOrDefault(g => g.Label.Label.Equals("misc " + seq.Substring(4), StringComparison.OrdinalIgnoreCase));

                    if (selected == null)
                        selected = presentation.SlideGroups.FirstOrDefault(g => g.Label.Label.StartsWith("misc", StringComparison.OrdinalIgnoreCase));
                }

                if (selected != null)
                    group.SlideGroups.Add(selected);
            }
        }