<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="/rss.xsl"?><rss version="2.0"><channel><title>Dynamic Forum Rss Feed</title><link>http://www.codeplex.com/Project/ListForums.aspx?ProjectName=Dynamic</link><description>Dynamic Forum Rss Description</description><item><title>New Post: How about generic method invocations?</title><link>http://www.codeplex.com/Dynamic/Thread/View.aspx?ThreadId=31524</link><description>&lt;div style="line-height: normal;"&gt;I'd like to use your approach to handling generic class instantiation and generic method&amp;nbsp;&amp;nbsp;invocation, but I don't see any way to do it.&lt;br&gt;
&lt;br&gt;
Here's a sample of code I'd like to use it for.&lt;br&gt;
&lt;br&gt;
creating a strongly typed object:&lt;br&gt;
&lt;br&gt;
CreateObject&amp;lt;T&amp;gt;( string a, int b, params object[] c )&lt;br&gt;
{&lt;br&gt;
&amp;nbsp; SomeObject&amp;lt;T&amp;gt; rv = new SomeObject&amp;lt;T&amp;gt;( a, b, c )&lt;br&gt;
&lt;br&gt;
&amp;nbsp; return rv;&lt;br&gt;
}&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
calling a strongly typed generic proc or function:&lt;br&gt;
&lt;br&gt;
...&lt;br&gt;
void Foo&amp;lt;T&amp;gt;( T arg1, T arg2 ) {}&lt;br&gt;
Q bar&amp;lt;Q&amp;gt;( int i, double j ) { }&lt;br&gt;
&lt;br&gt;
Is there a way to accomplish this with this thing?&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;/div&gt;</description><author>vankirkc</author><pubDate>Tue, 15 Jul 2008 08:05:43 GMT</pubDate><guid isPermaLink="false">New Post: How about generic method invocations? 20080715080543A</guid></item><item><title>NEW POST: Internal Class</title><link>http://www.codeplex.com/Dynamic/Thread/View.aspx?ThreadId=24967</link><description>&lt;div style="line-height: normal;"&gt;Yes, i've a solution.&lt;br&gt;
&lt;br&gt;
You can see a sample in my project Tangibilis in Codeplex.&lt;br&gt;
&lt;br&gt;
&lt;a href="http://www.codeplex.com/Tangibilis/SourceControl/FileView.aspx?itemId=135071&amp;changeSetId=6122"&gt;http://www.codeplex.com/Tangibilis/SourceControl/FileView.aspx?itemId=135071&amp;amp;changeSetId=6122&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
Good luck.
&lt;/div&gt;</description><author>sbia</author><pubDate>Wed, 21 May 2008 19:25:34 GMT</pubDate><guid isPermaLink="false">NEW POST: Internal Class 20080521072534P</guid></item><item><title>NEW POST: Internal Class</title><link>http://www.codeplex.com/Dynamic/Thread/View.aspx?ThreadId=24967</link><description>&lt;div style="line-height: normal;"&gt;Yes, i've a solution.&lt;br&gt;
&lt;br&gt;
You can see a sample in my project Tangibilis in Codeplex.&lt;br&gt;
&lt;br&gt;
&lt;a href="http://www.codeplex.com/Tangibilis/SourceControl/FileView.aspx?itemId=135071&amp;changeSetId=6122"&gt;http://www.codeplex.com/Tangibilis/SourceControl/FileView.aspx?itemId=135071&amp;amp;changeSetId=6122&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
Good luck.
&lt;/div&gt;</description><author>sbia</author><pubDate>Wed, 21 May 2008 16:50:32 GMT</pubDate><guid isPermaLink="false">NEW POST: Internal Class 20080521045032P</guid></item><item><title>NEW POST: Internal Class</title><link>http://www.codeplex.com/Dynamic/Thread/View.aspx?ThreadId=24967</link><description>&lt;div style="line-height: normal;"&gt;I have the same problem. Any solution?
&lt;/div&gt;</description><author>nesher</author><pubDate>Tue, 20 May 2008 18:47:18 GMT</pubDate><guid isPermaLink="false">NEW POST: Internal Class 20080520064718P</guid></item><item><title>NEW POST: Internal Class</title><link>http://www.codeplex.com/Dynamic/Thread/View.aspx?ThreadId=24967</link><description>&lt;div class="wikidoc"&gt;
Hi, How can i invoke method from an internal class ?&lt;br /&gt;
&lt;/div&gt;</description><author>sbia</author><pubDate>Sat, 29 Mar 2008 16:39:41 GMT</pubDate><guid isPermaLink="false">NEW POST: Internal Class 20080329043941P</guid></item><item><title>NEW POST: Nested Objects</title><link>http://www.codeplex.com/Dynamic/Thread/View.aspx?ThreadId=20443</link><description>&lt;div class="wikidoc"&gt;
Code example sent to your email.&lt;br /&gt;
&lt;/div&gt;</description><author>mtsu_bravo</author><pubDate>Thu, 17 Jan 2008 21:30:03 GMT</pubDate><guid isPermaLink="false">NEW POST: Nested Objects 20080117093003P</guid></item><item><title>NEW POST: Nested Objects</title><link>http://www.codeplex.com/Dynamic/Thread/View.aspx?ThreadId=20443</link><description>&lt;div class="wikidoc"&gt;
Is there any expectation of extending this to support nested objects? aka something.somethingelse.something&lt;br /&gt;I have taken your base and manipulated it with some other examples I have found to support this but it is not fully functional. As I do not fully understand how this works. I can supply you with the code I got if your willing to make the modification to your base to support this.&lt;br /&gt; &lt;br /&gt;The problem I have with mine is as long as all of the nested objects are populate it works, but if they are not they will have a value of null and it causes an compare error. These objects are not of type nullable but they have a value of null.&lt;br /&gt; &lt;br /&gt;Does this make any sense?&lt;br /&gt;Thanks for the library its been very helpful.&lt;br /&gt;
&lt;/div&gt;</description><author>mtsu_bravo</author><pubDate>Tue, 15 Jan 2008 01:15:39 GMT</pubDate><guid isPermaLink="false">NEW POST: Nested Objects 20080115011539A</guid></item><item><title>NEW POST: How to access the field like System.Data.RelatedView.values ?</title><link>http://www.codeplex.com/Dynamic/Thread/View.aspx?ThreadId=18335</link><description>&lt;div class="wikidoc"&gt;
The problem is that the type System.Data.RelatedView is internal into System.Data.dll so the following code can't be compiled : &lt;br /&gt;Dynamic&amp;lt;System.Data.RelatedView&amp;gt;.Instance.Field&amp;lt;object[]&amp;gt;.Getter.CreateDelegate(&amp;quot;values&amp;quot;); &lt;br /&gt; &lt;br /&gt;so I've wrote this to access it without your lib:&lt;br /&gt; &lt;br /&gt; Type relatedViewType = System.Reflection.Assembly.GetAssembly(typeof(System.Data.DataSet))&lt;br /&gt;                                                            .GetType(&amp;quot;System.Data.RelatedView&amp;quot;);&lt;br /&gt; &lt;br /&gt;            FieldInfo valuesField = relatedViewType.GetField(&amp;quot;values&amp;quot;, System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);&lt;br /&gt; &lt;br /&gt;            //build setter&lt;br /&gt;            DynamicMethod setterDef = new DynamicMethod(relatedViewType.Name + &amp;quot;&lt;i&gt;&amp;quot; + valuesField + &amp;quot;&lt;/i&gt;Setter&amp;quot;,&lt;br /&gt;                                                        typeof(void),&lt;br /&gt;                                                        new Type[] { typeof(DataView), typeof(object[]) }, //define 1st param as DataView cause RelatedView is not an accessible type&lt;br /&gt;                                                        relatedViewType);&lt;br /&gt; &lt;br /&gt;            ILGenerator setterIL = setterDef.GetILGenerator();&lt;br /&gt;            setterIL.Emit(OpCodes.Ldarg_0); //we expect in top of the stack object instance&lt;br /&gt;            setterIL.Emit(OpCodes.Ldarg_1);&lt;br /&gt;            setterIL.Emit(OpCodes.Stfld, valuesField);&lt;br /&gt;            setterIL.Emit(OpCodes.Ret); //note: we have to return, even if method is void&lt;br /&gt; &lt;br /&gt;            //assign s_RelatedViewKeyValuesSetter with the builded method&lt;br /&gt;            s_RelatedViewKeyValuesSetter = (Common.Utility.CodeEmit.Proc&amp;lt;DataView, object[]&amp;gt;)setterDef.CreateDelegate(typeof(Common.Utility.CodeEmit.Proc&amp;lt;DataView, object[]&amp;gt;));&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;
&lt;/div&gt;</description><author>BixasBxB</author><pubDate>Tue, 04 Dec 2007 11:18:20 GMT</pubDate><guid isPermaLink="false">NEW POST: How to access the field like System.Data.RelatedView.values ? 20071204111820A</guid></item><item><title>NEW POST: How to access the field like System.Data.RelatedView.values ?</title><link>http://www.codeplex.com/Dynamic/Thread/View.aspx?ThreadId=18335</link><description>&lt;div class="wikidoc"&gt;
Thanks for the interest.... the fact that a type is internal or private should cause you no trouble if you are running under full trust.  Can you upload or send me a sample that breaks, I'll happily fix the library to accomodate.&lt;br /&gt;
&lt;/div&gt;</description><author>IDisposable</author><pubDate>Tue, 27 Nov 2007 23:50:24 GMT</pubDate><guid isPermaLink="false">NEW POST: How to access the field like System.Data.RelatedView.values ? 20071127115024P</guid></item><item><title>NEW POST: How to access the field like System.Data.RelatedView.values ?</title><link>http://www.codeplex.com/Dynamic/Thread/View.aspx?ThreadId=18335</link><description>&lt;div class="wikidoc"&gt;
Hello,&lt;br /&gt; &lt;br /&gt;I'm search how to use your generic based framework on a Type which is inaccessible like System.Data.RelatedView ?&lt;br /&gt; &lt;br /&gt;Thanks for your great dynamic Reflection Lib.&lt;br /&gt; &lt;br /&gt;BxB&lt;br /&gt;
&lt;/div&gt;</description><author>BixasBxB</author><pubDate>Mon, 26 Nov 2007 19:33:48 GMT</pubDate><guid isPermaLink="false">NEW POST: How to access the field like System.Data.RelatedView.values ? 20071126073348P</guid></item><item><title>NEW POST: MethodAccessException</title><link>http://www.codeplex.com/Dynamic/Thread/View.aspx?ThreadId=10647</link><description>&lt;div class="wikidoc"&gt;
Hi, of course, as expected, this new code (changeset 22961) works fine in my generic base class scenario too.&lt;br /&gt; &lt;br /&gt;Vlado.&lt;br /&gt;
&lt;/div&gt;</description><author>vladooo</author><pubDate>Sat, 26 May 2007 09:46:30 GMT</pubDate><guid isPermaLink="false">NEW POST: MethodAccessException 20070526094630A</guid></item><item><title>NEW POST: MethodAccessException</title><link>http://www.codeplex.com/Dynamic/Thread/View.aspx?ThreadId=10647</link><description>&lt;div class="wikidoc"&gt;
I've updated the code according to your suggestion (keeping the existing path intact for varargs methods) and added your test-case.  Let me know if the current build does the trick and I'll drop a new release.&lt;br /&gt;
&lt;/div&gt;</description><author>IDisposable</author><pubDate>Fri, 25 May 2007 20:01:13 GMT</pubDate><guid isPermaLink="false">NEW POST: MethodAccessException 20070525080113P</guid></item><item><title>NEW POST: MethodAccessException</title><link>http://www.codeplex.com/Dynamic/Thread/View.aspx?ThreadId=10647</link><description>&lt;div class="wikidoc"&gt;
This discussion has been copied to a work item. Click here to &lt;a href="http://www.codeplex.com/Dynamic/WorkItem/View.aspx?WorkItemId=10576"&gt;go to the work item and continue the discussion&lt;/a&gt;.&lt;br /&gt;
&lt;/div&gt;</description><author>IDisposable</author><pubDate>Fri, 25 May 2007 19:44:30 GMT</pubDate><guid isPermaLink="false">NEW POST: MethodAccessException 20070525074430P</guid></item><item><title>NEW POST: MethodAccessException</title><link>http://www.codeplex.com/Dynamic/Thread/View.aspx?ThreadId=10647</link><description>&lt;div class="wikidoc"&gt;
OR another solution to this is to set skipVisibility parameter in DynamicMethod constructor to true:&lt;br /&gt; &lt;br /&gt;DynamicMethod dm = new DynamicMethod(&amp;quot;DynamicCompare&amp;quot;&lt;br /&gt;                , MethodAttributes.Static | MethodAttributes.Public, CallingConventions.Standard,&lt;br /&gt;                typeof(int), new Type[] { typeof(T), typeof(T) }, typeof(T), &lt;b&gt;true&lt;/b&gt;);&lt;br /&gt;
&lt;/div&gt;</description><author>vladooo</author><pubDate>Fri, 25 May 2007 17:32:41 GMT</pubDate><guid isPermaLink="false">NEW POST: MethodAccessException 20070525053241P</guid></item><item><title>NEW POST: MethodAccessException</title><link>http://www.codeplex.com/Dynamic/Thread/View.aspx?ThreadId=10647</link><description>&lt;div class="wikidoc"&gt;
Hi. I found the solution. I changed Call method in DynamicEmit class to this:&lt;br /&gt; &lt;br /&gt;public void Call(MethodInfo method)&lt;br /&gt;        {&lt;br /&gt;            if (method.IsFinal || !method.IsVirtual)&lt;br /&gt;            {&lt;br /&gt;                _ilGen.Emit(OpCodes.Call, method);&lt;br /&gt;            }&lt;br /&gt;            else&lt;br /&gt;            {&lt;br /&gt;                _ilGen.Emit(OpCodes.Callvirt, method);&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt; &lt;br /&gt;Now everything works fine.&lt;br /&gt; &lt;br /&gt;According to this http://blogs.msdn.com/haibo_luo/archive/2006/08/13/698719.aspx&lt;br /&gt;EmitCall is mainly for varargs methods and you can (should) use Emit when you do not use varargs.&lt;br /&gt;I do not understand MSIL but I might be a bug in EmitCall or I don't know.&lt;br /&gt; &lt;br /&gt;Have a nice day.&lt;br /&gt; &lt;br /&gt;Vlado&lt;br /&gt;
&lt;/div&gt;</description><author>vladooo</author><pubDate>Fri, 25 May 2007 13:49:09 GMT</pubDate><guid isPermaLink="false">NEW POST: MethodAccessException 20070525014909P</guid></item><item><title>NEW POST: MethodAccessException</title><link>http://www.codeplex.com/Dynamic/Thread/View.aspx?ThreadId=10647</link><description>&lt;div class="wikidoc"&gt;
Hi Marc, here is very simple minimal reproduction:&lt;br /&gt; &lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Text;&lt;br /&gt;using Phydeaux.Utilities;&lt;br /&gt; &lt;br /&gt;namespace ConsoleApplication1&lt;br /&gt;{&lt;br /&gt;    class Program&lt;br /&gt;    {&lt;br /&gt;        static void Main(string[] args)&lt;br /&gt;        {&lt;br /&gt;            // get the list&lt;br /&gt;            List&amp;lt;CountryBDO&amp;gt; list = CountryBDO.getAllBDOs();&lt;br /&gt;        }&lt;br /&gt; &lt;br /&gt;    }&lt;br /&gt; &lt;br /&gt;    // base class&lt;br /&gt;    public abstract class BDORoot&amp;lt;TBDO&amp;gt;&lt;br /&gt;    {&lt;br /&gt;        private long? _ID;&lt;br /&gt;        public long? ID&lt;br /&gt;        {&lt;br /&gt;            get { return _ID; }&lt;br /&gt;            set { _ID = value; }&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt; &lt;br /&gt;    // derived class&lt;br /&gt;    public class CountryBDO : BDORoot&amp;lt;CountryBDO&amp;gt;&lt;br /&gt;    {&lt;br /&gt;        private string _Name;&lt;br /&gt;        public string Name&lt;br /&gt;        {&lt;br /&gt;            get { return _Name; }&lt;br /&gt;            set { _Name = value; }&lt;br /&gt;        }&lt;br /&gt; &lt;br /&gt;        public static List&amp;lt;CountryBDO&amp;gt; getAllBDOs()&lt;br /&gt;        {&lt;br /&gt; &lt;br /&gt;            List&amp;lt;CountryBDO&amp;gt; list = new List&amp;lt;CountryBDO&amp;gt;();&lt;br /&gt;            CountryBDO c1 = new CountryBDO();&lt;br /&gt;            c1.ID = 100;&lt;br /&gt;            c1.Name = &amp;quot;USA&amp;quot;;&lt;br /&gt;            list.Add(c1);&lt;br /&gt;            CountryBDO c2 = new CountryBDO();&lt;br /&gt;            c2.ID = 50;&lt;br /&gt;            c2.Name = &amp;quot;Slovakia&amp;quot;;&lt;br /&gt;            list.Add(c2);&lt;br /&gt;            CountryBDO c3 = new CountryBDO();&lt;br /&gt;            c3.ID = 150;&lt;br /&gt;            c3.Name = &amp;quot;Vanuatu&amp;quot;;&lt;br /&gt;            list.Add(c3);&lt;br /&gt; &lt;br /&gt;            //works&lt;br /&gt;            list.Sort(new DynamicComparer&amp;lt;CountryBDO&amp;gt;(&amp;quot;Name&amp;quot;));&lt;br /&gt; &lt;br /&gt;            //throws exception&lt;br /&gt;            list.Sort(new DynamicComparer&amp;lt;CountryBDO&amp;gt;(&amp;quot;ID&amp;quot;));&lt;br /&gt; &lt;br /&gt;            return list;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;
&lt;/div&gt;</description><author>vladooo</author><pubDate>Fri, 25 May 2007 07:26:34 GMT</pubDate><guid isPermaLink="false">NEW POST: MethodAccessException 20070525072634A</guid></item><item><title>NEW POST: MethodAccessException</title><link>http://www.codeplex.com/Dynamic/Thread/View.aspx?ThreadId=10647</link><description>&lt;div class="wikidoc"&gt;
Any chance you could give me a minimal reproduction of the issue in code?  I can fix it much faster if I'm sure I'm addressing your actual issue.&lt;br /&gt;
&lt;/div&gt;</description><author>IDisposable</author><pubDate>Fri, 25 May 2007 04:48:48 GMT</pubDate><guid isPermaLink="false">NEW POST: MethodAccessException 20070525044848A</guid></item><item><title>NEW POST: MethodAccessException</title><link>http://www.codeplex.com/Dynamic/Thread/View.aspx?ThreadId=10647</link><description>&lt;div class="wikidoc"&gt;
Hi,&lt;br /&gt; &lt;br /&gt;I am getting MethodAccessException when I use DynamicComparer to compare classes using some property which is declared at the base-class level.&lt;br /&gt; &lt;br /&gt;The base class is abstract generic class BDORoot&amp;lt;T&amp;gt; and has properties like ID, DateCreated etc.. Derived classes inherit from it like: class CurrencyBDO : BDORoot&amp;lt;CurrencyBDO&amp;gt;.&lt;br /&gt; &lt;br /&gt;When I use DynamicComparer to sort by (for example) Name property which is declared in CurrencyBDO everything works fine. But when I try to sort by some property declared in BDORoot like ID or DateCreated it throws MethodAccessException (&amp;quot;cannot invoke get_ID() method&amp;quot;) during comparer.Invoke(x, y) call. I run it locally in Full trust so I do not understand why this happens. All that properties and classes are public.&lt;br /&gt; &lt;br /&gt;Do you have any idea what might be wrong? My code or something in DynamicEmit class?&lt;br /&gt; &lt;br /&gt;BTW: Thanks Mark for great Dynamic Reflection Library .&lt;br /&gt; &lt;br /&gt;Vlado.&lt;br /&gt;
&lt;/div&gt;</description><author>vladooo</author><pubDate>Thu, 24 May 2007 12:50:42 GMT</pubDate><guid isPermaLink="false">NEW POST: MethodAccessException 20070524125042P</guid></item><item><title>User Forum: RE: DynamicDeepCopy</title><link>http://www.codeplex.com/Dynamic/Project/DisplayThread.aspx?ForumId=1598&amp;ThreadId=3137&amp;ANCHOR#LastPost</link><description>Honestly, I don't know how much it would differ from Serialization. The idea doesn't really come out of a specific need, I will just have most of the code done (via the bulk method calls), so it seemed like a good next step.  I have had a need in the past for deep copy support though.  I would think it would be faster than serialization and it would not require you to mark up your objects as serializable.  

The downside to the bulk calls is that right now they take object[] for the properties to be set and return an object[] for retrieved properties (I can't have them both in one method because I am tranforming from one class to another) so there will usually be boxing/unboxing.  The only alternative I could come up with was to include Generic Delegates for up to n parameters, but since an object could have dozens of properties, this didn't seem like a very clean approach either.

As long as I'm deep copying an object tree, however, the getting and setting should be able to be called from within the same method on each object and should, I would think, be very fast as there is no serialization / deserialization happening.

That's about all I can come up with though.  Any thoughts?</description><author>JasonMueller</author><pubDate>Wed, 27 Dec 2006 16:47:00 GMT</pubDate><guid isPermaLink="false">User Forum: RE: DynamicDeepCopy 20061227044700P</guid></item><item><title>User Forum: RE: DynamicDeepCopy</title><link>http://www.codeplex.com/Dynamic/Project/DisplayThread.aspx?ForumId=1598&amp;ThreadId=3137&amp;ANCHOR#LastPost</link><description>I would definately be interested.  If the quality of code is good, I will add you to the project as a contributor if you like. Send me the goods at IDisposable@gmail.com

One question, how will this differ from simply doing a serialize/deserialize (which does a deep copy with related objects)?

FYI, I'm going to be commiting a couple things in this project again as soon as a minor issue with the CodePlex workspaces and my old (deceased) laptop is resolved.  
</description><author>IDisposable</author><pubDate>Wed, 27 Dec 2006 09:08:39 GMT</pubDate><guid isPermaLink="false">User Forum: RE: DynamicDeepCopy 20061227090839A</guid></item></channel></rss>