C# Pro UA is a repository containing solutions to assignments from the C# Video Course for Professionals. This course provides an in-depth exploration of the Microsoft .NET Framework and the C# language, covering essential topics such as:
- Custom and system collections
- Input/output operations
- Regular expressions and text processing
- XML handling and configuration management
- Reflection, attributes, and serialization
- Memory management and garbage collection
- Versioning and design patterns
-
Custom Collections
- Task 2: Implemented a
MonthCollectionclass that stores month names, their order numbers, and the number of days in each month. Implemented search functionality by order number or days. - Task 3: Developed a
FamilyMembercollection resembling a family tree, allowing adding/removing family members and filtering by birth year. - Task 4: Created a
DictionaryEntryclass for a multilingual dictionary, enabling retrieval of either the Russian or English translation for a Ukrainian word. - Task 6: Implemented a method in
Program.csthat takes an array of integers and returns a collection of squares of all odd numbers using theyieldoperator.
- Task 2: Implemented a
-
System Collections
- Task 2: Implemented in
Program.cs. Created a collection where customers and the categories of purchased products are stored. The collection allows retrieving purchased categories per customer or determining customers by product category. - Task 3: Implemented in
Program.cs. Created multiple collection implementations that store only integers and floating-point values, similar to a "company account – available balance" structure. - Task 4: Implemented in
Program.cs. Developed anOrderedDictionarycollection with custom comparison capabilities. - Task 6: Implemented in
Program.cs. UsedSortedListto create a collection and displayed key-value pairs in alphabetical order and then in reverse order.
- Task 2: Implemented in
- Task 2: Implemented in
Program.cs. Created a file, wrote arbitrary data into it, closed the file, then reopened it, read the data, and displayed it on the console. - Task 3: Implemented in
Program.cs. Developed a program to search for a specified file on disk. Added functionality usingFileStreamto view the file in a text window and provided an option to compress the found file. - Task 6: Implemented in
Program.cs. Created 100 directories namedFolder_0toFolder_99on disk and then deleted them.
- Task 2: Implemented in
Program.cs. Extracted all links, phone numbers, and email addresses from a given web page and saved them to a file. - Task 3: Implemented in
Program.cs. Created a "Decoder" program that replaces all prepositions in a text file with the word "BARK!". - Task 4: Implemented in
Program.cs. Generated a receipt file containing "Product Name – Price UAH" entries with a purchase date and displayed it in both the user's current locale anden-USformat. - Task 6: Implemented in
Program.cs. Developed a console program that allows users to register with aLoginconsisting only of Latin alphabet characters and aPasswordcomposed of numbers and symbols.
- Task 2: Implemented in
Program.cs. Created a program that outputs all information about a specified.xmlfile. - Task 3: Implemented in
Program.cs. Extracted and displayed only phone numbers from theTelephoneBook.xmlfile. - Task 4: Implemented in
Program.cs. Developed an administrator program that saves configuration data in a special file or Windows registry. Created a user program whose interface can be controlled by the admin program. - Task 6: Implemented in
Program.cs. Generated an.xmlfile namedTelephoneBook.xml, which follows these specifications:- Root element:
MyContacts - Each contact is represented by a
Contacttag with the contact name and an attributeTelephoneNumbercontaining the phone number.
- Root element:
- Task 2: Implemented in
Program.cs. Created a custom assembly following the example ofCarLibraryfrom the lesson. This assembly is used for atemperature converter. - Task 3: Implemented in
Program.cs. Developed a program that provides the user access to the assembly from Task 2. Implemented a method for converting temperature from Celsius to Fahrenheit using only reflection. - Task 5: Implemented in
Program.cs. Created a reflection-based program that retrieves information about an assembly and the types contained in it. The base for this implementation was taken from the lesson's reflector program.
- Task 2: Implemented in
MyClass.cs. Applied the Obsolete attribute to methods, demonstrating warnings and compilation errors. - Task 3: Implemented in
Program.cs. Extended the reflection program, adding filtering of type members and attribute display. - Task 5: Implemented in
SecureSystem.cs. Created a custom attribute for defining user access levels and implemented role-based access control.
- Task 2: Implemented in
Program.cs. Created a serializable class and performed XML serialization with default formatting and modified it to store field values as XML attributes. - Task 3: Implemented in
Program.cs. Deserialized the object from Task 2 and displayed its state. - Task 5: Implemented in
Program.cs. Created a custom type, serialized its object, considering network transmission requirements.
- Task 2: Implemented in
Program.cs. Created a resource monitoring class that tracks memory usage and issues warnings when consumption approaches a set threshold. - Task 4: Implemented in
Program.cs. Developed a memory-intensive class with a large array and implemented a formalized cleanup pattern.
- Task 2: Implemented in
Program.cs. Studied the Template Method pattern and implemented its abstract version in C#. - Task 4: Implemented in
Program.cs. Applied the Non-Virtual Interface (NVI) pattern in a custom inheritance hierarchy.
- Task 2: Implemented in
Program.cs. Created a console application that reads from two files in parallel threads and writes the data into a third file using thread synchronization. - Task 4: Implemented in
Program.cs. Modified thread execution to ensure the sequential operation of three threads using locking mechanisms.
- Task 3: Implemented in
Program.cs. Created a program that allows only one instance to run at a time using a named Mutex. - Task 5: Implemented in
Program.cs. Used a Semaphore to control access to a resource from multiple threads, ensuring an ordered log output.
- Task 2: Implemented in
Program.cs. Created two methods running as parallel tasks and invoked them usingInvokewithout blocking the main thread. - Task 4: Implemented in
Program.cs. Generated a large array (1,000,000+ elements) with random values and used PLINQ to filter out all odd numbers.
- Task 2: Implemented in
Program.cs. Created a console simulation of a WPF app that imitates database connection and data polling usingasync/awaitandTimer. - Task 4: Implemented in
Program.cs. Refactored a multithreaded task from lesson 11 usingasync/awaitfor sequential execution of three tasks.
- Task 2: Implemented in
Program.cs. Created a custom SynchronizationContext and used it withasync/awaitto track thread info before and afterawait. - Task 3: Implemented in
Program.cs. Modified task continuation to run on a ThreadPool thread without removing the custom context. - Task 4: Implemented in
Program.cs. Created a SynchronizationContext with error handling forasync voidmethods and verified exception processing.
- .NET SDK (latest stable version)
- C# compiler
- IDE of your choice (Visual Studio, JetBrains Rider, or VS Code with C# extension)
- Clone the repository:
git clone https://github.com/Weretik/CSharp-Pro-UA.git
- Open the project in your preferred IDE.
- Navigate to the specific topic folder.
- Run the
Program.csfile within that topic to execute the examples.
This project is open-source and available under the MIT License.