Hi,
I have a below code in my project and I tried to create an instance of TrackChartToo class.
TrackChartToo objTrackChartToo = new TrackChartToo();
But OnCreate method is never fired.
Please let me know how to solve this issue.
namespace TrackArchitect.Exporter
{
/// <summary>
/// An ESRI toolbar button that allows the
/// user to export a series of map portraits.
/// </summary>
public class TrackChartToo : BaseCommand
{
/// <summary>
/// The ESRI Application
/// </summary>
private IMxApplication ESRIApplication { get; set; }
/// <summary>
///
/// </summary>
private IMxDocument MxDocument { get; set; }
/// <summary>
/// The TrackPrintTool constructor.
/// </summary>
public TrackChartToo()
{
try
{
base.m_category = "Track Chart Too!";
base.m_caption = "Exporting to Visio";
base.m_message = "Track Map Export";
base.m_toolTip =
"Push to begin the TrackChartToo " +
"Map Export to the Visio format.";
Assembly a = Assembly.GetCallingAssembly();
Stream imgStream = a.GetManifestResourceStream(
"TrackArchitect.Images.TrackChart.ico");
base.m_bitmap = new System.Drawing.Bitmap(imgStream);
}
catch (Exception ex)
{
}
}
/// <summary>
///
/// </summary>
/// <param name="hook"></param>
public override void OnCreate( object hook )
{
if (hook != null)
{
if (hook is IMxApplication)
{
ESRIApplication = (IMxApplication)hook;
MxDocument = (IMxDocument)((IApplication)ESRIApplication).Document;
}
}
}
}
}