mattercontrol/ApplicationView/MenuRow/MenuOptionHelp.cs

92 lines
2.1 KiB
C#
Raw Normal View History

2015-04-08 15:20:10 -07:00
using MatterHackers.Agg;
using MatterHackers.Agg.UI;
using MatterHackers.Localizations;
using MatterHackers.MatterControl.ContactForm;
using MatterHackers.MatterControl.AboutPage;
using MatterHackers.VectorMath;
2015-04-08 15:20:10 -07:00
using System;
namespace MatterHackers.MatterControl
{
public class MenuOptionHelp : MenuBase
2015-04-08 15:20:10 -07:00
{
public MenuOptionHelp()
: base("Help".Localize())
2015-04-08 15:20:10 -07:00
{
}
override protected TupleList<string, Func<bool>> GetMenuItems()
2015-04-08 15:20:10 -07:00
{
return new TupleList<string, Func<bool>>
2015-04-08 15:20:10 -07:00
{
2015-05-22 12:36:07 -07:00
{"Getting Started".Localize(), gettingStarted_Click},
{"View Help".Localize(), help_Click},
{"Release Notes".Localize(), notes_Click},
{"------------------------", nothing_Click},
{"Report a Bug".Localize(), bug_Click},
{"Check For Update".Localize(), checkForUpdate_Click},
{"------------------------", nothing_Click},
{"About MatterControl".Localize(), about_Click},
};
2015-04-08 15:20:10 -07:00
}
2015-04-08 15:20:10 -07:00
private bool bug_Click()
{
UiThread.RunOnIdle(() =>
2015-04-08 15:20:10 -07:00
{
ContactFormWindow.Open();
});
return true;
}
2015-04-08 15:20:10 -07:00
private bool help_Click()
{
UiThread.RunOnIdle(() =>
2015-04-08 15:20:10 -07:00
{
MatterControlApplication.Instance.LaunchBrowser("http://www.mattercontrol.com/articles");
2015-04-08 15:20:10 -07:00
});
return true;
}
2015-05-22 12:33:59 -07:00
private bool checkForUpdate_Click()
{
UiThread.RunOnIdle(() =>
2015-05-22 12:33:59 -07:00
{
ApplicationMenuRow.AlwaysShowUpdateStatus = true;
UpdateControlData.Instance.CheckForUpdateUserRequested();
2015-08-10 15:44:19 -07:00
CheckForUpdateWindow.Show();
2015-05-22 12:33:59 -07:00
});
return true;
}
2015-04-08 15:20:10 -07:00
private bool about_Click()
{
UiThread.RunOnIdle(AboutWindow.Show);
2015-04-08 15:20:10 -07:00
return true;
}
2015-05-22 12:33:59 -07:00
private bool nothing_Click()
{
return true;
}
2015-04-08 15:20:10 -07:00
private bool notes_Click()
{
UiThread.RunOnIdle(() =>
{
MatterControlApplication.Instance.LaunchBrowser("http://wiki.mattercontrol.com/Release_Notes");
2015-04-08 15:20:10 -07:00
});
return true;
}
2015-04-08 15:20:10 -07:00
private bool gettingStarted_Click()
{
UiThread.RunOnIdle(() =>
2015-04-08 15:20:10 -07:00
{
MatterControlApplication.Instance.LaunchBrowser("http://www.mattercontrol.com/articles/mattercontrol-getting-started");
2015-04-08 15:20:10 -07:00
});
return true;
}
}
}