Exemple #1
0
        public void Move(ILayout source, int insert_index)
        {
            var index = Layouts.IndexOf(source);

            Layouts.Remove(source);
            if (index < insert_index)
            {
                --insert_index;
            }
            Layouts.Insert(insert_index, source);
        }
Exemple #2
0
        public void Update(ILayout new_layout, ILayout old_layout)
        {
            var index = Layouts.IndexOf(old_layout);

            Layouts[index] = new_layout;

            if (!old_layout.Shortcut.IsEmpty())
            {
                keyboard_hook.UnregisterHotKey(old_layout.Shortcut);
            }
            if (!new_layout.Shortcut.IsEmpty())
            {
                keyboard_hook.RegisterHotKey(new_layout.Shortcut);
            }
        }