Click here to Skip to main content
15,879,613 members
Articles / Programming Languages / XML
Article

SlickEdit 2007 For Windows Development

29 Jun 20075 min read 26.8K   2   3
Using SlickEdit 2007 For Windows Development

This article is in the Product Showcase section for our sponsors at CodeProject. These articles are intended to provide you with information on products and services that we consider useful and of value to developers.

SlickEdit 2007 For Windows Development

You've got Visual Studio®, and you mostly write applications for Windows. So why would you need SlickEdit? SlickEdit can read most Visual Studio solution and project files, and can pinch hit nicely for Visual Studio. If you just need to load up a project, make some edits, check some files in and out of source control, and kick off a build, you can do all this in SlickEdit.

But where SlickEdit really shines is helping you organize and edit all of that code you've got that doesn't fit neatly into an application project. It all starts with using SlickEdit's flexible and customizable project system in combination with other time-saving features. You can download a free trial of SlickEdit 2007 here.

Managing Builds

We've been using CruiseControl.NET and NAnt for nightly builds of our products. Both technologies use an XML file format. SlickEdit's XML features include Auto-completion of tags and attributes, gleaned from the definitions in XSD schemas. Visual Studio also has an excellent XML editing experience, but SlickEdit allows you to customize what specific XSD schemas are used for a particular XML namespace declaration. CruiseControl.NET does not distribute an "official" schema for their namespace, mostly because the CruiseControl syntax is extensible with a plug-in architecture. By using Microsoft's XML tools I was able to take my existing CruiseControl project files and generate a starter schema. SlickEdit's URL Mappings allow me to then use that custom schema for document validation and auto-completion.

In an effort to reduce redundant code and reduce the size of the NAnt source files, many common properties and tasks used by multiple projects have been broken out into a series of include files. However, locating a property or task that is defined in an external file usually requires a multi-file search.

By using the SlickEdit Regex Evaluator I was able to craft a regular expression to search for task and property definitions. Once the expression was ready, I created a macro in Slick-C (SlickEdit's C-like macro language)(snippet) to search for the word at the cursor in the current NAnt build file and any included build files. Now I have instant search across multiple files when the definition of a property or target eludes me.

Building Installers with WIX (Windows Installer XML)

WIX is an open-source toolkit from Microsoft for building Windows Installer .msi files. It too uses an XML file format. There are tools available in Wix for getting your project started and compiling your list of files to be installed, but authoring an installer still requires quite a bit of hand-editing the XML source. I use SlickEdit's Aliases feature to provide completion of code snippets for commonly used Wix XML constructs. Aliases go well beyond simple insertion of prewritten code. You can configure an alias to format and auto-indent the new text, set the initial editing position, and prompt for replacement parameters.

All of the code for the installer is placed in a custom SlickEdit project. A custom project allows you to create as many organizational folders as you need, optionally organized by physical directories or file extensions. The real power in SlickEdit projects is the ability to define custom build steps to call external tools. Since this project invokes quite a few NAnt build targets, I customized the build menu by adding new build tools to the project. These allow me to invoke NAnt to execute the build targets and display the output in the build window.

Dabbling in PHP and MySQL, with a Side of PowerShell

A year or so ago, I worked on a side project to develop a content management website using PHP and MySQL. The application had to work with Internet Explorer, Firefox, and Safari browsers. Using SlickEdit allowed me to create a single project to organize the code and work with the Subversion repository located on a remote Linux hosting account. And I was able to edit the code on both a Windows XP tablet PC and my MacBook as the custom project format is identical on Windows and *Nix platforms. Customizing the project's build commands allowed me to add shortcuts for opening pages in multiple browsers, execute MySQL scripts one the database, and transfer files via FTP to my remote hosting account.

SlickEdit supports dozens of languages out of the box, and has the ability to quickly add your own user-defined highlighting schemes or modify existing ones. I found that the default listing of SQL keywords didn't include some of the MySQL keywords, but they were easy enough to add via the Color Coding options dialog.

For the past year or so I've been using PowerShell in place of cmd.exe, and steadily building a library of scripts to automate routine tasks. But it just didn't seem right that such a neat shell language should have to be edited without any syntax highlighting. With SlickEdit, this was easily solved. To set up color coding for PowerShell, all I had to do was create a new language definition, specify the comment format, and add a list of keywords.

No Code Left Behind

These examples only begin to scratch the surface of the features available in SlickEdit. Your code or build process doesn't have to be a second-class citizen just because it doesn't fit neatly into Visual Studio. For all those times you have to "just edit it in notepad" or "run this tool from the commandline", think of how SlickEdit could save you time and hassle.

Download Free Trial

Download the free trial of SlickEdit 2007 and try it out for yourself today.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
United States United States
SlickEdit Inc. provides software developers with multi-language development tools and the most advanced code editors available. Power programmers, from Fortune 500 companies to individuals, have chosen SlickEdit as their development tool of choice for over 19 years. Proven on Windows, Linux, UNIX, and Mac OS X platforms, SlickEdit products enable even the most accomplished developers to write more code faster, and more accurately. For more information about SlickEdit and free trial downloads, please visit http://www.slickedit.com.
This is a Organisation

1 members

Comments and Discussions

 
GeneralI can do all this in VS 2005 with a handfull of Macros for clearcase Pin
AnandChavali6-Sep-07 21:44
AnandChavali6-Sep-07 21:44 
GeneralNOT WORTH MONEY Pin
MrGoodly6-Sep-07 9:17
MrGoodly6-Sep-07 9:17 
GeneralPrice way to much Pin
Sudhir Mangla1-Sep-07 16:40
professionalSudhir Mangla1-Sep-07 16:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.