123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220 |
- #pragma warning disable CA1822
- namespace OINA.Extender.WPF.Testharness
- {
- using System.Windows;
- using System.Windows.Media;
- using OINA.Extender.Controls.Styles;
- /// <summary>
- /// Interaction logic for PeriodicTableVisualSettings.xaml
- /// </summary>
- public partial class PeriodicTableVisualSettings : Window
- {
- /// <summary>
- /// Gets or sets the color of the background.
- /// </summary>
- /// <value>
- /// The color of the background.
- /// </value>
- public Color BackgroundColor
- {
- get { return PeriodicTableStyle.BackgroundColor; }
- set { PeriodicTableStyle.BackgroundColor = value; }
- }
- /// <summary>
- /// Gets or sets the color of the included element.
- /// </summary>
- /// <value>
- /// The color of the included element.
- /// </value>
- public Color IncludedElementColor
- {
- get { return PeriodicTableStyle.ElementIncludeBackgroundColor; }
- set { PeriodicTableStyle.ElementIncludeBackgroundColor = value; }
- }
- /// <summary>
- /// Gets or sets the color of the excluded element.
- /// </summary>
- /// <value>
- /// The color of the excluded element.
- /// </value>
- public Color ExcludedElementColor
- {
- get { return PeriodicTableStyle.ElementExcludeBackgroundColor; }
- set { PeriodicTableStyle.ElementExcludeBackgroundColor = value; }
- }
- /// <summary>
- /// Gets or sets the color of the idle element.
- /// </summary>
- /// <value>
- /// The color of the idle element.
- /// </value>
- public Color IdleElementColor
- {
- get
- {
- return PeriodicTableStyle.ElementIdleBackgroundColor;
- }
- set
- {
- PeriodicTableStyle.ElementIdleBackgroundColor = value;
- }
- }
- /// <summary>
- /// Gets or sets the color of the element highlight.
- /// </summary>
- /// <value>
- /// The color of the element highlight.
- /// </value>
- public Color ElementHighlightColor
- {
- get
- {
- return PeriodicTableStyle.ElementHighlightColor;
- }
- set
- {
- PeriodicTableStyle.ElementHighlightColor = value;
- }
- }
- /// <summary>
- /// Gets or sets the color of the element border.
- /// </summary>
- /// <value>
- /// The color of the element border.
- /// </value>
- public Color ElementBorderColor
- {
- get
- {
- return PeriodicTableStyle.ElementBorderColor;
- }
- set
- {
- PeriodicTableStyle.ElementBorderColor = value;
- }
- }
- /// <summary>
- /// Gets or sets the periodic table font family.
- /// </summary>
- /// <value>
- /// The periodic table font family.
- /// </value>
- public FontFamily PeriodicTableFontFamily
- {
- get
- {
- return PeriodicTableStyle.PeriodicTableFontFamily;
- }
- set
- {
- PeriodicTableStyle.PeriodicTableFontFamily = value;
- }
- }
- /// <summary>
- /// Gets or sets the periodic table font style.
- /// </summary>
- /// <value>
- /// The periodic table font style.
- /// </value>
- public FontStyle PeriodicTableFontStyle
- {
- get
- {
- return PeriodicTableStyle.PeriodicTableFontStyle;
- }
- set
- {
- PeriodicTableStyle.PeriodicTableFontStyle = value;
- }
- }
- /// <summary>
- /// Gets or sets the size of the periodic table font.
- /// </summary>
- /// <value>
- /// The size of the periodic table font.
- /// </value>
- public double PeriodicTableFontSize
- {
- get
- {
- return PeriodicTableStyle.PeriodicTableFontSize;
- }
- set
- {
- PeriodicTableStyle.PeriodicTableFontSize = value;
- }
- }
- /// <summary>
- /// Gets or sets the color of the element font.
- /// </summary>
- /// <value>
- /// The color of the element font.
- /// </value>
- public Color ElementFontColor
- {
- get
- {
- return PeriodicTableStyle.ElementFontColor;
- }
- set
- {
- PeriodicTableStyle.ElementFontColor = value;
- }
- }
- /// <summary>
- /// Initializes a new instance of the <see cref="PeriodicTableVisualSettings"/> class.
- /// </summary>
- public PeriodicTableVisualSettings()
- {
- this.InitializeComponent();
- this.DataContext = this;
- this.UpdateCombos();
- }
- /// <summary>
- /// Handles the Click event of the ResetStylesButton control.
- /// </summary>
- /// <param name="sender">The source of the event.</param>
- /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param>
- private void ResetStylesButton_Click(object sender, RoutedEventArgs e)
- {
- PeriodicTableStyle.ResetStyles();
- this.UpdateCombos();
- }
- /// <summary>
- /// Sets the combo boxes to have the values from the dictionary
- /// </summary>
- private void UpdateCombos()
- {
- this.BackgroundColorCombo.SelectedColor = this.BackgroundColor;
- this.IncludedElementColorCombo.SelectedColor = this.IncludedElementColor;
- this.ExcludedElementColorCombo.SelectedColor = this.ExcludedElementColor;
- this.IdleElementColorCombo.SelectedColor = this.IdleElementColor;
- this.ElementBorderColorCombo.SelectedColor = this.ElementBorderColor;
- this.ElementHighlightColorCombo.SelectedColor = this.ElementHighlightColor;
- this.PeriodicTableFontFamilyCombo.SelectedValue = this.PeriodicTableFontFamily;
- this.PeriodicTableFontStyleCombo.SelectedValue = this.PeriodicTableFontStyle;
- this.PeriodicTableFontSizeCombo.SelectedValue = this.PeriodicTableFontSize;
- this.ElementFontColorCombo.SelectedColor = this.ElementFontColor;
- }
- }
- }
|