public static void AttachWidgets(Camera camera) { if (SelectedObjects.Count == 1) { var selected = SelectedObjects[0].UserObject as ISelectable; if (selected != CurrentSelectedObject) { CurrentSelectedObject = selected; // fire an event of selected object being changed SelectedObjectChanged?.Invoke(selected, EventArgs.Empty); } // attach the widget TranslationalWidget.Attach(CurrentSelectedObject as ITranslatable, camera); } else { if (SelectedObjects.Count == 0 || !(CurrentSelectedObject is Manipulator)) { CurrentSelectedObject = null; } // detach the widget TranslationalWidget.Detach(); } }
/// <summary> /// Deselects the simulation's selected object. /// </summary> public void DeselectObject() { if (IsObjectSelected) { SelectedObject.Selected = false; SelectedObject = null; IsObjectSelected = false; SelectedObjectChanged?.Invoke(null, new EventArgs()); } }
/// <summary> /// Selects an object in the simulation. /// </summary> /// <param name="object">Object to select.</param> public void SelectObject(ISelectable @object) { if (@object != SelectedObject) { DeselectObject(); @object.Selected = true; SelectedObject = @object; IsObjectSelected = true; SelectedObjectChanged?.Invoke(SelectedObject, new EventArgs()); } }
public void SelectObject(CollisionObject selectedObject) { if (selectedObject == null) { SelectedObject = null; SelectedObjectChanged?.Invoke(this, new SelectEventArgs(SelectedObject)); } else if (selectedObject.UserObject is ObjectBlock) { SelectedObject = selectedObject; SelectedObjectChanged?.Invoke(this, new SelectEventArgs(SelectedObject)); } }
protected virtual void OnSelectedObjectChanged(object Value) { if (Value != null) { Properties.Reset(Value); //IsLoading = true; await SetObject(Value); IsLoading = false; } else if (AcceptsNullObjects) { Properties.Reset(null); } SelectedObjectChanged?.Invoke(this, new EventArgs <object>(Value)); }
public void SetSelectedObject(object sender, object obj) { SelectedObjectChanged?.Invoke(sender, obj); }
/// <summary> /// Overridable method to handle selection changing /// </summary> protected virtual void OnSelectedObjectChanged() { SelectedObjectChanged?.Invoke(this, new EventArgs()); }
private void selectionBox_SelectedIndexChanged(object sender, EventArgs e) { SelectedObject = selectionBox.SelectedItem; SelectedObjectChanged?.Invoke(SelectedObject, e); }
private void UICBTeamMembers_SelectionChanged(object sender, SelectionChangedEventArgs e) { SelectedObjectChanged?.Invoke(getSelectedObjectName()); }
public static void RequestSelectionChange(Component o) { SelectedObjectChanged?.Invoke(o); }