public override Value Evaluate() { var stack = State.Stack; var value = stack.Pop(true, LOCATION); var variable = stack.Pop <Variable>(false, LOCATION); value = value.AssignmentValue(); value = new BoundValue(variable.Name, value); return(value); }
public static IElement <TTag> For <TTag>( this IElement <TTag> element, BoundValue value, bool formItemWrapper = true, bool tooltipDescription = true) where TTag : ElementTag { if (value == null) { throw new ArgumentNullException(nameof(value)); } element = element.VModel(value); // Create the form item wrapper VueInstanceBoundValue instanceValue = value as VueInstanceBoundValue; if (formItemWrapper) { IElement <FormItem> formItem = element.Tag.Helper.FormItem(); if (instanceValue != null) { formItem = formItem .Label(instanceValue.Metadata.DisplayName) .Required(instanceValue.Metadata.IsRequired); // Set the validation property if (instanceValue.Instance.TagData.TryGetValue(ValidationErrorsKey, out object validationErrorsProperty)) { formItem = formItem.Error((BoundValue)$"{validationErrorsProperty}['{value.Value}']"); } } // Add the form item as a parent element = element.Parent(formItem); } // Create the tooltip description if (tooltipDescription && !string.IsNullOrWhiteSpace(instanceValue?.Metadata.Description)) { element = element.Child( element.Tag.Helper.Tooltip() .Content(instanceValue.Metadata.Description) .Html("<i class=\"el-icon-information\"></i>"), ChildPosition.AfterClosing); } return(element); }
static void Main(string[] args) { BoundValue <int> u1 = new BoundValue <int> .UpperBoundValue(1); BoundValue <int> u2 = new BoundValue <int> .UpperBoundValue(2); BoundValue <int> u3 = new BoundValue <int> .UpperBoundValue(3); BoundValue <int> l2 = new BoundValue <int> .LowerBoundValue(2); BoundValue <int> pi = new BoundValue <int> .PositiveInfiniteValue(); BoundValue <int> ni = new BoundValue <int> .NegativeInfiniteValue(); Console.Out.WriteLine("^1 < v2 == " + (u1 < l2)); Console.Out.WriteLine("^2 < v2 == " + (u2 < l2)); Console.Out.WriteLine("^3 < v2 == " + (u3 < l2)); Console.Out.WriteLine(); Console.Out.WriteLine("^1 > v2 == " + (u1 > l2)); Console.Out.WriteLine("^2 > v2 == " + (u2 > l2)); Console.Out.WriteLine("^3 > v2 == " + (u3 > l2)); Console.Out.WriteLine(); Console.Out.WriteLine("^1 >= v2 == " + (u1 >= l2)); Console.Out.WriteLine("^2 >= v2 == " + (u2 >= l2)); Console.Out.WriteLine("^3 >= v2 == " + (u3 >= l2)); Console.Out.WriteLine(); Console.Out.WriteLine("^1 == v2 == " + (u1 == l2)); Console.Out.WriteLine("^2 == v2 == " + (u2 == l2)); Console.Out.WriteLine("^3 == v2 == " + (u3 == l2)); Console.Out.WriteLine(); Console.Out.WriteLine("+∞ > v2 == " + (pi > l2)); Console.Out.WriteLine("^2 > +∞ == " + (u2 > pi)); Console.Out.WriteLine("-∞ > v2 == " + (ni > l2)); Console.Out.WriteLine("-∞ > +∞ == " + (ni > pi)); Console.Out.WriteLine("-∞ < +∞ == " + (ni < pi)); Console.Out.WriteLine(); var range = (2 <= Range <int> .That < 3); Console.Out.WriteLine(range); Console.Out.WriteLine(Range <int> .That > 0); Console.In.ReadLine(); }
static void Main(string[] args) { BoundValue<int> u1 = new BoundValue<int>.UpperBoundValue(1); BoundValue<int> u2 = new BoundValue<int>.UpperBoundValue(2); BoundValue<int> u3 = new BoundValue<int>.UpperBoundValue(3); BoundValue<int> l2 = new BoundValue<int>.LowerBoundValue(2); BoundValue<int> pi = new BoundValue<int>.PositiveInfiniteValue(); BoundValue<int> ni = new BoundValue<int>.NegativeInfiniteValue(); Console.Out.WriteLine("^1 < v2 == " + (u1 < l2)); Console.Out.WriteLine("^2 < v2 == " + (u2 < l2)); Console.Out.WriteLine("^3 < v2 == " + (u3 < l2)); Console.Out.WriteLine(); Console.Out.WriteLine("^1 > v2 == " + (u1 > l2)); Console.Out.WriteLine("^2 > v2 == " + (u2 > l2)); Console.Out.WriteLine("^3 > v2 == " + (u3 > l2)); Console.Out.WriteLine(); Console.Out.WriteLine("^1 >= v2 == " + (u1 >= l2)); Console.Out.WriteLine("^2 >= v2 == " + (u2 >= l2)); Console.Out.WriteLine("^3 >= v2 == " + (u3 >= l2)); Console.Out.WriteLine(); Console.Out.WriteLine("^1 == v2 == " + (u1 == l2)); Console.Out.WriteLine("^2 == v2 == " + (u2 == l2)); Console.Out.WriteLine("^3 == v2 == " + (u3 == l2)); Console.Out.WriteLine(); Console.Out.WriteLine("+∞ > v2 == " + (pi > l2)); Console.Out.WriteLine("^2 > +∞ == " + (u2 > pi)); Console.Out.WriteLine("-∞ > v2 == " + (ni > l2)); Console.Out.WriteLine("-∞ > +∞ == " + (ni > pi)); Console.Out.WriteLine("-∞ < +∞ == " + (ni < pi)); Console.Out.WriteLine(); var range = (2 <= Range<int>.That < 3); Console.Out.WriteLine(range); Console.Out.WriteLine(Range<int>.That > 0); Console.In.ReadLine(); }
public static IElement <Table> EmptyText(this IElement <Table> element, BoundValue emptyText) => element.Attribute("empty-text", emptyText);
public static IElement <Tooltip> Offset(this IElement <Tooltip> element, BoundValue <int> offset) => element.Attribute("offest", offset);
public static IElement <Table> ShowSummary(this IElement <Table> element, BoundValue <bool> showSummary) => element.Attribute("show-summary", showSummary);
public static IElement <Table> SummaryMethod(this IElement <Table> element, BoundValue summaryMethod) => element.Attribute("summary-method", summaryMethod);
public static IElement <Table> Fit(this IElement <Table> element, BoundValue <bool> fit) => element.Attribute("fit", fit);
public static IElement <Table> DefaultSort(this IElement <Table> element, BoundValue defaultSort) => element.Attribute("default-sort", defaultSort);
public static IElement <Table> Stripe(this IElement <Table> element, BoundValue <bool> stripe) => element.Attribute("stripe", stripe);
public static IElement <Table> Border(this IElement <Table> element, BoundValue <bool> border) => element.Attribute("border", border);
public static IElement <Table> MaxHeight(this IElement <Table> element, BoundValue <int> maxHeight) => element.Attribute("max-height", maxHeight);
public static IElement <Table> Height(this IElement <Table> element, BoundValue <int> height) => element.Attribute("height", height);
// Attributes public static IElement <Table> Data(this IElement <Table> element, BoundValue data) => element.Attribute("data", data);
public static IElement <Table> DefaultExpandAll(this IElement <Table> element, BoundValue <bool> defaultExpandAll) => element.Attribute("default-expand-all", defaultExpandAll);
public static IElement <Table> ShowHeader(this IElement <Table> element, BoundValue <bool> showHeader) => element.Attribute("show-header", showHeader);
public static IElement <Table> ExpandRowKeys(this IElement <Table> element, BoundValue expandRowKeys) => element.Attribute("expand-row-keys", expandRowKeys);
public static IElement <Table> HighlightCurrentRow(this IElement <Table> element, BoundValue <bool> highlightCurrentRow) => element.Attribute("highlight-current-row", highlightCurrentRow);
public static IElement <Table> TooltipEffect(this IElement <Table> element, BoundValue tooltipEffect) => element.Attribute("tooltip-effect", tooltipEffect);
public static IElement <Tooltip> Effect(this IElement <Tooltip> element, BoundValue effect) => element.Attribute("effect", effect);
public static IElement <Table> SumText(this IElement <Table> element, BoundValue sumText) => element.Attribute("sum-text", sumText);
public static IElement <Tooltip> Placement(this IElement <Tooltip> element, BoundValue placement) => element.Attribute("placement", placement);
public static IElement <Table> CurrentRowKey(this IElement <Table> element, BoundValue <int> currentRowKey) => element.Attribute("current-row-key", currentRowKey);
public static IElement <Row> Tag(this IElement <Row> element, BoundValue tag) => element.Attribute("tag", tag);
public static IElement <Tooltip> Content(this IElement <Tooltip> element, BoundValue content) => element.Attribute("content", content);
public static IElement <Table> RowClassName(this IElement <Table> element, BoundValue rowClassName) => element.Attribute("row-class-name", rowClassName);
public static IElement <Tooltip> Disabled(this IElement <Tooltip> element, BoundValue <bool> disabled) => element.Attribute("disabled", disabled);
public static IElement <Table> RowStyle(this IElement <Table> element, BoundValue rowStyle) => element.Attribute("row-style", rowStyle);
public static IElement <Tooltip> OpenDelay(this IElement <Tooltip> element, BoundValue <int> openDelay) => element.Attribute("open-delay", openDelay);
public static IElement <Table> RowKey(this IElement <Table> element, BoundValue rowKey) => element.Attribute("row-key", rowKey);