Thursday, September 09, 2010

Let’s get ready to Kindle!!!!

 

I’ve got a new Kindle (3rd generation)

Here are some pics. Review to follow later if when I can stop playing with it :)

2313

45614

15

And here are some shots of the cover.

891011

12

I would have added a shot of my new Kindle situated in it’s new home, but the battery on my camera gave out at this point.


Thursday, July 08, 2010

Echo…. echo…. echo…..

Just a very quick post in case you missed the updated link in my previous post.

There is the distinct possibility that this blog may go quiet for a while. It seems a little silly to cross-post to both here and My New DevExpress Blog.

So if you’re looking for CodeRush, CodeRush Xpress, RefactorPro or DXCore information, head on over to My New Blog and check out the rest of http://devexpress.com/ whilst you’re there.


Tuesday, July 06, 2010

New Beginnings…


It’s true what they say…

“As one door closes, another opens”

…and who can tell what new opportunities the new door might reveal.

Just recently I blogged there’s going to be “too much happening at work, for me to be able to juggle all my “Official” work, with my DX-Squad responsibilities.

…and this is technically true. If I had to do both one thing and the other without some sort of reconciliation, I’d probably go mad.

However it wasn’t the *entire truth*.

You see there is a very good reason that there’s going to be “too much happening at work”….

Big Announcement

I’ve joined DevExpress

Yup I’m going to join Mark and the gang in promoting the DevExpress IDE Tools.

CodeRush Pro/Xpress, RefactorPro and DXCore

Its worth noting that I’ve not actually given up my previous job. DX did ask, but honestly the family business couldn’t take the hit at this time. We’ll see what happens in the future… Who knows :)

Instead I’ll be working part time on all manner of things CodeRush related. But rest assured… My existing employer is aware of the situation and is ok with this new arrangement.

So what’s changed?

Well that’s a good question….. The simple answer is … well … not much really :)

I asked what my job title would be. The best we’ve come up with so far is “CodeRush Community Evangelist”. What do you think? Can you come up with anything better?

In theory, I’m going to be more focused. After all I’m being paid to do this now. This also means that I’ll be forgiven more easily by my wife, for the amount of time I sometimes spend in the evenings on these things :)

One way of looking at this, is that DevExpress thought it would be cool to be able to direct my efforts a little more than they do now.

The way I see it, it’s not such a good idea to dig too deeply into this sort of thing… If I ask too many questions they might change their mind :)

Community Plugin Site

Don’t worry the community site is still a community site. It and the plugins on it (current and future) will continue to be owned by the community. Nothing is changing there.

I’m going to continue all of my community stuff. I’ll still write plugins. I’ll still blog. Hey you never know they might even let me write on the official site :P.

What will I do?

The simple answer to this is ‘More of the same’. I’ll have greater access to the devs behind this wonderful set of products (You know, the crack squad of awesome guys that actually implement the stuff that Mark Miller comes up with)

With this new level of access, I should be even better equipped to answer questions and writing plugins. So we all win. Hurrah!

The biggest change from my perspective is that I can’t say “I don’t work for DevExpress” anymore. I’m going to have to work on that one :) Although it’s already recorded all over the place, so I hope you’ll forgive me if I don’t attempt to track down each and every instance.

So what next?

So I’m just off now for my ‘Kool-aid upgrade’.

Instead of making regular visits to the Kool-Aid fountain, I’ve got this new Kool-Aid Patch which hydrates Kool-Aid directly from moisture in the air around me. :)

Oh and while I’m on the topic of Kool-Aid, If anyone thinks for a minute that this will make me *more* Pro-CodeRush, I advise you to stop and think for a minute about that….

How exactly is that possible?

Seriously?

So after my Kool-Aid upgrade, I’ll be off to learn a few secret handshakes and will catch you all on the other side.

I think things are about to get interesting :D


All good things….


I’ve been a member of DX-Squad since some time in April 2006.

