private void SaveRotationManager() { if (rotationManagerController.Name != string.Empty) { rotationManagerController.ResetControllers(); foreach (Node node in BeRotations.Nodes) { var rotation = (Rotation)node.Tag; rotationManagerController.Rotations.Add(rotation); } rotationManagerController.Save(); } }
private void BeTbNewBehaviorPreviewKeyDown(object sender, PreviewKeyDownEventArgs e) { if (e.KeyValue == 13) { SaveRotationManager(); rotationManagerController = new RotationManagerController { Name = BeTBNewBehavior.Text }; rotationManagerController.ResetControllers(); ClearTree(BeRotations); BeTBSelectBehavior.Items.Add(rotationManagerController.Name); BeTBSelectBehavior.SelectedIndex = BeTBSelectBehavior.FindStringExact(rotationManagerController.Name); BeTBNewBehavior.Text = "Enter name and press return to create."; RotationSettings.LoadedRotationManager = rotationManagerController.Name; SaveRotationManager(); LoadBehavior(); } }
private void BeTbNewBehaviorPreviewKeyDown(object sender, PreviewKeyDownEventArgs e) { if (e.KeyValue == 13) { SaveRotationManager(); rotationManagerController = new RotationManagerController {Name = BeTBNewBehavior.Text}; rotationManagerController.ResetControllers(); ClearTree(BeRotations); BeTBSelectBehavior.Items.Add(rotationManagerController.Name); BeTBSelectBehavior.SelectedIndex = BeTBSelectBehavior.FindStringExact(rotationManagerController.Name); BeTBNewBehavior.Text = "Enter name and press return to create."; RotationSettings.LoadedRotationManager = rotationManagerController.Name; SaveRotationManager(); LoadBehavior(); } }