- Notifications
You must be signed in to change notification settings - Fork101
ExpandoObject
Coding Seb edited this pageMay 30, 2019 ·4 revisions
From version 1.2.2 ExpressionEvaluator manageExpandObject class.ExpandoObject are object that can dynamically create new properties when you assign a value to it.It is also a dictionnary of properties. In ExpressionEvaluator you can use it as a object or as a dictionnary.
Here some examples :
myVar=newExpandoObject();myVar.X=23.5;myVar.Y=34.8;returnmyVar.X+myVar.Y;// 58.3
myVar=newExpandoObject();myVar["Text"]="Hello ";returnmyVar["Text"]+" Bob";// "Hello Bob"
myVar=newExpandoObject();myVar["Text"]="Hello ";returnmyVar.Text+" Bob";// "Hello Bob"
myVar=newExpandoObject();myVar.Text="Hello ";returnmyVar["Text"]+" Bob";// "Hello Bob"
obj=newExpandoObject();obj.Add=(x,y)=>{text="The result is : ";returntext+(x+y).ToString();};returnobj.Add(3,4);// "The result is : 7"
And from version 1.3.7 ExpandoObject can be created as anonymous objects:
obj=new{Text="Hello",IntValue=8,Add=(x,y)=>{text="The result is : ";returntext+(x+y).ToString();}};
- Getting Started
- Variables and Functions
- Operators and Keywords
- C# Types Management
- ExpandoObject
- Code Comments Management
- Advanced Customization and Hacking
- Caching
- Options
- CultureInfoForNumberParsing
- OptionCaseSensitiveEvaluationActive
- OptionVariablesPersistenceCustomComparer
- OptionFluidPrefixingActive
- OptionForceIntegerNumbersEvaluationsAsDoubleByDefault
- OptionNumberParsingDecimalSeparator
- OptionNumberParsingThousandSeparator
- OptionFunctionArgumentsSeparator
- OptionInitializersSeparator
- OptionInlineNamespacesEvaluationRule
- OptionNewFunctionEvaluationActive
- OptionNewKeywordEvaluationActive
- OptionStaticMethodsCallActive
- OptionStaticProperiesGetActive
- OptionInstanceMethodsCallActive
- OptionInstanceProperiesGetActive
- OptionIndexingActive
- OptionStringEvaluationActive
- OptionCharEvaluationActive
- OptionEvaluateFunctionActive
- OptionVariableAssignationActive
- OptionPropertyOrFieldSetActive
- OptionIndexingAssignationActive
- OptionScriptEvaluateFunctionActive
- OptionOnNoReturnKeywordFoundInScriptAction
- OptionScriptNeedSemicolonAtTheEndOfLastExpression
- OptionAllowNonPublicMembersAccess
- Todo List