Get rid of properties starting with underscore

This commit is contained in:
Korney Czukowski 2017-12-20 07:03:34 +01:00
parent a06b1d6e27
commit ae294d8926

View File

@ -13,10 +13,8 @@ namespace DS4Windows.DS4Forms
{ {
public partial class LanguagePackComboBox : UserControl public partial class LanguagePackComboBox : UserControl
{ {
private string _invariantCultureText = "No (English UI)"; private string InvariantCultureTextValue = "No (English UI)";
private string _languageAssemblyName = "DS4Windows.resources.dll"; private TaskCompletionSource<bool> LanguageListInitialized = new TaskCompletionSource<bool>();
private TaskCompletionSource<bool> _languageListInitialized = new TaskCompletionSource<bool>();
private string _probingPath = "";
[Category("Action")] [Category("Action")]
[Description("Fires when the combo box selected index is changed.")] [Description("Fires when the combo box selected index is changed.")]
@ -31,10 +29,10 @@ namespace DS4Windows.DS4Forms
[Localizable(true)] [Localizable(true)]
public string InvariantCultureText public string InvariantCultureText
{ {
get { return _invariantCultureText; } get { return InvariantCultureTextValue; }
[System.Diagnostics.CodeAnalysis.SuppressMessage("InvariantCultureText_Changed call will complete when ready, no need for a warning", "CS4014:Await.Warning")] [System.Diagnostics.CodeAnalysis.SuppressMessage("InvariantCultureText_Changed call will complete when ready, no need for a warning", "CS4014:Await.Warning")]
set { set {
_invariantCultureText = value; InvariantCultureTextValue = value;
InvariantCultureText_Changed(value); InvariantCultureText_Changed(value);
} }
} }
@ -49,19 +47,11 @@ namespace DS4Windows.DS4Forms
[Category("Data")] [Category("Data")]
[Description("If probing path has been changed in App.config, add the same string here.")] [Description("If probing path has been changed in App.config, add the same string here.")]
public string ProbingPath public string ProbingPath { get; set; } = "";
{
get { return _probingPath; }
set { _probingPath = value; }
}
[Category("Data")] [Category("Data")]
[Description("Filter language assembly file names in order to ont include irrelevant assemblies to the combo box.")] [Description("Filter language assembly file names in order to ont include irrelevant assemblies to the combo box.")]
public string LanguageAssemblyName public string LanguageAssemblyName { get; set; } = "DS4Windows.resources.dll";
{
get { return _languageAssemblyName; }
set { _languageAssemblyName = value; }
}
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public int SelectedIndex public int SelectedIndex
@ -99,7 +89,7 @@ namespace DS4Windows.DS4Forms
cbCulture.SelectedValueChanged += new EventHandler(CbCulture_SelectedValueChanged); cbCulture.SelectedValueChanged += new EventHandler(CbCulture_SelectedValueChanged);
cbCulture.Enabled = true; cbCulture.Enabled = true;
_languageListInitialized.SetResult(true); LanguageListInitialized.SetResult(true);
}); });
} }
@ -133,7 +123,7 @@ namespace DS4Windows.DS4Forms
private async Task InvariantCultureText_Changed(string value) private async Task InvariantCultureText_Changed(string value)
{ {
// Normally the completion flag will be long set by the time this method is called. // Normally the completion flag will be long set by the time this method is called.
await _languageListInitialized.Task; await LanguageListInitialized.Task;
BindingSource dataSource = ((BindingSource)cbCulture.DataSource); BindingSource dataSource = ((BindingSource)cbCulture.DataSource);
dataSource[0] = new KeyValuePair<string, string>("", value); dataSource[0] = new KeyValuePair<string, string>("", value);
} }