After driving Mark Miller, Dustin Campbell and others round the bend asking questions, I finally started retaining enough of this information, that I was able to repeat it to others who came along asking similar questions.

A little while later Dustin suggested I be invited to join the DX-squad, and Mark Miller agreed. I am very grateful to them both for this.

DX-Squad is “A volunteer group of advanced users supporting our tools/component technologies and development community”

What this boils down to, is helping out on the DX forums answering questions on DX technology. It’s kind of like being a DevExpress MVP. And in exchange, DX grants the squad a gratis license to their stuff. It’s an arrangement which benefits both parties and I have found it to be very agreeable.

So I’ve been hanging out on the forums and more recently on twitter answering questions on CodeRush etc for the last 4 years or so. However I’m afraid the time has come to leave.

Unfortunately nothing is forever, and there’s just going to be too much happening at work, for me to be able to juggle all my “Official” work, with my DX-Squad responsibilities.

This being the case, I’m afraid something has to give… and realistically I’m afraid it’s membership of the DX-squad that is going have to loose out in this case.

So after a little over 4 years of helping to answer questions on CodeRush, the DXCore and related tech, I think it’s time to move on.

It’s been great working with my fellow DX-Squaders, who all do a great job supporting their respective areas of DevExpress goodness. I hope they’ll not shun me too much for this decision, and might even continue to provide the odd nugget of help in the future, if should I need it :)

I would like to say a huge thank you to everyone who’s ever used a plugin that I’ve written, and even more so to those who’ve suggested ideas (whether I’ve taken them up on the idea or not). I encourage everyone to go take a look at CodeRush, CodeRush Xpress, Refactor Pro and the DXCore.

IMO they are truly the most useful tools I’ve ever come across.

Unfortunately now (as has oft’ been said)…

…All good things must come to an end.


Monday, May 24, 2010

Template Driven Assembly References


In comments on my previous post @BlackMael asked about doing something similar to DX_NewItem, only with assembly references instead of Project Items.

That sounds like a challenge to me :D

My answer to this is that there already exists an AddAssemblyReference TextCommand in CodeRush. But that ‘s only useful if you know what to do with it.

So here’s a quick guide on setting up a “Dynamic List” of Assemblies

  • First Create a new Dynamic list (DevExpress\Options  Core\Dynamic Lists)

DynamicList0   

  • Then populate it with Assembly names and suitable mnemonics

DynamicList3DynamicList1

  • Finally create a template that references the variable used in the list.

DynamicList2

You’re done!

You can now use ‘ar’ in combination with any Assembly added to the assembly list and CodeRush will add your assembly reference without ever needing to go near the dreaded “Add Reference” Dialog


New CodeRush plugin ‘DX_NewItem’ replaces ‘Add New Item’ dialog

Note:This plugin requires the full version of CodeRush (Or a trial of same). Xpress is not supported at this time.]

I’m sick of visual studio’s ‘Add New Item’ dialog.

It’s filled with way too many items I’ll never use and it’s slow to use.

So I’ve created a CodeRush plugin to replace it in > 90% of cases.

Now I’m sure you already use CodeRush templates to create classes, methods , Interfaces and the like, but what about when you need to create something more complicated.

Something with multiple files. Something which studio is already capable of creating and where creating a CodeRush template would take too long.

Wouldn’t it be nice if you could ask CodeRush to trigger a Visual Studio Item template without having to muck around in the “Add New Item” dialog trying to find it first?

Well now you can!

  • Locate DX_NewItem
  • Deploy the dll to your plugin folder
  • Extract the settings file to the correct location
  • Create a single CodeRush template

and you’re done (full instructions here)

Now you have the benefit of the ‘an’ template. ‘an’ is a mnemonic for ‘Add new

For example:

anwf<space> – add new win form to your project.

anxf<space> – add new xml file to your project.

andxp<space> – add new dxcore plugin to your project.

[Note: Other Templates are already catered to… See the ‘Templates’ list on the ‘Core\Dynamic Templates’ (advanced) option page – ]

