public static Dictionary <VariableOperatorType, string> _operatorToString;//= new Dictionary<VariableOperatorType, string> public static string GetOperatorString(VariableOperatorType inOperator) { if (_operatorToString == null) { _operatorToString = new Dictionary <VariableOperatorType, string>(); foreach (var tmpEntry in VariableOperators) { _operatorToString.Add(tmpEntry.Value, tmpEntry.Key); } } return(_operatorToString[inOperator]); }
/// <summary> /// Set Value to Variable /// </summary> public static CodeBlock CreateComparisionBlock(string inVar1, VariableOperatorType inOperatorType, string inVar2) { var tmpCodeBlock = new CodeBlock(); var tmpExpr = new CodeExpression() { Manipulator = inOperatorType, }; tmpExpr.SubClauseEntries.Add(new CodeBlock { CodeEntries = new List <ICodeEntry> { new ConstantValue(inVar1) } }); tmpExpr.SubClauseEntries.Add(new CodeBlock { CodeEntries = new List <ICodeEntry> { new ConstantValue(inVar2) } }); tmpCodeBlock.CodeEntries.Add(tmpExpr); return(tmpCodeBlock); }