The following custom command always throws an exception.
Any ideas what could be going on?
using System;
using System.Collections;
using System.Windows.Forms;
using Sony.Vegas;
public class SampleModule : ICustomCommandModule
{
protected Vegas myVegas = null;
public void InitializeModule(Vegas vegas)
{
myVegas = vegas;
}
public ICollection GetCustomCommands()
{
CustomCommand cmd = new CustomCommand(CommandCategory.Tools, "NewProjectBug");
cmd.DisplayName = "NewProjectBug";
cmd.Invoked += this.HandleInvoked;
return new CustomCommand[] { cmd };
}
void HandleInvoked(Object sender, EventArgs args)
{
using (UndoBlock undo = new UndoBlock("NewProjectBug"))
{
try
{
// This generates an exception
Project project = new Project();
}
catch (Exception e)
{
MessageBox.Show(e.Message);
}
}
}
}
Any ideas what could be going on?