How sweet is that?!!

I’ll be adding support for other items as time goes on, but you can already add your own via the instructions on the wiki page

And now for something more visual:

DX_NewItem


Friday, May 21, 2010

CodeRush 10.1 hits RTM


Yes I know I’m a bit late with this news but I was on twitter this morning and noticed that people were still under the impression that CodeRush 10.1 was still in beta.

So let me set the record straight… Here are the facts:

  • CodeRush 10.1 (along with DXperience) hit RTM at approx 21:40 BST on 19th May.
  • CodeRush is available to subscribers from the DevExpress Client Center
  • CodeRush Xpress (Still Completely Free!!!) is available from it’s own page
  • A trial of CodeRush (Full version) is available from this page
  • The current version is 10.1.4
  • CodeRush 10.1 works under VS2010, VS2008 and VS2005
  • CodeRush has a new Color Picker which absolutely rocks in *any* color related scenario (WPF, CSS, VB, CS)
  • The Graphical API has been rewritten to the account for the changes in VS2010
  • Microsoft have requested that some features be removed from CodeRush Xpress under VS2010
    • This is believed to be because they introduced ‘similar’ features in VS2010 that they wanted to promote.
    • Such features include QuickNav, QuickFileNav, Tab To Next Reference, Highlight References and several consume first Code Generators
    • These features all still work under VS2008 and VS2005
    • These features all still work in the Trial or Full versions of CodeRush
    • MS paid to license CodeRush Xpress to all users of VS Pro or higher, so frankly they have the right to say what they’re willing to pay for. It kinda sucks but this is actually not unreasonable.

So go out spread the word “CodeRush has come to VS2010” - Which means VS2010 is finally usable :D


Friday, April 30, 2010

How much faster is CodeRush ?


Recently DevExpress released a video which compared the rename functionality in CodeRush to that of in of it’s competitor products.

There then followed some discussion on Twitter, about how valid the tests were.

Questions were raised like “Why would anyone want undo like that ?” and comments were made like “He probably used a pre-release version of ‘Brand X’ productivity tool. They’re always slower than the RTM versions”.

These are potentially fair points. Lets see if we can address them.

“Why would anyone want to do that?”

First up “Why would anyone want undo like that” . Now I must confess I’ve can’t now find the tweet in question in order to quote this properly, but the person who mentioned this appeared confused about why anyone would want to do an undo at that point in time.

[To put this statement in context… the DevExpress Video shows a rename of a local symbol using the Brand X product, occurring at approx 0:30 of said video, and then shows the effect of trying to undo this at approx 0:40]

Why should being able to undo something be unnecessarily restricted. I frequently get called away in the middle of something, come back, wonder what I was doing exactly. Sometimes undoing and redoing is a good way to remember.

In any case I don’t think there is any point at which it should be suggested that undo is unreasonable. If your tool is telling making anything that you do this awkward and error prone, IMO you should re-evaluate if it’s helping you or not.

Bottom line: This clearly works in CodeRush… It clearly doesn’t work in Brand X.

“It was probably an unfair test using a pre release version of Brand X”

Well I can see why some people might think this. DevExpress did this test, and they did it on a one of their own solutions. This does make it kind of hard to verify independently, since they’re hardly about to hand out the source of CodeRush :D

…and so I decided to do my own test :)

You might say that I am biased also. However the test I conducted is reproducible by anyone who cares to do so using their tool of choice.

  • I started by selecting an open source project that anyone could get hold of. I chose Paint.Net version 3.5.5
  • I then downloaded the latest version of CodeRush 10.1 (This will soon be available to anyone as RTM is imminent) and the latest version of Brand X (Available from their main page. Can’t get less pre-release than that :D)
  • Both tools were installed and in each case, whilst a test was being done, the opposing product was disabled.
  • I restarted Studio for each test and allowed the CPU to settle after loading the solution before starting the test.
  • I used a quad core machine with 2GB RAM (Yeah I know I need more RAM) running on Win7 x64 (My home machine)

