.NET Standard Helper Library - JHelpers
-
I published a free to use, free to distribute, free support NuGet package for .NET Core. Standard, and Framework that provides a number of helpful methods and objects, called JHelpers[^] . To keep this post short, there is a public GitHub .NET project, JHelpers_Demo[^] that has source code showing how to use each method and object. The NuGet package is targeted to .NET Standard 2.0, is signed, and includes documentation. If you have any questions, please feel free to ask. Thank you. For those who might want a little more info, here you go. There are two primary parts of the library, ContextMgr and CommonHelpers. ContextMgr ContextMgr is a thread-safe singleton that can be used to store data in a single place accessible from anywhere, and any thread, in the application. One typical use is to store settings and other runtime values so their sources (file, database, etc.) only have to be read once. Anything that can be defined as a unique String name and a value or reference type of any kind can be kept there. Items in the collection are added as a String key name (which must be unique) and any value or reference type, boxed as a dynamic type. ContextMgr has no initialization, and as a singleton, does not use “new” to be created. The actual instance is dynamically created on the first reference in the code. Example:
// Adding values:
ContextMgr.Instance.ContextValues.AddCheck("Computer Name", Environment.MachineName);
ContextMgr.Instance.ContextValues.AddCheck("Startup Time", DateTime.Now);//Example of reading values:
dynamic machineName = "";
retVal = ContextMgr.Instance.ContextValues.TryGetValue("Computer Name", out machineName);
dynamic startupTime = "";
retVal = ContextMgr.Instance.ContextValues.TryGetValue("Startup Time", out startupTime);
this.Text = $"This program on {machineName} started at {((DateTime)startupTime).ToShortDateString()}";In your application’s shutdown code, I recommend adding this line so the ContextMgr disposes of its resources without waiting on the .NET garbage collector.
ContextMgr.Instance.Dispose();
CommonHelpers This is a static class with a number of u
-
I published a free to use, free to distribute, free support NuGet package for .NET Core. Standard, and Framework that provides a number of helpful methods and objects, called JHelpers[^] . To keep this post short, there is a public GitHub .NET project, JHelpers_Demo[^] that has source code showing how to use each method and object. The NuGet package is targeted to .NET Standard 2.0, is signed, and includes documentation. If you have any questions, please feel free to ask. Thank you. For those who might want a little more info, here you go. There are two primary parts of the library, ContextMgr and CommonHelpers. ContextMgr ContextMgr is a thread-safe singleton that can be used to store data in a single place accessible from anywhere, and any thread, in the application. One typical use is to store settings and other runtime values so their sources (file, database, etc.) only have to be read once. Anything that can be defined as a unique String name and a value or reference type of any kind can be kept there. Items in the collection are added as a String key name (which must be unique) and any value or reference type, boxed as a dynamic type. ContextMgr has no initialization, and as a singleton, does not use “new” to be created. The actual instance is dynamically created on the first reference in the code. Example:
// Adding values:
ContextMgr.Instance.ContextValues.AddCheck("Computer Name", Environment.MachineName);
ContextMgr.Instance.ContextValues.AddCheck("Startup Time", DateTime.Now);//Example of reading values:
dynamic machineName = "";
retVal = ContextMgr.Instance.ContextValues.TryGetValue("Computer Name", out machineName);
dynamic startupTime = "";
retVal = ContextMgr.Instance.ContextValues.TryGetValue("Startup Time", out startupTime);
this.Text = $"This program on {machineName} started at {((DateTime)startupTime).ToShortDateString()}";In your application’s shutdown code, I recommend adding this line so the ContextMgr disposes of its resources without waiting on the .NET garbage collector.
ContextMgr.Instance.Dispose();
CommonHelpers This is a static class with a number of u
Why are you posting this again? Your previous thread about this library[^] hasn't even dropped off the bottom of the first page yet. :doh:
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
-
Why are you posting this again? Your previous thread about this library[^] hasn't even dropped off the bottom of the first page yet. :doh:
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
Sean Ewington suggested using this forum to share about free tools. That is what this post is. The post you are referring to is about an article that addressed the topic of "build vs buy", using this NuGet package only as an example in discussing the topic. Two completely different things, plus the article in question is kept from the community by a handful of members who, for some unknown reason, think they are the judges of what the rest of us are allowed to read.
-
I published a free to use, free to distribute, free support NuGet package for .NET Core. Standard, and Framework that provides a number of helpful methods and objects, called JHelpers[^] . To keep this post short, there is a public GitHub .NET project, JHelpers_Demo[^] that has source code showing how to use each method and object. The NuGet package is targeted to .NET Standard 2.0, is signed, and includes documentation. If you have any questions, please feel free to ask. Thank you. For those who might want a little more info, here you go. There are two primary parts of the library, ContextMgr and CommonHelpers. ContextMgr ContextMgr is a thread-safe singleton that can be used to store data in a single place accessible from anywhere, and any thread, in the application. One typical use is to store settings and other runtime values so their sources (file, database, etc.) only have to be read once. Anything that can be defined as a unique String name and a value or reference type of any kind can be kept there. Items in the collection are added as a String key name (which must be unique) and any value or reference type, boxed as a dynamic type. ContextMgr has no initialization, and as a singleton, does not use “new” to be created. The actual instance is dynamically created on the first reference in the code. Example:
// Adding values:
ContextMgr.Instance.ContextValues.AddCheck("Computer Name", Environment.MachineName);
ContextMgr.Instance.ContextValues.AddCheck("Startup Time", DateTime.Now);//Example of reading values:
dynamic machineName = "";
retVal = ContextMgr.Instance.ContextValues.TryGetValue("Computer Name", out machineName);
dynamic startupTime = "";
retVal = ContextMgr.Instance.ContextValues.TryGetValue("Startup Time", out startupTime);
this.Text = $"This program on {machineName} started at {((DateTime)startupTime).ToShortDateString()}";In your application’s shutdown code, I recommend adding this line so the ContextMgr disposes of its resources without waiting on the .NET garbage collector.
ContextMgr.Instance.Dispose();
CommonHelpers This is a static class with a number of u
MSBassSinger wrote:
To keep this post short,
I very much appreciate that; however, it would be helpful to edit your post and explain briefly about these helper methods. I see the word JHelper and I think Java so I have no interest in them. It might be helpful to put a brief description of the type of helper methods.
Social Media - A platform that makes it easier for the crazies to find each other. Everyone is born right handed. Only the strongest overcome it. Fight for left-handed rights and hand equality.
-
Sean Ewington suggested using this forum to share about free tools. That is what this post is. The post you are referring to is about an article that addressed the topic of "build vs buy", using this NuGet package only as an example in discussing the topic. Two completely different things, plus the article in question is kept from the community by a handful of members who, for some unknown reason, think they are the judges of what the rest of us are allowed to read.
MSBassSinger wrote:
a handful of members who, for some unknown reason, think they are the judges of what the rest of us are allowed to read.
You really don't get it do you? It is not a question of what others are allowed to read, but whether the article adheres to the guidelines as set down in Submission Guidelines[^]. The approval system here is quite simple and works well in general. Anyone with a high reputation (i.e. people who contribute articles, answer questions etc.) are deemed to be qualified to review newly posted articles and measure them against the guidelines. If they are not considered to adhere to them all, then there are various ways that can be communicated. Either the article would be better as a Tip or Blog, or it really does not match the criteria and should not be published. The people voting may (or may not, it's their choice) leave a message if they feel it just needs some work, or it needs action by a CodeProject editor/administrator. This is not in any way a personal attack (most of us don't know you), nor does it mean any other articles you post will be similarly rejected.
-
MSBassSinger wrote:
To keep this post short,
I very much appreciate that; however, it would be helpful to edit your post and explain briefly about these helper methods. I see the word JHelper and I think Java so I have no interest in them. It might be helpful to put a brief description of the type of helper methods.
Social Media - A platform that makes it easier for the crazies to find each other. Everyone is born right handed. Only the strongest overcome it. Fight for left-handed rights and hand equality.
Excellent idea. I wasn't sure how well a longer post would be received. Thanks for your input.
-
MSBassSinger wrote:
a handful of members who, for some unknown reason, think they are the judges of what the rest of us are allowed to read.
You really don't get it do you? It is not a question of what others are allowed to read, but whether the article adheres to the guidelines as set down in Submission Guidelines[^]. The approval system here is quite simple and works well in general. Anyone with a high reputation (i.e. people who contribute articles, answer questions etc.) are deemed to be qualified to review newly posted articles and measure them against the guidelines. If they are not considered to adhere to them all, then there are various ways that can be communicated. Either the article would be better as a Tip or Blog, or it really does not match the criteria and should not be published. The people voting may (or may not, it's their choice) leave a message if they feel it just needs some work, or it needs action by a CodeProject editor/administrator. This is not in any way a personal attack (most of us don't know you), nor does it mean any other articles you post will be similarly rejected.
Apparently I get it better than you. Why are you over here on a different topic pursuing this? The article met what the guidelines require. It just did not meet you narrow and inaccurate interpretation.
-
Apparently I get it better than you. Why are you over here on a different topic pursuing this? The article met what the guidelines require. It just did not meet you narrow and inaccurate interpretation.