private void reset(int characterId, bool isAnonymous, string lines, Sugarism.ELinesEffect linesEffect) { if (Common.Instance.IsValidCharacter(characterId)) { SelectedItem = CharacterList[characterId]; } else { if (null == CharacterList) { SelectedItem = null; } else if (CharacterList.Length > 0) { SelectedItem = CharacterList[0]; } else { SelectedItem = null; } } IsAnonymous = isAnonymous; Lines = lines; LinesEffect = linesEffect; }
// default handler private void onCmdLines(int characterId, bool isAnonymous, string lines, Sugarism.ELinesEffect linesEffect) { Log.Debug(string.Format( "onCmdLines; characterId({0}), isAnonymous({1}), linesEffect({2}), lines: \"{3}\"", characterId, isAnonymous, linesEffect, lines)); }
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { if ((null == value) || (false == (value is Sugarism.ELinesEffect))) { return(string.Empty); } Sugarism.ELinesEffect eff = (Sugarism.ELinesEffect)value; return(eff.ToString()); }
// EventHandler private void onCmdLines(int characterId, bool isAnonymous, string lines, Sugarism.ELinesEffect linesEffect) { string name = getName(characterId, isAnonymous); setName(name); setActiveNamePanel(true); setLines(lines); set(linesEffect); Show(); }
private EditLines() { _lines = string.Empty; _linesEffectList = new List <Sugarism.ELinesEffect>(); Array arr = Enum.GetValues(typeof(Sugarism.ELinesEffect)); foreach (var v in arr) { Sugarism.ELinesEffect item = (Sugarism.ELinesEffect)v; _linesEffectList.Add(item); } }
private void set(Sugarism.ELinesEffect linesEffect) { switch (linesEffect) { case Sugarism.ELinesEffect.Shake: _shake = InitShakeAmount; break; case Sugarism.ELinesEffect.None: default: resetShake(); break; } }
/// <summary> /// Show View.Popup.EditLines. /// </summary> /// <param name="characterId">Character Id before editing.</param> /// <param name="lines">Lines before editing.</param> /// <returns>Whether edit or not.</returns> public bool Show(int characterId, bool isAnonymous, string lines, Sugarism.ELinesEffect linesEffect) { reset(characterId, isAnonymous, lines, linesEffect); View.Popup.EditLines view = new View.Popup.EditLines(this); bool?result = view.ShowDialog(); switch (result) { case true: return(true); default: return(false); } }
public void Invoke(int characterId, bool isAnonymous, string lines, Sugarism.ELinesEffect linesEffect) { _event.Invoke(characterId, isAnonymous, lines, linesEffect); }