public AssignmentCollection GetCollection()
        {
            AssignmentCollection result = new AssignmentCollection();

            foreach (var c in collection)
            {
                switch (c.type)
                {
                case AssignmentType.Keyboard:    result.Add(c.keyboardAssignment); break;

                case AssignmentType.Mouse:       result.Add(c.mouseAssignment); break;

                case AssignmentType.MouseButton: result.Add(c.mouseButtonAssignment); break;

                case AssignmentType.MouseScroll: result.Add(c.mouseScrollAssignment); break;

                case AssignmentType.Shift:       result.Add(c.shiftAssignment); break;

                case AssignmentType.XboxAxis:    result.Add(c.xinputAxisAssignment); break;

                case AssignmentType.XboxButton:  result.Add(c.xinputButtonAssignment); break;

                case AssignmentType.VJoyButton:  result.Add(c.vjoyButtonAssignment); break;

                case AssignmentType.VJoyAxis:    result.Add(c.vjoyAxisAssignment); break;

                case AssignmentType.VJoyPOV:     result.Add(c.vjoyPOVAssignment); break;
                }
            }

            return(result);
        }
        public AssignmentPair(string inputName, AssignmentCollection assignments) : this()
        {
            input = inputName;

            foreach (var a in assignments)
            {
                AssignmentInfo info = new AssignmentInfo();

                if (a is KeyboardAssignment)
                {
                    info.type = AssignmentType.Keyboard;
                    info.keyboardAssignment = (KeyboardAssignment)a;
                }
                else if (a is MouseAssignment)
                {
                    info.type            = AssignmentType.Mouse;
                    info.mouseAssignment = (MouseAssignment)a;
                }
                else if (a is MouseButtonAssignment)
                {
                    info.type = AssignmentType.MouseButton;
                    info.mouseButtonAssignment = (MouseButtonAssignment)a;
                }
                else if (a is MouseScrollAssignment)
                {
                    info.type = AssignmentType.MouseScroll;
                    info.mouseScrollAssignment = (MouseScrollAssignment)a;
                }
                else if (a is ShiftAssignment)
                {
                    info.type            = AssignmentType.Shift;
                    info.shiftAssignment = (ShiftAssignment)a;
                }
                else if (a is XInputAxisAssignment)
                {
                    info.type = AssignmentType.XboxAxis;
                    info.xinputAxisAssignment = (XInputAxisAssignment)a;
                }
                else if (a is XInputButtonAssignment)
                {
                    info.type = AssignmentType.XboxButton;
                    info.xinputButtonAssignment = (XInputButtonAssignment)a;
                }
                else if (a is VJoyButtonAssignment)
                {
                    info.type = AssignmentType.VJoyButton;
                    info.vjoyButtonAssignment = (VJoyButtonAssignment)a;
                }
                else if (a is VJoyAxisAssignment)
                {
                    info.type = AssignmentType.VJoyAxis;
                    info.vjoyAxisAssignment = (VJoyAxisAssignment)a;
                }
                else if (a is VJoyPOVAssignment)
                {
                    info.type = AssignmentType.VJoyPOV;
                    info.vjoyPOVAssignment = (VJoyPOVAssignment)a;
                }

                collection.Add(info);
            }
        }