<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Workaround for Known Issue with TypeConverters in DSL Tools for Visual Studio</title>
	<atom:link href="http://www.ticklishtechs.net/2008/02/06/workaround-for-known-issue-with-typeconverters-in-dsl-tools-for-visual-studio/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ticklishtechs.net/2008/02/06/workaround-for-known-issue-with-typeconverters-in-dsl-tools-for-visual-studio/</link>
	<description>a mostly .NET but also some other cool techs blog</description>
	<lastBuildDate>Mon, 16 Aug 2010 19:53:08 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Benjamin SchrÃ¶ter</title>
		<link>http://www.ticklishtechs.net/2008/02/06/workaround-for-known-issue-with-typeconverters-in-dsl-tools-for-visual-studio/comment-page-1/#comment-1714</link>
		<dc:creator>Benjamin SchrÃ¶ter</dc:creator>
		<pubDate>Tue, 27 Jan 2009 14:35:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.ticklishtechs.net/2008/02/06/workaround-for-known-issue-with-typeconverters-in-dsl-tools-for-visual-studio/#comment-1714</guid>
		<description>Hi Atul
That scenario is in fact not supported at this time. I reproduced it and found a solution but Iâ€™m not sure how to build that solution into JaDAL. At the moment I will not do that, but I can tell you a way to use your own Classes with DynamicProperties.

First of all you have to implement a TypeConverter for your TestClass and use the TypeConverter-Attribute on the TestClass as well (please use the string overload instead of the typeof() version of that attribute). When persisting the TestClass, the TypeConverter will be used to create a string representation of its value. To create a new TestClass from that representation when loading it is used too. For an example take a look at the DynamicProperty-CollectionTypeConverter.cs file from the JaDAL source code.

Now the values will be stored in the file when saving the DSL model but there is still a problem when loading the file: the class TestClass is not known by the DynamicProperty system and cannot be created. One solution is, to add your TestClass to the JaDAL assembly (or take the DynamicProperty code into your DSL assembly). 

Another solution is to change the code saving the TestClass to use the AssemblyQualifiedName instead of the namespace + class name. Now the TestClass can be created but if you change the version or public key of your assembly, old files cannot longer be loaded (since the public key and the version are part of the AssemblyQualifiedName). If you prefer that solution, you have to change the source code of JaDAL a little bit: In the DynamicPropertyCollectionTypeConverter class there is a line 
&gt; attr = new XAttribute(&quot;type_&quot; + i, property.Type.ToString());
change it to 
&gt; attr = new XAttribute(&quot;type_&quot; + i, property.Type.AssemblyQualifiedName);
Maybe you should add an if statement to use the first way for classes from mscorelib and from the JaDAL assembly and use the second way only for your own classes.

