public void Start() { OptionsMenu menu = new OptionsMenu(); menu.Add("Check files for errors", () => IterateOverSongs(PathToSongs, CheckFiles)); menu.Add("Check files for errors and try to fix them", () => IterateOverSongs(PathToSongs, CheckFiles, true)); menu.Add("Move new anime songs into correct folder", () => IterateOverSongs(PathToNewSongs, MoveToFolder)); menu.Add("Exit", () => { }); Console.Clear(); menu.DisplayMenu("Please choose action to perform..."); }
static void setupMenu() { BaseMenu = MainMenu.AddMenu(MenuName, MenuName.ToLower()); BaseMenu.Add("enable", new CheckBox("Habilitar AutoChat")); GreetingMenu = BaseMenu.AddSubMenu("Saludos", "greetingmessage"); GreetingMenu.Add("sayGreeting", new CheckBox("Saludar")); GreetingMenu.Add("sayGreetingAllChat", new CheckBox("Saludar en el chat general")); GreetingMenu.AddSeparator(); GreetingMenu.Add("sayGreetingDelayMin", new Slider("Delay mínimo en saludar", 3, 1, 5)); GreetingMenu.Add("sayGreetingDelayMax", new Slider("Delay máximo en saludar", 6, 5, 10)); OptionsMenu = BaseMenu.AddSubMenu("Opciones", "messageoptions"); OptionsMenu.Add("sayCongratulate", new CheckBox("Felicitar")); OptionsMenu.Add("sayMotivate", new CheckBox("Motivar")); OptionsMenu.Add("sayApology", new CheckBox("Disculparse")); OptionsMenu.Add("saySympathy", new CheckBox("Simpatía")); OptionsMenu.Add("sayHonor", new CheckBox("Dar honor a oponentes")); OptionsMenu.AddSeparator(); OptionsMenu.Add("sayMessageDelayMin", new Slider("Delay mínimo en los mensajes", 2, 1, 3)); OptionsMenu.Add("sayMessageDelayMax", new Slider("Delay máximo en los mensajes", 6, 3, 10)); OptionsMenu.Add("sayMessageInterval", new Slider("Intervalo mínimo en cada mensaje", 180, 1, 600)); EndGameMenu = BaseMenu.AddSubMenu("Final de la partida", "endgamemessage"); EndGameMenu.Add("sayEndGame", new CheckBox("Mensaje al final de la partida")); EndGameMenu.Add("sayEndGameAllChat", new CheckBox("Mensaje al final de la partida en chat general")); }
static void setupMenu() { BaseMenu = MainMenu.AddMenu(MenuName, MenuName.ToLower()); BaseMenu.Add("enable", new CheckBox("Enable Autochat")); GreetingMenu = BaseMenu.AddSubMenu("Greeting Message", "greetingmessage"); GreetingMenu.Add("sayGreeting", new CheckBox("Say Greeting")); GreetingMenu.Add("sayGreetingAllChat", new CheckBox("Say Greeting In All Chat")); GreetingMenu.AddSeparator(); GreetingMenu.Add("sayGreetingDelayMin", new Slider("Min Greeting Delay", 3, 1, 5)); GreetingMenu.Add("sayGreetingDelayMax", new Slider("Max Greeting Delay", 10, 5, 10)); OptionsMenu = BaseMenu.AddSubMenu("Message Options", "messageoptions"); OptionsMenu.Add("sayCongratulate", new CheckBox("Congratulate")); OptionsMenu.Add("sayMotivate", new CheckBox("Motivate")); OptionsMenu.Add("sayApology", new CheckBox("Apologize")); OptionsMenu.Add("saySympathy", new CheckBox("Sympathetic")); OptionsMenu.Add("sayHonor", new CheckBox("Honor Opponents")); OptionsMenu.AddSeparator(); OptionsMenu.Add("sayMessageDelayMin", new Slider("Min Message Delay", 2, 1, 3)); OptionsMenu.Add("sayMessageDelayMax", new Slider("Max Message Delay", 6, 3, 10)); OptionsMenu.Add("sayMessageInterval", new Slider("Minimum Interval between messages", 180, 1, 600)); EndGameMenu = BaseMenu.AddSubMenu("EndGame Message", "endgamemessage"); EndGameMenu.Add("sayEndGame", new CheckBox("Say EndGame Message")); EndGameMenu.Add("sayEndGameAllChat", new CheckBox("Say EndGame Message In All Chat")); }
static void setupMenu() { BaseMenu = MainMenu.AddMenu(MenuName, MenuName.ToLower()); BaseMenu.Add("enable", new CheckBox("抵制贩卖挂机脚本")); GreetingMenu = BaseMenu.AddSubMenu("卖脚本死全家", "greetingmessage"); GreetingMenu.Add("sayGreeting", new CheckBox("卖脚本死全家")); GreetingMenu.Add("sayGreetingAllChat", new CheckBox("卖脚本死全家")); GreetingMenu.AddSeparator(); GreetingMenu.Add("sayGreetingDelayMin", new Slider("卖脚本死全家", 3, 1, 5)); GreetingMenu.Add("sayGreetingDelayMax", new Slider("卖脚本死全家", 6, 5, 10)); OptionsMenu = BaseMenu.AddSubMenu("卖脚本死全家", "messageoptions"); OptionsMenu.Add("sayCongratulate", new CheckBox("卖脚本死全家")); OptionsMenu.Add("sayMotivate", new CheckBox("卖脚本死全家")); OptionsMenu.Add("sayApology", new CheckBox("卖脚本死全家")); OptionsMenu.Add("saySympathy", new CheckBox("卖脚本死全家")); OptionsMenu.Add("sayHonor", new CheckBox("卖脚本死全家")); OptionsMenu.AddSeparator(); OptionsMenu.Add("sayMessageDelayMin", new Slider("卖脚本死全家", 2, 1, 3)); OptionsMenu.Add("sayMessageDelayMax", new Slider("卖脚本死全家", 6, 3, 10)); OptionsMenu.Add("sayMessageInterval", new Slider("卖脚本死全家", 180, 1, 600)); EndGameMenu = BaseMenu.AddSubMenu("卖脚本死全家", "endgamemessage"); EndGameMenu.Add("sayEndGame", new CheckBox("卖脚本死全家")); EndGameMenu.Add("sayEndGameAllChat", new CheckBox("卖脚本死全家")); }
public NavigationViewModel() { Menu.Add(new MenuItem() { Icon = new PackIconMaterial() { Kind = PackIconMaterialKind.CommentTextMultiple }, IsEnabled = true, Text = "Chat'n'Roll", NavigationDestination = new Uri("Views/ChatnRollPage.xaml", UriKind.RelativeOrAbsolute) }); //Menu.Add(new MenuItem() { Icon = new PackIconMaterial() { Kind = PackIconMaterialKind.Brush }, IsEnabled = true, Text = "Whiteboard", NavigationDestination = new Uri("Views/WhiteboardPage.xaml", UriKind.RelativeOrAbsolute) }); //Menu.Add(new MenuItem() { Icon = new PackIconMaterial() { Kind = PackIconMaterialKind.SwordCross }, IsEnabled = false, Text = "BattleMap", NavigationDestination = new Uri("Views/BattleMapPage.xaml", UriKind.RelativeOrAbsolute) }); Menu.Add(new MenuItem() { Icon = new PackIconMaterial() { Kind = PackIconMaterialKind.AccountEdit }, IsEnabled = true, Text = "Charakter", NavigationDestination = new Uri("Views/CharacterPage.xaml", UriKind.RelativeOrAbsolute) }); Menu.Add(new MenuItem() { Icon = new PackIconMaterial() { Kind = PackIconMaterialKind.HeartBroken }, IsEnabled = true, Text = "Patzertabelle", NavigationDestination = new Uri("Views/PatzerTabellePage.xaml", UriKind.RelativeOrAbsolute) }); //Menu.Add(new MenuItem() { Icon = new PackIconMaterial() { Kind = PackIconMaterialKind.Wikipedia }, IsEnabled = true, Text = "Wiki", NavigationDestination = new Uri("Views/WikiPage.xaml", UriKind.RelativeOrAbsolute) }); OptionsMenu.Add(new MenuItem() { Icon = new PackIconMaterial() { Kind = PackIconMaterialKind.Cogs }, IsEnabled = true, Text = "Einstellungen", NavigationDestination = new Uri("Views/SettingsPage.xaml", UriKind.RelativeOrAbsolute) }); OptionsMenu.Add(new MenuItem() { Icon = new PackIconMaterial() { Kind = PackIconMaterialKind.Information }, IsEnabled = true, Text = "Über", NavigationDestination = new Uri("Views/AboutPage.xaml", UriKind.RelativeOrAbsolute) }); }
public MenuViewModel(IDialogCoordinator dialogCoordinator, AppSettings appSettings, IEventAggregator eventAggregator) { this.eventAggregator = eventAggregator; Menu.Add(new MenuItem() { Icon = new PackIconFontAwesome() { Kind = PackIconFontAwesomeKind.CalendarRegular }, Text = "Accounts", NavigationDestination = () => this.NavigateTo(AppMenu, 0) }); Menu.Add(new MenuItem() { Icon = new PackIconFontAwesome() { Kind = PackIconFontAwesomeKind.UserCogSolid }, Text = "Permissions", NavigationDestination = () => this.NavigateTo(AppMenu, 1) }); Menu.Add(new MenuItem() { Icon = new PackIconFontAwesome() { Kind = PackIconFontAwesomeKind.FileContractSolid }, Text = "Contracts", NavigationDestination = () => this.NavigateTo(AppMenu, 2) }); OptionsMenu.Add(new MenuItem() { Icon = Application.Current.FindResource("SettingsIcon"), Text = "Settings", NavigationDestination = () => this.NavigateTo(AppOptionsMenu, 0) }); this.eventAggregator.GetEvent <NavigationInfoEvent>().Subscribe(OnNavigationInfoEvent, ThreadOption.UIThread, true); this.SelectedOptionsIndex = -1; this.SelectedIndex = -1; this.IsEnabled = true; }
/// <summary> /// Constructor /// </summary> public AlignmentViewModel() { Options = new RuntimeOptionsViewModel(); _isScreenSplit = false; _rightPaneSize = Double.PositiveInfinity; SplitScreenCommand = new DelegatingCommand(() => IsScreenSplit = !IsScreenSplit); ShowOptionsCommand = new DelegatingCommand(OnShowOptions); ShowBirdsEyeView = new DelegatingCommand(OnShowBev); MakeReferenceSequence = new DelegatingCommand <AlignmentEntityViewModel>(OnMakeReferenceSequence); FlipGrouping = new DelegatingCommand(() => IsGrouped = !IsGrouped, () => SupportsGrouping); GotoColumn = new DelegatingCommand(OnGotoColumn); GotoRow = new DelegatingCommand(OnGotoRow); GotoRefColumn = new DelegatingCommand(OnGotoRefColumn, () => HasReferenceSequence); FindByName = new DelegatingCommand(OnFindByName); JumpNextNucleotide = new DelegatingCommand(OnGotoNextNucleotide, () => FocusedRow != null && FocusedColumnIndex < TotalColumns - 1); JumpPreviousNucleotide = new DelegatingCommand(OnGotoPreviousNucleotide, () => FocusedRow != null && FocusedColumnIndex > 0); JumpNextRefNucleotide = new DelegatingCommand(OnGotoNextRefNucleotide, () => FocusedRow != null && FocusedColumnIndex < TotalColumns - 1 && HasReferenceSequence); JumpPreviousRefNucleotide = new DelegatingCommand(OnGotoPreviousRefNucleotide, () => FocusedRow != null && FocusedColumnIndex > 0 && HasReferenceSequence); ShiftFocusLeft = new DelegatingCommand(OnShiftFocusLeft, () => FocusedRow != null); ShiftFocusRight = new DelegatingCommand(OnShiftFocusRight, () => FocusedRow != null); FindByTaxonomy = new DelegatingCommand(OnFindByTaxonomy, () => IsGrouped); OptionsMenu.Add(new MenuItem("Change _View Options") { Command = ShowOptionsCommand, GestureText = "Ctrl+O" }); _groupByMenuItem = new MenuItem("Group By Taxonomy") { Command = FlipGrouping, IsChecked = IsGrouped, GestureText = "Ctrl+G" }; OptionsMenu.Add(_groupByMenuItem); _splitScreenMenuItem = new MenuItem("Split Screen View") { Command = SplitScreenCommand, IsChecked = IsScreenSplit, GestureText = "Ctrl+S" }; ViewMenu.Add(_splitScreenMenuItem); ViewMenu.Add(new MenuItem("_Taxonomy Browser") { Command = FindByTaxonomy, GestureText = "Ctrl+T" }); ViewMenu.Add(new MenuItem("Birds-Eye Viewer") { Command = ShowBirdsEyeView, GestureText = "Ctrl+B" }); EditMenu.Add(new MenuItem("Jump To _Column") { Command = GotoColumn, GestureText = "Ctrl+C" }); EditMenu.Add(new MenuItem("Jump To _Row") { Command = GotoRow, GestureText = "Ctrl+R" }); EditMenu.Add(new MenuItem()); EditMenu.Add(new MenuItem("Jump To Previous Nucelotide") { Command = JumpPreviousNucleotide, GestureText = "F2" }); EditMenu.Add(new MenuItem("Jump To Next Nucelotide") { Command = JumpNextNucleotide, GestureText = "F3" }); EditMenu.Add(new MenuItem()); EditMenu.Add(new MenuItem("Jump To Reference Nucelotide") { Command = GotoRefColumn, GestureText = "Ctrl+N" }); EditMenu.Add(new MenuItem("Jump To Previous Reference Nucelotide") { Command = JumpPreviousRefNucleotide, GestureText = "Ctrl+F2" }); EditMenu.Add(new MenuItem("Jump To Next Reference Nucelotide") { Command = JumpNextRefNucleotide, GestureText = "Ctrl+F3" }); EditMenu.Add(new MenuItem()); EditMenu.Add(new MenuItem("Find By _Name") { Command = FindByName, GestureText = "Ctrl+F" }); NucleotideColorSelector = new NucleotideColorSelector(this, Options); _leftView = new SplitPaneViewModel(this); _rightView = new SplitPaneViewModel(this); // Set the intial view SetActiveView(_leftView); }
private void MoveToFolder(DefFile defFileToMove, bool tryToFix) { char firstChar = defFileToMove.Title[0]; bool isKatakana = firstChar >= 0x30A0 && firstChar <= 0x30FF; if (firstChar > 122) // ASCII table values { firstChar = TranslationTool.GetPhoneticReading(defFileToMove.Title)[0]; if (firstChar > 122) { firstChar = TranslationTool.GetTranslation(defFileToMove.Title)[0]; } if (isKatakana && (firstChar == 'r' || firstChar == 'R')) // Check if letter was actually an L { OptionsMenu menu = new OptionsMenu(); menu.Add("R", () => firstChar = 'R'); menu.Add("L", () => firstChar = 'L'); menu.DisplayMenu($"Original song name: '{defFileToMove.Title}'. Please choose folder letter to move the file to..."); } } string folderName = string.Format(Constants.FOLDER_NAME_FORMAT, Constants.NameDirMap[firstChar]); string folderPath = Path.Combine(PathToSongs, folderName); if (!Directory.Exists(folderPath)) { Directory.CreateDirectory(folderPath); string boxDefPath = Path.Combine(folderPath, Path.GetFileName(Constants.PATH_BOX_DEF_BASE)); File.Copy(Constants.PATH_BOX_DEF_BASE, boxDefPath); File.Copy(Constants.PATH_FOLDER_IMG, Path.Combine(folderPath, Path.GetFileName(Constants.PATH_FOLDER_IMG))); BoxFile boxFile = new BoxFile(boxDefPath); boxFile.SetTitle(folderName); } string newFolderPath = Path.Combine(folderPath, Path.GetFileName(Path.GetDirectoryName(defFileToMove.FilePath))); // If dest folder already exist, we will start enumerating the folders with exact same song name if (Directory.Exists(newFolderPath)) { Regex regex = new Regex(@".*_(?<fileNum>\d{2})$"); Match match = regex.Match(newFolderPath); // If there's already more than one, then we need to keep the numbering order if (match.Success) { int currentNum = int.Parse(match.Groups["fileNum"].Value) + 1; newFolderPath = newFolderPath.Replace($"_{match.Groups["fileNum"].Name}", $"_{currentNum:D2}"); } else { newFolderPath += "_02"; } } Directory.Move(Path.GetDirectoryName(defFileToMove.FilePath), newFolderPath); Logger.Instance.LogInfo($"Moved song '{defFileToMove.Title}' to folder '{folderName}'"); }