Fading Coder

One Final Commit for the Last Sprint

Home > Tech > Content

Essential Visual Studio 2022 Extensions for Productivity and Code Quality

Tech 8

C# Method Signature Generation

Quickly scaffold method definitions by typing a shortcut keyword followed by the Tab key.

  • method: Standard method
  • imethod: Interface method (lacks implementation body)
  • vmethod: Virtual method
  • smethod: Static method
  • xmethod: Extension method
  • amethod: Asynchronous method
  • asmethod: Asynchronous static method
// Type "eh" + Tab to generate:
private void OnCustomEvent(object sender, EventArgs args)
{
    throw new NotImplementedException();
}
  • eh: Event handler
// Type "seh" + Tab to generate:
private static void HandleStaticEvent(object sender, EventArgs args)
{
    throw new NotImplementedException();
}
  • seh: Static event handler

Prism MVVM Snippets

A collection of item templates, project templates, and code shortcuts for building WPF applications with the Prism framework.

  • propp: Bindable property backed by a private field
private string _userName;
public string UserName
{
    get => _userName;
    set => SetProperty(ref _userName, value);
}
  • cmd: DelegateCommand with an execute action
private DelegateCommand _submitCmd;
public DelegateCommand SubmitCommand =>
    _submitCmd ??= new DelegateCommand(OnSubmit);

private void OnSubmit() { }
  • cmdfull: DelegateCommand with execute and canExecute logic
private DelegateCommand _saveCmd;
public DelegateCommand SaveCommand =>
    _saveCmd ??= new DelegateCommand(OnSave, CanSave);

private void OnSave() { }

private bool CanSave() => true;
  • cmdg: Generic DelegateCommand with a typed parameter
private DelegateCommand<string> _searchCmd;
public DelegateCommand<string> SearchCommand =>
    _searchCmd ??= new DelegateCommand<string>(OnSearch);

private void OnSearch(string query) { }
  • cmdgfull: Generic DelegateCommand with typed parameter and canExecute logic
private DelegateCommand<int> _deleteCmd;
public DelegateCommand<int> DeleteCommand =>
    _deleteCmd ??= new DelegateCommand<int>(OnDelete, CanDelete);

private void OnDelete(int id) { }

private bool CanDelete(int id) => true;

Text Occurrence Highlighting

Visually highlights all instances of a selected word within the document and places corresponding markers on the scroll bar margin for easy navigation.

Syntax and Bracket Colorization

Enhances the text editor by rendering distinct colors for matching bracket pairs, emphasizing language keywords, and improving the visual structure of XML documents.

Color-Coded Build Output

Alters the text color in the output window based on the severity level of the log message. Color mappings are fully customizable within the IDE options.

Code Organization and Cleaning

A refactoring utility designed to format and clean up code structure. It handles removing unused regions, sorting methods, and organizing file layouts.

Editor Background Customization

Renders a custom image or a slideshow as the background of the code editor or the entire IDE. When using slideshow mode, keep the transition interval reasonably high to prevent performance issues or application crashes. Settings for image sources and opacity are available in the options menu.

XAML Formatting

Reorganizes and standardizes XAML markup formatting according to configurable styling rules, ensuring consistent attribute ordering and indentation.

Editor Theme

A refined color theme providing a cohesive and high-contrast visual experience across the IDE interface.

Auto-Formatting on File Save

Triggers the document formattting rules automatical whenever a file is saved, ensuring consistent code style without manual intervention.

Related Articles

Understanding Strong and Weak References in Java

Strong References Strong reference are the most prevalent type of object referencing in Java. When an object has a strong reference pointing to it, the garbage collector will not reclaim its memory. F...

Comprehensive Guide to SSTI Explained with Payload Bypass Techniques

Introduction Server-Side Template Injection (SSTI) is a vulnerability in web applications where user input is improper handled within the template engine and executed on the server. This exploit can r...

Implement Image Upload Functionality for Django Integrated TinyMCE Editor

Django’s Admin panel is highly user-friendly, and pairing it with TinyMCE, an effective rich text editor, simplifies content management significantly. Combining the two is particular useful for bloggi...

Leave a Comment

Anonymous

◎Feel free to join the discussion and share your thoughts.