예제 #1
0
        public static VarNumber Divide(VarBase v1, VarBase v2)
        {
            (VarNumber r1, VarNumber r2) = CheckTypes(v1, v2);

            return(new VarNumber(r1.Value / r2.Value));
        }
예제 #2
0
        public static VarNumber Modulo(VarBase v1, VarBase v2)
        {
            (VarNumber r1, VarNumber r2) = CheckTypes(v1, v2);

            return(new VarNumber(r1.Value % r2.Value));
        }
예제 #3
0
        public static VarNumber Subtract(VarBase v1, VarBase v2)
        {
            (VarNumber r1, VarNumber r2) = CheckTypes(v1, v2);

            return(new VarNumber(r1.Value - r2.Value));
        }
예제 #4
0
        public static VarNumber Multiply(VarBase v1, VarBase v2)
        {
            (VarNumber r1, VarNumber r2) = CheckTypes(v1, v2);

            return(new VarNumber(r1.Value * r2.Value));
        }
예제 #5
0
 /// <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)
     });
 }
예제 #6
0
 public static VarBoolean CompareNotEquals(VarBase vs1, VarBase vs2)
 {
     return(new VarBoolean(!vs1.ToString().Equals(vs2.ToString())));
 }
예제 #7
0
 public UnderlyingVariableValuePair(VariableValuePair variableValuePair)
 {
     // Set our properties
     Variable = variableValuePair.Variable.ValueParser;
     Value    = variableValuePair.Value;
 }
 public ConstantWrapperContext(ScriptRunner scriptRunner, VarBase constant) : base(scriptRunner)
 {
     Constant = constant;
 }
예제 #9
0
 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()
     });
 }
예제 #10
0
 public UnderlyingVariableValuePair(VarBase variable, object value)
 {
     // Set our properties
     Variable = variable;
     Value    = value;
 }
예제 #11
0
 public static VarBoolean CompareEquals(VarBase v1, VarBase v2)
 {
     return(new VarBoolean(v1.ToBoolean() == v2.ToBoolean()));
 }
예제 #12
0
 public static VarBoolean CompareOr(VarBase v1, VarBase v2)
 {
     return(new VarBoolean(v1.ToBoolean() || v2.ToBoolean()));
 }
예제 #13
0
 public static VarBoolean CompareAnd(VarBase v1, VarBase v2)
 {
     return(new VarBoolean(v1.ToBoolean() && v2.ToBoolean()));
 }
예제 #14
0
        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();
예제 #15
0
 public MethodContext(ScriptRunner scriptRunner, VarBase variable, string methodName, IEnumerable <ExecutionContext> arguments) : base(scriptRunner)
 {
     Variable   = variable;
     MethodName = methodName;
     Arguments  = arguments;
 }