Skip to content

Latest commit

 

History

History
115 lines (78 loc) · 6.55 KB

CONTRIBUTING.md

File metadata and controls

115 lines (78 loc) · 6.55 KB

How to Contribute:

You can contribute to DevToys app by:

  • Report issues and bugs here.
  • Submit feature requests here.
  • Creating a pull request.
  • Internationalization and localization:
    • See instructions below.

How to Build and Run DevToys from source:

  • Make sure your machine is running on Windows 10 1903+.
  • Make sure you have Visual Studio 2019 16.10+ or Visual Studio 2022 17.0+ installed.
  • In Visual Studio Installer, install the required components by importing the vs2022.vsconfig or vs2019.vsconfig file.
  • Run init.ps1 in a PowerShell command prompt to restore all the dependencies.
  • Open src/DevToys.sln with Visual Studio and set Solution Platform to x64*.
  • Once opened, set src/dev/DevToys.Startup/DevToys.Startup.wapproj as startup project.
  • Now you should be able to build and run DevToys on your machine. If it fails, try to close the solution and reopen it again.

*If x64 doesn't work, use the architecture of your system

Internationalization and localization

There are two possibilities offered:

Use Crowdin (preferred)

  • Go on DevToy's Crowdin project. Crowdin is a localization management platform that helps individuals to translate a project without having to be familiar with its repository.
  • Log in or create an account. Join the DevToys project.
  • Select the language of your choice in the list of existing supported language and let yourself guided by the website to translate the app.
  • If you want to add a new language, please create a new discussion on Crowdin's website or on GitHub. We will be happy to add your language to the list.
  • When your translation is done, it will be synchronized with our GitHub repository within 1 hour and create a pull request.

Change the translations in the repository yourself

This approach is more complex but has the advantage that it allows you to test your changes on your local machine.

  • After following How to Build and Run DevToys from source, close Visual Studio, if any instance is running.
  • In File Explorer, copy the folder dev/impl/DevToys/Strings/en-US and rename the copied folder with the language indication of your choice. For example, "fr-FR" for French (France).
  • Open src/DevToys.sln with Visual Studio.
  • Open each .resw file from the language folder you created and translate the text.
  • Build and Run the app and test your changes.

Coding

Main architecture

DevToys is using MEF as a dependency injection framework. Every tool available (i.e Base64 Encoder/Decoder, JSON Formatter, Settings...) are dynamically discovered and instantiated through MEF. A tool is divided in 3 components:

  1. IToolProvider and its metadata, which represents the tool as displayed in the main menu in the app. IToolProvider should be MEF exported.
  2. IToolViewModel, which is a ViewModel as described by the MVVM pattern in UWP. It doesn't have to be MEF exported but may be required depending on what the tool needs to work.
  3. A Page that represents the view of the tool.

The tool provider is instantiated when the app starts. The view and view models are instantiated when the user selects the tool in the main menu.

IToolProvider metadata

Several attributes can be used when implementing an IToolProvider. They can be used in customize the behavior of the tool in DevToys without needing to implement a special logic for it. You can find the attributes here. Here is a non-exhaustive list of attribute to use:

Iconography

Icons in the UI of a tool or in the main UI of DevToys uses Fluent System Icons. For the icons of the tools, a custom font is used. See documentation here for modifying it (or ask us for help!).

Sample

A good tool to take an example on is Json <> Yaml converter.

Things to keep in mind

We try to avoid at maximum any UWP capability/permission like internet, camera, location...etc. The reason why is that this app is designed to be a tool that we can trust when pasting sensitive data inside. Therefore, when making changes to DevToys, please try at maximum to avoid any capability requirement.

Code Style

  1. DO use PascalCase:
  • class names
  • method names
  • const names
  1. DO use camelCase:
  • method arguments
  • local variables
  • private fields
  1. DO NOT use Hungarian notation.

  2. DO NOT use underscores, hyphens, or any other non-alphanumeric characters.

  3. DO NOT use Caps for any names.

  4. DO use predefined type names like int, string etc. instead of Int32, String.

  5. DO use _ prefix for private field names.

  6. DO use the I prefix for Interface names.

  7. DO vertically align curly brackets.

  8. DO NOT use Enum or Flag(s) suffix for Enum names.

  9. DO use prefix Is, Has, Have, Any, Can or similar keywords for Boolean names.

  10. DO use curly brackets for single line if, for and foreach statements.

  11. DO use nullable reference type by adding #nullable enable at the top of every C# file.