And so I looked around for something in the solution which would have a lot of references.

After some fairly casual looking around, I couldn’t find anything with more than about 50 references. Then I had a brainwave…. I’d rename the main namespace. [Note:CodeRush took all of 4.1seconds to tell me that there were some 416 references to this in 197 files.] This seemed like it would be enough of a test.

What followed was a fairly boring, so frankly I’ll skip straight to the results:
[Note: If you’re interested in the details, they’re pretty much the same as the CodeRush Video at 01:53]

Product Time to rename
CodeRush 22 seconds
Brand X 4 minutes and 28 seconds

Conclusion

So with the latest versions of each product, and a test you can reproduce yourself if you really want, to my conclusion is:

Mark Miller is wrong.
CodeRush is not 10x faster than Brand X….. It’s 12x faster :D

With a difference this big… I couldn’t just have made myself a Coffee…. I could have ground the beans myself.


Wednesday, April 21, 2010

New ‘Color Swatch’ Feature in CodeRush 10.1

Update: Mark Miller has since addressed this feature much more thoroughly

I’m sure you recognise at least one of these…

#2387d4 &h23 &h87 &hd4 0x23 0x87 0xd4


Apparently, these are all representations of color.

Did you ever think that, for something designed to represent color, that … well … They’re not very colorful are they?

So how about something better? Something designed to give you a little more relevant information on the color you’re talking about:

ColorSwatchCode

This little strip of color will also appear in C#, WPF and HTML code.

If you click the bar itself… You are presented with….

“The most glorious color picking dialog known to Dev”. – Rory :P

This first shot shows, an incredibly granular, ‘Picker’ tab.ColorSwatchPicker

Next up.. Some well known ‘Web’ colors:ColorSwatchWeb

Named Colors (Like Color.Red, Color.HotPink)

ColorSwatchNamed

Some colors taken from the local system:ColorSwatchSystem

Colors found in your open document. This is very useful when designing web pages or css schemes. Essentially you are being shown a dynamic palette of colors that are already in use in your current document.ColorSwatchDocument

And of course a ‘Favorites’ Tab. Each of the previous pages has a little star button which allows you to add the selected color to your favourites. Multiple palettes can be created and stored here.

ColorSwatchFavourites
…And once you have chosen your preferred shade of “Hot Pink” or “Acid Yellow” … Simply click ok and CodeRush will replace your original code, with code representing your chosen color. As usual CodeRush understands the code you’re working with and will happily create C#, Vb.Net and others.

[Note: In the beta, this feature is off by default. You’ll need to visit Editor\Painting\Show Color in the DevExpress Options (Ctrl+Shift+Alt+O) and enable this feature in order to use it.]

So now you’ll be able to readily identify just what a color looks like, and be able to alter it in a simple and intuitive way :)


Monday, April 19, 2010

My CodeRush Shortcuts

After being asked to provide a post detailing on the additional shortcuts I configure for CodeRush after installation, I came up with the following.

