Skip to content

Instantly share code, notes, and snippets.

View NicoVermeir's full-sized avatar

NicoVermeir

View GitHub Profile
private void OnRotationChanged(RadialController sender, RadialControllerRotationChangedEventArgs args)
{
if (args.RotationDeltaInDegrees > 0)
{
_dte.Application.Debugger.StepOver();
}
else
{
_dte.Application.Debugger.StepInto();
}
private void OnButtonClicked(RadialController sender, RadialControllerButtonClickedEventArgs args)
{
if (_dte.Application.Debugger.CurrentMode == dbgDebugMode.dbgRunMode)
{
_dte.Application.Debugger.Stop();
}
else
{
_dte.Application.Debugger.Go();
}
private void HookUpEvents()
{
_radialController.RotationChanged += OnRotationChanged;
_radialController.ButtonClicked += OnButtonClicked;
_dte.Events.SolutionEvents.AfterClosing += () =>
{
_radialController.Menu.Items.Clear();
};
}
private void CreateMenuItem()
{
_menuItems = new List<RadialControllerMenuItem>
{
RadialControllerMenuItem.CreateFromKnownIcon("Debug", RadialControllerMenuKnownIcon.InkColor),
};
foreach (var item in _menuItems)
{
_radialController.Menu.Items.Add(item);
private void CreateController()
{
IRadialControllerInterop interop = (IRadialControllerInterop)System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeMarshal.GetActivationFactory(typeof(RadialController));
Guid guid = typeof(RadialController).GetInterface("IRadialController").GUID;
_radialController = interop.CreateForWindow(new IntPtr(_dte.ActiveWindow.HWnd), ref guid);
}
protected override void Initialize()
{
base.Initialize();
_dte = GetService(typeof(DTE)) as DTE;
if (_dte == null)
{
throw new NullReferenceException("DTE is null");
}
using System;
using Windows.UI.Input;
namespace DialDebug
{
[System.Runtime.InteropServices.Guid("1B0535C9-57AD-45C1-9D79-AD5C34360513")]
[System.Runtime.InteropServices.InterfaceType(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIInspectable)]
public interface IRadialControllerInterop
{
RadialController CreateForWindow(
[System.Runtime.InteropServices.Guid("1B0535C9-57AD-45C1-9D79-AD5C34360513")]
[System.Runtime.InteropServices.InterfaceType(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIInspectable)]
public interface IRadialControllerInterop
{     RadialController CreateForWindow(     IntPtr hwnd,     [System.Runtime.InteropServices.In]ref Guid riid);
}
[System.Runtime.InteropServices.Guid("787cdaac-3186-476d-87e4-b9374a7b9970")]
[System.Runtime.InteropServices.InterfaceType(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIInspectable)]
public interface IRadialControllerConfigurationInterop
{     RadialControllerConfiguration GetForWindow(     IntPtr hwnd,     [System.Runtime.InteropServices.In]ref Guid riid);
[PackageRegistration(UseManagedResourcesOnly = true)]
[InstalledProductRegistration("#110", "#112", "1.0", IconResourceID = 400)] // Info on this package for Help/About
[Guid(DialDebugPackage.PackageGuidString)]
[SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1650:ElementDocumentationMustBeSpelledCorrectly", Justification = "pkgdef, VS and vsixmanifest are valid VS terms")]
[ProvideAutoLoad(UIContextGuids80.SolutionExists)]
[ProvideMenuResource("Menus.ctmenu", 1)]
public sealed class DialDebugPackage : Package
{
[ProvideAutoLoad(UIContextGuids80.SolutionExists)]