public override void Execute(uint cmdId) { var functions = new AlignFunctions { UIManager = new UIManager(), Document = new Document(m_view), Handle = m_textViewAdapter.GetWindowHandle(), KeyGrabOffset = new System.Drawing.Point(10, -35) }; switch (cmdId) { case Commands.AlignBy: functions.AlignByDialog(); break; case Commands.AlignByKey: functions.AlignByKey(); break; case Commands.AlignByEquals: functions.AlignBy(Key.EqualsPlus); break; case Commands.AlignByEqualsEquals: functions.AlignBy("=="); break; case Commands.AlignByMUnderscore: functions.AlignBy(Key.M); break; case Commands.AlignByQuote: functions.AlignBy(Key.Quotes); break; case Commands.AlignByPeriod: functions.AlignBy(Key.Period); break; case Commands.AlignBySpace: functions.AlignBy(Key.Space); break; case Commands.AlignFromCaret: functions.AlignByDialog(alignFromCaret: true); break; } }
public override void Load(IServices services) { System.Windows.Forms.Application.EnableVisualStyles(); System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(false); AddShortcut(ModifierKeys.Control, Key.OemPlus, () => m_functions.AlignByKey()); AddShortcut(ModifierKeys.Control | ModifierKeys.Shift, Key.OemPlus, () => m_functions.AlignByDialog()); base.Load(services); }
public override void Execute(uint cmdId) { var functions = new AlignFunctions { Document = new Document(m_view), Handle = m_textViewAdapter.GetWindowHandle(), KeyGrabOffset = new System.Drawing.Point(10, -35) }; switch (cmdId) { case Commands.AlignBy : functions.AlignByDialog(); break; case Commands.AlignByKey : functions.AlignByKey(); break; case Commands.AlignByEquals : functions.AlignBy(Key.EqualsPlus); break; case Commands.AlignByEqualsEquals : functions.AlignBy("=="); break; case Commands.AlignByMUnderscore : functions.AlignBy(Key.M); break; case Commands.AlignByQuote : functions.AlignBy(Key.Quotes); break; case Commands.AlignByPeriod : functions.AlignBy(Key.Period); break; case Commands.AlignBySpace : functions.AlignBy(Key.Space); break; case Commands.AlignFromCaret : functions.AlignByDialog(alignFromCaret:true); break; } }