コード例 #1
0
        public void SetPresentation()
        {
            lbSelectedFiles.Items.Clear();

            foreach (PresentationPlay pPlay in Presentation.Plays)
            {
                string strStandardFilePath = new System.IO.FileInfo(pPlay.PlayPath).FullName;

                if (strStandardFilePath.EndsWith(".Ttl", true, null))
                {
                    Title title = new Title(strStandardFilePath);

                    TitleViewModel tvm = new TitleViewModel(title, null);

                    lbSelectedFiles.Items.Add(tvm);
                }
                else
                {
                    if (strStandardFilePath.Contains(AppDomain.CurrentDomain.BaseDirectory + @"Offensive\Formation\Offensive") ||
                        strStandardFilePath.Contains(AppDomain.CurrentDomain.BaseDirectory + @"Defensive\Formation\Offensive") ||
                        strStandardFilePath.Contains(AppDomain.CurrentDomain.BaseDirectory + @"Kicks\Formation\Offensive"))
                    {
                        Formation formation = new Formation(strStandardFilePath);

                        FormationViewModel fvm = new FormationViewModel(formation, null);

                        lbSelectedFiles.Items.Add(fvm);
                    }

                    if (strStandardFilePath.Contains(AppDomain.CurrentDomain.BaseDirectory + @"Offensive\Formation\Defensive") ||
                        strStandardFilePath.Contains(AppDomain.CurrentDomain.BaseDirectory + @"Defensive\Formation\Defensive") ||
                        strStandardFilePath.Contains(AppDomain.CurrentDomain.BaseDirectory + @"Kicks\Formation\Defensive"))
                    {
                        Formation formation = new Formation(strStandardFilePath);

                        FormationViewModel fvm = new FormationViewModel(formation, null);

                        lbSelectedFiles.Items.Add(fvm);
                    }

                    if (strStandardFilePath.Contains(AppDomain.CurrentDomain.BaseDirectory + @"Offensive\Formation\Kicks") ||
                        strStandardFilePath.Contains(AppDomain.CurrentDomain.BaseDirectory + @"Defensive\Formation\Kicks") ||
                        strStandardFilePath.Contains(AppDomain.CurrentDomain.BaseDirectory + @"Kicks\Formation\Kicks"))
                    {
                        Formation formation = new Formation(strStandardFilePath);

                        FormationViewModel fvm = new FormationViewModel(formation, null);

                        lbSelectedFiles.Items.Add(fvm);
                    }

                    if (strStandardFilePath.Contains(AppDomain.CurrentDomain.BaseDirectory + @"Offensive\Playbook") ||
                        strStandardFilePath.Contains(AppDomain.CurrentDomain.BaseDirectory + @"Defensive\Playbook") ||
                        strStandardFilePath.Contains(AppDomain.CurrentDomain.BaseDirectory + @"Kicks\Playbook"))
                    {
                        Play play = new Play(strStandardFilePath);

                        PlayViewModel pvm = new PlayViewModel(play, null);

                        lbSelectedFiles.Items.Add(pvm);
                    }
                }

                foreach (Object objVideo in pPlay.Videos)
                {
                    if (objVideo.ToString().EndsWith(".ppt", true, null))
                    {
                        PowerPoint ppt = new PowerPoint(objVideo.ToString());

                        PPTViewModel pptVM = new PPTViewModel(ppt, null);

                        lbSelectedFiles.Items.Add(pptVM);
                    }
                    else
                    {
                        VideoCoachingPointInfo vcpi = null;

                        if (!(objVideo is VideoCoachingPointInfo))
                        {
                            vcpi = new VideoCoachingPointInfo(objVideo.ToString());
                        }
                        else
                        {
                            vcpi = objVideo as VideoCoachingPointInfo;
                        }

                        VideoViewModel vvm = new VideoViewModel(vcpi, null);

                        this.lbSelectedFiles.Items.Add(vvm);
                    }
                }
            }
        }