internal static void EnsureCommands() { for (byte index = (byte)0; (int)index <= 3; ++index) { BookCommands.EnsureCommand((BookCommands.CommandId)index); } }
private static RoutedUICommand EnsureCommand(BookCommands.CommandId commandId) { if (commandId < BookCommands.CommandId.FirstPage || commandId > BookCommands.CommandId.LastPage) { return((RoutedUICommand)null); } if (BookCommands.internalCommands[(int)commandId] == null) { BookCommands.internalCommands[(int)commandId] = new RoutedUICommand(BookCommands.GetPropertyName(commandId), BookCommands.GetPropertyName(commandId), typeof(BookCommands)); } return(BookCommands.internalCommands[(int)commandId]); }