internal void setReading(string stem, string reading) { if (mainForm != null && lastData != null && lastData.getMatchStem() == stem) { Settings.app.setSelectedReading(stem, reading); OkuriganaType okType = Settings.app.okuriganaType; if (okType == OkuriganaType.NORMAL) { mainForm.updateReading(lastData.getMatchStem(), lastData.getReading(okType)); } else if (okType == OkuriganaType.ENGLISH || okType == OkuriganaType.RUSSIAN) { mainForm.updateReading(lastData.asText(), lastData.getReading(okType)); } } }
public string getReading(OkuriganaType okType) { string reading; switch (okType) { case OkuriganaType.NONE: reading = null; break; case OkuriganaType.NORMAL: reading = getStemReading(); break; case OkuriganaType.ENGLISH: if (isName()) { reading = getSelectedEntry().getNameReading(); } else { string origReading = (getStemReading() ?? getMatchStem()) + inf.getReading(); reading = TextUtils.kanaToRomaji(origReading); } break; case OkuriganaType.RUSSIAN: if (isName()) { reading = getSelectedEntry().getNameReading(); } else { string origReading = (getStemReading() ?? getMatchStem()) + inf.getReading(); reading = TextUtils.kanaToCyrillic(origReading); } break; default: throw new MyException("OkuriganaType"); } return(reading); }
internal abstract object serialize(OkuriganaType okType);
internal override object serialize(OkuriganaType okType) { return(new object[] { originalText, getMatchStem(), getReading(okType), isName() }); }
internal abstract object serialize(OkuriganaType okType);
internal override object serialize(OkuriganaType okType) { return from p in parts select p.serialize(okType); }
internal override object serialize(OkuriganaType okType) { return(from p in parts select p.serialize(okType)); }