public static VarNumber Divide(VarBase v1, VarBase v2) { (VarNumber r1, VarNumber r2) = CheckTypes(v1, v2); return(new VarNumber(r1.Value / r2.Value)); }
public static VarNumber Modulo(VarBase v1, VarBase v2) { (VarNumber r1, VarNumber r2) = CheckTypes(v1, v2); return(new VarNumber(r1.Value % r2.Value)); }
public static VarNumber Subtract(VarBase v1, VarBase v2) { (VarNumber r1, VarNumber r2) = CheckTypes(v1, v2); return(new VarNumber(r1.Value - r2.Value)); }
public static VarNumber Multiply(VarBase v1, VarBase v2) { (VarNumber r1, VarNumber r2) = CheckTypes(v1, v2); return(new VarNumber(r1.Value * r2.Value)); }
/// <summary> /// All variables have a string representation, so it is safe to use /// VarBase without verifying types. This allows use to be as generic /// as possible, such as 1 + "test" = "1test", etc. /// </summary> /// <param name="vs1"></param> /// <param name="vs2"></param> /// <returns></returns> public static VarString Add(VarBase vs1, VarBase vs2) { return(new VarString { Value = string.Concat(vs1, vs2) }); }
public static VarBoolean CompareNotEquals(VarBase vs1, VarBase vs2) { return(new VarBoolean(!vs1.ToString().Equals(vs2.ToString()))); }
public UnderlyingVariableValuePair(VariableValuePair variableValuePair) { // Set our properties Variable = variableValuePair.Variable.ValueParser; Value = variableValuePair.Value; }
public ConstantWrapperContext(ScriptRunner scriptRunner, VarBase constant) : base(scriptRunner) { Constant = constant; }
private static List <Declaration> BuildDeclarations() { return(new List <Declaration>(83) { Aggregate.GetDeclaration(), AggregateRow.GetDeclaration(), Avg.GetDeclaration(), BTree.GetDeclaration(), BTreeNode.GetDeclaration(), BTreeNodeTuple.GetDeclaration(), BTreeNodeTupleList.GetDeclaration(), BTreeNodeHierarchyObj.GetDeclaration(), CalculatedFieldWrapperImpl.GetDeclaration(), ChildLeafInfo.GetDeclaration(), Count.GetDeclaration(), CountDistinct.GetDeclaration(), CountRows.GetDeclaration(), DataAggregateObj.GetDeclaration(), DataAggregateObjResult.GetDeclaration(), DataRegionMemberInstance.GetDeclaration(), DataFieldRow.GetDeclaration(), FieldImpl.GetDeclaration(), First.GetDeclaration(), Last.GetDeclaration(), Max.GetDeclaration(), Min.GetDeclaration(), Previous.GetDeclaration(), RuntimeCell.GetDeclaration(), RuntimeCells.GetDeclaration(), RuntimeCellWithContents.GetDeclaration(), RuntimeChartCriCell.GetDeclaration(), RuntimeChartCriGroupLeafObj.GetDeclaration(), RuntimeChartCriObj.GetDeclaration(), RuntimeChartObj.GetDeclaration(), RuntimeCriObj.GetDeclaration(), RuntimeDataRegionObj.GetDeclaration(), RuntimeDataTablixObj.GetDeclaration(), RuntimeDataTablixGroupLeafObj.GetDeclaration(), RuntimeDataTablixGroupRootObj.GetDeclaration(), RuntimeDataTablixMemberObj.GetDeclaration(), RuntimeDataTablixWithScopedItemsObj.GetDeclaration(), RuntimeDataTablixWithScopedItemsGroupLeafObj.GetDeclaration(), RuntimeDetailObj.GetDeclaration(), RuntimeExpressionInfo.GetDeclaration(), RuntimeGroupLeafObj.GetDeclaration(), RuntimeGroupObj.GetDeclaration(), RuntimeGroupRootObj.GetDeclaration(), RuntimeGroupingObj.GetDeclaration(), RuntimeHierarchyObj.GetDeclaration(), RuntimeMemberObj.GetDeclaration(), RuntimeRDLDataRegionObj.GetDeclaration(), RuntimeRICollection.GetDeclaration(), RuntimeSortDataHolder.GetDeclaration(), RuntimeSortFilterEventInfo.GetDeclaration(), RuntimeSortFilterEventInfo.SortExpressionScopeInstanceHolder.GetDeclaration(), RuntimeSortFilterEventInfo.SortFilterExpressionScopeObj.GetDeclaration(), RuntimeSortFilterEventInfo.SortScopeValuesHolder.GetDeclaration(), RuntimeSortHierarchyObj.GetDeclaration(), RuntimeSortHierarchyObj.SortHierarchyStructure.GetDeclaration(), RuntimeDataRowSortHierarchyObj.GetDeclaration(), RuntimeTablixCell.GetDeclaration(), RuntimeTablixGroupLeafObj.GetDeclaration(), RuntimeTablixObj.GetDeclaration(), RuntimeUserSortTargetInfo.GetDeclaration(), ScopeInstance.GetDeclaration(), ScopeLookupTable.GetDeclaration(), StDev.GetDeclaration(), StDevP.GetDeclaration(), Sum.GetDeclaration(), Var.GetDeclaration(), VarBase.GetDeclaration(), VarP.GetDeclaration(), Filters.FilterKey.GetDeclaration(), RuntimeGaugePanelObj.GetDeclaration(), LookupMatches.GetDeclaration(), LookupMatchesWithRows.GetDeclaration(), LookupTable.GetDeclaration(), RuntimeMapDataRegionObj.GetDeclaration(), DataScopeInfo.GetDeclaration(), BucketedDataAggregateObjs.GetDeclaration(), DataAggregateObjBucket.GetDeclaration(), RuntimeGroupingObjHash.GetDeclaration(), RuntimeGroupingObjTree.GetDeclaration(), RuntimeGroupingObjDetail.GetDeclaration(), RuntimeGroupingObjDetailUserSort.GetDeclaration(), RuntimeGroupingObjLinkedList.GetDeclaration(), RuntimeGroupingObjNaturalGroup.GetDeclaration() }); }
public UnderlyingVariableValuePair(VarBase variable, object value) { // Set our properties Variable = variable; Value = value; }
public static VarBoolean CompareEquals(VarBase v1, VarBase v2) { return(new VarBoolean(v1.ToBoolean() == v2.ToBoolean())); }
public static VarBoolean CompareOr(VarBase v1, VarBase v2) { return(new VarBoolean(v1.ToBoolean() || v2.ToBoolean())); }
public static VarBoolean CompareAnd(VarBase v1, VarBase v2) { return(new VarBoolean(v1.ToBoolean() && v2.ToBoolean())); }
public VarBase Execute(VarBase variable) { List <MethodSignature> methodSignatures = new List <MethodSignature>(); IEnumerable <(MethodInfo, VarMethodAvailableAttribute)> methods = variable.GetMethods(MethodName); IEnumerable <(MethodInfo, VarMethodAvailableAttribute)> methodsArray = methods as (MethodInfo, VarMethodAvailableAttribute)[] ?? methods.ToArray();
public MethodContext(ScriptRunner scriptRunner, VarBase variable, string methodName, IEnumerable <ExecutionContext> arguments) : base(scriptRunner) { Variable = variable; MethodName = methodName; Arguments = arguments; }