protected override object GetFormattedValue(object value, int rowIndex, ref DataGridViewCellStyle cellStyle, TypeConverter valueTypeConverter, TypeConverter formattedValueTypeConverter, DataGridViewDataErrorContexts context) { TransDirection dir = (TransDirection)value; if (dir == TransDirection.Buy) { return("买"); } else { return("卖"); } }
private void TransLyricsTan2Ren(TransDirection direction) { foreach (var track in Data.TrackList) { var noteList = track.NoteList; switch (direction) { case TransDirection.None: //Do nothing break; case TransDirection.Sequential: //TanDoku to RenZoku string tailOfLast = "-"; for (int i = 0; i < noteList.Count; i++) { string tail = tailOfLast; if (i > 0 && noteList[i].NoteTimeOn > noteList[i - 1].NoteTimeOff) { tail = "-"; } if (FindKana(noteList[i].NoteLyric) != -1) //is Kana { tailOfLast = ConvertKanaToRomaji(noteList[i].NoteLyric).Substring(ConvertKanaToRomaji(noteList[i].NoteLyric).Length - 1, 1); noteList[i].NoteLyric = tail + " " + noteList[i].NoteLyric; } else if (FindRomaji(noteList[i].NoteLyric) != -1) //is Romaji { tailOfLast = noteList[i].NoteLyric.Substring(noteList[i].NoteLyric.Length - 1, 1); noteList[i].NoteLyric = tail + " " + noteList[i].NoteLyric; } else { tailOfLast = "-"; } } break; case TransDirection.Reverse: //RenZoku to TanDoku for (int i = 0; i < noteList.Count; i++) { if (noteList[i].NoteLyric.Contains(" ") && (FindKana(noteList[i].NoteLyric.Remove(0, 2)) != -1 || FindRomaji(noteList[i].NoteLyric.Remove(0, 2)) != -1)) { noteList[i].NoteLyric = noteList[i].NoteLyric.Remove(0, 2); } } break; } } }
private void TransLyricsRomaji2Kana(TransDirection direction) { foreach (var track in Data.TrackList) { var NoteList = track.NoteList; switch (direction) { case TransDirection.None: //Do nothing break; case TransDirection.Sequential: //Romaji to Kana for (int i = 0; i < NoteList.Count; i++) { if (NoteList[i].NoteLyric.Contains(" ")) //is RenZokuOn { string head = NoteList[i].NoteLyric.Substring(0, 1); string body = NoteList[i].NoteLyric.Remove(0, 2); NoteList[i].NoteLyric = head + " " + ConvertRomajiToKana(body); } else //is TanDokuOn { NoteList[i].NoteLyric = ConvertRomajiToKana(NoteList[i].NoteLyric); } } break; case TransDirection.Reverse: //Kana to Romaji for (int i = 0; i < NoteList.Count; i++) { if (NoteList[i].NoteLyric.Contains(" ")) //is RenZokuOn { string head = NoteList[i].NoteLyric.Substring(0, 1); string body = NoteList[i].NoteLyric.Remove(0, 2); NoteList[i].NoteLyric = head + " " + ConvertKanaToRomaji(body); } else //is TanDokuOn { NoteList[i].NoteLyric = ConvertKanaToRomaji(NoteList[i].NoteLyric); } } break; } } }
void TransLyricsRomaji2Kana(TransDirection mode) { foreach (Track track in _data.TrackList) { List <Note> noteList = track.NoteList; switch (mode) { case TransDirection.None: //Do nothing break; case TransDirection.Sequential: //Romaji to Kana for (int i = 0; i < noteList.Count; i++) { if (noteList[i].NoteLyric.Contains(" ")) //is RenZokuOn { string head = noteList[i].NoteLyric.Substring(0, 1); string body = noteList[i].NoteLyric.Remove(0, 2); noteList[i].NoteLyric = head + " " + ConvertRomajiToKana(body); } else //is TanDokuOn { noteList[i].NoteLyric = ConvertRomajiToKana(noteList[i].NoteLyric); } } break; case TransDirection.Reverse: //Kana to Romaji for (int i = 0; i < noteList.Count; i++) { if (noteList[i].NoteLyric.Contains(" ")) //is RenZokuOn { string head = noteList[i].NoteLyric.Substring(0, 1); string body = noteList[i].NoteLyric.Remove(0, 2); noteList[i].NoteLyric = head + " " + ConvertKanaToRomaji(body); } else //is TanDokuOn { noteList[i].NoteLyric = ConvertKanaToRomaji(noteList[i].NoteLyric); } } break; } } }
private void TransLyricsRomaji2Kana(TransDirection direction) { foreach (Track track in _converter.TrackList) { var noteList = track.NoteList; switch (direction) { case TransDirection.None: //Do nothing break; case TransDirection.Sequential: //Romaji to Kana foreach (Note note in noteList) { if (note.NoteLyric.Contains(" ")) //is RenZokuOn { string head = note.NoteLyric.Substring(0, 1); string body = note.NoteLyric.Remove(0, 2); note.NoteLyric = head + " " + ConvertRomajiToKana(body); } else //is TanDokuOn { note.NoteLyric = ConvertRomajiToKana(note.NoteLyric); } } break; case TransDirection.Reverse: //Kana to Romaji foreach (Note note in noteList) { if (note.NoteLyric.Contains(" ")) //is RenZokuOn { string head = note.NoteLyric.Substring(0, 1); string body = note.NoteLyric.Remove(0, 2); note.NoteLyric = head + " " + ConvertKanaToRomaji(body); } else //is TanDokuOn { note.NoteLyric = ConvertKanaToRomaji(note.NoteLyric); } } break; } } }