I’ll try to keep this post up to date as I find

  • F2 – Refactor(Rename)
  • Alt+` - CodeRushTrainingWindowToggle
  • Alt+1 - Refactor
  • Alt+2 – Navigate
    • I disable some Navigations (DevExpress\Options ... Editor\Navigation\Catalog) which I personally never use via this Navigate menu:
      • [First/Last/Prev/Next] Enum Element
      • [First/Last/Prev/Next] Member
      • [First/Last/Prev/Next] Statement
      • Parent
      • Parent Member
      • Parent Type
      • [Next / Previous] Reference
  • Alt+Q - QuickNav
  • Ctrl+M – QuickNav(AllTypes, AllMembers, AllVisibilities, CurrentSolution) Explanation
  • Ctrl+T – QuickNav(AllTypes,, AllVisibilities, CurrentSolution) - Explanation
  • Alt+Up - MoveCodeUp [requires DX_MoveCode] **
  • Alt+Down - MoveCodeDown [requires DX_MoveCode] **
  • Alt+Left - MoveCodeLeft [requires DX_MoveCode] **
  • Alt+Right – MoveCodeRight [requires DX_MoveCode] **
  • F12 – NavigateToDefinition [requires CR_NavigateToDefinition]

In cases where indicated shortcut involves brackets, the content of the brackets is to be placed in the parameters box rather than in the command box.

** Note: I have, as yet, not been able to find a better set of keys that this. I realise that these keys are used by other CodeRush functionality. Therefore I recommend placing these bindings in a folder of their own and disabling this folder. You can then switch between the CodeRush set of functionality and that provided by the DX_MoveCode plugin.

It is my intention to develop a plugin to allow me to toggle between these 2 sets of functionality by enabling and disabling these folders on the fly. A keyboard scheme switcher or sorts. :)


Monday, March 29, 2010

New CodeRush Plugin: CR_RemoveRegions


Not much to say here other than that this plugin was inspired, nay requested, by Mr @JayRWren

Place your caret on a region and invoke this like refactoring and *all* regions in the current file will be removed.

Personally I like regions. I feel that when used judiciously, they add to code in the same way as comments. Obviously they can be abused, but that’s the same with any feature.

In any case… Jay requested it so I felt it only reasonable to provide him with this little plugin. Especially since it only took me about 20 minutes including time to make some coffee. :)

So here you are… CR_RemoveRegions  Enjoy.


Tuesday, March 16, 2010

New CodeRush Plugin: DX_DirectOptions


This is a very simple plugin that I developed, like most of DX_DirectOptionsmy plugins, to help me save some time. In this case it’s a very small amount of time.

In 90%+ of all cases when I’m loading the CodeRush options screen, I want to use either the “Templates” or the “Shortcuts” pages.

Therefore I have created a plugin which does nothing more than provide actions and menu options to launch each of these directly.

Simply install the plugin in the usual way and then restart either the DXCore or Visual studio.

When the restart is complete, you should have 2 additional menu options in your DevExpress menu.

[Note: The “Templates Options” menu item will only be present if you have the full CodeRush, or a trial of same, installed.]

Additionally these actions exist in their own right allowing you to bind a key to them if you want to. Their names are “ShowTemplateOptions” and “ShowShortcutOptions” respectively.

[As above: If you only have CodeRush Xpress installed, then the “ShowTemplateOptions” action will not have registered itself and will not be available.]

This plugin still loads the other options pages, but will ensure that the page you indicated is the one selected.

For more details, see the DX_DirectOptions’ wiki page

Update:
I'm considering placing these entries on their own submenu. I can envisage a scenario where other options pages get nominated for this and the list of entries on the DevExpress menu gets a bit overwhelming. I would supply an options page myself for picking which of these might show up in the menu.

Also It’s been suggested that these menu options should perhaps have their own Accelerator keys

Thoughts?


Thursday, March 11, 2010

New Plugin: DX_GuidGen


I couldn’t find a StringProvider in CodeRush that would output a new Guid. So I built one :)

It’s a pretty simple plugin but I put up a wiki page anyway and you can download it from here.

Yeah I know…. There are many ways to produce this same behaviour, but I liked the idea of writing another simple StringProvider, because it allowed me time to additionally create the ‘NewStringProvider’ CodeRush template I recently added to my plugin templates.

Enjoy :)

[Note: I firmly believe that having taken the time to create this, and post it up on the web in this way, that I will find out it actually duplicates some CodeRush functionality in about 2 minutes from now.]


Yet More Designer Free CodeRush Plugins


Yup I have updated my Plugin Templates (Originally started here and continued here) to include a further 2 templates:

  • NewStringProvider
  • NewTextCommand

Again I have provided these in both C# and VB.Net so if you can find any flaws, or have ideas for improvements you’d like to see made. Just email me … RoryBecker@gmail.com and I’ll see what I can do :)

Plugin templates are available here.


Wednesday, March 10, 2010

More Designer Free CodeRush Plugins


[Update: I am now receiving help (from @surekill) for my chronically poor VB.Net –> C# conversions :D (Personally I blame the late nights). These templates now suck less :)] 

A couple of days ago (Erm I think) I posted here on how to use these new templates ….

  • NewAction<Space>
  • NewRefactoring<Space>
  • NewCodeProvider<Space>
  • NewIssue<Space>

… to kickstart the building of new plugins for the DXCore.

Well since then I’ve added 2 additional templates to those already provided

Now you can also call upon…

  • NewNavigationProvider<Space>
  • NewSmartTagMenu<Space>

The first of these produces code which will create items for the CodeRush “Jump To” menu.

The second one gives you code to produce your own menus (Like ‘Refactor’, ‘Code’ and ‘Jump To’)

The zip file which contained my previously exported templates now includes these 2 new ones… So feel free to download again, import them and get cracking on some new plugins :)


Tuesday, March 09, 2010

New plugin: CR_NavigateToDefinition

[CardsOnTable:I did not write this plugin. It was written by Jorge Rowies. Thanks so much Jorge. My life, at least, is now much easier]

I know what you’re thinking…. You’re thinking “Why the **** do I need a plugin for that?”… You’re thinking “Studio already does that!!”.

Please just bear with me… All will become clear[er]

So for those who aren’t already at this point let’s spin back a bit first.

What does this plugin do?

Well this plugin will navigate from a type or member to the declaration of that type or member. Which is to say it will find the source code of that element and position your caret on it.

Why do I need this plugin?

Well you might not. this plugin is built to serve an edge case scenario that might not apply to you.

Visual studio already has a function “Goto Definition” which appears to serve the same purpose as this plugin.

Visual Studio Limitations

Visual studio is capable of finding the source you are looking for if the source you are looking for is…

  • …in the same project as that from which you start.
  • …in a project referenced (only a project reference will do) from the project from which you start.

If you use file references then you are normally out of luck.

Why would I use File references if I have the source?

Well your reasons may vary…  I myself have 3 reasons:

  1. Historically (VS2002, VS2003) had some file locking bugs which appeared to lock the produced binaries when intellisense accessed them which would prevent a rebuild until VS was restarted. (This was the reason we switched to File references only in the first place. It probably no longer applies.)
  2. For performance reasons it can be useful to be able to carve up your solution into multiple sub-solutions in order to work on a smaller section of the problem you are assigned to. Using File references allows you to do this quickly and easily as you are already referencing the binary versions of everything. (I have not had to do this in a while because CodeRush’s performance is really that good. But back in the day I had very poor hardware and CodeRush has not always been as performant (Damn it! It’s my blog and I say that ‘Performant’ is a perfectly valid word) as it is now.
  3. We have an external build process which builds reference versions of our dlls etc under known conditions. These are the files that ultimately go into out installers and therefore it makes sense that these are the versions of the files that are actually referenced by the various projects in a solution.

Other uses

So imagine that you’re coding against a 3rd party open source library. (Could be ASP.MVC. Could be Log4Net could be anything really.) You are referencing their binary because frankly you don’t see the value in trying to build their source as well as your own, but it’s comforting to  have it there in case you need it.

Now suddenly you come across a need to understand something about it’s internals. You have 2 choices:

  • Load the OS solution in a new copy of studio
  • Add the OS solution’s project’s to your existing copy of studio

The first of these is the simplest, but you now have to navigate through the OS solution as a separate entity which has no connection to your own project. Thee is no easy way to navigate between the OS solution and your own.

Instead consider adding their solution’s projects to your own. In some cases this is madness as they will have 15 or more projects and things can get out of hand very quickly. However in some cases like ASP.MVC or Log4Net, there are few projects in the OS solution and these can be added very quickly.

Normally this would not have provided any advantage. You would ask VS for the definition of ‘Controller’ and would be greeted with a wonderful view of the Object browser. This will of course give you a view of what members the ‘Controller’ has, but would do nothing for helping you learn how it worked…

With CR_NavigateToDefinition in place, you can now jump directly from a usage of ‘Controller’ to it’s actual definition in it’s own project and you didn’t have to alter any of your own references to do it.

If this plugin interests you you can find further details here


Monday, March 08, 2010

RedGate – Conducting ‘ANTS 6’ UX Testing


I have been asked by RedGate (Very clever people who bring your SQL Compare, Reflector and others) to see if any of you might be interested in helping out testing their upcoming Version 6 of ANTS Performance Profiler.

There are a few requirements:

  • You must be .NET Developers (who use either C# or Visual Basic .NET)
  • You must be using Windows Vista or Windows 7.
  • The application you are working on is either:
    • Reasonably File I/O bound (i.e. lots of reading and writing from disk) 
      • and/or
    • The .NET application makes use of SQL Server but it must NOT be SQL Server Express. You must also be using a local instance of SQL Server (i.e. the instance must be on the same computer as the process being profiled).
  • You are not using the Compact Framework (very unlikely but you never know)

The session is run remotely, only lasts 1hr and you only have to share your screen – RedGate wouldn’t have any control of your computer.

If this interests you in any way, email me (rorybecker@gmail.com) with a subject line of “ANTS 6 UX Testing”, and I’ll see it gets to the right people.


Sunday, March 07, 2010

Designer Free CodeRush Plugins – The new CodeRush plugin Quick Start

Explaining how to start a new CodeRush plugin can be a little complex.

So I’ve knocked up a few CodeRush templates that should make it a lot easier :)

Step 1 - Import these Plugin Templates into your copy of CodeRush.

(DevExpress\Options … Editor\Templates … Right-click Templates … “Import Templates…”)

Step 2 - Create a new DXCore Plugin project via the “New Project” dialog

Step 3 - Activate any one of the following templates inside your plugin class.

  • NewAction<Space>
  • NewRefactoring<Space>
  • NewCodeProvider<Space>
  • NewIssue<Space>

You should now have a “CreateMyX” method which….

  • Creates the relevant component
  • Adds it to the components collection
  • Sets up the minimal mandatory properties.
  • Creates the relevant event handlers.
  • Attaches said event handlers to the component in question.

For example, one of the more simplistic things you might want to do is to create a new custom Action to Bind to a Key.

Here is the Default DXCore plugin as written in CS…

DefaultCSPlugin

And here is what you get after executing “NewAction<Space>”  CSActionPlugin

After a little customization…  CSHelloWorldPlugin

The only think you need to do .. Is to call your new “CreateMyX” method from inside the “InitializePlugIn” method

You have a completely functional Hello World action ready to be bound to the key of your choice

Now you have to admit … That makes things a lot simpler…

I’ve even linked a few sections of code together with some CodeRush «Field» and «TypeLink» tokens in order to make customizing of that default code a little easier.

So if you’re interested in making plugins…. This should make things a little better.

Feel free to leave me some feedback… I’ve done my best to convert the original VB.Net versions to C#…. So it’s possible there were some issues in translation… But that’s what you get for picking such a strange language (I mean C# people… VB.Net FTW! :D)


Thursday, February 25, 2010

Improve the Speed of CodeRush: EdgeCase Scenario

I have *one* solution on *one* machine on which CodeRush runs slow.

Dog slow…

Lame-Dog slow

So slow it’s painful and I was forced to unload (not uninstall … don’t be daft) CodeRush.
This is also painful, but in my view there was simply no alternative.

Seriously I’ll happily explain if it’s really needed, but no… Resharper is not, for me, a valid alternative.

This has been the case for nearly 2 weeks. This problem as I say, affects only a single solution and not all files in it… But enough of them to cause me some serious headaches.

Yesterday I cured it. [Cue Choir of angels… lights from heaven … General merriment from all]

How did I do this.. Well to cut an already long story short…

I *un*installed StyleCop 4.3.3.0, restarted Studio and loaded my solution

The effect was immediate… like a bolt of lightning turning night into day. however unlike a bolt of lightning, the effect was permanent. This offending solution has now been made into CodeRush’s whipping boy and frankly my entire week is looking up :D

I have handed support all the information I can find which might help eliminate this issue and I’m sure they’ll soon find out what’s going on…

In the mean time I’m writing this post in the hopes that others who might have tried CodeRush and found it to be slow (I’m sure there aren’t that many :D) might find this or be pointed at it by colleagues and perhaps give it another spin with this in mind.


Thursday, February 18, 2010

Enhance QuickNav (CodeRush or CodeRush Xpress)

Update: DevExpress have removed the QuickNav feature from CodeRush Xpress 10.1 and higher (when used under VS2010) at the request of Microsoft. It is believed that this is because it overlaps in functionality with one of the VS2010's new features. Since Microsoft licensed CodeRush Xpress on behalf from DevExpress for all users of VS2008 and VS2010 (Pro and above), this is not completely unreasonable. This feature remains in the Pro version of CodeRush


QuickNav (Ctrl+Shift+Q) is an often overlooked but useful tool in the CodeRush (and Xpress) box.

With it you can search through your code pretty quickly… provided, that is, you configure it for the type of search you’re trying to do.

QuickNavigation

I don’t know about you but I often go kinda snow blind looking at all those icons for “Public property”, “Friend Method”, “Private Class”

However what very few people seem to know, is that you can preconfigure QuickNav to behave differently based on how you launch it.

That’s right you can create your own shortcuts (keystrokes) to launch QuickNav preconfigured for a specific type of search.

By adding just a couple of keystrokes, QuickNav can become IMHO a much more useful facility.

The 2 shortcuts I’m going to suggest I’m going to call “Find Types in Solution” and “Find Types and Members in File”. These are more descriptions of what they will do, rather than the names they will be given.

To add these shortcuts, follow the instructions in my previous post Binding a key in CodeRush and enter the information below in the appropriate boxes. At this point you will have added 2 very useful tools to your box o’ tricks

Find Types in Solution
Bind to : Suggest Ctrl+T
Command: QuickNav
Params: AllTypes, , AllVisibilities, CurrentSolution

Find Types and Members in CurrentFile
Bind to : Suggest Ctrl+M
Command: QuickNav
Params: AllTypes, AllMembers, AllVisibilities, CurrentFile

These bindings should allow you to navigate your code even easier than before :)

For reference, I will now quote from an early forum post by AlexS in which he details the possible parameters for the QuickNav command

-------------------------------------------------------------
There are 4 parameters for the QuickNav action:

TypeFilter -- defines default type filter for the Quick Navigation.
Use the following values to setup default type filter: Classes, Interfaces, Structs, Enums, Delegates, AllTypes.
Use "and" keyword to combine filters together like this: Classes and Structs
MemberFilter -- defines default member filter for the Quick Navigation.
Use the following values to setup default member filter: Methods, Properties, Events, Fields, LocalsAndParams, AllMembers.
Use "and" keyword to combine filters together like this: Methods and Properties.
AccessFilter -- defines default access filter for the Quick Navigation.
Use the following values to setup default access filter: Private, Protected, Internal, ProtectedInternal, Public, AllVisibilities.
Use "and" keyword to combine filters together like this: Private and Protected.
LocationFilter -- defines default location filter for the Quick Navigation.
Use the following values to setup default location filter: AllFiles, CurrentSolution, CurrentProject, CurrentNamespace, CurrentFile.
You can not use "and" keyword here to combine filters together.
Here are examples of parameters usage:

AllTypes, AllMembers, AllVisibilities, CurrentFile
AllTypes, AllMembers, AllVisibilities, AllFiles
AllTypes, AllMembers, Public and Protected, CurrentFile
-------------------------------------------------------------