private void SetType(Type controlType) { var uiControls = ParentEditor.Values; if (Presenter.Undo != null) { using (new UndoMultiBlock(Presenter.Undo, uiControls, "Set Control Type")) { for (int i = 0; i < uiControls.Count; i++) { var uiControl = (UIControl)uiControls[i]; uiControl.Control = (Control)Activator.CreateInstance(controlType); } } } else { for (int i = 0; i < uiControls.Count; i++) { var uiControl = (UIControl)uiControls[i]; uiControl.Control = (Control)Activator.CreateInstance(controlType); } } ParentEditor.RebuildLayout(); }
/// <inheritdoc /> public override void Refresh() { if (Values.Count == 1) { var scripts = ((Actor)ParentEditor.Values[0]).Scripts; if (!Utils.ArraysEqual(scripts, _scripts)) { ParentEditor.RebuildLayout(); return; } } base.Refresh(); }
/// <inheritdoc /> public override void Refresh() { base.Refresh(); // Check if type has been modified outside the editor (eg. from code) if (Type != _type) { if (ParentEditor != null) { ParentEditor.RebuildLayout(); } else { RebuildLayout(); } } }
/// <inheritdoc /> public override void Refresh() { if (Values.Count == 1) { var scripts = ((Actor)ParentEditor.Values[0]).Scripts; if (!Utils.ArraysEqual(scripts, _scripts)) { ParentEditor.RebuildLayout(); return; } for (int i = 0; i < _scriptToggles.Length; i++) { if (_scriptToggles[i] != null) { _scriptToggles[i].Checked = scripts[i].Enabled; } } } base.Refresh(); }