<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>DLR Hosting and related stuff... : Addin</title><link>http://blogs.msdn.com/seshadripv/archive/tags/Addin/default.aspx</link><description>Tags: Addin</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>DLR Hosting Sample : QikScript - Handle Visual Studio 2008 extensibility events in IronPython</title><link>http://blogs.msdn.com/seshadripv/archive/2008/07/17/dlr-hosting-sample-write-event-handlers-for-vs-in-ironpython.aspx</link><pubDate>Fri, 18 Jul 2008 00:01:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8744434</guid><dc:creator>seshadripv</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/seshadripv/comments/8744434.aspx</comments><wfw:commentRss>http://blogs.msdn.com/seshadripv/commentrss.aspx?PostID=8744434</wfw:commentRss><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Trebuchet MS','sans-serif'"&gt;The DLR Hosting API offers a well defined&amp;nbsp;interface for managed applications to host and utilize the power of the DLR (Dynamic Language Runtime) to enable end user scripting. The objective of this sample (and the forthcoming series of posts based on this sample) is to demonstrate and explain the usage of the API in doing those things.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Trebuchet MS','sans-serif'"&gt;QikScript is a Visual Studio addin that hosts the DLR enabling end users to write python scripts to handle events&amp;nbsp;fired by Visual Studio.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Trebuchet MS','sans-serif'"&gt;As part of its &lt;A class="" href="http://msdn.microsoft.com/en-us/library/1xt0ezx9(VS.71).aspx" mce_href="http://msdn.microsoft.com/en-us/library/1xt0ezx9(VS.71).aspx"&gt;extensibility model&lt;/A&gt;, Visual Studio defines &lt;A class="" href="http://msdn.microsoft.com/en-us/library/aa291100(VS.71).aspx" mce_href="http://msdn.microsoft.com/en-us/library/aa291100(VS.71).aspx"&gt;events&lt;/A&gt; that can be subscribed to through an add-in.&amp;nbsp;Add-ins can also access ‘live’ objects like the project system, editor, menus, output window etc in the hosting instance of visual studio. By Hosting the DLR and routing the events appropriately, QikScript&amp;nbsp;&lt;SPAN style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Trebuchet MS','sans-serif'; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;lets IronPython scripts to handle these events and access VS objects at runtime.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Trebuchet MS','sans-serif'"&gt;&lt;SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Trebuchet MS','sans-serif'"&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT size=4&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Trebuchet MS','sans-serif'; mso-bidi-font-size: 10.5pt"&gt;How to Install&lt;/SPAN&gt;&lt;/B&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Trebuchet MS','sans-serif'"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpFirst style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"&gt;&lt;SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Trebuchet MS','sans-serif'; mso-fareast-font-family: 'Trebuchet MS'; mso-bidi-font-family: 'Trebuchet MS'"&gt;&lt;SPAN style="mso-list: Ignore"&gt;1)&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Trebuchet MS','sans-serif'"&gt;Extract the contents of the &lt;A class="" href="https://blogs.msdn.com/seshadripv/attachment/8744434.ashx" mce_href="https://blogs.msdn.com/seshadripv/attachment/8744434.ashx"&gt;attached zip file&lt;/A&gt; to a folder on disk( say C:\QikScript)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l0 level1 lfo1"&gt;&lt;SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Trebuchet MS','sans-serif'; mso-fareast-font-family: 'Trebuchet MS'; mso-bidi-font-family: 'Trebuchet MS'"&gt;&lt;SPAN style="mso-list: Ignore"&gt;2)&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Trebuchet MS','sans-serif'"&gt;Copy the ‘QikScript.AddIn’ file to the VS 2008 AddIns folder. is the Addin folder is present in C:\Documents and Settings\&amp;lt;user name&amp;gt;\My Documents\Visual Studio 2008\Addins or C:\users\&amp;lt;user name&amp;gt;\My Documents\Visual Studio 2008\Addins &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"&gt;&lt;SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Trebuchet MS','sans-serif'; mso-fareast-font-family: 'Trebuchet MS'; mso-bidi-font-family: 'Trebuchet MS'"&gt;&lt;SPAN style="mso-list: Ignore"&gt;3)&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Trebuchet MS','sans-serif'"&gt;Open the AddIn file in a text or XML editor. &lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;Edit the value of the &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Assembly&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Trebuchet MS','sans-serif'"&gt;tag to indicate the full path to the ‘QikScript.dll’ file you copied in step 1.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpLast style="MARGIN: 0in 0in 10pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"&gt;&lt;SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Trebuchet MS','sans-serif'; mso-fareast-font-family: 'Trebuchet MS'; mso-bidi-font-family: 'Trebuchet MS'"&gt;&lt;SPAN style="mso-list: Ignore"&gt;4)&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Trebuchet MS','sans-serif'"&gt;If you extracted the files to a disk folder other than ‘C:\QikScript’ do the following. Go to the folder where you extracted the binary files. Open up the ‘Settings.XML’ file. Edit the ‘FilePath’ node in each of the ‘handler’ nodes to refer to the full path of the ‘handler.py’ file. (You can do a search and replace over the entire file).&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpLast style="MARGIN: 0in 0in 10pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"&gt;&lt;SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Trebuchet MS','sans-serif'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;IMG src="http://blogs.msdn.com/photos/seshadripv/images/8744613/original.aspx" mce_src="http://blogs.msdn.com/photos/seshadripv/images/8744613/original.aspx"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Trebuchet MS','sans-serif'"&gt;
&lt;P class=MsoListParagraph style="MARGIN: 0in 0in 10pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"&gt;&lt;SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Trebuchet MS','sans-serif'; mso-fareast-font-family: 'Trebuchet MS'; mso-bidi-font-family: 'Trebuchet MS'"&gt;&lt;SPAN style="mso-list: Ignore"&gt;5)&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Trebuchet MS','sans-serif'"&gt;The ‘handler.py’ contains the event handlers. You can write your own code in these methods and it will be invoked the next time VS fires that event.&lt;/SPAN&gt;&lt;/P&gt;&lt;SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Trebuchet MS','sans-serif'"&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Trebuchet MS','sans-serif'"&gt;Once you install the add-in, the next instance of VS that you start will invoke functions defined in the handler file. The simplest way to check if the addin is loaded succesfully is to take a look at the 'outpu' window of the VS. The dropdown box would contain an entry with the name 'QikScript' if loading is succesful. &lt;/SPAN&gt;&lt;/P&gt;&lt;SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Trebuchet MS','sans-serif'"&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Trebuchet MS','sans-serif'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;IMG style="WIDTH: 713px; HEIGHT: 183px" height=183 src="http://blogs.msdn.com/photos/seshadripv/images/8744629/original.aspx" width=713 mce_src="http://blogs.msdn.com/photos/seshadripv/images/8744629/original.aspx"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Trebuchet MS','sans-serif'"&gt;&lt;SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Trebuchet MS','sans-serif'"&gt;Depending on your settings, it is possible for the addin not to load on startup. In such cases, you can go to the 'Tools-&amp;gt;Addin Manager' menu item and manually select the addin, make it autoload and restart VS. Please do not hesitate to let me know via email or comments if you are stuck with the installation steps.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=4&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Trebuchet MS','sans-serif'; mso-bidi-font-size: 10.5pt"&gt;How to disable or remove the addin&lt;/SPAN&gt;&lt;/B&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Trebuchet MS','sans-serif'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Trebuchet MS','sans-serif'"&gt;The easiest way to disable this addin is to move or delete the QikScript.addin file from the AddIns folder. You could also change the extension of this file if you want to temporarily stop the VS from loading this. If you want to load VS without &lt;STRONG&gt;*any*&lt;/STRONG&gt; addin you can use the ‘devenv /safemode’ from the Run prompt to start VS.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT size=4&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Trebuchet MS','sans-serif'; mso-bidi-font-size: 10.5pt"&gt;Package details&lt;/SPAN&gt;&lt;/B&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Trebuchet MS','sans-serif'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Trebuchet MS','sans-serif'"&gt;The deployment zip file contains the binaries that implement the functionality, an event handler definition XML file (settings.xml) and a python file (handler.py) that implements the event handlers. The DLR and ironPython binaries are from the &lt;A class="" href="http://www.codeplex.com/IronPython/Release/ProjectReleases.aspx?ReleaseId=12988" mce_href="http://www.codeplex.com/IronPython/Release/ProjectReleases.aspx?ReleaseId=12988"&gt;IronPython 2.0 Beta 3&lt;/A&gt; release&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT size=2&gt;&lt;SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Trebuchet MS','sans-serif'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Trebuchet MS','sans-serif'"&gt;Settings.xml&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpFirst style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo3"&gt;&lt;SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;·&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Trebuchet MS','sans-serif'"&gt;Settings.xml contains the details about the event handlers. You can edit the individual events to run a specific function in any given python file.&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpLast style="MARGIN: 0in 0in 10pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo3"&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3&gt;·&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;The settings.xml must reside in the same folder as the QikScript.dll file.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Trebuchet MS','sans-serif'"&gt;Handler.py&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpFirst style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo3"&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3&gt;·&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;The Handler.py file contains the event handlers. &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpFirst style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo3"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;IMG style="WIDTH: 490px; HEIGHT: 157px" height=157 src="http://blogs.msdn.com/photos/seshadripv/images/8744590/original.aspx" width=490 mce_src="http://blogs.msdn.com/photos/seshadripv/images/8744590/original.aspx"&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpFirst style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo3"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo3"&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3&gt;·&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Each of the handler defined in this file uses the correct signature needed to work with VS. Some of the arguments are primitive data types – string, bool , int and some are &lt;A class="" href="http://msdn.microsoft.com/en-us/library/aa291104(VS.71).aspx" mce_href="http://msdn.microsoft.com/en-us/library/aa291104(VS.71).aspx"&gt;VS specific types&lt;/A&gt;.&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo3"&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3&gt;·&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Note the commented out line just above the event handler. That line indicates the types of the arguments passed to the event handler. &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo3"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Trebuchet MS','sans-serif'"&gt;The event handlers can also access the host VS object through the ‘hostApp’ variable in the script. The type of the object is &lt;A class="" href="http://msdn.microsoft.com/en-us/library/envdte80.dte2_members(VS.80).aspx" mce_href="http://msdn.microsoft.com/en-us/library/envdte80.dte2_members(VS.80).aspx"&gt;DTE2&lt;/A&gt;. &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Trebuchet MS','sans-serif'"&gt;All output (like print calls) from the script is redirected to a new output window (with the name ‘QikScript’) that the add-in creates.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Trebuchet MS','sans-serif'"&gt;&lt;FONT face="trebuchet ms,geneva"&gt;Notes &lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;&lt;SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;
&lt;P class=MsoListParagraphCxSpFirst style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"&gt;&lt;FONT face="trebuchet ms,geneva"&gt;&lt;SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;·&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Trebuchet MS','sans-serif'"&gt;This is strictly intended as a demo tool and comes with zero warranty or support. &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;FONT face="trebuchet ms,geneva"&gt;&lt;SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;
&lt;P class=MsoListParagraph style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; LINE-HEIGHT: 115%"&gt;&lt;SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;·&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 7pt; LINE-HEIGHT: 115%; mso-fareast-font-family: Symbol"&gt;&lt;FONT face="Times New Roman"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Trebuchet MS','sans-serif'; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;This addin doesn’t make VS an IronPython editor&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Trebuchet MS','sans-serif'; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;. You would use an external editor to edit the IronPython code. See &lt;A href="http://blogs.msdn.com/haibo_luo/archive/2007/10/16/5482940.aspx" mce_href="http://blogs.msdn.com/haibo_luo/archive/2007/10/16/5482940.aspx"&gt;&lt;FONT color=#0000ff&gt;this post&lt;/FONT&gt;&lt;/A&gt; if you are interested in enabling VS to edit IronPython sources&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoListParagraph style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; LINE-HEIGHT: 115%; mso-list: l0 level1 lfo1"&gt;&lt;SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;·&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Trebuchet MS','sans-serif'; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;I have used this addin only as part of Visual Studio 2008. It may or may not work in earlier versions.&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoListParagraph style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; LINE-HEIGHT: 115%"&gt;&lt;SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;·&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 7pt; LINE-HEIGHT: 115%; mso-fareast-font-family: Symbol"&gt;&lt;FONT face="Times New Roman"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Trebuchet MS','sans-serif'; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;Theoretically, all operations supported by the VS through the extensibility model( the DTE2 interface) can be performed from any of the handlers. However, I did not attempt any testing to see which operations work and which don’t. So you are on your own when trying out adventurous things&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 115%; FONT-FAMILY: Wingdings; mso-ascii-font-family: 'Trebuchet MS'; mso-fareast-font-family: Symbol; mso-hansi-font-family: 'Trebuchet MS'; mso-bidi-font-family: Symbol; mso-char-type: symbol; mso-symbol-font-family: Wingdings"&gt;&lt;SPAN style="mso-char-type: symbol; mso-symbol-font-family: Wingdings"&gt;J&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Trebuchet MS','sans-serif'; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;.&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="trebuchet ms,geneva"&gt;&lt;SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Trebuchet MS','sans-serif'"&gt;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpLast style="MARGIN: 0in 0in 10pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"&gt;&lt;FONT face="trebuchet ms,geneva"&gt;&lt;SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;·&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Trebuchet MS','sans-serif'"&gt;Currently only ‘IronPython’ is available as the scripting language&lt;/SPAN&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Trebuchet MS','sans-serif'"&gt;This post is very light on implementation details deliberately. I am planning to put up a separate post with more details about the parts of the Hosting API this component uses.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Trebuchet MS','sans-serif'"&gt;&lt;o:p&gt;Please let me know of any comments, questions, feedback or suggestions you have regarding this sample, DLR and/or the Hosting API.&lt;/o:p&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Trebuchet MS','sans-serif'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8744434" width="1" height="1"&gt;</description><enclosure url="http://blogs.msdn.com/seshadripv/attachment/8744434.ashx" length="1067937" type="application/x-zip-compressed" /><category domain="http://blogs.msdn.com/seshadripv/archive/tags/IronPython/default.aspx">IronPython</category><category domain="http://blogs.msdn.com/seshadripv/archive/tags/Hosting+API/default.aspx">Hosting API</category><category domain="http://blogs.msdn.com/seshadripv/archive/tags/DLR/default.aspx">DLR</category><category domain="http://blogs.msdn.com/seshadripv/archive/tags/sample/default.aspx">sample</category><category domain="http://blogs.msdn.com/seshadripv/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://blogs.msdn.com/seshadripv/archive/tags/Visual+Studio/default.aspx">Visual Studio</category><category domain="http://blogs.msdn.com/seshadripv/archive/tags/QikScript/default.aspx">QikScript</category><category domain="http://blogs.msdn.com/seshadripv/archive/tags/Addin/default.aspx">Addin</category></item></channel></rss>