static private CreatePropertyGridView ( ) : void | ||
return | void |
/// <summary> /// Changes the property grid and property label to the selected objects /// </summary> public static void ChangeSelectedObjects() { EditorHandler.TilesetMenuItems.IsEnabled = false; if (SelectedGameObjects != null) { if (SelectedGameObjects.Count == 1) { ChangeSelectedObject(SelectedGameObjects[0]); if (SelectedGameObjects[0] is Tileset) { EditorHandler.TilesetBrushControl.ChangeSelectionSize((SelectedGameObjects[0] as Tileset).TileWidth, (SelectedGameObjects[0] as Tileset).TileHeight); EditorHandler.TilesetBrushControl.ChangeImageSource((SelectedGameObjects[0] as Tileset).ImageName); SceneManager.ActiveTileset = (Tileset)SelectedGameObjects[0]; EditorHandler.TilesetMenuItems.IsEnabled = true; } else { SceneManager.ActiveTileset = null; } EditorCommands.CreatePropertyGridView(); } else if (SelectedGameObjects.Count == 0) { SceneManager.ActiveTileset = null; if (EditorHandler.SceneTreeView.SelectedItem != null) { (EditorHandler.SceneTreeView.SelectedItem as DragDropTreeViewItem).IsSelected = false; } EditorCommands.CreatePropertyGridView(); } else { EditorCommands.CreatePropertyGridView(); } if (EditorHandler.TilesetBrushControl != null) { EditorHandler.TilesetBrushControl.InvalidateVisual(); } } }
void newItem_Click(object sender, RoutedEventArgs e) { GibboMenuItem _sender = (GibboMenuItem)sender; foreach (var ti in TreeViewExtension.GetSelectedTreeViewItems(treeView)) { ObjectComponent component = (ObjectComponent)Activator.CreateInstance((Type)_sender.Tag, new object[] { /* params here */ }); GameObject gameObject = (GameObject)ti.Tag; if (!gameObject.AddComponent(component)) { MessageBox.Show("The component was not added to " + gameObject.Name + ", the requirements are not met", "Error", MessageBoxButton.OK, MessageBoxImage.Error); } else { EditorCommands.CreatePropertyGridView(); } } }
private void Compile() { this.Dispatcher.Invoke((Action)(() => { if (!ScriptsBuilder.ReloadScripts()) { ErrorDataGrid.ItemsSource = ScriptsBuilder.Logger.Errors; if (ErrorDataGrid.Items.Count > 0) { ErrorsExpander.IsExpanded = true; } } else { ErrorDataGrid.ItemsSource = null; EditorCommands.CreatePropertyGridView(); } })); }