|
| 1 | +# Coding Conventions |
| 2 | + |
| 3 | +Junie Pro generated these guidelines using the Gemini 3 model. |
| 4 | + |
| 5 | +## General |
| 6 | +* **Language**: C# (Latest version features used, e.g., file-scoped namespaces, target-typed new). |
| 7 | +* **Framework**: .NET 10.0 (Windows). |
| 8 | +* **Architecture**: MVVM (Model-View-ViewModel). |
| 9 | +* **UI Framework**: WPF (using MahApps.Metro and Dragablz). |
| 10 | + |
| 11 | +## Naming Conventions |
| 12 | +* **Classes, Methods, Properties, Enums**: PascalCase. |
| 13 | +* **Private Fields**: `_camelCase` (underscore prefix). |
| 14 | + * Exception: `private static readonly ILog Log` (PascalCase). |
| 15 | +* **Event Handlers**: `Object_EventName` (e.g., `SettingsManager_PropertyChanged`). |
| 16 | +* **Interfaces**: `IPascalCase` (prefix with I). |
| 17 | + |
| 18 | +## Formatting |
| 19 | +* **Indentation**: 4 spaces. |
| 20 | +* **Braces**: Allman style (opening brace on a new line). |
| 21 | +* **Namespaces**: File-scoped namespaces (`namespace MyNamespace;`). |
| 22 | +* **Imports**: `using` directives sorted alphabetically, `System` namespaces mixed in. |
| 23 | +* **Grouping**: `#region` used to group related members (e.g., Variables, Events, Properties). |
| 24 | + |
| 25 | +## Specific Practices |
| 26 | +* **Logging**: Use `log4net` via `LogManager.GetLogger(typeof(ClassName))`. |
| 27 | +* **Properties**: Implement `INotifyPropertyChanged` (usually via `ViewModelBase`). Use expression-bodied members for getters where concise. |
| 28 | +* **Null Checks**: Use pattern matching or standard checks. |
| 29 | +* **Localization**: Use static `Strings` class (e.g., `localization:Strings.MyString`). |
| 30 | +* **Documentation**: XML documentation comments (`///`) for all public members. |
| 31 | + |
| 32 | +# Code Organization and Package Structure |
| 33 | + |
| 34 | +## Projects |
| 35 | +The solution is divided into multiple projects to separate concerns: |
| 36 | + |
| 37 | +* **NETworkManager**: The main WPF application project. Contains the entry point (`App.xaml`), main window, and feature-specific Views and ViewModels. |
| 38 | +* **NETworkManager.Controls**: Custom WPF UI controls used throughout the application. |
| 39 | +* **NETworkManager.Converters**: WPF Value Converters for data binding. |
| 40 | +* **NETworkManager.Models**: Core business logic, data entities, and service wrappers (e.g., Network, Ping, Traceroute logic). |
| 41 | +* **NETworkManager.Utilities**: General purpose utility classes and helpers. |
| 42 | +* **NETworkManager.Utilities.WPF**: WPF-specific utility classes. |
| 43 | +* **NETworkManager.Settings**: Manages application settings and configuration persistence. |
| 44 | +* **NETworkManager.Profiles**: Logic for handling network profiles. |
| 45 | +* **NETworkManager.Localization**: Contains localization resources (`Strings.resx`). |
| 46 | +* **NETworkManager.Validators**: Input validation logic. |
| 47 | +* **NETworkManager.Documentation**: Application documentation resources. |
| 48 | +* **NETworkManager.Update**: Logic for checking and applying application updates. |
| 49 | +* **NETworkManager.Setup**: Related to the installer setup. |
| 50 | + |
| 51 | +## Directory Structure |
| 52 | +* `/NETworkManager` |
| 53 | + * `/Views`: XAML Views (UserControls, Windows). |
| 54 | + * `/ViewModels`: ViewModels corresponding to Views. |
| 55 | + * `/Resources`: App-specific resources. |
| 56 | +* `/NETworkManager.Models` |
| 57 | + * Organized by feature (e.g., `/Network`, `/Ping`, `/Lookup`). |
| 58 | +* `/3rdparty`: Third-party libraries and dependencies. Junie must not modify these libraries and dependencies. |
0 commit comments