219 Commits
Author SHA1 Message Date
Eberhard Beilharz 63a8b08dd7 [System] Improve ApplicationSettingsBase behavior (#6272)
* [System] Add unit test for Xamarin-2315

* [System] Use temporary directory for saving settings files

This change modifies the ApplicationSettingsBaseTests so that they
store the settings files in a temporary directory. This reduces
the risk of failed tests because of stale files from previous test
run, or from a build that runs in parallel.

* [System] Improve Settings behavior (Xamarin-15818)

Improve behavior of ApplicationSettingsBase class to match Windows .NET
more closely.
* Implement Upgrade to allow Upgrading of settings
* Make SettingsPropertyValue serialization work for complex objects
* Make Save and Update throw in unimplemented configurations
* Changed Reload to clear PropertyValues so they are reloaded
  and fire PropertyChanged event for all Properties
* Modified Reset to do what Reload used to do.
* Added a backup Type loading for custom SettingsProviders
* don't call SettingsSaving on Reset()

* [System] Fire SettingsSaving event (Xamarin-2315)

When calling ApplicationSettingsBase.Save() the SettingsSaving
event has to be fired.

* [System] Add unit tests for Xamarin-15818
2018-01-05 13:08:20 +01:00
Alexander Köplinger e0e93f396d [System] Rename method parameters to match .NET contract 2017-03-16 13:02:09 +01:00
Marek Safar b572846271 [System] Cleanup some warnings 2017-01-05 15:01:08 +01:00
Marek Safar 95b0698304 [System] Clean up some warnings 2016-10-25 14:28:35 +02:00
Marek Safar 0c44dca122 [System] Uri handling from reference source
Fixes many issues in our uri handling
2016-05-11 09:59:46 +02:00
Marek Safar aa77a6ddcc [System] Remove PrebuiltSystem alias (it's not needed with any modern mcs) 2016-04-16 08:37:07 +02:00
Marcos Henrich 355d2c5eca Merge pull request #2400 from esdrubal/extrahead
[System] Fix extra head in config bug.
2016-02-15 12:21:29 +00:00
Alexander Köplinger b03e606287 Remove ChangeLog files from the repo
They weren't updated in the last 6 years and aren't helpful anymore (e.g. by causing unrelated matches during git grep searches).
2016-01-29 19:17:06 +01:00
Marcos Henrich f43a2563d7 [System] Removed dead code. 2016-01-05 11:56:26 +00:00
ArsenShnurkov 9c088b38e2 [System] Fix extra xml header in configs.
Fixes #36388.
2016-01-05 11:56:26 +00:00
Atsushi Eno d9184320f7 [Configuration] skip whitespaces in the settings xml.
This is required after we switch to referencesource, which somehow
preserves whitespaces during deserialization from xml.
2015-02-21 03:29:21 +08:00
Alexander Köplinger 48e112d652 [Cleanup] Removed TARGET_JVM
It was once part of a special Java target profile, but this is no longer used today.
2014-08-08 03:28:34 +02:00
Atsushi Eno 40d5064d04 hack SettingValueElement.Unmerge(). 2013-11-02 16:54:09 +09:00
Marek Safar 4bc748b49d Fixes failing tests 2013-02-25 22:10:45 +01:00
Atsushi Eno 7689ac2e54 implement some SettingValueElement members to suppress nunit test regressions. 2013-01-04 02:14:22 +09:00
Marek Safar 743e879293 Fix compiler warnings 2012-12-15 12:46:59 +01:00
Atsushi Eno 05d46a8fc9 fix bug #8533 - more than one user config section should be generated in ApplicationSettingsBase.Save().
Patch by Kei Nakazawa.
2012-11-27 19:49:19 +09:00
Atsushi Eno 2ce799595e fix xbc bug #8592: Make sure to reload configuration when Reset() was invoked.
Patch by Kei Nakazawa.
2012-11-27 16:13:30 +09:00
Marek Safar d5d4b9c22b Fix some warnings 2012-06-08 12:48:08 +01:00
Miguel de Icaza f48ceb9860 [System] Removal of the NET_2_0 in the source code
Modulo the GUID in the assembly and the GUID embedded in some
field initializers that use the assembly GUID for their name, the
assemblies are idential before and after the patch.
2012-06-02 13:16:40 -04:00
Carsten Schlote 7e42d3474e [System.Configuration] Added check for SettingProviderAttribute on settings class
There is no checkfor the SettingProviderAttribute attached to a Settings class.
.NET uses this to replace the default LocalSettingsProvider with your
own SettingsProvider.

The patch adds this feature.

Signed-off-by: Carsten Schlote <[email protected]>
2010-09-20 20:53:45 -04:00
Carsten Schlote ee5a1d2a73 [System.Configuration] Fixed GetProductName() function
Added missing check for empty strongname. This case is now handled the
same way as a missing strongname.

GetProductName() now correctly uses _Url_ and assembly.EscapedCodeBase
for its output.

Signed-off-by: Carsten Schlote <[email protected]>
2010-09-20 20:53:45 -04:00
Carsten Schlote b26e26544c [System.Configuration] Fixed GetEvidenceHash() function to produce valid filenames
The previous implementation creates eventually invalid filenames in a
random fashion on linux, mac, windows by having '/' or '\' chars
in the base64 output. As a result you can't save or retrieve your settings
due to filesystem errors.

This patch changes the output to plain hex values. This is a bit longer
then a base64 string, but also 100% filesystem safe.

Might

Signed-off-by: Carsten Schlote <[email protected]>
2010-09-20 20:53:44 -04:00
Miguel de Icaza f47e5fe6a6 2010-03-20 Miguel de Icaza <[email protected]>
* Eliminate warnings in a bunch of places.

svn path=/trunk/mcs/; revision=153952
2010-03-20 23:09:06 +00:00
Carlos Alberto Cortez 81317df205 2010-02-16 Carlos Alberto Cortez <[email protected]>
* CustomizableLocalFileSettingsProvider.cs: When saving the
	properties, ignore the properties marked with
	ApplicationScopedSettingAttribute, as they are not serialized in .net 
	by FileSettingsProvider (the default class used to save the config,
	and the one using the class we are modifying).
	Fixes #468658.


svn path=/trunk/mcs/; revision=151798
2010-02-16 13:12:50 +00:00
Carlos Alberto Cortez b6fdd83c60 2010-02-12 Carlos Alberto Cortez <[email protected]>
* CustomizableLocalFileSettingsProvider.cs: The name of the child
	class of Settings should be 'normalized' by replacing the chars that
	are invalid in a xml element name with their corresponding hexadecimal
	values. This is specially visible when using classes container in
	other classes.
	Fixes #471289.


svn path=/trunk/mcs/; revision=151607
2010-02-12 12:16:08 +00:00
Gonzalo Paniagua Javier f272f2d0a7 2009-08-31 Gonzalo Paniagua Javier <[email protected]>
* CustomizableFileSettingsProvider.cs: reset the property value
	instead of using the DefaultValue.
	* SettingsPropertyValue.cs: new Reset() method.
	* ApplicationSettingsBase.cs: Reset happens in Reload().
	Patch by Andrew Kurochka that fixes bug #532180.


svn path=/trunk/mcs/; revision=140950
2009-08-31 09:20:07 +00:00
Gonzalo Paniagua Javier 664c12c8d8 2009-06-18 Gonzalo Paniagua Javier <[email protected]>
* IriParsingElement.cs:
	* UriSection.cs:
	* IdnElement.cs: new files that parse <uri> and subelements.


svn path=/trunk/mcs/; revision=136437
2009-06-18 20:31:47 +00:00
Marek Safar ba5939a531 2009-06-05 Marek Safar <[email protected]>
* DictionarySectionHandler.cs, NameValueSectionHandler.cs,
	NameValueFileSectionHandler.cs, SingleTagSectionHandler.cs,
	IConfigurationSectionHandler.cs, IgnoreSectionHandler.cs: Always
	build IConfigurationSectionHandler.


svn path=/trunk/mcs/; revision=135528
2009-06-05 14:20:21 +00:00
Gonzalo Paniagua Javier 052391245a 2009-05-10 Gonzalo Paniagua Javier <[email protected]>
* CustomizableFileSettingsProvider.cs: make sure 'values' is
	initialized in Reset(). Fixes bug #436592.


svn path=/trunk/mcs/; revision=133866
2009-05-11 02:06:04 +00:00
Marek Habersack 7766743366 2009-04-03 Marek Habersack <[email protected]>
* WebConfigurationManager.cs: added code in the static constructor
	to enable retrieving application settings via
	ApplicationSettingsBase from within asp.net applications. Fixes
	bug #491531

	* ApplicationSettingsConfigurationFileMap.cs: added.

2009-04-03  Marek Habersack  <[email protected]>

	* CustomizableFileSettingsProvider.cs: added a way for System.Web
	to specify path to the current Web.config. Fixes bug #491531

svn path=/trunk/mcs/; revision=130909
2009-04-02 22:35:28 +00:00
Gonzalo Paniagua Javier 75883dc733 2008-11-20 Gonzalo Paniagua Javier <[email protected]>
* ConfigHelper.cs: allow xmlns attribute.


svn path=/trunk/mcs/; revision=119505
2008-11-20 20:36:45 +00:00
Gert Driesen 2dcef460e7 * SettingPropertyValue.cs: Do not return null for zero-length String
value.

svn path=/trunk/mcs/; revision=118927
2008-11-15 13:41:35 +00:00
Atsushi Eno cc59158ec3 2008-11-11 Atsushi Enomoto <[email protected]>
Fix for bug 439943.
        * SettingValueElement.cs : do not write value element twice.
        * CustomizableFileSettingsProvider.cs : create "value" element
          instead of a document fragment so that the output from
          SettingValueElement could become consistent.
          Null binary value caused crash. Set appropriate
          SerializedValue for each serialization type.
        * SettingsPropertyValue.cs : output only when the value is
          non-null.


svn path=/trunk/mcs/; revision=118565
2008-11-12 00:11:45 +00:00
Atsushi Eno f2b5ad3c51 2008-11-05 Atsushi Enomoto <[email protected]>
* SettingValueElement.cs, CustomizableFileSettingsProvider.cs :
	  revert previous regressive change.


svn path=/trunk/mcs/; revision=117984
2008-11-05 15:51:55 +00:00
Atsushi Eno 4baa530b64 2008-11-05 Atsushi Enomoto <[email protected]>
* SettingValueElement.cs, CustomizableFileSettingsProvider.cs :
	  Fixed bug #439943. Xml deserialization for complex content was
	  not done correctly.


svn path=/trunk/mcs/; revision=117961
2008-11-05 09:18:26 +00:00
Gonzalo Paniagua Javier 8db1078e92 revert
svn path=/trunk/mcs/; revision=117574
2008-10-31 17:47:04 +00:00
Gonzalo Paniagua Javier 23a91b586e 2008-10-31 Gonzalo Paniagua Javier <[email protected]>
* System/System.Configuration/CustomizableFileSettingsProvider.cs:
	* System/System.Configuration/ApplicationSettingsBase.cs:
	* System.Configuration/System.Configuration/ClientConfigurationSystem.cs:
	* System.Configuration/System.Configuration/ConfigurationManager.cs:
	Generate the same file name for the local settings file and properly
	save the configuration to it. Not loading it yet.


svn path=/trunk/mcs/; revision=117573
2008-10-31 17:36:16 +00:00
Gert Driesen 2b4812d44a * CustomizableFileSettingsProvider.cs (LoadPropertyValue): Do not
hide ArgumentException.

svn path=/trunk/mcs/; revision=114883
2008-10-05 09:13:33 +00:00
Gonzalo Paniagua Javier 1cd9846abc 2008-10-04 Gonzalo Paniagua Javier <[email protected]>
* CustomizableFileSettingsProvider.cs: when reading application or
	user settings, only read those settings appropriate for the context.
	This avoids duplicate key errors when 2 different groups have a key
	with the same name.
	* ApplicationSettingsBase.cs: the context is a hashtable with several
	values set upon creation: SettingsKey, GroupName and
	SettingsClassType.

	Fixes bug #432466.


svn path=/trunk/mcs/; revision=114853
2008-10-04 21:50:11 +00:00
Gonzalo Paniagua Javier 3a62ec8a81 2008-10-04 Gonzalo Paniagua Javier <[email protected]>
* ApplicationSettingsBase.cs: honor the IsSynchronized value in the
	Context, Properties, PropertyValues and Providers. All of them might
	initialize an instance field for the class. Hopefully this fixes some
	nullrefs.


svn path=/trunk/mcs/; revision=114842
2008-10-04 18:24:39 +00:00
Gonzalo Paniagua Javier cffdef0f69 2008-10-04 Gonzalo Paniagua Javier <[email protected]>
* ApplicationSettingsBase.cs: honor the IsSynchronized value in the
	indexer.


svn path=/trunk/mcs/; revision=114837
2008-10-04 16:42:47 +00:00
Raja R Harinath 8320786617 * ConfigXmlDocument.cs (Load): Fix build break in 1.1 profile.
Open code the 'using' with try/finally/Close.

svn path=/trunk/mcs/; revision=112981
2008-09-15 02:01:27 +00:00
Gert Driesen 93ff28fda8 * System_test.dll.sources: Added ConfigXmlDocumentTest.cs.
* ConfigXmlDocumentTest.cs: Added test for Load (String).
* ConfigXmlDocument.cs: Dispose XmlTextReader in Load (String).

svn path=/trunk/mcs/; revision=112958
2008-09-14 16:39:17 +00:00
Ivan Zlatev 86e2ab6d2b 2008-09-01 Ivan N. Zlatev <[email protected]>
* SettingsPropertyValue.cs: Explicitly use the Invariant culture
	instead of the current.
	[Fixes bug #374516]

svn path=/trunk/mcs/; revision=112027
2008-09-01 13:55:01 +00:00
Marek Safar 225f1c9198 Warnings cleanup
svn path=/trunk/mcs/; revision=111790
2008-08-28 09:12:00 +00:00
Ivan Zlatev 646e7afef4 2008-08-05 Ivan N. Zlatev <[email protected]>
* ApplicationSettingsBase.cs: If there is no explicit
	SettingsSerializeAs attribute to specify the format, distinguish
	between plain string and XML by checking if the TypeConverter for the
	property type supports string conversions. If it doesn't then we are
	present with XML.
	[Fixes bug #414445]

svn path=/trunk/mcs/; revision=109706
2008-08-05 20:39:18 +00:00
Marek Safar bdd9de656e Fixed few warnings
svn path=/trunk/mcs/; revision=107455
2008-07-08 10:34:18 +00:00
Gert Driesen 3ff3823088 * DiagnosticsConfigurationHandler.cs: On 2.0 profile, throw
ConfigurationErrorsException when any attribute other than 'Name'
is found when referencing a shared listener. Fixes bug #404054.
Added support for the traceOutputOptions attribute on 2.0 profile.
Fixes bug #403583.
* ConfigXmlDocument.cs: Implement IConfigErrorInfo on all Node classes.

svn path=/trunk/mcs/; revision=106628
2008-06-26 10:54:00 +00:00
Gert Driesen 846e400474 * DictionarySectionHandler.cs: Fixed line endings.
* IgnoreSectionHandler.cs: Fixed line endings.

svn path=/trunk/mcs/; revision=106583
2008-06-25 17:21:30 +00:00