/// <summary> /// Updates formatting based on input from the toolbar controls /// </summary> private void UpdateFormat(object sender, EventArgs args) { if (sizeList.Selection != null && fontList.Selection != null) { float textSize = sizeList.Selection.AssocMember; IFontMin font = fontList.Selection.AssocMember; FontStyles style = FontStyles.Regular; // Bolding requires a separate set of texture atlases, and as such, isn't always // available boldToggle.Enabled = font.IsStyleDefined(FontStyles.Bold); if (boldToggle.Selected) { style |= FontStyles.Bold; } // Underlining and italics are render as effects and are available // for every font if (underlineToggle.Selected) { style |= FontStyles.Underline; } if (italicToggle.Selected) { style |= FontStyles.Italic; } _format = new GlyphFormat(_format.Color, _format.Alignment, textSize, font.GetStyleIndex(style)); FormatChanged?.Invoke(); } }
public void Handle(FormatChanged e) { using (var session = _store.OpenSession()) { var get = session.Load <Responses.Get>(e.CurrencyId); get.Format = e.Format; session.SaveChanges(); _manager.Publish(get); } }
public void Handle(FormatChanged e) { _elastic.Update <Responses.Index, Object>(x => x .Id(e.CurrencyId) .Doc(new { Format = e.Format }) .RetryOnConflict(3) .Refresh() ); var index = _elastic.Get <Responses.Index>(e.CurrencyId); _manager.Publish(index.Source); }
protected virtual void OnFormatChanged(EventArgs e) { FormatChanged?.Invoke(this, e); }
private void FormatCtrl_OnSelectionChanged(object sender, SelectionChangedEventArgs e) { FormatChanged.SafeInvoke(); }
public void RaiseFormatChangedEvent(FormatStorage.Formats newFormat) => FormatChanged?.Invoke(newFormat);