Anonymous Type vs Dynamic Type
What are the real differences between anonymous type(var) in c# 3.0 and dynamic type(dynamic) that is coming in c# 4.0? ...
What are the real differences between anonymous type(var) in c# 3.0 and dynamic type(dynamic) that is coming in c# 4.0? ...
I have a piece of code here that i really could use some help with refactoring. I need the different methods for adding relational data in a form in rails. The code is taken from http://railscasts.com/episodes/75-complex-forms-part-3, my problem is that i need to have the methods fro both the Material model and the Answer model. So i nee...
Here's the scenario: I have a set of buttons that I want to bind to corresponding functions when clicked. The ids of these buttons are the same as the names of their corresponding functions. I could do this: $("#kick").click(kick); $("#push").click(push); $("#shove").click(shove); But I'm lazy and would like to do this more lazily (as...
I have a window with a title on it. When the user selects a choice from a drop down list, the title image can change. The problem is when the image loads, it's a blurred, stretched, and pixelated. These are PNG files I'm working with and they look good prior to setting the source dynamically. Here's the code I'm using to change the imag...
I've some classes defined in a dll file. These are in the form of com api. I'm trying to create an object of one of the class dynamically and than setting some property of that object. When I set the property manually, it works, but when I try to invoke the same using reflection it gives the error that Object does not match target ty...
For instance, will I be able to create an application that allows users to create and modify existing types at runtime? Will I be able to persist instances of those types in SQL without having to worry about the user who adds 100,000 records and expects a (really) fast query on them? Think SharePoint Content Types... but on steroids. Os...
I am trying to build a dynamic proxy for an interface with LinFu. The proxy should just implement the getter methods of the properties that are defined by the interface and return for instance a value from a dictionary, where the key is the property name. link text ...
In his PDC talk, Anders said that the dynamic keyword would dispatch any function calls made to it at run time. He then went on to say that the "dynamic" keyword is itself staticly typed checked during compile time. Now if you were to invoke a method that does not exist on a "dynamic" type - would'nt this result in a run time error? ...
Has anyone tried ASP.NET MVC using IronPython? Having done a lot of Python development recently, it would be nice to continue with the language as I go into a potential ASP.NET MVC project. I'm especially interested in exploiting the dynamic aspects of Python with .NET features such as LINQ and want to know if this will be possible. T...
I'm generating code dynamically, currently using String.Format and embedding placeholders - but reformatting the C# code for use as a template is a pain, and I think using a T4 template would be better. However, the code generation will be happening on a running system, so I need to know that I can safely and legally redistribute the Mi...
Has anyone seen any how-to, documentation, or otherwise about how to load HTTP Modules dynamically for IIS? Basically what I am trying to do is to load HTTP Modules, which I'll call HTTPModuleA, HTTPModuleB, and HTTPModuleC. The modules however could be changed out at any time with HTTPModuleD, HTTPModuleE, or HTTPModuleF. I basically...
Let's say I have a resource file which exports mc1 with 4 frames in it. I would like to create a new MovieClip and insert frames like this: mc2:flash.display.MovieClip = new flash.display.MovieClip() mc1.gotoAndStop(2); mc2.gotoAndStop(1); mc2.currentFrame = mc1.currenctFrame mc1.gotoAndStop(1); mc2.gotoAndStop(2); mc2.currentFrame = m...
I want to know I can dynamically modify an existing Crystal Report (using C# and Crystal Reports 2008) so that it can report on fundamentally different data (from the same database) using the same layout. The reason is that we are building an application that allows the user to specify: A filter so that only the data they are intereste...
I would like my website to create search-engine-optimized links for dynamic content (instead of locating data via the querystring). So: mysite/SomeModifiableNname.aspx instead of mysite/DynamicContent.aspx?entryID=2345. Aside from a smart 404 handler that redirects requests, or a custom mime-type handler in IIS, is there a good solut...
I need to perform 9 different operations on a coordinate, depending on the position of the coordinate. I have a function that returns the coordinates of a position around the given coordinate (down, up, left, right or diagonals). The 9 different operations are the different possible 'types' of coordinate; if I'm dealing with coordinate (...
At the moment I have something like this ` <%# Eval("orderBy").ToString()%>) <%# Eval("question").ToString()%> " type="radio" id="True" value="True" class="styled" /> " type="radio" id="False" value="False" class="styled" /> ` And in the code behind I caputure the values as Request.Form("question1") for example and this a...
Hi, I want to provide dynamic download of files. These files can be generated on-the-fly on serverside so they are represented as byte[] and do not exist on disk. I want the user to fill in an ASP.NET form, hit the download button and return the file he/she wanted. Here is how my code behind the ASP.NET form looks like: public partial...
Question I am trying to dynamically get the default for a type that is specified in a ParameterInfo. _methods[methodName] returns a MethodInfo object. Unfortunately, the compiler doesn't like the "paramType" bit inside the default(paramType). I'm stumped. Error The type or namespace name 'paramType' could not be found (are you mis...
I would like to get all the instances of an object of a certain class. For example: class Foo { } $a = new Foo(); $b = new Foo(); $instances = get_instances_of_class('Foo'); $instances should be either array($a, $b) or array($b, $a) (order does not matter). A plus is if the function would return instances which have a superclass o...
Is there a way to create WCF proxy objects on the fly without using codedom? By on the fly I mean during runtime. So lets say I have a smart client application that is accessing a WCF service. The Data Contract for the WCF service is changed while the client is running. I want to dynamically create a new proxy object that reflects the ch...