- ‘tree like’ data structure
- each node is expression (method call, equality comparison, binary operation etc.) representing a piece of code
- you can compile expression tree and run code it represent
- enables dynamic code generation at runtime
- LINQ queries on DBs are implemented with Expression Trees
- used in the dynamic language runtime (DLR)
- anonymous lambda expression can be converted to
ExpressionTree via compiler (i.e.
x => x*2 can be represented as tree instead of delegate or anonymous lambda function)
Delegates can be converted easily to another type if you know types of those delegates. But if you do not know it is impossible without really complicated code.
Continue reading “Dynamic runtime delegates conversion”
Important note: this should work well with newer version of Xamarin (2.3.3). If you cannot update for some reason this article will explain workaround.
In previous article I explained how to detect show and hide events of software keyboard in Xamarin Android. I did it in my project because of the fact that some of text boxes was hidden by software keyboard that suppose to edit contents of those text boxes. In this article I will explain how to work around this issue in some older versions of Xamarin. Continue reading “Automatic scrolling to edited text box in Xamarin Android.”
This article is builds on topics and solutions introduces in ViewFactory for Xamarin application and Xamarin Master-Detail Page articles. It shows method for easier navigation and use of services via IoC in Xamarin application.
Knowledge from previous examples is not necessary, but makes this article bit easier to understand. Continue reading “Xamarin with TinyIoC”
Reflection.Emit is very powerful tool. It creates IL code and since C# is converted into IL too, we have the same functionality as in C# and even more. It is very powerful and at the same time very complicated. Because of that it is worth to discuss how and for what it should be used. One idea is to create dynamic code with automatic implementations of interfaces – proxy types.
Continue reading “Genereting proxies during runtime using Reflection.Emit”