SharpDevelop Community

Get your problems solved!
Welcome to SharpDevelop Community Sign in | Join | Help
in Search

Siegfried Pammer

August 2008 - Posts

  • New feature: Extract method

     In the upcoming SharpDevelop 3 there's a new refactoring included: Extract method. With it you can easily split a method into two independent methods.

    If you want to use it you first have to select the piece of code you want to extract:

    Then just click on Refactor > Extract method in the main menu:

     The preview will pop up, here you can enter a name for the new method:

     After entering a name click "OK" and here you can see the new method and the inserted call:

    Of course you can undo the change, just press Ctrl+Z.

    I hope you find this refactoring useful and I would be glad to receive any comments on this.

  • The Hex Editor

    Basically the UI of the hex editor is divided into two views. On the left side you can edit/input the parts of the bytes as hexadecimal figures. On the right side you can edit/input the data as ASCII characters:

    The interface of the hex editor.

    On the left-most side and on the top you see the offsets of the bytes you look at. You can switch the way the offsets are displayed by selecting either "hexadecimal", "decimal" or "octal" in the toolbar above. The number of bytes displayed per line can be changed using the middle up-down-field.

    In the screenshot you can see that it is disabled, that's because the button on the left is switched on. If it is switched on, the number of bytes displayed per line is calculated automatically to fit the current width of the editor's window. When you resize the window, the number of bytes per line is adjusted automatically.

    Editing data in the hex editor

    You can either input data using the 0, 1, ..., 8, 9, A, ..., F keys on the left side or just change it on the right side like in a normal text editor. Text can be selected using the mouse with the left mouse button held down or using left shift and the arrow keys.

    Text can be copied, pasted and cut using Ctrl+C, Ctrl+V and Ctrl+X. Ctrl+A selects everything the editor.You can switch between the left and the right side without loosing the current selection or position using the TAB key. Using Ctrl+Up or Down arrow key you can scroll the view without moving the caret.

    Customizing the hex editor

    In the options dialog you can customize the standard behavior of the hex editor:

    The options dialog.

    You can simply change the font, style and/or color of the offsets or the data. It is recommended to use fixed-size fonts for best view (like Courier, Courier New). Furthermore you can force the editor use "automatic fitting of bytes per line" or set a standard view-mode and a standard number of bytes per line. You can tell SharpDevelop to open specific file-types with the hex editor using the last text-field.

    One important thing: You have to set ALL settings (even font, style and size and standard number of bytes per line) when you first open up the settings dialog, before this point there's no settings-file and the hex editor uses it's built-in standard settings, but when a settings file is created and there is no font selected, another standard font is used.

    I would be glad to receive tips for improvement and feature requests for the hex editor.

Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.