private void CreateOrUpdateTaskBarButtons(bool validRepo)
{
if (EnvUtils.RunningOnWindows() && TaskbarManager.IsPlatformSupported)
{
if (!_toolbarButtonsCreated)
{
_commitButton = new ThumbnailToolBarButton(MakeIcon(toolStripButton1.Image, 48, true), toolStripButton1.Text);
_commitButton.Click += ToolStripButton1Click;
_pushButton = new ThumbnailToolBarButton(MakeIcon(toolStripButtonPush.Image, 48, true), toolStripButtonPush.Text);
_pushButton.Click += PushToolStripMenuItemClick;
_pullButton = new ThumbnailToolBarButton(MakeIcon(toolStripButtonPull.Image, 48, true), toolStripButtonPull.Text);
_pullButton.Click += PullToolStripMenuItemClick;
_toolbarButtonsCreated = true;
ThumbnailToolBarButton[] buttons = new[] { _commitButton, _pullButton, _pushButton };
//Call this method using reflection. This is a workaround to *not* reference WPF libraries, becuase of how the WindowsAPICodePack was implimented.
TaskbarManager.Instance.ThumbnailToolBars.AddButtons(Handle, buttons);
}
_commitButton.Enabled = validRepo;
_pushButton.Enabled = validRepo;
_pullButton.Enabled = validRepo;
}
}
#endif