Beispiel #1
0
 private static void SetIsCheckedOfLineSpacingMenuItem(MenuItemData menuItemData, object parameter)
 {
     menuItemData.IsChecked = (menuItemData == parameter);
 }
Beispiel #2
0
 private static void LineSpacingMenuItemDefaultExecute(MenuItemData menuItemData)
 {
     SetIsCheckedOfLineSpacingMenuItem((MenuItemData)LineSpacingFirstValue, menuItemData);
     SetIsCheckedOfLineSpacingMenuItem((MenuItemData)LineSpacingSecondValue, menuItemData);
     SetIsCheckedOfLineSpacingMenuItem((MenuItemData)LineSpacingThirdValue, menuItemData);
     SetIsCheckedOfLineSpacingMenuItem((MenuItemData)LineSpacingFourthValue, menuItemData);
     SetIsCheckedOfLineSpacingMenuItem((MenuItemData)LineSpacingFifthValue, menuItemData);
     SetIsCheckedOfLineSpacingMenuItem((MenuItemData)LineSpacingSixthValue, menuItemData);
 }
Beispiel #3
0
 private static bool BordersMenuItemDefaultCanExecute(MenuItemData menuItemData)
 {
     return true;
 }
Beispiel #4
0
 private static bool LineSpacingMenuItemDefaultCanExecute(MenuItemData menuItemData)
 {
     return true;
 }
Beispiel #5
0
        private static void BorderMenuItemDefaultExecute(MenuItemData menuItemData)
        {
            MenuItemData bottomBorder = (MenuItemData)BottomBorder;
            MenuItemData topBorder = (MenuItemData)TopBorder;
            MenuItemData leftBorder = (MenuItemData)LeftBorder;
            MenuItemData rightBorder = (MenuItemData)RightBorder;
            MenuItemData noBorder = (MenuItemData)NoBorder;
            MenuItemData allBorders = (MenuItemData)AllBorders;
            MenuItemData outsideBorders = (MenuItemData)OutsideBorders;
            MenuItemData insideBorders = (MenuItemData)InsideBorders;
            MenuItemData insideHorizontalBorder = (MenuItemData)InsideHorizontalBorder;
            MenuItemData insideVerticalBorder = (MenuItemData)InsideVerticalBorder;

            if (menuItemData == bottomBorder ||
                menuItemData == topBorder ||
                menuItemData == leftBorder ||
                menuItemData == rightBorder)
            {
                outsideBorders.IsChecked = (bottomBorder.IsChecked &&
                    topBorder.IsChecked &&
                    leftBorder.IsChecked &&
                    rightBorder.IsChecked);
            }

            if (menuItemData == outsideBorders)
            {
                bottomBorder.IsChecked = topBorder.IsChecked = leftBorder.IsChecked = rightBorder.IsChecked = outsideBorders.IsChecked;
            }

            if (menuItemData == insideHorizontalBorder ||
                menuItemData == insideVerticalBorder)
            {
                insideBorders.IsChecked = (insideHorizontalBorder.IsChecked &&
                    insideVerticalBorder.IsChecked);
            }

            if (menuItemData == insideBorders)
            {
                insideHorizontalBorder.IsChecked = insideVerticalBorder.IsChecked = insideBorders.IsChecked;
            }

            if (menuItemData == noBorder)
            {
                bottomBorder.IsChecked = false;
                topBorder.IsChecked = false;
                leftBorder.IsChecked = false;
                rightBorder.IsChecked = false;
                outsideBorders.IsChecked = false;
                insideBorders.IsChecked = false;
                insideHorizontalBorder.IsChecked = false;
                insideVerticalBorder.IsChecked = false;
            }

            if (menuItemData == allBorders)
            {
                bottomBorder.IsChecked = true;
                topBorder.IsChecked = true;
                leftBorder.IsChecked = true;
                rightBorder.IsChecked = true;
                outsideBorders.IsChecked = true;
                insideBorders.IsChecked = true;
                insideHorizontalBorder.IsChecked = true;
                insideVerticalBorder.IsChecked = true;
            }
        }