public static void BindCommonEditBox(CommonEditBox box, DataColumn column) { if (box == null || column == null) { return; } box.BindColumn = column; }
void SetComponent(IPropertyEditorParams editorParams, int component, CommonEditBox editor, CoalescedValue<float> currentValue) { if (Parser.TryParse(editor.Text, out double newValue)) { DoTransaction(() => { SetProperty<Vector2>(current => { current[component] = (float)newValue; return current; }); }); editor.Text = newValue.ToString("0.###"); } else { editor.Text = currentValue.IsDefined ? currentValue.Value.ToString("0.###") : ManyValuesText; } }
void SetComponent(IPropertyEditorParams editorParams, int component, CommonEditBox editor, float currentValue) { if (Parser.TryParse(editor.Text, out double newValue)) { DoTransaction(() => { SetProperty <Vector2>((current) => { current[component] = (float)newValue; return(current); }); }); editor.Text = newValue.ToString("0.###"); } else { editor.Text = currentValue.ToString("0.###"); } }
void SetComponent(IPropertyEditorParams editorParams, int component, CommonEditBox editor, float currentValue) { float newValue; if (float.TryParse(editor.Text, out newValue)) { foreach (var obj in editorParams.Objects) { var current = new Property <Vector2>(obj, editorParams.PropertyName).Value; current[component] = newValue; editorParams.PropertySetter(obj, editorParams.PropertyName, current); } } else { editor.Text = currentValue.ToString(); } }
private void SetIndexValue(int index, CommonEditBox editor, CoalescedValue <int> prevValue) { if (float.TryParse(editor.Text, out float newValue)) { DoTransaction(() => { SetProperty <SkinningWeights>((current) => { current[index] = new BoneWeight { Index = (int)newValue, Weight = current[index].Weight }; CheckWarnings(); return(current); }); }); } else { editor.Text = prevValue.IsDefined ? prevValue.Value.ToString() : ManyValuesText; } }
private void SetWeightValue(IPropertyEditorParams editorParams, int idx, CommonEditBox editor, CoalescedValue <float> prevWeight) { float newValue; if (float.TryParse(editor.Text, out newValue)) { DoTransaction(() => { SetProperty <SkinningWeights>((current) => { current[idx] = new BoneWeight { Index = current[idx].Index, Weight = newValue }; return(current); }); }); } else { editor.Text = prevWeight.IsDefined ? prevWeight.Value.ToString("0.###") : ManyValuesText; } }
private void SetWeightValue(IPropertyEditorParams editorParams, int idx, CommonEditBox editor, SkinningWeights sw) { float newValue; if (float.TryParse(editor.Text, out newValue)) { foreach (var obj in editorParams.Objects) { var prop = new Property <SkinningWeights>(obj, editorParams.PropertyName).Value.Clone(); prop[idx] = new BoneWeight { Index = prop[idx].Index, Weight = newValue }; editorParams.PropertySetter(obj, editorParams.PropertyName, prop); } } else { editor.Text = sw[idx].Weight.ToString(); } }
private void SetWeightValue(IPropertyEditorParams editorParams, int idx, CommonEditBox editor, SkinningWeights sw) { float newValue; if (float.TryParse(editor.Text, out newValue)) { DoTransaction(() => { SetProperty <SkinningWeights>((current) => { current[idx] = new BoneWeight { Index = current[idx].Index, Weight = newValue }; return(current); }); }); } else { editor.Text = sw[idx].Weight.ToString("0.###"); } }