Welcome to LibraryGPT, a comprehensive utility library designed to streamline various aspects of c# and winforms development. This library encompasses a wide range of utilities, from configuration and data handling to UI and security. All code generated by chatGPT 4 with prompts and prodding by me. A collection I plan on updating whenever possible to see how many "universal" (for the most part) methods I can get her to lend me.
- .NET Framework 4.8
- Add a reference to
LibraryGPT.dll
in your project. - Import the necessary namespaces.
- Call the desired methods or instantiate the classes as needed.
// Using ThreadingUtilities for non-blocking UI updates
await ThreadingUtilities.UpdateTextBoxAsync(myTextBox);
// Implementing the Factory pattern from PatternImplementations
IAnimal animal = PatternImplementations.AnimalFactory.CreateAnimal("dog");
Collection of A.I generated, human tweaked, all purpose functions for use in c# and Winforms focused development.
Features:
- Configuration Utilities: Fetch and set configuration settings, manage environment variables, handle configuration files.
- Data Handling: JSON and XML serialization/deserialization, email format validation.
- Database Utilities: Asynchronous SQL command execution, connection string management.
- Design Patterns: Common design patterns like Singleton, Factory Method, Adapter, Decorator, Observer, and Strategy.
- Dialog Utilities: Simplified dialog box creation for information, error, and warning messages, user input handling.
- Event Utilities: Custom event handling and logging.
- Exception Handling: Utility methods for common exception handling scenarios.
- Security: Encryption and decryption of strings.
- Other Utilities: UI, Task, Threading, and various other utility classes.
UIUtilities
Purpose: Facilitates dynamic control creation and enhances user interface elements.
Examples: Dynamic control resizing, password input field, tab controls, context menus, custom drawing, tooltips, etc.
ThreadingUtilities
Purpose: Manages threading, asynchronous operations, and ensures non-blocking UI updates.
Examples: Using async/await for non-blocking UI, BackgroundWorker for threaded operations, Invoke for cross-thread UI updates, etc.
DataUtilities
Purpose: Provides robust methods for data manipulation and validation.
Examples: Using LINQ for data manipulation, data validation, clipboard operations, etc.
FileAndIOUtilities
Purpose: Offers a suite of functions for file operations and input/output tasks.
Examples: File operations (reading/writing), detecting USB insertion/removal, etc.
EventAndDelegateUtilities
Purpose: Functions and patterns related to events, delegates, and custom event arguments.
Examples: Custom events with EventArgs, implementing triggers/delegates, etc.
PatternImplementations
Purpose: Implementations of various design patterns.
Examples: Factory pattern, strategy pattern, observer pattern, command pattern, decorator pattern, state pattern, etc.
WebUtilities
Purpose: Functions related to web operations, scraping, and web-based tasks.
Examples: Web scraping functions, web-based ticket automation, etc.
HardwareUtilities
Purpose: Functions related to hardware interactions and operations.
Examples: Detecting USB insertion/removal.
FormUtilities
Purpose: Functions specifically related to form operations and events.
Examples: Hide form to system tray, handle form closing event, resize controls with form, etc.
TaskUtilities
Purpose: Functions related to tasks, timers, and scheduled operations.
Examples: Timed actions, using Task.Run for fire-and-forget operations, etc.
ExtensionMethods
Purpose: General utility functions that extend existing classes for added functionality.
Examples: String extensions, list extensions, etc.
DatabaseUtilities
Purpose: Functions related to database operations, queries, and data retrieval.
Examples: Simple database operations using ADO.NET or Entity Framework.
ConfigurationUtilities
Purpose: Functions related to configuration, settings, and user preferences.
Examples: Using a configuration file, save and load user preferences, etc.
DialogUtilities
Purpose: Functions related to showing dialogs, messages, and user prompts.
Examples: Modal dialogs, message prompts, etc.
Contributions to LibraryGPT are welcome. If you have ideas or functions that can be added to this library, please feel free to fork the repository, make your changes, and submit a pull request.
- 1.0.0 - Initial release with basic utilities.
- 1.1.0 - Added design patterns and enhanced UI utilities.
For any queries, feedback, or contributions, please contact:
- Name: SuperHands
- Email: anthon3869@gmail.com
- GitHub: https://www.github.com/ant3869
This project is licensed under the MIT License - see the LICENSE file for details.