properties.settings

Saving user scoped settings (ApplicationSettingsBase)

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-15 20:24:54
问题 I am trying to get my application settings to save when a user exits a configuration form (not my mainform). It will keep the settings in memory because when I open the form again, it will have my data that I configured still there, but it will not save it to disk. This is the filepath it is saving the xml file to C:\Users\david_000\AppData\Local[company name][project name]\1.0.0.0. I am using [UserScopedSetting()] in my class that implements the ApplicationSettingsBase file, so it should

Saving user scoped settings (ApplicationSettingsBase)

假如想象 提交于 2020-01-15 20:19:28
问题 I am trying to get my application settings to save when a user exits a configuration form (not my mainform). It will keep the settings in memory because when I open the form again, it will have my data that I configured still there, but it will not save it to disk. This is the filepath it is saving the xml file to C:\Users\david_000\AppData\Local[company name][project name]\1.0.0.0. I am using [UserScopedSetting()] in my class that implements the ApplicationSettingsBase file, so it should

Saving user scoped settings (ApplicationSettingsBase)

旧街凉风 提交于 2020-01-15 20:18:43
问题 I am trying to get my application settings to save when a user exits a configuration form (not my mainform). It will keep the settings in memory because when I open the form again, it will have my data that I configured still there, but it will not save it to disk. This is the filepath it is saving the xml file to C:\Users\david_000\AppData\Local[company name][project name]\1.0.0.0. I am using [UserScopedSetting()] in my class that implements the ApplicationSettingsBase file, so it should

how to get Properties.Settings.Default with a string?

﹥>﹥吖頭↗ 提交于 2020-01-03 10:39:10
问题 I have a Winforms/C# application and I am migrating from xml configuration file to application settings. I would like to know if it is possible to access dynamically application settings (Properties.Settings.Default). I have 4 configurations possible for my application with the settings associated, which I logically named name1, name2, name3, name4, server1, server2 etc.. Instead of assigning them a value like Properties.Settings.Default.name1 = textbox.txt; I would like to to something like

Is it possible to bind to a value in Properties.Settings.Default?

喜欢而已 提交于 2019-12-20 05:13:18
问题 Is it possible to bind to a value in Properties.Settings.Default in a way that will keep my UI current with the value stored there? I have a class: public class FavoritePlayer { public string Name { get { return wpfSample021.Properties.Settings.Default.FavoritePlayer.ToString(); } set { wpfSample021.Properties.Settings.Default.FavoritePlayer = value; } } } In my XAML, I have a resource: <local:FavoritePlayer x:Key="fvPlayer"/> and a binding: <Label DataContext="{DynamicResource fvPlayer}"

Looking for a shurtcut of Properties.Settings.Default

浪子不回头ぞ 提交于 2019-12-19 06:47:20
问题 The more options I have defined, the more a have to type when I have to modify them. So I'm looking for a shorter version of Properties.Settings.Default.varX I tried: Properties.Settings settings = Properties.Settings.Default; settings.var1 = "x"; settings.var2 = "y"; settings.var3 = "Z"; Properties.Settings.Default = settings; but Properties.Settings.Default is read-only and the Save function has no overload. So is there any other way than typing Properties.Settings.Default again and again?

Viewing Properties.Settings.Default variables

孤街醉人 提交于 2019-12-11 02:56:56
问题 I am trying to use Settings.settings to define/persist some vars. For brevity, I've set up a test file to demonstrate the behavior I'm seeing: First, I define a setting in Settings.settings: I then have the following code to test changing variableName: public Form1() { InitializeComponent(); string newString = Properties.Settings.Default.variableName; Properties.Settings.Default.variableName = "This is a new string"; Properties.Settings.Default.Save(); } Running the above in the debugger for

how to change default path for Properties.Settings

社会主义新天地 提交于 2019-12-06 07:01:29
问题 Whenever I do Properties.Settings.Save() , it commites the properties changes to Application.LocalUserAppDataPath but I want the path to be Application.CommonAppDataPath . where Application.CommonAppDataPath = C:\Documents and Settings\**All Users**\Application Data\xxxxx\xxxx\1.0.0.0 Application.LocalUserAppDataPath = C:\Documents and Settings\**gsankar**\Local Settings\Application Data\xxxxx\xxxx\1.0.0.0 Please let me know whether it's possible to change. If so, please let me know how? 回答1:

how to change default path for Properties.Settings

为君一笑 提交于 2019-12-04 12:42:27
Whenever I do Properties.Settings.Save() , it commites the properties changes to Application.LocalUserAppDataPath but I want the path to be Application.CommonAppDataPath . where Application.CommonAppDataPath = C:\Documents and Settings\**All Users**\Application Data\xxxxx\xxxx\1.0.0.0 Application.LocalUserAppDataPath = C:\Documents and Settings\**gsankar**\Local Settings\Application Data\xxxxx\xxxx\1.0.0.0 Please let me know whether it's possible to change. If so, please let me know how? use Properties.Settings.Default.ParentPath = Application.CommonAppDataPath; before calling Properties

Is it possible to bind to a value in Properties.Settings.Default?

女生的网名这么多〃 提交于 2019-12-02 04:37:22
Is it possible to bind to a value in Properties.Settings.Default in a way that will keep my UI current with the value stored there? I have a class: public class FavoritePlayer { public string Name { get { return wpfSample021.Properties.Settings.Default.FavoritePlayer.ToString(); } set { wpfSample021.Properties.Settings.Default.FavoritePlayer = value; } } } In my XAML, I have a resource: <local:FavoritePlayer x:Key="fvPlayer"/> and a binding: <Label DataContext="{DynamicResource fvPlayer}" Content="{Binding Path=Name}"/> What I would like is for the data-binding to update any time the property