Giter Club home page Giter Club logo

settingsproviders's People

Contributors

alxnull avatar dependabot[bot] avatar phantomgamers avatar simonbuehler avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

settingsproviders's Issues

.NET Core Compatibility

When I try to use your brilliant customised settings provides in my WPF project with .NET Core 3.1, it will have the following warning:

Package 'PortableSettingsProvider 0.2.3' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETCoreApp,Version=v3.1'. This package may not be fully compatible with your project.

Although I do not encounter any compatibility issues for now, is there any plan to support the .NET Core framework?

Settings file is not created

Hi,
i tried to use your nuGet pakage.
Iam on Visual Studio 2019 with a Windows Forms App on .NET 4.5.

I added
PortableJsonSettingsProvider.SettingsFileName = "settings.config";
PortableJsonSettingsProvider.ApplyProvider(Properties.Settings.Default);

to my Main() class, created 3 settings and tried to change them via code. I noticed that the settings.config file will not be created in the applications folder.
Conclusion it cannot be used to change the settings in the app folder...
I dont get any errors... it just wont work...

I tried both, your XML classic version and the new json version... nothing works

Any help would be appreciated :)

setXmlValue throws XmlException in some cases

Hello
A method setXmlValue throws XmlException when serialized value is empty string.

The test case is in the attachment.

To fix, in PortableSettingsProvider.cs change
if (value.SerializedValue == null) serialized = new XText("");
to
if ((value.SerializedValue is string && String.IsNullOrWhiteSpace(value.SerializedValue as string)) ||value.SerializedValue == null) serialized = new XText("");

xmlexctest.zip

Settings corrupted on Shutdown

I occasionally get error in telemetry reports that settings file is corrupted if user shuts down computer while program is running. I already have in place shutdown blocking - program blocks shutdown with ShutdownBlockReasonCreate, runs Properties.Settings.Default.Save(); and then removes the shutdown block with ShutdownBlockReasonDestroy. I know that the user didn't press "shut down anyway" because the Serilog logs a message that the ShutdownBlockReasonDestroy was reached and completed, and that log is saved to disk and properly flushed, but for some reason the settings are not consistently saved.
Is there a way to ensure that settings are saved?
I am using PortableJsonSettingsProvider 0.2.1 from Nuget

[DllImport("user32.dll")]
public extern static bool ShutdownBlockReasonCreate(IntPtr hWnd, [MarshalAs(UnmanagedType.LPWStr)] string pwszReason);

[DllImport("user32.dll")]
public extern static bool ShutdownBlockReasonDestroy(IntPtr hWnd);

Abstract class for easy maintenance

Right now there are two classes (one for each project) which have mostly the same code.
Maybe implement an abstract class and let the two specialized classes inherit to make changes easier.
In commit/pull request #1 I had to add/edit 6 lines instead of 3.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.