If you have some more questions, do not hesitate to write me an email or a comment on the blog.</description>
		<content:encoded><![CDATA[<p>Hi Atul<br />
That scenario is in fact not supported at this time. I reproduced it and found a solution but Iâ€™m not sure how to build that solution into JaDAL. At the moment I will not do that, but I can tell you a way to use your own Classes with DynamicProperties.</p>
<p>First of all you have to implement a TypeConverter for your TestClass and use the TypeConverter-Attribute on the TestClass as well (please use the string overload instead of the typeof() version of that attribute). When persisting the TestClass, the TypeConverter will be used to create a string representation of its value. To create a new TestClass from that representation when loading it is used too. For an example take a look at the DynamicProperty-CollectionTypeConverter.cs file from the JaDAL source code.</p>
<p>Now the values will be stored in the file when saving the DSL model but there is still a problem when loading the file: the class TestClass is not known by the DynamicProperty system and cannot be created. One solution is, to add your TestClass to the JaDAL assembly (or take the DynamicProperty code into your DSL assembly). </p>
<p>Another solution is to change the code saving the TestClass to use the AssemblyQualifiedName instead of the namespace + class name. Now the TestClass can be created but if you change the version or public key of your assembly, old files cannot longer be loaded (since the public key and the version are part of the AssemblyQualifiedName). If you prefer that solution, you have to change the source code of JaDAL a little bit: In the DynamicPropertyCollectionTypeConverter class there is a line<br />
> attr = new XAttribute(&#8220;type_&#8221; + i, property.Type.ToString());<br />
change it to<br />
> attr = new XAttribute(&#8220;type_&#8221; + i, property.Type.AssemblyQualifiedName);<br />
Maybe you should add an if statement to use the first way for classes from mscorelib and from the JaDAL assembly and use the second way only for your own classes.</p>
<p>If you have some more questions, do not hesitate to write me an email or a comment on the blog.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Atul Katare</title>
		<link>http://www.ticklishtechs.net/2008/02/06/workaround-for-known-issue-with-typeconverters-in-dsl-tools-for-visual-studio/comment-page-1/#comment-1654</link>
		<dc:creator>Atul Katare</dc:creator>
		<pubDate>Mon, 19 Jan 2009 09:54:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.ticklishtechs.net/2008/02/06/workaround-for-known-issue-with-typeconverters-in-dsl-tools-for-visual-studio/#comment-1654</guid>
		<description>Hi
Good Article on Dynamic Property

I have some query about how to provide external Type as Type in AddProperty() method

DynamicPropertyCollection dpc=new DynamicPropertyCollection ();

dpc.Addproperty(&quot;test&quot;,typeof(TestClass), new TestClass())

when I close visual studio and open next time It never persist its value
but It work with string,Int,bool, Datetime object 
Is there any solution for this scenario.

Thank You</description>
		<content:encoded><![CDATA[<p>Hi<br />
Good Article on Dynamic Property</p>
<p>I have some query about how to provide external Type as Type in AddProperty() method</p>
<p>DynamicPropertyCollection dpc=new DynamicPropertyCollection ();</p>
<p>dpc.Addproperty(&#8220;test&#8221;,typeof(TestClass), new TestClass())</p>
<p>when I close visual studio and open next time It never persist its value<br />
but It work with string,Int,bool, Datetime object<br />
Is there any solution for this scenario.</p>
<p>Thank You</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ticklish Techs &#187; Blog Archive &#187; Workaround for Known Issue with TypeDescriptors in DSL Tools for Visual Studio</title>
		<link>http://www.ticklishtechs.net/2008/02/06/workaround-for-known-issue-with-typeconverters-in-dsl-tools-for-visual-studio/comment-page-1/#comment-596</link>
		<dc:creator>Ticklish Techs &#187; Blog Archive &#187; Workaround for Known Issue with TypeDescriptors in DSL Tools for Visual Studio</dc:creator>
		<pubDate>Sat, 19 Jul 2008 17:33:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.ticklishtechs.net/2008/02/06/workaround-for-known-issue-with-typeconverters-in-dsl-tools-for-visual-studio/#comment-596</guid>
		<description>[...] time ago I posted a workaround for this problem with the TypeConverter, but today a realized that this workaround does not work [...]</description>
		<content:encoded><![CDATA[<p>[...] time ago I posted a workaround for this problem with the TypeConverter, but today a realized that this workaround does not work [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Má»™t sá»‘ bÃ i há»?c vá»? DSL sÆ°u táº§m(luÃ´n cáº­p nháº­t) &#171; IT Technology</title>
		<link>http://www.ticklishtechs.net/2008/02/06/workaround-for-known-issue-with-typeconverters-in-dsl-tools-for-visual-studio/comment-page-1/#comment-458</link>
		<dc:creator>Má»™t sá»‘ bÃ i há»?c vá»? DSL sÆ°u táº§m(luÃ´n cáº­p nháº­t) &#171; IT Technology</dc:creator>
		<pubDate>Mon, 12 May 2008 04:50:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.ticklishtechs.net/2008/02/06/workaround-for-known-issue-with-typeconverters-in-dsl-tools-for-visual-studio/#comment-458</guid>
		<description>[...] 1. Workaround for Known Issue with TypeConverters in DSL Tools for Visual Studio [...]</description>
		<content:encoded><![CDATA[<p>[...] 1. Workaround for Known Issue with TypeConverters in DSL Tools for Visual Studio [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Francesio</title>
		<link>http://www.ticklishtechs.net/2008/02/06/workaround-for-known-issue-with-typeconverters-in-dsl-tools-for-visual-studio/comment-page-1/#comment-415</link>
		<dc:creator>Francesio</dc:creator>
		<pubDate>Mon, 24 Mar 2008 14:14:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.ticklishtechs.net/2008/02/06/workaround-for-known-issue-with-typeconverters-in-dsl-tools-for-visual-studio/#comment-415</guid>
		<description>Great page.., man</description>
		<content:encoded><![CDATA[<p>Great page.., man</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ticklish Techs &#187; Blog Archive &#187; Adding properties to Domain Classes at runtime with DSL Tools</title>
		<link>http://www.ticklishtechs.net/2008/02/06/workaround-for-known-issue-with-typeconverters-in-dsl-tools-for-visual-studio/comment-page-1/#comment-373</link>
		<dc:creator>Ticklish Techs &#187; Blog Archive &#187; Adding properties to Domain Classes at runtime with DSL Tools</dc:creator>
		<pubDate>Sun, 17 Feb 2008 13:21:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.ticklishtechs.net/2008/02/06/workaround-for-known-issue-with-typeconverters-in-dsl-tools-for-visual-studio/#comment-373</guid>
		<description>[...] is a known issue and a workaround I described here with the TypeConverterAttribute and the DSL [...]</description>
		<content:encoded><![CDATA[<p>[...] is a known issue and a workaround I described here with the TypeConverterAttribute and the DSL [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
