Beispiel #1
0
        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 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;
     }
 }
Beispiel #3
0
 public AlignmentViewModel(AlignFunctions functions, Alignment alignment)
 {
     m_alignment = alignment;
     m_functions = functions;
 }