I've created a new version of my DotNetNuke Module Project Template for use with Visual Studio 2010.
This allows developers in VS2010 to create a DNN module solution that they can use as the basis of their own module.
The template is for C# and will produce a compiled module which can then be packaged and distributed to end users.
Existing users of VS2005 or VS2008 can still download the template for the IDE from this location http://www.bitethebullet.co.uk/DNN_4_C_Sharp_Template.aspx
Download Visual Studio 2010 DNN Template
View the getting started guide
Note this template can be used to create module for DNN 4.x and DNN 5.x
Strongly Typed Settings
This template contains an improvement over the previous versions, I've created a strongly typed class that is used to provide access to the module settings.
TestModuleSettings settingsData = new TestModuleSettings(this.TabModuleId);
if (settingsData.Template != null)
{
txtTemplate.Text = settingsData.Template;
}
To add more properties and settings to your own module simple edit the [ModuleName]Settings.cs file which is located in the Components folder.
For example to add Width setting simple add the code below to the [ModuleName]Settings.cs file.
/// <summary>
/// get/set width of the module
/// </summary>
public int width
{
get { return ReadSetting<int>("width", 150); }
set { WriteSetting("width", value.ToString()); }
}
The ReadSetting method takes the name of the property key used in the underlying hash table and a default value to return when the value is not set already in DNN.
WriteSetting method takes the property key used in the hash table to store the value and the value itself expressed as a string value.