Esempio n. 1
0
        /// <summary>
        ///     Sets the styles this list displays.
        /// </summary>
        /// <param name="styles">The styles.</param>
        /// <param name="resourceManager">The resource manager.</param>
        public void SetStyles([NotNull] IEnumerable <TileStyle> styles, [NotNull] GDIResourceManager resourceManager)
        {
            Controls.Clear();

            foreach (TileStyle style in styles)
            {
                StyleControl styleControl = new StyleControl(style.Style, resourceManager);
                styleControl.StyleChanged += (sender, args) =>
                {
                    if (styleControl.Style == null)
                    {
                        return;
                    }
                    style.Style = styleControl.Style;
                    StylesChanged?.Invoke(sender, args);
                };
                AddStyle(styleControl);
            }
        }
Esempio n. 2
0
 /// <summary>
 /// Signals that the styles have been updated.
 /// </summary>
 public void Refresh()
 {
     StylesChanged?.Invoke(this, EventArgs.Empty);
 }
Esempio n. 3
0
 /// <summary>
 /// Invoke StylesChanged event
 /// </summary>
 /// <param name="styles">New app styles</param>
 internal static void Call_StylesChanged(Styles styles)
 {
     StylesChanged?.Invoke(styles);
 }
Esempio n. 4
0
 /// <summary>
 ///     Raises the <see cref="E:Changed" /> event.
 /// </summary>
 /// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param>
 protected virtual void OnChanged(EventArgs e)
 {
     StylesChanged?.Invoke(this, e);
 }