Resharper File Template - Extract part of the current file name

I'm trying to create a "handler" file template so that when I enter a name of "GetBlogRequestHandler" the following will be generated:

public class GetBlogRequestHandler : IHandle<GetBlogRequest, GetBlogResponse> {

}

The problem is that given then following template

public class %VARIABLE%RequestHandler : IHandle<%VARIABLE%Request, %VARIABLE%Response> {

}

I want to be able to set the macro for

%VARIABLE%
to be "Current file name without extension", but without the
RequestHandler
part.

Is this possible, or are there any workarounds ?
1 comment
Comment actions Permalink

There are no direct ways to accomplish this, however, you can create your own macro for live templates - one that can remove the "RequestHandler" part of the filename. For more info on writing a macro see here:

http://confluence.jetbrains.com/display/NETCOM/4.04+Live+Template+Macros+%28R8%29

0

Please sign in to leave a comment.