Example #1
0
 public void SaveTrickFile(string fileName)
 {
     if (this.playState != PlaybackState.Stopped)
     {
         throw new NotChangeException();
     }
     FreeStyle.WriteCsv(Name.ToStringArray(this.trickNameList), fileName, "ympt,0");
 }
Example #2
0
 /// <summary>
 /// 指定されたリストをCSVとして保存します
 /// </summary>
 /// <param name="list">リスト</param>
 /// <param name="fileName">ファイル名</param>
 /// <param name="header"></param>
 private static void WriteCsv(List <string> list, string fileName, string header)
 {
     /*保存*/
     using (StreamWriter writer =
                new StreamWriter(fileName, false, Encoding.GetEncoding("UTF-8")))
     {
         writer.WriteLine(header + "\n" + FreeStyle.ToCSV(list));
     }
 }
Example #3
0
 public void LoadTrickFile(string fileName)
 {
     if (this.playState != PlaybackState.Stopped)
     {
         throw new NotChangeException();
     }
     string[] strs = FreeStyle.ReadCSV(fileName, "ympt", "0");
     foreach (string s in strs)
     {
         this.AddTrickName(s);
     }
 }
Example #4
0
        public void Save(string fileName)
        {
            if (this.playState != PlaybackState.Stopped)
            {
                throw new NotChangeException();
            }

            //データ作成
            string text = "yymp,0\n";

            {
                text += this.freeStyleLength + "\n";
                text += FreeStyle.ToCSV(Name.ToStringArray(this.comboNameList)) + "\n";
                text += FreeStyle.ToCSV(Name.ToStringArray(this.trickNameList)) + "\n";

                List <string> comboString = new List <string>();
                List <string> trickString = new List <string>();
                foreach (Combo c in this.comboList)
                {
                    string cText = this.comboNameList.IndexOf(new Name(c.Name)) + ":";
                    cText += c.Start + ":";
                    cText += c.End;
                    comboString.Add(cText);

                    foreach (Trick t in c.TrickList)
                    {
                        string tText = this.comboList.IndexOf(c) + ":";
                        tText += this.trickNameList.IndexOf(new Name(t.Name)) + ":";
                        tText += t.Start + ":";
                        tText += t.End;
                        trickString.Add(tText);
                    }
                }
                text += FreeStyle.ToCSV(comboString) + "\n";
                text += FreeStyle.ToCSV(trickString) + "\n";
                if (this.music != null)
                {
                    text += Convert.ToBase64String(this.music.ByteData);
                }
            }

            using (StreamWriter writer =
                       new StreamWriter(fileName, false, Encoding.GetEncoding("UTF-8")))
            {
                writer.WriteLine(text);
            }
        }
Example #5
0
        /// <summary>
        /// タイマーイベント
        /// </summary>
        /// <param name="fs"></param>
        private void TimerEvent(FreeStyle fs)
        {
            RaisePropertyChanged(nameof(NowComboName));
            RaisePropertyChanged(nameof(NowTrickName));
            RaisePropertyChanged(nameof(NextTrickName));
            RaisePropertyChanged(nameof(NextComboName));
            RaisePropertyChanged(nameof(NextComboFastTrickName));
            RaisePropertyChanged(nameof(NowComboLength));
            RaisePropertyChanged(nameof(NowComboPosition));
            RaisePropertyChanged(nameof(NowTrickLength));
            RaisePropertyChanged(nameof(NowTrickPosition));

            RaisePropertyChanged(nameof(Position));
            RaisePropertyChanged(nameof(FreeStylePosition));

            RaisePropertyChanged(nameof(StopButton));

            RaisePropertyChanged(nameof(FreeLenSetIsEnabled));
            RaisePropertyChanged(nameof(StopIsEnabled));
        }