tag:blogger.com,1999:blog-55031864096947017192024-02-21T04:02:12.140-08:00desktopWeb - Office Addinsdvanahttp://www.blogger.com/profile/07584985948993945278noreply@blogger.comBlogger14125tag:blogger.com,1999:blog-5503186409694701719.post-41801991119779485412011-08-12T21:12:00.000-07:002011-08-12T21:12:06.899-07:00Changed my blogHello, I changed my blog to <a href="http://desktopweb.wordpress.com/">http://desktopweb.wordpress.com/</a>.dvanahttp://www.blogger.com/profile/07584985948993945278noreply@blogger.com0tag:blogger.com,1999:blog-5503186409694701719.post-53940477766636977932011-08-12T20:35:00.000-07:002011-09-27T18:12:04.115-07:00Design and Run a Windows Workflow 4.0 within Excel or Word 2010<div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Calibri;">I have a </span><a href="http://desktopweb.codeplex.com/releases/view/70858#DownloadId=269599"><span style="color: blue; font-family: Calibri;">document</span></a><span style="font-family: Calibri;"> at (<a href="http://desktopweb.codeplex.com/releases/view/70858#DownloadId=269599">http://desktopweb.codeplex.com/releases/view/70858#DownloadId=269599</a></span><span style="font-family: Calibri;">) that discusses more about integrating Windows Workflow into Office Add-ins. </span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Calibri;">The source code is located at </span><a href="http://desktopweb.codeplex.com/SourceControl/changeset/changes/9363"><span style="font-family: Calibri;">http://desktopweb.codeplex.com/SourceControl/changeset/changes/9363</span></a><span style="font-family: Calibri;">.</span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Calibri;">Please note that an Access version is currently not included in the source code. Please let me know if an Access version would help you.</span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Calibri;">I prefer to put the documents into my codeplex.com project since it is much faster to authoring in Word and simply upload the document.</span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Calibri;">Here are a few screenshots from the source code. </span></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisCHM8xju3OS54hW91Coh2ctTWXdAX1J22MeA5MeQW0dS3Hu8slHOD6iEsogqz7_9nD8rC61upaLUYvgg5FBFijAhUofj0XRBp6uw3DtXuOevGzxjCB3zsciN1dqD773TNm17YBOwCRmNg/s1600/SampleWFD.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="295" naa="true" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisCHM8xju3OS54hW91Coh2ctTWXdAX1J22MeA5MeQW0dS3Hu8slHOD6iEsogqz7_9nD8rC61upaLUYvgg5FBFijAhUofj0XRBp6uw3DtXuOevGzxjCB3zsciN1dqD773TNm17YBOwCRmNg/s320/SampleWFD.PNG" width="320" /></a></div><br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkQZko5rpsGuZdEyUgRqKeWz65NrLmyu_tJWNWSYpUNfvdh6MPuDHiddYe0xl_tVsVIeSWiqWZmdhhImiq-PZJqDLPCE72KP-PHdHMVjeziQtCzMpSQI_RbBYvn91Xb2p-U05LaI51OfSW/s1600/OfficeXmlDocumentParts.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" naa="true" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkQZko5rpsGuZdEyUgRqKeWz65NrLmyu_tJWNWSYpUNfvdh6MPuDHiddYe0xl_tVsVIeSWiqWZmdhhImiq-PZJqDLPCE72KP-PHdHMVjeziQtCzMpSQI_RbBYvn91Xb2p-U05LaI51OfSW/s320/OfficeXmlDocumentParts.PNG" width="303" /></a></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><br />
</div><div class="separator" style="clear: both; text-align: center;"></div>dvanahttp://www.blogger.com/profile/07584985948993945278noreply@blogger.com0tag:blogger.com,1999:blog-5503186409694701719.post-35637645751397503712011-07-19T20:00:00.000-07:002011-08-06T09:34:59.059-07:00Host a Windows Workflow 4.0 Designer in an Office add-in<div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Calibri;">desktopWeb.codeplex.com has a new check-in containing source code to host a Windows Workflow 4.0 designer in an Office add-in and a couple of SharePoint 2010 workflow activities. The source code is at </span><span style="font-family: Calibri;"><a href="http://desktopweb.codeplex.com/SourceControl/changeset/changes/9308">http://desktopweb.codeplex.com/SourceControl/changeset/changes/9308</a> and the setup is at <a href="http://desktopweb.codeplex.com/releases/view/70858">http://desktopweb.codeplex.com/releases/view/70858</a>.</span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Calibri;"><strong><span style="color: red;">Update</span></strong>: A new check-in has a separate MyData.Workflow.Designer control.</span><br />
<br />
<span style="font-family: Calibri;">The check-in covers the following Windows Workflow 4.0 topics:</span></div><div class="MsoListParagraphCxSpFirst" style="margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1; text-indent: -0.25in;"><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-family: "Times New Roman";"> </span></span></span><span style="font-family: Calibri;">Hosting a Windows Workflow 4.0 Designer surface in an Access add-in</span></div><div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 1in; mso-add-space: auto; mso-list: l0 level2 lfo1; text-indent: -0.25in;"><span style="font-family: "Courier New"; mso-fareast-font-family: "Courier New";"><span style="mso-list: Ignore;">o<span style="font-family: "Times New Roman";"> </span></span></span><span style="font-family: Calibri;">Note that the WF4 designer can also be hosted in any other Office add-in such as an Excel VSTO project.</span></div><div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1; text-indent: -0.25in;"><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-family: "Times New Roman";"> </span></span></span><span style="font-family: Calibri;">Custom Activity Designers <span style="mso-spacerun: yes;"> </span></span></div><div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1; text-indent: -0.25in;"><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-family: "Times New Roman";"> </span></span></span><span style="font-family: Calibri;">Context sensitive WF4 designer expression editor that works with SharePoint 2010 Client Side Object Model (CSOM) list schema</span></div><div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1; text-indent: -0.25in;"><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-family: "Times New Roman";"> </span></span></span><span style="font-family: Calibri;">Two SharePoint CSOM code activities</span></div><div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 1in; mso-add-space: auto; mso-list: l0 level2 lfo1; text-indent: -0.25in;"><span style="font-family: "Courier New"; mso-fareast-font-family: "Courier New";"><span style="mso-list: Ignore;">o<span style="font-family: "Times New Roman";"> </span></span></span><span style="font-family: Calibri;">BasePermissions</span></div><div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 1in; mso-add-space: auto; mso-list: l0 level2 lfo1; text-indent: -0.25in;"><span style="font-family: "Courier New"; mso-fareast-font-family: "Courier New";"><span style="mso-list: Ignore;">o<span style="font-family: "Times New Roman";"> </span></span></span><span style="font-family: Calibri;">UpdateListItem</span></div><div class="MsoListParagraphCxSpLast" style="margin: 0in 0in 10pt 0.5in; mso-list: l0 level1 lfo1; text-indent: -0.25in;"><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-family: "Times New Roman";"> </span></span></span><span style="font-family: Calibri;">Sample workflow that uses the SharePoint CSOM UpdateListItem activity to add a list item to a SharePoint task list</span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Calibri;">SharePoint CSOM code activities enable some interesting scenarios in that Office Add-in solutions that interact with SharePoint can be created in a declarative fashion. One can simply drag SharePoint 2010 activities into workflow logic and set some arguments to gain SP functionality. The check-in shows two activities as a starting point to develop other SP 2010 workflow activities. Perhaps others would like to contribute to the project by creating other SP 2010 activities. In a few weeks, I will follow up with a descriptive article about hosting a WF4 designer.</span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Calibri;"><b style="mso-bidi-font-weight: normal;">Note</b> The designer is part of MyDataAddin. A future check-in will pull the designer out into a stand-alone UserControl.</span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><b style="mso-bidi-font-weight: normal;"><span style="color: red;"><span style="font-family: Calibri;">Setup Note</span></span></b></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Calibri;">In addition to running MyDataAddinSetup.msi, the custom activity designers need to be added to the GAC using the gacutil utility.</span></div><div class="MsoNormal" style="margin: 0in 0in 10pt; text-indent: 0.5in;"><span style="font-family: Calibri;">From the Visual Studio Command Prompt:</span></div><br />
<table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" style="background: #dbe5f1; border-bottom: medium none; border-collapse: collapse; border-left: medium none; border-right: medium none; border-top: medium none; margin: auto auto auto 41.4pt; mso-background-themecolor: accent1; mso-background-themetint: 51; mso-border-alt: solid #A6A6A6 .5pt; mso-border-insideh-themecolor: background1; mso-border-insideh-themeshade: 166; mso-border-insideh: .5pt solid #A6A6A6; mso-border-insidev-themecolor: background1; mso-border-insidev-themeshade: 166; mso-border-insidev: .5pt solid #A6A6A6; mso-border-themecolor: background1; mso-border-themeshade: 166; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-yfti-tbllook: 1184;"><tbody>
<tr style="height: 13pt; mso-yfti-firstrow: yes; mso-yfti-irow: 0; mso-yfti-lastrow: yes;"><td style="background-color: transparent; border-bottom: #a6a6a6 1pt solid; border-left: #a6a6a6 1pt solid; border-right: #a6a6a6 1pt solid; border-top: #a6a6a6 1pt solid; height: 13pt; mso-border-alt: solid #A6A6A6 .5pt; mso-border-themecolor: background1; mso-border-themeshade: 166; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 5.75in;" valign="top" width="552"><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;"><span style="font-family: Calibri;">gacutil /i {FullPath}\bin\Debug\MyData.ActivityDesigners.dll</span></div></td></tr>
</tbody></table><br />
<div class="MsoNormal" style="margin: 0in 0in 10pt; text-indent: 0.5in;"><br />
</div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><b style="mso-bidi-font-weight: normal;"><span style="font-family: Calibri;">Workflow Designer</span></b></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Calibri;">A workflow designer with custom activities can be hosted in any .NET 4.0 application (in this case an Access add-in). The vision is to create a suite of SP based activities to provide a much faster means to create Office / SharePoint applications. </span></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJ5kxJUES14Uk2W_x-ndteEgSb7aaMNFDf3Pn6vCRb0VctE28m0iaWMJnGdJijazvmzXHavIdCbw-r3s2XCeX6jCo8Ms30bEy-hEEvmAm_6b2Uq7LQbpWX9mjOCwwKWa5Xozq8AHbQH1m6/s1600/WF_Designer.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="293" m$="true" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJ5kxJUES14Uk2W_x-ndteEgSb7aaMNFDf3Pn6vCRb0VctE28m0iaWMJnGdJijazvmzXHavIdCbw-r3s2XCeX6jCo8Ms30bEy-hEEvmAm_6b2Uq7LQbpWX9mjOCwwKWa5Xozq8AHbQH1m6/s320/WF_Designer.PNG" width="320" /></a></div><br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;"><b style="mso-bidi-font-weight: normal;"><span style="font-family: Calibri;">SharePoint Activity Designer with Context-sensitive expression editor</span></b></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvXJrAVY-YbQkv0sQ1jvi43b7lEXzmbEoqSJD6VaI7qaYgcIRnm2D1Zfkuc-9IdgqmpN9eEsA-dT0ZG2ZVfx5VHM_IcUyhS4ACVXtbUgLMZHcvQvsy15YqckXAC-nMvLBWuFGopT4NBbb9/s1600/SharePointActivities.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" m$="true" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvXJrAVY-YbQkv0sQ1jvi43b7lEXzmbEoqSJD6VaI7qaYgcIRnm2D1Zfkuc-9IdgqmpN9eEsA-dT0ZG2ZVfx5VHM_IcUyhS4ACVXtbUgLMZHcvQvsy15YqckXAC-nMvLBWuFGopT4NBbb9/s320/SharePointActivities.PNG" width="261" /></a></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><br />
</div>dvanahttp://www.blogger.com/profile/07584985948993945278noreply@blogger.com0tag:blogger.com,1999:blog-5503186409694701719.post-55975420263153554022011-06-20T06:49:00.000-07:002011-07-09T23:15:23.529-07:00Microsoft Patterns and Practices and Add-in Exception Logging<div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Verdana;">This post shows how to use the Microsoft Patterns and Practices (MSPP) Logging Block, and related Security Block, within an Access add-in to log exceptions to the Windows Event Viewer. MSPP is a collection of application blocks to assist developers with implementing common enterprise development scenarios.<span style="mso-spacerun: yes;"> </span>Since sensitive logging data could be viewed by an unauthorized user, the post also introduces how to use the MSPP Security Block to prevent unauthorized access to the event log. Along with an introduction to using the security block, SharePoint Foundation 2010 base permission’s are demonstrated as an example authorization provider.</span></div><h2 style="margin: 10pt 0in 0pt;"><span style="font-size: medium;"><span style="color: #4f81bd;"><span style="font-family: Cambria;">Topics</span></span></span></h2><ul><li><div class="MsoListParagraphCxSpFirst" style="margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1; text-indent: -0.25in;"><span style="color: blue; font-family: Verdana;">Microsoft Patterns and Practices Logging Block</span></div></li>
<li><div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1; text-indent: -0.25in;"><span style="color: blue; font-family: Verdana;">Microsoft Patterns and Practices Security Block</span></div></li>
<li><div class="MsoListParagraphCxSpLast" style="margin: 0in 0in 10pt 0.5in; mso-list: l0 level1 lfo1; text-indent: -0.25in;"><span style="color: blue; font-family: Verdana;">SharePoint 2010 Base Permissions</span></div></li>
</ul><h2 style="margin: 10pt 0in 0pt;"><span style="font-size: medium;"><span style="color: #4f81bd;"><span style="font-family: Cambria;">Sample Code</span></span></span></h2><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Verdana;">Sample code accompanying this post can be viewed and downloaded from </span><a href="http://desktopweb.codeplex.com/SourceControl/changeset/changes/8578"><span style="font-family: Verdana;">http://desktopweb.codeplex.com/SourceControl/changeset/changes/8578</span></a><a href="http://desktopweb.codeplex.com/"></a><span style="font-family: Verdana;">. The Microsoft Enterprise Library 5.0 is required to compile and use the CodePlex sample.</span><br />
<span style="font-size: large;"><span style="color: #365f91;"><span style="font-family: Cambria;">Logging Block</span></span></span><br />
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Verdana;">The MSPP Logging Block is designed to address a wide range of enterprise application logging scenarios including logging exceptions, workflow logs and performance monitoring. This post discusses how to use the Logging Block, along with the Security Block, to enable Access add-in exception logging. Exception logging can be particularly handy to diagnose add-in issues.</span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Verdana;"></span> <span style="font-family: Verdana;">You can read the full document for this post at:</span></div><ul><li><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Verdana;">PDF </span><span style="font-family: Verdana;"><a href="http://desktopweb.codeplex.com/releases/view/68662#DownloadId=251277">http://desktopweb.codeplex.com/releases/view/68662#DownloadId=251277</a> </span></div></li>
<li><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Verdana;">DOCX <a href="http://desktopweb.codeplex.com/releases/view/68662#DownloadId=251276">http://desktopweb.codeplex.com/releases/view/68662#DownloadId=251276</a></span></div></li>
</ul><span style="font-family: Verdana;"></span><br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: "Verdana", "sans-serif"; line-height: 115%;">A user with proper permissions can view add-in event entries from within Access. </span><br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1f-0uzlE3PK7LgpqV4M1SPHwT1YromUTZirOiRmVvom4QW-GjQtJj0xysPvIE2XxYrzeXg6LjefCTclMTMEKuxZyv4Fx5jUjTtVgQ6bKlUfi20Ml5EbqpP8EIZi3DsExeKAieFDe0eQjx/s1600/LoggingForm.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="236" i$="true" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1f-0uzlE3PK7LgpqV4M1SPHwT1YromUTZirOiRmVvom4QW-GjQtJj0xysPvIE2XxYrzeXg6LjefCTclMTMEKuxZyv4Fx5jUjTtVgQ6bKlUfi20Ml5EbqpP8EIZi3DsExeKAieFDe0eQjx/s320/LoggingForm.png" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Logging Dialog Form</td></tr>
</tbody></table></div><br />
<div class="separator" style="clear: both; text-align: center;"><br />
</div></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><br />
<span style="font-family: Verdana;">Steps to authorize a user:</span><br />
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Verdana;"><b style="mso-bidi-font-weight: normal;"><span style="mso-no-proof: yes;">Step 1</span></b><span style="mso-no-proof: yes;"> An AuthorizationRuleProvider configuration type configured in msaccess.exe.config defines a RuleProvider</span></span></div><div style="background: #f2f2f2; border-bottom: windowtext 1pt solid; border-left: windowtext 1pt solid; border-right: windowtext 1pt solid; border-top: windowtext 1pt solid; margin-left: 13.5pt; margin-right: 0in; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-border-alt: solid windowtext .5pt; mso-element: para-border-div; padding-bottom: 1pt; padding-left: 4pt; padding-right: 4pt; padding-top: 1pt;"><div class="MsoNormal" style="background: #f2f2f2; border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding-bottom: 0in; padding-left: 0in; padding-right: 0in; padding-top: 0in; tab-stops: 27.0pt .5in 45.0pt;"><span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">add</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;"> </span><span style="color: red; font-family: Consolas; font-size: 9.5pt;">type</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">=</span><span style="font-family: Consolas; font-size: 9.5pt;">"<span style="color: blue;">Microsoft.Practices.EnterpriseLibrary.Security</span></span></div><div class="MsoNormal" style="background: #f2f2f2; border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding-bottom: 0in; padding-left: 0in; padding-right: 0in; padding-top: 0in; tab-stops: 27.0pt .5in 45.0pt;"><span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 2;"> </span>.AuthorizationRuleProvider, Microsoft.Practices.EnterpriseLibrary.Security</span><span style="font-family: Consolas; font-size: 9.5pt;">"</span></div><div class="MsoNormal" style="background: #f2f2f2; border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding-bottom: 0in; padding-left: 0in; padding-right: 0in; padding-top: 0in; tab-stops: 27.0pt .5in 45.0pt;"><span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-tab-count: 1;"></span></span><span style="color: red; font-family: Consolas; font-size: 9.5pt;">name</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">=</span><span style="font-family: Consolas; font-size: 9.5pt;">"<span style="color: blue;">RuleProvider</span>"<span style="color: blue;">></span></span></div></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><br />
</div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Verdana;"><b style="mso-bidi-font-weight: normal;"><span style="mso-no-proof: yes;">Step 2</span></b><span style="mso-no-proof: yes;"> An AuthorizationProvider also defines authorization Rules</span></span></div><div style="background: #f2f2f2; border-bottom: windowtext 1pt solid; border-left: windowtext 1pt solid; border-right: windowtext 1pt solid; border-top: windowtext 1pt solid; margin-left: 13.5pt; margin-right: 0in; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-border-alt: solid windowtext .5pt; mso-element: para-border-div; padding-bottom: 1pt; padding-left: 4pt; padding-right: 4pt; padding-top: 1pt;"><div class="MsoNormal" style="background: #f2f2f2; border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding-bottom: 0in; padding-left: 0in; padding-right: 0in; padding-top: 0in; tab-stops: 13.5pt .25in 27.0pt .5in 45.0pt;"><span style="font-family: Consolas; font-size: 9.5pt;"><rules></span></div><div class="MsoNormal" style="background: #f2f2f2; border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding-bottom: 0in; padding-left: 0in; padding-right: 0in; padding-top: 0in; tab-stops: 13.5pt .25in 27.0pt .5in 45.0pt;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 1;"></span><add expression="R:ManageLog" name="ReadEventViewerLog" /></span></div><div class="MsoNormal" style="background: #f2f2f2; border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding-bottom: 0in; padding-left: 0in; padding-right: 0in; padding-top: 0in; tab-stops: 13.5pt .25in 27.0pt .5in 45.0pt;"><span style="font-family: Consolas; font-size: 9.5pt;"></rules></span></div></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><b style="mso-bidi-font-weight: normal;"><span style="mso-no-proof: yes;"><br />
<span style="font-family: Verdana;">Step 3</span></span></b><span style="mso-no-proof: yes;"><span style="font-family: Verdana;"> Get the RuleProvider defined in msaccess.exe.config</span></span></div><div style="background: #f2f2f2; border-bottom: windowtext 1pt solid; border-left: windowtext 1pt solid; border-right: windowtext 1pt solid; border-top: windowtext 1pt solid; margin-left: 13.5pt; margin-right: 0in; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-border-alt: solid windowtext .5pt; mso-element: para-border-div; padding-bottom: 1pt; padding-left: 4pt; padding-right: 4pt; padding-top: 1pt;"><div class="MsoNormal" style="background: #f2f2f2; border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding-bottom: 0in; padding-left: 0in; padding-right: 0in; padding-top: 0in;"><span style="font-family: Consolas; font-size: 9.5pt;">IAuthorizationProvider ruleProvider = </span></div><div class="MsoNormal" style="background: #f2f2f2; border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding-bottom: 0in; padding-left: 0in; padding-right: 0in; padding-top: 0in;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>EnterpriseLibraryContainer.Current</span></div><div class="MsoNormal" style="background: #f2f2f2; border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding-bottom: 0in; padding-left: 0in; padding-right: 0in; padding-top: 0in;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>.GetInstance<IAuthorizationProvider>("RuleProvider");</span></div></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><b style="mso-bidi-font-weight: normal;"><span style="mso-no-proof: yes;"><br />
<span style="font-family: Verdana;">Step 4 </span></span></b><span style="mso-no-proof: yes;"><span style="font-family: Verdana;">Get the current user identity</span></span></div><div style="background: #f2f2f2; border-bottom: windowtext 1pt solid; border-left: windowtext 1pt solid; border-right: windowtext 1pt solid; border-top: windowtext 1pt solid; margin-left: 13.5pt; margin-right: 0in; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-border-alt: solid windowtext .5pt; mso-element: para-border-div; padding-bottom: 1pt; padding-left: 4pt; padding-right: 4pt; padding-top: 1pt;"><div class="MsoNormal" style="background: #f2f2f2; border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding-bottom: 0in; padding-left: 0in; padding-right: 0in; padding-top: 0in; tab-stops: 27.0pt .5in 45.0pt;"><span style="color: #2b91af; font-family: Consolas; font-size: 9.5pt;">WindowsIdentity</span><span style="font-family: Consolas; font-size: 9.5pt;"> identity = <span style="color: #2b91af;">WindowsIdentity</span>.GetCurrent();</span></div></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><br />
</div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Verdana;"><b style="mso-bidi-font-weight: normal;"><span style="mso-no-proof: yes;">Step 5 </span></b><span style="mso-no-proof: yes;">Get an IPrincipal object that maps an identity to a role</span></span></div><div style="background: #f2f2f2; border-bottom: windowtext 1pt solid; border-left: windowtext 1pt solid; border-right: windowtext 1pt solid; border-top: windowtext 1pt solid; margin-left: 9pt; margin-right: 0in; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-border-alt: solid windowtext .5pt; mso-element: para-border-div; padding-bottom: 1pt; padding-left: 0in; padding-right: 4pt; padding-top: 1pt;"><div class="MsoNormal" style="background: #f2f2f2; border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 0in; padding-bottom: 0in; padding-left: 0in; padding-right: 0in; padding-top: 0in; tab-stops: 9.0pt .25in 27.0pt .5in 45.0pt;"><span style="color: #2b91af; font-family: Consolas; font-size: 9.5pt;">IPrincipal</span><span style="font-family: Consolas; font-size: 9.5pt;"> principal = <span style="color: blue;">new</span> <span style="color: #2b91af;">GenericPrincipal</span></span></div><div class="MsoNormal" style="background: #f2f2f2; border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 0in; padding-bottom: 0in; padding-left: 0in; padding-right: 0in; padding-top: 0in; tab-stops: 9.0pt .25in 27.0pt .5in 45.0pt;"><span style="color: #2b91af; font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 1;"> </span></span><span style="font-family: Consolas; font-size: 9.5pt;">(WindowsIdentity.GetCurrent(), <span style="color: blue;">new</span> <span style="color: blue;">string</span>[] { <span style="color: #a31515;">"ManageLog"</span> });</span></div></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><br />
</div><div class="MsoNormal" style="margin: 0in 0in 10pt 9pt;"><span style="font-size: x-small;"><span style="font-family: Verdana;"><b style="mso-bidi-font-weight: normal;"><span style="mso-no-proof: yes;">Note</span></b><span style="mso-no-proof: yes;"> In a production application, the user’s rule expression would be stored in a secure data store such as a SQL Server Database or the SharePoint Permissions service.</span></span></span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Verdana;"><b style="mso-bidi-font-weight: normal;"><span style="mso-no-proof: yes;">Step 6</span></b><span style="mso-no-proof: yes;"> A <b style="mso-bidi-font-weight: normal;">RuleProvider.Authorize()</b> method<span style="mso-spacerun: yes;"> </span>determines whether an IPrincipal has ReadEventViewerLog authorization. </span></span></div><div style="background: #f2f2f2; border-bottom: windowtext 1pt solid; border-left: windowtext 1pt solid; border-right: windowtext 1pt solid; border-top: windowtext 1pt solid; margin-left: 13.5pt; margin-right: 0in; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-border-alt: solid windowtext .5pt; mso-element: para-border-div; padding-bottom: 1pt; padding-left: 4pt; padding-right: 4pt; padding-top: 1pt;"><div class="MsoNormal" style="background: #f2f2f2; border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding-bottom: 0in; padding-left: 0in; padding-right: 0in; padding-top: 0in; tab-stops: 13.5pt .25in 27.0pt .5in 45.0pt;"><span style="font-family: Consolas; font-size: 9.5pt;">canReadEventViewerLog = ruleProvider.Authorize(principal, <span style="color: #a31515;">"ReadEventViewerLog"</span>);</span></div></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj__mIAVhBYGZGqEkdlH0fGPcl_rJJjcqUSuCRtAoDAeQeVurtFj-HW8kVitFViApvyKZMvEqkdNvu0MQjWxLbZ9dW3814nBuG5cXtSuX-COehOqrQcdIYKo3Cy1RqY5aUGS0Snpbw6HXFJ/s1600/AuthorizeSteps.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="186" i$="true" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj__mIAVhBYGZGqEkdlH0fGPcl_rJJjcqUSuCRtAoDAeQeVurtFj-HW8kVitFViApvyKZMvEqkdNvu0MQjWxLbZ9dW3814nBuG5cXtSuX-COehOqrQcdIYKo3Cy1RqY5aUGS0Snpbw6HXFJ/s320/AuthorizeSteps.png" width="320" /></a></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><br />
</div></div>dvanahttp://www.blogger.com/profile/07584985948993945278noreply@blogger.com0tag:blogger.com,1999:blog-5503186409694701719.post-60867091311950598592011-05-21T19:45:00.000-07:002011-07-06T21:05:33.365-07:00SQL XML with Access<div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Calibri;">The previous post discussed a SurfaceView object model concept for managed code add-ins. This post shares how to use SQL Server 2005, and above, XML features to implement stored procedure array parameters. The SQL XML code uses the sample Northwind SQL Server database as well as the SurfaceView model. The example scenario sends a <Products><ProductID> xml list that returns a non-contiguous list of products. </span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Calibri;"><b style="mso-bidi-font-weight: normal;">Note</b><span style="mso-tab-count: 1;"> </span>The sample code, located at </span><a href="http://desktopweb.codeplex.com/"><span style="font-family: Calibri;">http://desktopweb.codeplex.com</span></a><span style="font-family: Calibri;"><span class="MsoHyperlink"><span style="color: windowtext; text-decoration: none; text-underline: none;"><u>,</u></span></span> contains a sql script that adds the SQL CML code to the Northwind sample database. The Northwind sample database is also available at </span><a href="http://desktopweb.codeplex.com/"><span style="font-family: Calibri;">http://desktopweb.codeplex.com</span></a><span style="font-family: Calibri;">.</span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><b style="mso-bidi-font-weight: normal;"><span style="font-size: 14pt; line-height: 115%; mso-bidi-font-size: 11.0pt; mso-no-proof: yes;"><span style="font-family: Calibri;">SelectByIdList Stored Procedure</span></span></b></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><br />
</div><table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" style="background: #dbe5f1; border-bottom: medium none; border-collapse: collapse; border-left: medium none; border-right: medium none; border-top: medium none; mso-background-themecolor: accent1; mso-background-themetint: 51; mso-border-alt: solid #A6A6A6 .5pt; mso-border-insideh-themecolor: background1; mso-border-insideh-themeshade: 166; mso-border-insideh: .5pt solid #A6A6A6; mso-border-insidev-themecolor: background1; mso-border-insidev-themeshade: 166; mso-border-insidev: .5pt solid #A6A6A6; mso-border-themecolor: background1; mso-border-themeshade: 166; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-yfti-tbllook: 1184;"><tbody>
<tr style="mso-yfti-firstrow: yes; mso-yfti-irow: 0; mso-yfti-lastrow: yes;"><td style="background-color: transparent; border-bottom: #a6a6a6 1pt solid; border-left: #a6a6a6 1pt solid; border-right: #a6a6a6 1pt solid; border-top: #a6a6a6 1pt solid; mso-border-alt: solid #A6A6A6 .5pt; mso-border-themecolor: background1; mso-border-themeshade: 166; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 6.65in;" valign="top" width="638"><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="color: blue; font-family: "Courier New"; font-size: 10pt; mso-no-proof: yes;">CREATE</span><span style="font-family: "Courier New"; font-size: 10pt; mso-no-proof: yes;"> <span style="color: blue;">PROCEDURE</span> SelectByIdList</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="color: grey; font-family: "Courier New"; font-size: 10pt; mso-no-proof: yes;">(</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: "Courier New"; font-size: 10pt; mso-no-proof: yes;"><span style="mso-tab-count: 1;"> </span>@productIds <span style="color: blue;">xml</span></span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="color: grey; font-family: "Courier New"; font-size: 10pt; mso-no-proof: yes;">)</span><span style="font-family: "Courier New"; font-size: 10pt; mso-no-proof: yes;"> </span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="color: blue; font-family: "Courier New"; font-size: 10pt; mso-no-proof: yes;">AS</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="color: blue; font-family: "Courier New"; font-size: 10pt; mso-no-proof: yes;">SET</span><span style="font-family: "Courier New"; font-size: 10pt; mso-no-proof: yes;"> <span style="color: blue;">ARITHABORT</span> <span style="color: blue;">ON</span></span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="color: green; font-family: "Courier New"; font-size: 10pt; mso-no-proof: yes;">-- @Products table for Products Non-contiguous XML query</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="color: blue; font-family: "Courier New"; font-size: 10pt; mso-no-proof: yes;">DECLARE</span><span style="font-family: "Courier New"; font-size: 10pt; mso-no-proof: yes;"> @Products <span style="color: blue;">TABLE </span><span style="color: grey;">(</span>ProductID <span style="color: blue;">int</span><span style="color: grey;">)</span> </span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="color: blue; font-family: "Courier New"; font-size: 10pt; mso-no-proof: yes;">INSERT</span><span style="font-family: "Courier New"; font-size: 10pt; mso-no-proof: yes;"> <span style="color: blue;">INTO</span> @Products<span style="color: blue;"> </span><span style="color: grey;">(</span>ProductID<span style="color: grey;">)</span> <span style="color: blue;">SELECT</span> ParamValues<span style="color: grey;">.</span>ProductID<span style="color: grey;">.</span>value<span style="color: grey;">(</span><span style="color: red;">'.'</span><span style="color: grey;">,</span><span style="color: red;">'INT'</span><span style="color: grey;">)</span></span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="color: blue; font-family: "Courier New"; font-size: 10pt; mso-no-proof: yes;">FROM</span><span style="font-family: "Courier New"; font-size: 10pt; mso-no-proof: yes;"> @productIds<span style="color: grey;">.</span>nodes<span style="color: grey;">(</span><span style="color: red;">'/Products/ProductID'</span><span style="color: grey;">)</span> <span style="color: blue;">as</span> ParamValues<span style="color: grey;">(</span>ProductID<span style="color: grey;">)</span> </span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="color: blue; font-family: "Courier New"; font-size: 10pt; mso-no-proof: yes;">SELECT</span><span style="font-family: "Courier New"; font-size: 10pt; mso-no-proof: yes;"> <span style="color: grey;">*</span> <span style="color: blue;">FROM</span> </span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: "Courier New"; font-size: 10pt; mso-no-proof: yes;"><span style="mso-spacerun: yes;"> </span>Products</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="color: grey; font-family: "Courier New"; font-size: 10pt; mso-no-proof: yes;">INNER</span><span style="font-family: "Courier New"; font-size: 10pt; mso-no-proof: yes;"> <span style="color: grey;">JOIN</span> </span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: "Courier New"; font-size: 10pt; mso-no-proof: yes;"><span style="mso-spacerun: yes;"> </span>@Products p</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="color: blue; font-family: "Courier New"; font-size: 10pt; mso-no-proof: yes;">ON</span><span style="font-family: "Courier New"; font-size: 10pt; mso-no-proof: yes;"><span style="mso-spacerun: yes;"> </span>Products<span style="color: grey;">.</span>ProductID <span style="color: grey;">=</span> p<span style="color: grey;">.</span>ProductID</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="color: green; font-family: "Courier New"; font-size: 10pt; mso-no-proof: yes;">-- Test the procedure</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="color: blue; font-family: "Courier New"; font-size: 10pt; mso-no-proof: yes;">EXEC</span><span style="font-family: "Courier New"; font-size: 10pt; mso-no-proof: yes;"> SelectByIdList<span style="color: blue;"> </span>@productIds<span style="color: grey;">=</span></span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="color: red; font-family: "Courier New"; font-size: 10pt; mso-no-proof: yes;">'<Products><ProductID>37</ProductID><ProductID>6</ProductID></span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="color: red; font-family: "Courier New"; font-size: 10pt; mso-no-proof: yes;"><ProductID>15</ProductID><ProductID>3</ProductID></Products>'</span></div></td></tr>
</tbody></table><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><br />
</div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><b style="mso-bidi-font-weight: normal;"><span style="font-size: 14pt; line-height: 115%; mso-bidi-font-size: 11.0pt;"><span style="font-family: Calibri;">SelectByIdList() Method</span></span></b></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Calibri;">Once the SelectByIdList stored procedure is added to the Northwind database, you need to write some ADO.NET code to call </span><span style="font-family: "Courier New"; font-size: 10pt; mso-no-proof: yes;">SelectByIdList @productIds </span><span style="font-family: Calibri;">sending the stored procedure a XElement containing a non-contiguous list of products. Using SQL XML parameters provides a flexible means to query SQL Server.</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><b style="mso-bidi-font-weight: normal;"><span style="font-family: Calibri;">ADO.NET Code</span></b></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><br />
</div><table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" style="background: #dbe5f1; border-bottom: medium none; border-collapse: collapse; border-left: medium none; border-right: medium none; border-top: medium none; mso-background-themecolor: accent1; mso-background-themetint: 51; mso-border-alt: solid #A6A6A6 .5pt; mso-border-insideh-themecolor: background1; mso-border-insideh-themeshade: 166; mso-border-insideh: .5pt solid #A6A6A6; mso-border-insidev-themecolor: background1; mso-border-insidev-themeshade: 166; mso-border-insidev: .5pt solid #A6A6A6; mso-border-themecolor: background1; mso-border-themeshade: 166; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-yfti-tbllook: 1184;"><tbody>
<tr style="mso-yfti-firstrow: yes; mso-yfti-irow: 0; mso-yfti-lastrow: yes;"><td style="background-color: transparent; border-bottom: #a6a6a6 1pt solid; border-left: #a6a6a6 1pt solid; border-right: #a6a6a6 1pt solid; border-top: #a6a6a6 1pt solid; mso-border-alt: solid #A6A6A6 .5pt; mso-border-themecolor: background1; mso-border-themeshade: 166; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 6.65in;" valign="top" width="638"><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in;"><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">private</span><span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: #2b91af;">DataTable</span> sp_SelectByIdList(<span style="color: #2b91af;">XElement</span> idElements)</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in;"><span style="font-family: Consolas; font-size: 9.5pt;">{</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 1;"> </span><span style="color: blue;">using</span> (<span style="color: #2b91af;">StringWriter</span> swStringWriter = <span style="color: blue;">new</span> <span style="color: #2b91af;">StringWriter</span>())</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 1;"> </span>{</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 2;"> </span><span style="color: blue;">using</span> (<span style="color: #2b91af;">SqlConnection</span> dbConnection =</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt 0.25in; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in;"><span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 1;"> </span>new</span><span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: #2b91af;">SqlConnection</span></span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt 0.25in; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 1;"> </span>(MyDataAddin.Properties.<span style="color: #2b91af;">Settings</span>.Default.NorthwindConnectionString))</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 3;"> </span>{</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 4;"> </span><span style="color: blue;">using</span> (<span style="color: #2b91af;">SqlCommand</span> dbCommand = <span style="color: blue;">new</span> <span style="color: #2b91af;">SqlCommand</span>(<span style="color: #a31515;">"SelectByIdList"</span>, dbConnection))</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 4;"> </span>{</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in 45.0pt .75in;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 5;"> </span>dbCommand.CommandType = <span style="color: #2b91af;">CommandType</span>.StoredProcedure;</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in 45.0pt .75in;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 5;"> </span><span style="color: #2b91af;">SqlParameter</span> parameter = <span style="color: blue;">new</span> <span style="color: #2b91af;">SqlParameter</span>();</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in 45.0pt .75in;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 5;"> </span>parameter.ParameterName = <span style="color: #a31515;">"@productIds"</span>;</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in 45.0pt .75in;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 3;"> </span><span style="mso-spacerun: yes;"> </span><span style="mso-tab-count: 2;"> </span>parameter.DbType = <span style="color: #2b91af;">DbType</span>.Xml;</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in 45.0pt .75in;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 5;"> </span>parameter.Direction = <span style="color: #2b91af;">ParameterDirection</span>.Input; <span style="color: green;">// Input Parameter<span style="mso-spacerun: yes;"> </span></span></span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in 45.0pt .75in;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 5;"> </span>parameter.Value = idElements.ToString();</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in 45.0pt .75in;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 5;"> </span>dbCommand.Parameters.Add(parameter);</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in 45.0pt .75in;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 5;"> </span>dbConnection.Open();</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in 45.0pt .75in;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in 45.0pt .75in;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 5;"> </span><span style="color: #2b91af;">SqlDataAdapter</span> da = <span style="color: blue;">new</span> <span style="color: #2b91af;">SqlDataAdapter</span>(dbCommand);</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in 45.0pt .75in;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 5;"> </span>northwindDataSet.sp_SelectByIdList.Clear();</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in 45.0pt .75in;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 5;"> </span>da.Fill(<span style="color: blue;">this</span>.northwindDataSet.sp_SelectByIdList);</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in 45.0pt .75in;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 5;"> </span><span style="color: blue;">return</span> <span style="color: blue;">this</span>.northwindDataSet.sp_SelectByIdList;</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 4;"> </span>}</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 3;"> </span>}</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 2;"> </span>}</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 1;"> </span>}</span></div></td></tr>
</tbody></table><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><b style="mso-bidi-font-weight: normal;"><span style="font-family: Calibri;">Create Products XElement</span></b></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><br />
</div><table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" style="background: #dbe5f1; border-bottom: medium none; border-collapse: collapse; border-left: medium none; border-right: medium none; border-top: medium none; mso-background-themecolor: accent1; mso-background-themetint: 51; mso-border-alt: solid #A6A6A6 .5pt; mso-border-insideh-themecolor: background1; mso-border-insideh-themeshade: 166; mso-border-insideh: .5pt solid #A6A6A6; mso-border-insidev-themecolor: background1; mso-border-insidev-themeshade: 166; mso-border-insidev: .5pt solid #A6A6A6; mso-border-themecolor: background1; mso-border-themeshade: 166; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-yfti-tbllook: 1184;"><tbody>
<tr style="mso-yfti-firstrow: yes; mso-yfti-irow: 0; mso-yfti-lastrow: yes;"><td style="background-color: transparent; border-bottom: #a6a6a6 1pt solid; border-left: #a6a6a6 1pt solid; border-right: #a6a6a6 1pt solid; border-top: #a6a6a6 1pt solid; mso-border-alt: solid #A6A6A6 .5pt; mso-border-themecolor: background1; mso-border-themeshade: 166; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 6.65in;" valign="top" width="638"><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in;"><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">private</span><span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: blue;">void</span> selectButton_Click(<span style="color: blue;">object</span> sender, <span style="color: #2b91af;">EventArgs</span> e)</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in;"><span style="font-family: Consolas; font-size: 9.5pt;">{</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 1;"> </span><span style="color: #2b91af;">XElement</span> xmlIdElements = <span style="color: blue;">new</span> <span style="color: #2b91af;">XElement</span>(<span style="color: #a31515;">"Products"</span>);</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 1;"> </span><span style="color: blue;">foreach</span> (<span style="color: #2b91af;">DataGridViewRow</span> row <span style="color: blue;">in</span> vw_ProductListDataGridView.Rows)</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 1;"> </span>{</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in; text-indent: 9pt;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 1;"> </span><span style="color: blue;">if</span> (<span style="color: blue;">true</span> == <span style="color: #2b91af;">Convert</span>.ToBoolean(row.Cells[<span style="color: #a31515;">"SelectCheckbox"</span>].Value))</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 2;"> </span>{</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt 27pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in;"><span style="font-family: Consolas; font-size: 9.5pt;">xmlIdElements.Add(<span style="color: blue;">new</span> <span style="color: #2b91af;">XElement</span>(<span style="color: #a31515;">"ProductID"</span>, <span style="color: #2b91af;">Convert</span>.ToInt32(row.Cells[<span style="color: #a31515;">"ProductIDColumn"</span>].Value)));</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 2;"> </span>}</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 1;"> </span>}</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 1;"> </span><span style="color: green; mso-no-proof: yes;">//Bind the DataGridView</span></span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 1;"> </span><span style="background: yellow; mso-highlight: yellow;">sp_SelectByIdListDataGridView.DataSource = sp_SelectByIdList(xmlIdElements);</span></span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in;"><span style="font-family: Consolas; font-size: 9.5pt;">}</span></div></td></tr>
</tbody></table><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Calibri;">To run the sample, download and setup the source from </span><span style="font-family: Calibri;"><a href="http://desktopweb.codeplex.com/SourceControl/changeset/changes/7973">http://desktopweb.codeplex.com/SourceControl/changeset/changes/7973</a></span><span style="font-family: Calibri;">.<span style="mso-spacerun: yes;"> </span>You might need to change the NorthwindConnectionString within Settings.Settings to point to your SQL Server instance. </span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><b style="mso-bidi-font-weight: normal;"><span style="font-size: 14pt; line-height: 115%; mso-bidi-font-size: 11.0pt;"><span style="font-family: Calibri;">To run the sample</span></span></b></div><div class="MsoListParagraphCxSpFirst" style="line-height: normal; margin: 0in 0in 0pt 0.5in; mso-add-space: auto; mso-layout-grid-align: none; mso-list: l0 level1 lfo1; text-indent: -0.25in;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">1)</span><span style="font-family: "Times New Roman";"> </span></span></span><span style="font-family: Calibri;">Open the Dashboard form by clicking the <b style="mso-bidi-font-weight: normal;">Dashboard</b> ribbon button</span></div><div class="MsoListParagraphCxSpLast" style="line-height: normal; margin: 0in 0in 0pt 0.5in; mso-add-space: auto; mso-layout-grid-align: none; mso-list: l0 level1 lfo1; text-indent: -0.25in;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">2)</span><span style="font-family: "Times New Roman";"> </span></span></span><span style="font-family: Calibri;">Click the <b style="mso-bidi-font-weight: normal;">SQL Xml Table</b> ribbon button to view the data grid task pane</span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><br />
</div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Calibri;">When you click a product row, the data in the form is bound to the DataGridRow. As you can see from the example, the form is now bound to Access data and SQL Server data. The sample code partially implements ADO.NET data binding. Hopefully, this might get you started bringing SQL Server data and ADO.NET into your Access solutions. </span></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEic1Nzjob7hJLWYN1qFkHCiDdDK9bQbob6NqoOgv0jJwGl12P7BnnTqcc09r65CxR0XSyJeGbHVehMZ-EZXDS9F6tl4VtaRzc6D2zMDZoGV7KkKqR0pMKYprH18KcoDpnE5az4B4LPiGw04/s1600/SQLXml.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="231" j8="true" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEic1Nzjob7hJLWYN1qFkHCiDdDK9bQbob6NqoOgv0jJwGl12P7BnnTqcc09r65CxR0XSyJeGbHVehMZ-EZXDS9F6tl4VtaRzc6D2zMDZoGV7KkKqR0pMKYprH18KcoDpnE5az4B4LPiGw04/s320/SQLXml.png" width="320" /></a></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><b style="mso-bidi-font-weight: normal;"><span style="font-size: 14pt; line-height: 115%; mso-bidi-font-size: 11.0pt;"><span style="font-family: Calibri;">BindForm</span></span></b></div><table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" style="background: #dbe5f1; border-bottom: medium none; border-collapse: collapse; border-left: medium none; border-right: medium none; border-top: medium none; mso-background-themecolor: accent1; mso-background-themetint: 51; mso-border-alt: solid #A6A6A6 .5pt; mso-border-insideh-themecolor: background1; mso-border-insideh-themeshade: 166; mso-border-insideh: .5pt solid #A6A6A6; mso-border-insidev-themecolor: background1; mso-border-insidev-themeshade: 166; mso-border-insidev: .5pt solid #A6A6A6; mso-border-themecolor: background1; mso-border-themeshade: 166; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-yfti-tbllook: 1184;"><tbody>
<tr style="mso-yfti-firstrow: yes; mso-yfti-irow: 0; mso-yfti-lastrow: yes;"><td style="background-color: transparent; border-bottom: #a6a6a6 1pt solid; border-left: #a6a6a6 1pt solid; border-right: #a6a6a6 1pt solid; border-top: #a6a6a6 1pt solid; mso-border-alt: solid #A6A6A6 .5pt; mso-border-themecolor: background1; mso-border-themeshade: 166; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 6.65in;" valign="top" width="638"><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in 45.0pt;"><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">public</span><span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: blue;">void</span> BindForm(<span style="color: #2b91af;">DataRow</span> currentRow)</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in 45.0pt;"><span style="font-family: Consolas; font-size: 9.5pt;">{</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in 45.0pt;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 1;"> </span>access.<span style="color: #2b91af;">TextBox</span> textBox;</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in 45.0pt;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in 45.0pt;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 2;"> </span><span style="color: green;">//Fill Form from BindingSource</span></span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in 45.0pt;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 2;"> </span><span style="color: green;">//Set Form Textbox values based on ColumnName match</span></span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in 45.0pt;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 2;"> </span><span style="color: blue;">foreach</span> (<span style="color: #2b91af;">DataColumn</span> c <span style="color: blue;">in</span> currentRow.Table.Columns)</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in 45.0pt;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 2;"> </span>{</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in 45.0pt;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 3;"> </span><span style="color: blue;">if</span> (<span style="color: #2b91af;">ThisDatabase</span>.AllForms[<span style="color: #a31515;">"Dashboard"</span>].FindControl(c.ColumnName))</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in 45.0pt;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 4;"> </span>{</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt 45pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in 45.0pt .75in;"><span style="font-family: Consolas; font-size: 9.5pt;">textBox = <span style="color: #2b91af;">ThisDatabase</span>.AllForms[<span style="color: #a31515;">"Dashboard"</span>].Controls(c.ColumnName) <span style="color: blue;">as</span> access.<span style="color: #2b91af;">TextBox</span>;</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in 45.0pt;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-tab-count: 2;"> </span>textBox.Value = currentRow[c.ColumnName].ToString();</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in 45.0pt;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 4;"> </span>}</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in 45.0pt;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 2;"> </span>}</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in 45.0pt;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in 45.0pt;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 2;"> </span>textBox = <span style="color: blue;">null</span>;</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in 45.0pt;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 2;"> </span>}</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in 45.0pt;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 1;"> </span>}</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in 45.0pt;"><span style="font-family: Consolas; font-size: 9.5pt;">}</span></div></td></tr>
</tbody></table><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><br />
</div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><b style="mso-bidi-font-weight: normal;"><span style="font-size: 14pt; line-height: 115%; mso-bidi-font-size: 11.0pt;"><span style="font-family: Calibri;">Navigate a DataTable</span></span></b></div><table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" style="background: #dbe5f1; border-bottom: medium none; border-collapse: collapse; border-left: medium none; border-right: medium none; border-top: medium none; mso-background-themecolor: accent1; mso-background-themetint: 51; mso-border-alt: solid #A6A6A6 .5pt; mso-border-insideh-themecolor: background1; mso-border-insideh-themeshade: 166; mso-border-insideh: .5pt solid #A6A6A6; mso-border-insidev-themecolor: background1; mso-border-insidev-themeshade: 166; mso-border-insidev: .5pt solid #A6A6A6; mso-border-themecolor: background1; mso-border-themeshade: 166; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-yfti-tbllook: 1184;"><tbody>
<tr style="mso-yfti-firstrow: yes; mso-yfti-irow: 0; mso-yfti-lastrow: yes;"><td style="background-color: transparent; border-bottom: #a6a6a6 1pt solid; border-left: #a6a6a6 1pt solid; border-right: #a6a6a6 1pt solid; border-top: #a6a6a6 1pt solid; mso-border-alt: solid #A6A6A6 .5pt; mso-border-themecolor: background1; mso-border-themeshade: 166; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 6.65in;" valign="top" width="638"><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in;"><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">int</span><span style="font-family: Consolas; font-size: 9.5pt;"> rowPosition = 0;</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in;"><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">void</span><span style="font-family: Consolas; font-size: 9.5pt;"> prevCommand_Click()</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in;"><span style="font-family: Consolas; font-size: 9.5pt;">{</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 1;"> </span><span style="color: blue;">if</span> (<span style="color: blue;">this</span>.SqlXmlDataGrid != <span style="color: blue;">null</span> && <span style="color: blue;">this</span>.SqlXmlDataGrid.Visible)</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 1;"> </span>{</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 2;"> </span><span style="color: blue;">if</span> (rowPosition > 0)</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 2;"> </span>{</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 3;"> </span>rowPosition--;</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt 27pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt 27pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in;"><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">this</span><span style="font-family: Consolas; font-size: 9.5pt;">.SqlXmlDataGrid.BindForm</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt 27pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in;"><span style="font-family: Consolas; font-size: 9.5pt;">(<span style="color: blue;">this</span>.SqlXmlDataGrid.CurrentDataRow.Table.Rows[rowPosition]);</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 2;"> </span>}</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 1;"> </span>}</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in;"><span style="font-family: Consolas; font-size: 9.5pt;">}</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in;"><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">void</span><span style="font-family: Consolas; font-size: 9.5pt;"> nextCommand_Click()</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in;"><span style="font-family: Consolas; font-size: 9.5pt;">{</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 1;"> </span><span style="color: blue;">if</span> (<span style="color: blue;">this</span>.SqlXmlDataGrid != <span style="color: blue;">null</span> && <span style="color: blue;">this</span>.SqlXmlDataGrid.Visible)</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 1;"> </span>{</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 2;"> </span><span style="color: blue;">if</span> (rowPosition + 1 < <span style="color: blue;">this</span>.SqlXmlDataGrid.CurrentDataRow.Table.Rows.Count)</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 2;"> </span>{</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 3;"> </span>rowPosition++;</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span></span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 3;"> </span><span style="color: blue;">this</span>.SqlXmlDataGrid.BindForm</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 3;"> </span>(<span style="color: blue;">this</span>.SqlXmlDataGrid.CurrentDataRow.Table.Rows[rowPosition]);</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 2;"> </span>}</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 1;"> </span>}</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; tab-stops: 9.0pt .25in 27.0pt .5in;"><span style="font-family: Consolas; font-size: 9.5pt;">}</span></div></td></tr>
</tbody></table><div class="MsoNormal" style="margin: 0in 0in 10pt;"><br />
</div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><br />
</div>dvanahttp://www.blogger.com/profile/07584985948993945278noreply@blogger.com0tag:blogger.com,1999:blog-5503186409694701719.post-2636094278383510152011-05-02T21:06:00.000-07:002011-05-27T06:48:33.209-07:00Managing Access Add-ins with a SurfaceView<div class="MsoNormal" style="margin: 0in 0in 10pt; tab-stops: 51.75pt;"><span style="line-height: 115%; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"><span style="font-family: Arial, Helvetica, sans-serif;">Extending Microsoft Access solutions with managed code has traditionally been a challenge. Visual Studio Shared Add-ins have been available for some time; however, managing the details of releasing Access.exe after closing an Access application has been a challenge. This article presents a SurfaceView object model that manages the release of Access form and report controls. After discussing the SurfaceView, the article suggests effective ways to extend Access applications using SurfaceView, Ribbon controls, custom task panes, a custom Access form and Windows Workflow 4.0. The code snippets used within the article are contained within the source code located at </span></span><a href="http://desktopweb.codeplex.com/SourceControl/changeset/changes/7526"><span style="line-height: 115%; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"><span style="font-family: Times New Roman;">http://desktopweb.codeplex.com/SourceControl/changeset/changes/7526</span></span></a><span style="line-height: 115%; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"><span style="font-family: Arial, Helvetica, sans-serif;">.</span></span></div><h2 style="margin: 10pt 0in 0pt;"><span style="mso-fareast-font-family: "Times New Roman";"><span style="font-size: medium;"><span style="color: #4f81bd;"><span style="font-family: Cambria;">Topics</span></span></span></span></h2><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Arial, Helvetica, sans-serif;">Using the SurfaceView object model to manage an Access .NET add-in enables extensibility opportunities beyond traditional VBA. This article presents several how to topics to get you started extending Access with managed code.</span></div><ul><li><div class="MsoListParagraphCxSpFirst" style="margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1; tab-stops: 51.75pt; text-indent: -0.25in;"><span style="font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 115%; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">Setup the sample including troubleshooting Add-in setup</span></span></div></li>
<li><div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1; tab-stops: 51.75pt; text-indent: -0.25in;"><span style="font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 115%; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">Use the sample</span></span></div></li>
<li><div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1; tab-stops: 51.75pt; text-indent: -0.25in;"><span style="font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 115%; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">Use a SurfaceView to manage forms and reports</span></span></div></li>
<li><div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1; tab-stops: 51.75pt; text-indent: -0.25in;"><span style="font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 115%; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">Use a ribbon button</span></span></div></li>
<li><div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1; tab-stops: 51.75pt; text-indent: -0.25in;"><span style="font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 115%; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">Create custom task panes</span></span></div></li>
<li><div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1; tab-stops: 51.75pt; text-indent: -0.25in;"><span style="font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 115%; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">Create a custom Access popup form</span></span></div></li>
<li><div class="MsoListParagraphCxSpLast" style="margin: 0in 0in 10pt 0.5in; mso-list: l0 level1 lfo1; tab-stops: 51.75pt; text-indent: -0.25in;"><span style="font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 115%; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">Use Windows Workflow 4.0 to automate Access</span></span></div></li>
</ul><div class="MsoNormal" style="margin: 0in 0in 10pt; tab-stops: 51.75pt;"><span style="line-height: 115%; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"><span style="font-family: Arial, Helvetica, sans-serif;">Please note that the SurfaceView model is a sample of a potential object model to manage Access objects. As with any sample, the concepts and source code have not been thoroughly designed or tested and are not intended for production use. </span></span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Arial, Helvetica, sans-serif;">The remainder of this blog is in pdf format …</span><br />
<br />
<span style="font-family: Arial;"><a href="http://desktopweb.codeplex.com/releases/view/54874#DownloadId=234814">PDF Article</a></span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"></div>dvanahttp://www.blogger.com/profile/07584985948993945278noreply@blogger.com0tag:blogger.com,1999:blog-5503186409694701719.post-2198967790621926832011-04-10T21:28:00.001-07:002011-04-10T21:28:40.284-07:00Source code update<p><font size="2">This week we will post new code to </font><a title="http://desktopweb.codeplex.com" href="http://desktopweb.codeplex.com"><font size="2">http://desktopweb.codeplex.com</font></a><font size="2">.</font> <font size="2">The following screenshot shows the Access HTML editor improvements.</font></p> <p><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdMxsVpuHyxEf2FQdAwcVsX_-FgrnE5dReiYsyLogQ1U99qOmbsPcu8HHYyV359RwtWvCzy4ba3V7OpgLtutkpJULlRXAywvk1ES9uefD2zEmuINTbRaKSOTW843h0OkfOAlrtsuHOzDUf/s1600-h/image%5B2%5D.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiiLJq6ZX-08MXp2bpRPYu7S5iZO53e0i5SsFF-1rCxotPU0qyODRmg5jbBnF8gfID9CNHeZ-gK4ULlyjnjrP3WR3PAuTN3ZmO8ZYNJev5Pm4ZvTLGjBZFjXJ2008seX2Ix8cQ8qfwCVXER/?imgmax=800" width="244" height="141"></a></p> <p>HTML Editor enhancements:</p> <ul> <li>Open content stored in an Access table <li>Save content <li>Common formatting including <strong>bold</strong>, <em>italic</em>, <u>underline</u>, fonts and colors <li>Undo, cut, copy and paste <li>Numbered list, bulleted list, outdent and indent <li><a href="file:///C:/Projects/desktopWeb/MyDataAddin/MyContent/Template/href=" name="popupControl">DataLinks</a> <li>Find text <li>Insert content via a HyperBar control (not fully implemented)</li></ul> <p>Access Addin stability is another significant improvement. An abstract SurfaceController class and corresponding FormController and ReportController class was added to provide a clean and stable model to manage Access form and report controls. Access controls can be referenced as ThisDatabase.AllForms["Dashboard"].Controls(“Budget”). The SurfaceController handles the details including ensuring that Access is always released when closed.</p> <p>Silverlight WebWidgets can be included in a database as an attachment and deployed to the client.</p> <p>The source code also shows more Windows Workflow 4.0 to add .NET features into Access. The idea is to create common CodeActivities that others can drop into a Workflow to automate Access. </p> <p>I will upload the new source code and provide more documentation later this week …</p> dvanahttp://www.blogger.com/profile/07584985948993945278noreply@blogger.com0tag:blogger.com,1999:blog-5503186409694701719.post-13870999470729562552011-02-18T07:03:00.000-08:002011-02-20T08:56:37.566-08:00Access HTML Editor with Silverlight and Workflow<div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Calibri;">One of the goals of my blog is to experiment with integrating .NET into Office. Lately, the emphasis has been to show Silverlight in Access. Another area of interest is evaluating how Windows Workflow 4.0 could be used in Access to create workflow solutions as well as enable a declarative development environment. This blog, and accompanying CodePlex code download, refines the Silverlight and web browser control concept and introduces a simple Windows Workflow 4.0 containing two custom activities. </span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Calibri;">The Silverlight and web browser control concept is refined by showing how to create a simple Access HTML editor containing an embedded Silverlight Treeview control. An HTML Editor can be created primarily by using a contentEditable attribute and calling an HtmlDocument execCommand()<span style="mso-spacerun: yes;"> </span>method or using mshtml.IHTMLTxtRange methods to style a span element. An embedded Silverlight Treeview control can be displayed by creating an HtmlDocumentEvent.onclick delegate and setting the Dashboard.TreeviewPage.Display style to none or block. Here is an overview of how this works. You can go to </span><a href="http://desktopweb.codeplex.com/SourceControl/list/changesets"><span style="font-family: Calibri;">http://desktopweb.codeplex.com/SourceControl/list/changesets</span></a><span style="font-family: Calibri;"> for a complete sample.</span></div><h1 style="margin: 24pt 0in 0pt;"><span style="font-size: large;"><span style="color: #365f91;"><span style="font-family: Cambria;">HTML Editor with Embedded Silverlight</span></span></span></h1><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><strong><span class="Heading3Char"><span style="color: #4f81bd; font-family: Cambria;">HTML formatting</span></span><span style="font-family: Calibri;"> </span></strong></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><b style="mso-bidi-font-weight: normal;"><span style="font-family: Calibri;">Commands</span></b></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="color: #2b91af; font-family: Consolas; font-size: 9.5pt;">Dashboard</span><span style="font-family: Consolas; font-size: 9.5pt;">.HtmlDocument.execCommand(<span style="color: #a31515;">"Bold"</span>);</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="color: #2b91af; font-family: Consolas; font-size: 9.5pt;">Dashboard</span><span style="font-family: Consolas; font-size: 9.5pt;">.HtmlDocument.execCommand(<span style="color: #a31515;">"Italic"</span>);</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><b style="mso-bidi-font-weight: normal;"><span style="font-family: Calibri;">Style a span element</span></b></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;">mshtml.<span style="color: #2b91af;">IHTMLTxtRange</span> rng = </span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>(mshtml.<span style="color: #2b91af;">IHTMLTxtRange</span>)<span style="color: #2b91af;">Dashboard</span>.HtmlDocument.selection.createRange();</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span></span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;">…</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;">rng.pasteHTML(<span style="color: #a31515;">"<span style='color:"</span> + <span style="color: #2b91af;">Dashboard</span>.ColorCombo.Text + <span style="color: #a31515;">";'>"</span> + text + <span style="color: #a31515;">"</span>"</span>);</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="color: green; font-family: Consolas; font-size: 9.5pt;">//Reselect text</span><span style="font-family: Consolas; font-size: 9.5pt;"></span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;">rng.moveStart(<span style="color: #a31515;">"character"</span>, -text.Length);</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;">rng.select();</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;">…</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><br />
</div><h3 style="margin: 10pt 0in 0pt;"><span style="color: #4f81bd;"><span style="font-family: Cambria;"><span style="font-size: small;">TreeviewPage</span></span></span></h3><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><b style="mso-bidi-font-weight: normal;"><span style="font-family: Calibri;">Create event delegates after HTML document is complete</span></b></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">void</span><span style="font-family: Consolas; font-size: 9.5pt;"> MyDocumentTasks_onDocumentComplete(<span style="color: blue;">object</span> sender, <span style="color: #2b91af;">EventArgs</span> e)</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;">{</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt 0.5in; mso-layout-grid-align: none;"><span style="color: #2b91af; font-family: Consolas; font-size: 9.5pt;">Dashboard</span><span style="font-family: Consolas; font-size: 9.5pt;">.HtmlDocumentEvent.onclick += <span style="color: blue;">new</span> mshtml.<span style="color: #2b91af;">HTMLDocumentEvents2_onclickEventHandler</span>(HtmlDocumentEvent_onclick);</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span></span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; text-indent: 0.5in;"><span style="font-family: Consolas; font-size: 9.5pt;">…<span style="mso-spacerun: yes;"> </span><span style="mso-spacerun: yes;"> </span></span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt 0.5in; mso-layout-grid-align: none;"><span style="color: green; font-family: Consolas; font-size: 9.5pt;">//Initially hide the Treeview</span><span style="font-family: Consolas; font-size: 9.5pt;"></span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-tab-count: 1;"></span><span style="color: #2b91af;">Dashboard</span>.TreeviewPage.Display = <span style="color: #a31515;">"none"</span>;</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;">}</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><b style="mso-bidi-font-weight: normal;"><span style="font-family: Calibri;">Toggle TreeviewPage display</span></b></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">bool</span><span style="font-family: Consolas; font-size: 9.5pt;"> HtmlDocumentEvent_onclick(mshtml.<span style="color: #2b91af;">IHTMLEventObj</span> pEvtObj)</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;">{</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 1;"> </span><span style="color: blue;">if</span> (<span style="color: #a31515;">"popup"</span> == pEvtObj.srcElement.id.ToString())</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>{</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt 0.5in; mso-layout-grid-align: none; text-indent: 0.5in;"><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">if</span><span style="font-family: Consolas; font-size: 9.5pt;">(<span style="color: #2b91af;">Dashboard</span>.TreeviewPage.Display == <span style="color: #a31515;">"none"</span>)</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt 1in; mso-layout-grid-align: none; text-indent: 0.5in;"><span style="color: #2b91af; font-family: Consolas; font-size: 9.5pt;">Dashboard</span><span style="font-family: Consolas; font-size: 9.5pt;">.TreeviewPage.Display = <span style="color: #a31515;">"block"</span>;</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt 0.5in; mso-layout-grid-align: none; text-indent: 0.5in;"><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">else</span><span style="font-family: Consolas; font-size: 9.5pt;"></span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt 1in; mso-layout-grid-align: none; text-indent: 0.5in;"><span style="color: #2b91af; font-family: Consolas; font-size: 9.5pt;">Dashboard</span><span style="font-family: Consolas; font-size: 9.5pt;">.TreeviewPage.Display = <span style="color: #a31515;">"none"</span>;</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt 0.5in; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;">}</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; text-indent: 0.5in;"><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">return</span><span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: blue;">true</span>;</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;">}</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="mso-no-proof: yes;"><span style="font-size: large;"><span style="color: #365f91;"><span style="font-family: Cambria;">Invoke Windows Workflow 4.0 in Access</span></span></span></span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Calibri;">Adding Windows Workflow 4.0 (WF4) enables workflow and declarative development into Access. To experiment with WF4 in Access, a simple project budget workflow was created containing an If activity and two custom activates; ValidValueActivity and EmailActivity. An If activity executes ValidValueActivity if the budget threshold is less than 1000; otherwise, EmailActivity is executed. To show how a custom activity could be designed for Access, each activity sets the Cost Textbox BorderColor. In addition, the ValidValueActivity adds an item to the Silverlight TreeviewPage control. </span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><b style="mso-bidi-font-weight: normal;"><span style="font-family: Calibri;">Note</span></b></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Calibri;">An assembly reference must be added to a workflow xaml file; otherwise, a cannot create unknown type XamlObjectWriterException is thrown. You will need to append <b style="mso-bidi-font-weight: normal;">assembly=MyDataAddin </b>to the xmlns:local Activity attribute.</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Calibri;"><span style="mso-tab-count: 1;"> </span><b style="mso-bidi-font-weight: normal;">Default <span style="mso-spacerun: yes;"> </span>Activity<span style="mso-spacerun: yes;"> </span>Element</b></span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt 0.5in; mso-layout-grid-align: none;"><span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">Activity</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;"> </span><span style="color: red; font-family: Consolas; font-size: 9.5pt;">xmlns:local</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">=</span><span style="font-family: Consolas; font-size: 9.5pt;">"<span style="color: blue;">clr-namespace:MyDataAddin</span>" …</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt 0.5in; mso-layout-grid-align: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt 0.5in; mso-layout-grid-align: none;"><b style="mso-bidi-font-weight: normal;"><span style="font-family: Calibri;">Change to</span></b></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt 0.5in; mso-layout-grid-align: none;"><span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">Activity</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;"> </span><span style="color: red; font-family: Consolas; font-size: 9.5pt;">xmlns:local</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">=</span><span style="font-family: Consolas; font-size: 9.5pt;">"<span style="color: blue;">clr-namespace:MyDataAddin;assembly=MyDataAddin</span>" …</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt 0.5in; mso-layout-grid-align: none;"><br />
</div><h2 style="margin: 10pt 0in 0pt;"><span style="font-size: medium;"><span style="color: #4f81bd;"><span style="font-family: Cambria;">Example Workflow</span></span></span></h2><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpwKyJQgK4QSvT0mFqkYa8kgVq-CcM8MEwR96YXCRIaLZIM9oz9PuV0ch6vMG1nMeqcHQqv9kAEMzfZYeAeArUYYIG3G3Tg5AxJUDMYP9nwK7TyNNGVoIcJEaqFvrAn5_7fv-Vj4e_hKWd/s1600/2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="221" j6="true" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpwKyJQgK4QSvT0mFqkYa8kgVq-CcM8MEwR96YXCRIaLZIM9oz9PuV0ch6vMG1nMeqcHQqv9kAEMzfZYeAeArUYYIG3G3Tg5AxJUDMYP9nwK7TyNNGVoIcJEaqFvrAn5_7fv-Vj4e_hKWd/s320/2.png" width="320" /></a></div><h3 style="margin: 10pt 0in 0pt;"><span style="color: #4f81bd;"><span style="font-family: Cambria;"><span style="font-size: small;">Dashboard_onAfterUpdate</span></span></span></h3><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Calibri;">The onAfterUpdate event delegate Invokes the example XAML workflow.</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">void</span><span style="font-family: Consolas; font-size: 9.5pt;"> Dashboard_onAfterUpdate(<span style="color: blue;">object</span> sender, <span style="color: #2b91af;">EventArgs</span> e)</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;">{</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; text-indent: 0.5in;"><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">int</span><span style="font-family: Consolas; font-size: 9.5pt;"> value;</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-tab-count: 1;"></span><span style="color: #2b91af;">Int32</span>.TryParse(<span style="color: #2b91af;">Dashboard</span>.TreeviewCheckbox.Value.ToString(), <span style="color: blue;">out</span> value);</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span></span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-tab-count: 1;"></span><span style="color: #2b91af;">String</span> fullFilePath =</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: #a31515;">@"C:\Projects\desktopWeb\MyDataAddin\WorkflowLibrary\ExampleWorkflow.xaml"</span>;</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-tab-count: 1;"></span><span style="color: #2b91af;">Activity</span> wf = (<span style="color: #2b91af;">Activity</span>)<span style="color: #2b91af;">ActivityXamlServices</span>.Load(fullFilePath);</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: #2b91af;">IDictionary</span><<span style="color: #2b91af;">String</span>, <span style="color: #2b91af;">Object</span>> output = <span style="color: #2b91af;">WorkflowInvoker</span>.Invoke(</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-spacerun: yes;"> </span>wf, <span style="color: blue;">new</span> <span style="color: #2b91af;">Dictionary</span><<span style="color: #2b91af;">String</span>, <span style="color: #2b91af;">Object</span>></span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>{</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>{<span style="color: #a31515;">"ArgBudget"</span>, <span style="color: #2b91af;">Convert</span>.ToInt32(<span style="color: #2b91af;">Dashboard</span>.Cost.Value)},</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>});</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; text-indent: 0.5in;"><span style="color: #2b91af; font-family: Consolas; font-size: 9.5pt;">MessageBox</span><span style="font-family: Consolas; font-size: 9.5pt;">.Show(output[<span style="color: #a31515;">"ResultString"</span>].ToString(), <span style="color: #a31515;">"Windows Workflow"</span>);</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;">}</span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><br />
</div><h3 style="margin: 10pt 0in 0pt;"><span style="font-size: small;"><span style="color: #4f81bd;"><span style="font-family: Cambria;">Code Activities</span></span></span></h3><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">public</span><span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: blue;">sealed</span> <span style="color: blue;">class</span> <span style="color: #2b91af;">EmailActivity</span> : <span style="color: #2b91af;">CodeActivity, ISimpleActivity</span></span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;">{</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; text-indent: 0.5in;"><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">public</span><span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: #2b91af;">OutArgument</span><<span style="color: #2b91af;">Int32</span>> ResultCode { <span style="color: blue;">get</span>; <span style="color: blue;">set</span>; }</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-tab-count: 1;"></span><span style="color: blue;">public</span> <span style="color: #2b91af;">OutArgument</span><<span style="color: #2b91af;">String</span>> ResultString { <span style="color: blue;">get</span>; <span style="color: blue;">set</span>; }</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-tab-count: 1;"></span><span style="color: blue;">protected</span> <span style="color: blue;">override</span> <span style="color: blue;">void</span> Execute(<span style="color: #2b91af;">CodeActivityContext</span> context)</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-tab-count: 1;"></span>{</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-tab-count: 1;"> </span><span style="color: green;">//This example returns -1 for failure</span></span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-tab-count: 1;"> </span><span style="color: green;">//A production application would send email to the manager</span></span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-tab-count: 1;"> </span>ResultCode.Set(context, -1);</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-tab-count: 1;"> </span>ResultString.Set(context, <span style="color: #a31515;">"Email sent to your manager"</span>);</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-tab-count: 1;"> </span><span style="color: #2b91af;">Dashboard</span>.Cost.BorderColor = VB.<span style="color: #2b91af;">Information</span>.RGB(255, 0, 0);</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-tab-count: 1;"></span>}</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;">}</span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">public</span><span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: blue;">sealed</span> <span style="color: blue;">class</span> <span style="color: #2b91af;">ValidValueActivity</span> : <span style="color: #2b91af;">CodeActivity, ISimpleActivity</span></span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;">{</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; text-indent: 0.5in;"><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">public</span><span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: #2b91af;">OutArgument</span><<span style="color: #2b91af;">Int32</span>> ResultCode { <span style="color: blue;">get</span>; <span style="color: blue;">set</span>; }</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-tab-count: 1;"> </span><span style="color: blue;">public</span> <span style="color: #2b91af;">OutArgument</span><<span style="color: #2b91af;">String</span>> ResultString { <span style="color: blue;">get</span>; <span style="color: blue;">set</span>; }</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-tab-count: 1;"> </span><span style="color: blue;">protected</span> <span style="color: blue;">override</span> <span style="color: blue;">void</span> Execute(<span style="color: #2b91af;">CodeActivityContext</span> context)</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-tab-count: 1;"> </span>{</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-tab-count: 2;"> </span><span style="color: green;">//This example returns 1 for success</span></span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-tab-count: 2;"> </span>ResultCode.Set(context, 1);</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-tab-count: 2;"> </span>ResultString.Set(context, <span style="color: #a31515;">"Valid value"</span>);</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-tab-count: 2;"> </span><span style="color: #2b91af;">Dashboard</span>.Cost.BorderColor = VB.<span style="color: #2b91af;">Information</span>.RGB(0, 0, 255);</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-tab-count: 2;"> </span><span style="color: #2b91af;">Dashboard</span>.TreeviewPage.AddRootItem(<span style="color: #2b91af;">Dashboard</span>.Title.Value.ToString());</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; text-indent: 0.5in;"><span style="font-family: Consolas; font-size: 9.5pt;">}</span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="mso-no-proof: yes;"><span style="font-family: Calibri;">}</span></span></div><h1 style="margin: 24pt 0in 0pt;"><span style="font-size: large;"><span style="color: #365f91;"><span style="font-family: Cambria;">Example Workflow</span></span></span></h1><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWdV_hLNv6msRLROLAxT0jsPrdycIhwTe97D6m_q-1-Qx6v4aTLeRzkGMceRpl-dhyEcOBxXNXxaSdn7P5-sayaW8BBn3dcvLNrVyXi6O2wO-eEB_WgXKutYUDriLUuP6XWx_Sj7yqZeS6/s1600/3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="314" j6="true" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWdV_hLNv6msRLROLAxT0jsPrdycIhwTe97D6m_q-1-Qx6v4aTLeRzkGMceRpl-dhyEcOBxXNXxaSdn7P5-sayaW8BBn3dcvLNrVyXi6O2wO-eEB_WgXKutYUDriLUuP6XWx_Sj7yqZeS6/s320/3.png" width="320" /></a></div><h1 style="margin: 24pt 0in 0pt;"><span style="font-size: large;"><span style="color: #365f91;"><span style="font-family: Cambria;"></span></span></span> </h1>dvanahttp://www.blogger.com/profile/07584985948993945278noreply@blogger.com0tag:blogger.com,1999:blog-5503186409694701719.post-77759402048328754512011-02-02T21:20:00.000-08:002011-02-02T21:20:41.454-08:00Access HTML Editor Example<div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Calibri;">Tonight I added an improved example of how to create a Heading 1 style and add and remove a color style. This is useful for an Access HTML Editor using the Web Browser Control. Note how one can program DHTML from within an Access .NET Addin. </span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Calibri;">Source Code: <a href="http://desktopweb.codeplex.com/SourceControl/changeset/changes/5386">http://desktopweb.codeplex.com/SourceControl/changeset/changes/5386</a></span></div><h2 style="margin: 10pt 0in 0pt;"><span style="font-size: medium;"><span style="color: #4f81bd;"><span style="font-family: Cambria;">Apply an H1 element</span></span></span></h2><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">void</span><span style="font-family: Consolas; font-size: 9.5pt;"> Heading1_Click()</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;">{</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; text-indent: 0.5in;"><span style="color: #2b91af; font-family: Consolas; font-size: 9.5pt;">Tasks</span><span style="font-family: Consolas; font-size: 9.5pt;">.HtmlDocument.execCommand(<span style="color: #a31515;">"formatblock"</span>, <span style="color: blue;">false</span>, <span style="color: #a31515;">"<H1>"</span>);</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;">}</span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><br />
</div><h2 style="margin: 10pt 0in 0pt;"><span style="font-size: medium;"><span style="color: #4f81bd;"><span style="font-family: Cambria;">Apply a color style</span></span></span></h2><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">void</span><span style="font-family: Consolas; font-size: 9.5pt;"> ColorCombo_Change()</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;">{<span style="mso-spacerun: yes;"> </span></span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="color: green; font-family: Consolas; font-size: 9.5pt;">//Apply style</span><span style="font-family: Consolas; font-size: 9.5pt;"></span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">try</span><span style="font-family: Consolas; font-size: 9.5pt;"></span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;">{</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt 0.5in; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;">mshtml.<span style="color: #2b91af;">IHTMLTxtRange</span> rng = (mshtml.<span style="color: #2b91af;">IHTMLTxtRange</span>)<span style="color: #2b91af;">Tasks</span>.HtmlDocument.selection.createRange();</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-tab-count: 1;"> </span></span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; text-indent: 0.5in;"><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">string</span><span style="font-family: Consolas; font-size: 9.5pt;"> text = rng.text;</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">var</span> elem = rng.parentElement();</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">if</span> (elem.tagName != <span style="color: #a31515;">"SPAN"</span>)</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>{</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt 1in; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;">rng.pasteHTML(<span style="color: #a31515;">"<span style='color:"</span> + <span style="color: #2b91af;">Tasks</span>.ColorCombo.Text + <span style="color: #a31515;">";'>"</span> + text + <span style="color: #a31515;">"</span>"</span>);</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-tab-count: 1;"> </span>rng.moveStart(<span style="color: #a31515;">"character"</span>, -text.Length);</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-tab-count: 1;"> </span>rng.select();</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>}<span style="color: blue;">else</span> <span style="color: blue;">if</span> (elem.tagName == <span style="color: #a31515;">"SPAN"</span> && elem.style.color != <span style="color: blue;">string</span>.Empty)</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>{</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">if</span> (<span style="color: #2b91af;">Tasks</span>.ColorCombo.Text != <span style="color: blue;">string</span>.Empty)</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt 0.5in; mso-layout-grid-align: none; text-indent: 0.5in;"><span style="font-family: Consolas; font-size: 9.5pt;">elem.style.color = <span style="color: #2b91af;">Tasks</span>.ColorCombo.Text;</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">else</span>{</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-tab-count: 2;"> </span><span style="color: green;">//Remove SPAN element</span></span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>rng.pasteHTML(text);</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>rng.moveStart(<span style="color: #a31515;">"character"</span>, -text.Length);</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>rng.select();</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>}</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>}</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; text-indent: 0.5in;"><span style="color: #2b91af; font-family: Consolas; font-size: 9.5pt;">Tasks</span><span style="font-family: Consolas; font-size: 9.5pt;">.WebBrowser.SetFocus();</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>}</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; text-indent: 0.5in;"><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">catch</span><span style="font-family: Consolas; font-size: 9.5pt;"> (<span style="color: #2b91af;">Exception</span>) { }</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;">}</span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><br />
</div>dvanahttp://www.blogger.com/profile/07584985948993945278noreply@blogger.com0tag:blogger.com,1999:blog-5503186409694701719.post-31347912113580213272011-01-28T21:51:00.000-08:002011-01-28T21:51:07.915-08:00Post III – Access with Silverlight & Windows Workflow 4.0<div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Calibri;">New source code has been checked into </span><a href="http://desktopweb.codeplex.com/SourceControl/changeset/changes/5312"><span style="font-family: Calibri;">http://desktopweb.codeplex.com/SourceControl/changeset/changes/5312</span></a></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Calibri;">First, I would like to personally thank everyone who has downloaded the CodePlex source code. These posts are forging new ground with Access and .NET. Your interest provides motivation to continue unlocking .NET features into Access. </span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Calibri;">This new post is focused on some code re-design, exploring Windows Workflow 4.0, showing basic HTML editing with embedded Silverlight and showing WPF in a Task Pane. I’ll find some time to provide more specific code details. For now, the source code contains:</span></div><div class="MsoListParagraphCxSpFirst" style="margin: 0in 0in 0pt 0.5in; mso-list: l3 level1 lfo5; text-indent: -0.25in;"><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font: 7pt "Times New Roman";"> </span></span></span><span style="font-family: Calibri;">How to use Windows Workflow 4.0 in Access. We have a simple example, but more complex WF4 workflows could be used within Access</span></div><div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 0.5in; mso-list: l3 level1 lfo5; text-indent: -0.25in;"><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font: 7pt "Times New Roman";"> </span></span></span><span style="font-family: Calibri;">Added EventConverterAttribute to convert ondataavailable HTML DOM event to more specific event such as XmlBridgeChanged event</span></div><div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 0.5in; mso-list: l3 level1 lfo5; text-indent: -0.25in;"><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font: 7pt "Times New Roman";"> </span></span></span><span style="font-family: Calibri;">Added XmlBridge() method that returns a schema derived from an ADO.NET DataSet. We considered using a Data Contract, but a DataSet XML Schema is easier to generate and is more in tune with Access. Future versions will use the DataSet schema to send/receive XML messages to/from Silverlight and Access.</span></div><div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 0.5in; mso-list: l3 level1 lfo5; text-indent: -0.25in;"><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font: 7pt "Times New Roman";"> </span></span></span><span style="font-family: Calibri;">Added a WPF Task Pane to show how to use WPF with Access</span></div><div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 0.5in; mso-list: l3 level1 lfo5; text-indent: -0.25in;"><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font: 7pt "Times New Roman";"> </span></span></span><span style="font-family: Calibri;">Modified Database Form Reflector to support more efficient Access object get and release. Note that the pattern used in Form.Reference.cs files always releases the Access process. See http://msdn.microsoft.com/en-us/library/aa902693(office.12).aspx that discusses this issue.</span></div><div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 0.5in; mso-list: l3 level1 lfo5; text-indent: -0.25in;"><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font: 7pt "Times New Roman";"> </span></span></span><span style="font-family: Calibri;">Added a simple SharePoint Client Object Model example.</span></div><div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 0.5in; mso-list: l3 level1 lfo5; text-indent: -0.25in;"><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font: 7pt "Times New Roman";"> </span></span></span><span style="font-family: Calibri;">Added a few HTML editor examples that use HTML contentEditable = true</span></div><div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 0.5in; mso-list: l3 level1 lfo5; text-indent: -0.25in;"><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font: 7pt "Times New Roman";"> </span></span></span><span style="font-family: Calibri;">Added Silverlight Treeview popup to Sample. Click popup link to show/hide Silverlight Treeview</span></div><div class="MsoListParagraphCxSpLast" style="margin: 0in 0in 10pt 0.5in; mso-list: l3 level1 lfo5; text-indent: -0.25in;"><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font: 7pt "Times New Roman";"> </span></span></span><span style="font-family: Calibri;">Added more code documentation</span></div><h1 style="margin: 24pt 0in 0pt;"><span style="font-size: large;"><span style="color: #365f91;"><span style="font-family: Cambria;">Workflow</span></span></span></h1><div class="MsoListParagraph" style="margin: 0in 0in 10pt 0.5in; mso-list: l2 level1 lfo3; text-indent: -0.25in;"><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font: 7pt "Times New Roman";"> </span></span></span><span style="font-family: Calibri;">Added an example of how to use Windows Workflow 4.0 in Access. The example executes a custom CodeActivity that implements ITaskActivity. Each CodeActivity gets data from a different data source. Note that this is an example only. Not a very fancy sample, but shows the basic principles.</span></div><div class="MsoListParagraph" style="margin: 0in 0in 10pt 0.5in; mso-list: l2 level1 lfo3; text-indent: -0.25in;"><br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6LKs62dwgN-y8xw-HGBoIhw7OAVHy9MrURUhMfA-WbbbFu0Eyqe6VLw2Ng2ArPGX3bAfv2UvtFO9PW_ysHUsP77A0Gv_sOPevtEHCZBSJgVi4q7yOhLS220okciKbZ6RxBXPKPBQhYEvF/s1600/WorkflowExample.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" s5="true" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6LKs62dwgN-y8xw-HGBoIhw7OAVHy9MrURUhMfA-WbbbFu0Eyqe6VLw2Ng2ArPGX3bAfv2UvtFO9PW_ysHUsP77A0Gv_sOPevtEHCZBSJgVi4q7yOhLS220okciKbZ6RxBXPKPBQhYEvF/s320/WorkflowExample.png" width="266" /></a></div><div class="MsoListParagraph" style="margin: 0in 0in 10pt 0.5in; mso-list: l2 level1 lfo3; text-indent: -0.25in;"><br />
</div><div class="MsoNormal" style="margin: 0in 0in 10pt 0.25in;"><span style="mso-no-proof: yes;"><shapetype coordsize="21600,21600" filled="f" id="_x0000_t75" o:preferrelative="t" o:spt="75" path="m@4@5l@4@11@9@11@9@5xe" stroked="f"><stroke joinstyle="miter"></stroke><formulas><f eqn="if lineDrawn pixelLineWidth 0"></f><f eqn="sum @0 1 0"></f><f eqn="sum 0 0 @1"></f><f eqn="prod @2 1 2"></f><f eqn="prod @3 21600 pixelWidth"></f><f eqn="prod @3 21600 pixelHeight"></f><f eqn="sum @0 0 1"></f><f eqn="prod @6 1 2"></f><f eqn="prod @7 21600 pixelWidth"></f><f eqn="sum @8 21600 0"></f><f eqn="prod @7 21600 pixelHeight"></f><f eqn="sum @10 21600 0"></f></formulas><path gradientshapeok="t" o:connecttype="rect" o:extrusionok="f"></path><lock aspectratio="t" v:ext="edit"></lock></shapetype></span></div><h2 style="margin: 10pt 0in 0pt;"><span style="font-size: medium;"><span style="color: #4f81bd;"><span style="font-family: Cambria;">Access Addin</span></span></span></h2><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">void</span><span style="font-family: Consolas; font-size: 9.5pt;"> WorkflowCommand_Click()</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;">{</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span></span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; text-indent: 0.5in;"><span style="color: #2b91af; font-family: Consolas; font-size: 9.5pt;">Cursor</span><span style="font-family: Consolas; font-size: 9.5pt;">.Current = <span style="color: #2b91af;">Cursors</span>.WaitCursor;</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-tab-count: 1;"></span><span style="color: #2b91af;">String</span> fullFilePath = <span style="color: #a31515;">@"ExampleWorkflow.xaml"</span>;</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-tab-count: 1;"></span><span style="color: #2b91af;">Activity</span> wf = (<span style="color: #2b91af;">Activity</span>)<span style="color: #2b91af;">ActivityXamlServices</span>.Load(fullFilePath);</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-tab-count: 1;"></span><span style="color: blue;">try</span></span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-tab-count: 1;"></span>{</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-tab-count: 1;"> </span><span style="color: #2b91af;">IDictionary</span><<span style="color: #2b91af;">String</span>, <span style="color: #2b91af;">Object</span>> output = <span style="color: #2b91af;">WorkflowInvoker</span>.Invoke(</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-tab-count: 2;"> </span>wf, <span style="color: blue;">new</span> <span style="color: #2b91af;">Dictionary</span><<span style="color: #2b91af;">String</span>, <span style="color: #2b91af;">Object</span>></span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>{</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>{<span style="color: #a31515;">"ArgTeamCode"</span>,<span style="mso-spacerun: yes;"> </span><span style="color: #2b91af;">Convert</span>.ToInt32(<span style="color: #2b91af;">Tasks</span>.ItemText.Value)},</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>});</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-spacerun: yes;"> </span></span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt 1in; mso-layout-grid-align: none;"><span style="color: #2b91af; font-family: Consolas; font-size: 9.5pt;">Tasks</span><span style="font-family: Consolas; font-size: 9.5pt;">.HtmlDocument.getElementById(<span style="color: #a31515;">"popup"</span>).innerText = output[<span style="color: #a31515;">"OriginatedCount"</span>].ToString();</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>}</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">catch</span> (<span style="color: #2b91af;">InvalidOperationException</span> exception)</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>{</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-tab-count: 1;"> </span><span style="color: #2b91af;">MessageBox</span>.Show(exception.Message.ToString());</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>}</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">finally</span></span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>{</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-tab-count: 1;"> </span><span style="color: #2b91af;">Cursor</span>.Current = <span style="color: #2b91af;">Cursors</span>.Default;</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>}</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;">}</span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><br />
</div><h2 style="margin: 10pt 0in 0pt;"><span style="font-size: medium;"><span style="color: #4f81bd;"><span style="font-family: Cambria;">Example CodeActivity</span></span></span></h2><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">public</span><span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: blue;">sealed</span> <span style="color: blue;">class</span> <span style="color: #2b91af;">Activity1</span> : <span style="color: #2b91af;">CodeActivity</span>, <span style="color: #2b91af;">ITaskActivity</span></span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>{</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">public</span> <span style="color: #2b91af;">InArgument</span><<span style="color: #2b91af;">Int32</span>> TeamCode { <span style="color: blue;">get</span>; <span style="color: blue;">set</span>; }</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">public</span> <span style="color: #2b91af;">OutArgument</span><<span style="color: #2b91af;">Int32</span>> CategoryCount { <span style="color: blue;">get</span>; <span style="color: blue;">set</span>; }</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">public</span> <span style="color: #2b91af;">OutArgument</span><<span style="color: #2b91af;">Int32</span>> WaitingCount { <span style="color: blue;">get</span>; <span style="color: blue;">set</span>; }</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">protected</span> <span style="color: blue;">override</span> <span style="color: blue;">void</span> Execute(<span style="color: #2b91af;">CodeActivityContext</span> context)</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>{ </span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-tab-count: 2;"> </span>NorthwindDataSetTableAdapters.<span style="color: #2b91af;">CategoriesTableAdapter</span> categories =</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-tab-count: 1;"> </span><span style="color: blue;">new</span> NorthwindDataSetTableAdapters.<span style="color: #2b91af;">CategoriesTableAdapter</span>();</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt 1in; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;">CategoryCount.Set(context, Convert.ToInt32(categories.CategoryCount(TeamCode.Get(context)));</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt 1in; mso-layout-grid-align: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-tab-count: 1;"> </span>WaitingCount.Set(context, 10);</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>}</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>}</span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">interface</span><span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: #2b91af;">ItaskActivity</span></span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;">{</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-tab-count: 1;"> </span><span style="color: #2b91af;">InArgument</span><<span style="color: #2b91af;">Int32</span>> TeamCode { <span style="color: blue;">get</span>; <span style="color: blue;">set</span>; }</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-tab-count: 1;"> </span><span style="color: #2b91af;">OutArgument</span><<span style="color: #2b91af;">Int32</span>> OriginatedCount{<span style="color: blue;">get</span>; <span style="color: blue;">set</span>;}</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-tab-count: 1;"> </span><span style="color: #2b91af;">OutArgument</span><<span style="color: #2b91af;">Int32</span>> WaitingCount{<span style="color: blue;">get</span>; <span style="color: blue;">set</span>;}</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;">}</span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><br />
</div><h2 style="margin: 10pt 0in 0pt;"><span style="font-size: medium;"><span style="color: #4f81bd;"><span style="font-family: Cambria;">Silverlight</span></span></span></h2><div class="MsoListParagraphCxSpFirst" style="margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo4; text-indent: -0.25in;"><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font: 7pt "Times New Roman";"> </span></span></span><span style="font-family: Calibri;">MyDocumentPanel changed to WebWidget</span></div><div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 0.5in; mso-list: l4 level1 lfo1; text-indent: -0.25in;"><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font: 7pt "Times New Roman";"> </span></span></span><span style="font-family: Calibri;">Added EventConverterAttribute to convert ondataavailable HTML DOM event to more specific event such as XmlBridgeChanged event.</span></div><div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 0.5in;"><br />
</div><div class="MsoListParagraphCxSpLast" style="margin: 0in 0in 10pt 0.5in;"><span style="font-family: Calibri;">Example:</span></div><div class="MsoNormal" style="margin: 0in 0in 10pt; text-indent: 0.5in;"><span style="font-family: Calibri;">[EventConverter(“XmlBridgeChanged”)]</span></div><div class="MsoNormal" style="margin: 0in 0in 10pt; text-indent: 0.5in;"><span style="font-family: Calibri;">…</span></div><div class="MsoNormal" style="margin: 0in 0in 10pt 0.5in;"><span style="font-family: Calibri;">Tasks.TreeviewPage.<b style="mso-bidi-font-weight: normal;">onXmlBridgeChanged</b> += new EventHandler<AsyncEventArgs>(TreeviewPage_onXmlBridgeChanged);</span></div><div class="MsoListParagraphCxSpFirst" style="margin: 0in 0in 0pt 0.5in; mso-list: l4 level1 lfo1; text-indent: -0.25in;"><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font: 7pt "Times New Roman";"> </span></span></span><span style="font-family: Calibri;">Added XmlBridge() method that returns a schema derived from an ADO.NET DataSet. Considered using a Data Contract, but a DataSet XML Schema is easier to generate. Future versions will use the DataSet schema to send/receive XML messages to/from Silverlight and Access.</span></div><div class="MsoListParagraphCxSpLast" style="margin: 0in 0in 10pt 0.5in;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;">[<span style="color: #2b91af;">ondataavailable</span>, <span style="color: #2b91af;">EventConverter</span>(<span style="color: #a31515;">"onXmlBridgeChanged"</span>)]</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">public</span><span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: blue;">void</span> XmlBridge()</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;">{</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: #2b91af;">HtmlElement</span> xmlBridge = <span style="color: #2b91af;">HtmlPage</span>.Document.GetElementById(<span style="color: #a31515;">"xmlBridge"</span>);</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">if</span> (xmlBridge != <span style="color: blue;">null</span>)</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>{</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-tab-count: 1;"> </span>xmlBridge.SetProperty(<span style="color: #a31515;">"innerHtml"</span>, <span style="color: #2b91af;">Resource</span>.XmlSchema.ToString());<span style="mso-spacerun: yes;"> </span></span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt 1in; mso-layout-grid-align: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt 1in; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;">htmlBridge.ondataavailable(<span style="color: blue;">new</span> <span style="color: #2b91af;">HtmlBridge</span>.<span style="color: #2b91af;">AsyncEventArgs</span>(<span style="color: #a31515;">"XmlBridge"</span>, <span style="color: #a31515;">"TreeviewPage"</span>, <span style="color: #a31515;">"XmlBridgeChanged"</span>));</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>}</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;">}<span style="mso-spacerun: yes;"> </span></span></div><h1 style="margin: 24pt 0in 0pt;"><span style="font-size: large;"><span style="color: #365f91;"><span style="font-family: Cambria;">WPF Task Pane</span></span></span></h1><div class="MsoListParagraph" style="margin: 0in 0in 10pt 0.5in; mso-list: l1 level1 lfo2; text-indent: -0.25in;"><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font: 7pt "Times New Roman";"> </span></span></span><span style="font-family: Calibri;">Added a WPF Task Pane to show how to use WPF with Access</span></div><h1 style="margin: 24pt 0in 0pt;"><span style="font-size: large;"><span style="color: #365f91;"><span style="font-family: Cambria;"><span style="mso-spacerun: yes;"> </span>Database Form Reflector</span></span></span></h1><div class="MsoListParagraph" style="margin: 0in 0in 10pt 0.5in; mso-list: l1 level1 lfo2; text-indent: -0.25in;"><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font: 7pt "Times New Roman";"> </span></span></span><span style="font-family: Calibri;">Modified to support more efficient Access object get and release. Note that the pattern used in Form.Reference always releases the Access process. See </span><a href="http://msdn.microsoft.com/en-us/library/aa902693(office.12).aspx"><span style="font-family: Calibri;">http://msdn.microsoft.com/en-us/library/aa902693(office.12).aspx</span></a><span style="font-family: Calibri;"> that discusses this issue.</span></div><h1 style="margin: 24pt 0in 0pt;"><span style="font-size: large;"><span style="color: #365f91;"><span style="font-family: Cambria;">SharePoint</span></span></span></h1><div class="MsoListParagraph" style="margin: 0in 0in 10pt 0.5in; mso-list: l1 level1 lfo2; text-indent: -0.25in;"><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font: 7pt "Times New Roman";"> </span></span></span><span style="font-family: Calibri;">Added a simple SharePoint Client Object Model example.</span></div><h2 style="margin: 10pt 0in 0pt;"><span style="font-size: medium;"><span style="color: #4f81bd;"><span style="font-family: Cambria;">Access Addin</span></span></span></h2><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">void</span><span style="font-family: Consolas; font-size: 9.5pt;"> SharePointCommand_Click()</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;">{</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-tab-count: 1;"></span><span style="color: #2b91af;">Cursor</span>.Current = <span style="color: #2b91af;">Cursors</span>.WaitCursor;</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-tab-count: 1;"></span><span style="color: #2b91af;">ClientContext</span> clientContext = <span style="color: blue;">new</span> <span style="color: #2b91af;">ClientContext</span>(<span style="color: #a31515;">"http://localhost"</span>);</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-tab-count: 1;"></span><span style="color: #2b91af;">Web</span> site = clientContext.Web;</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-tab-count: 1;"></span>clientContext.Load(site);</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-tab-count: 1;"></span>clientContext.ExecuteQuery();</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-tab-count: 1;"></span><span style="color: #2b91af;">Cursor</span>.Current = <span style="color: #2b91af;">Cursors</span>.Default;</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-tab-count: 1;"></span><span style="color: #2b91af;">MessageBox</span>.Show(site.Title);</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;">}</span></div><h1 style="margin: 24pt 0in 0pt;"><span style="font-size: large;"><span style="color: #365f91;"><span style="font-family: Cambria;">Web Browser Control </span></span></span></h1><div class="MsoListParagraph" style="margin: 0in 0in 10pt 0.5in; mso-list: l1 level1 lfo2; text-indent: -0.25in;"><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font: 7pt "Times New Roman";"> </span></span></span><span style="font-family: Calibri;">Added a few HTML editor examples that use HTML contentEditable = true</span></div><h2 style="margin: 10pt 0in 0pt;"><span style="font-size: medium;"><span style="color: #4f81bd;"><span style="font-family: Cambria;">Access Addin</span></span></span></h2><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">void</span><span style="font-family: Consolas; font-size: 9.5pt;"> ItalicCommand_Click()</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;">{</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-tab-count: 1;"></span><span style="color: #2b91af;">Tasks</span>.HtmlDocument.execCommand(<span style="color: #a31515;">"Italic"</span>);</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;">}</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">void</span><span style="font-family: Consolas; font-size: 9.5pt;"> BoldCommand_Click()</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;">{</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-tab-count: 1;"></span><span style="color: #2b91af;">Tasks</span>.HtmlDocument.execCommand(<span style="color: #a31515;">"Bold"</span>);</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;">}</span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">void</span><span style="font-family: Consolas; font-size: 9.5pt;"> Heading1Command_Click()</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;">{</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-tab-count: 1;"></span><span style="color: #2b91af;">Tasks</span>.HtmlDocument.execCommand(<span style="color: #a31515;">"Heading1"</span>);</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;">}</span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><br />
</div>dvanahttp://www.blogger.com/profile/07584985948993945278noreply@blogger.com1tag:blogger.com,1999:blog-5503186409694701719.post-28791174972969597262011-01-27T23:19:00.000-08:002011-01-27T23:19:23.831-08:00Post III source code is coming in a few days<div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Calibri;">The source code:</span></div><div class="MsoListParagraphCxSpFirst" style="margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1; text-indent: -0.25in;"><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font: 7pt "Times New Roman";"> </span></span></span><span style="font-family: Calibri;">How to use Windows Workflow 4.0 in Access. We have a simple example, but more complex WF4 workflows could be used within Access</span></div><div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1; text-indent: -0.25in;"><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font: 7pt "Times New Roman";"> </span></span></span><span style="font-family: Calibri;">Added EventConverterAttribute to convert ondataavailable HTML DOM event to more specific event such as XmlBridgeChanged event</span></div><div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1; text-indent: -0.25in;"><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font: 7pt "Times New Roman";"> </span></span></span><span style="font-family: Calibri;">Added XmlBridge() method that returns a schema derived from an ADO.NET DataSet. We considered using a Data Contract, but a DataSet XML Schema is easier to generate and is more in tune with Access. Future versions will use the DataSet schema to send/receive XML messages to/from Silverlight and Access.</span></div><div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1; text-indent: -0.25in;"><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font: 7pt "Times New Roman";"> </span></span></span><span style="font-family: Calibri;">Added a WPF Task Pane to show how to use WPF with Access</span></div><div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1; text-indent: -0.25in;"><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font: 7pt "Times New Roman";"> </span></span></span><span style="font-family: Calibri;">Modified Database Form Reflector to support more efficient Access object get and release. Note that the pattern used in Form.Reference.cs files always releases the Access process. See http://msdn.microsoft.com/en-us/library/aa902693(office.12).aspx that discusses this issue.</span></div><div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1; text-indent: -0.25in;"><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font: 7pt "Times New Roman";"> </span></span></span><span style="font-family: Calibri;">Added a simple SharePoint Client Object Model example.</span></div><div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1; text-indent: -0.25in;"><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font: 7pt "Times New Roman";"> </span></span></span><span style="font-family: Calibri;">Added a few HTML editor examples that use HTML contentEditable = true</span></div><div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1; text-indent: -0.25in;"><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font: 7pt "Times New Roman";"> </span></span></span><span style="font-family: Calibri;">Added Silverlight Treeview popup to Sample. Click popup link to show/hide Silverlight Treeview</span></div><div class="MsoListParagraphCxSpLast" style="margin: 0in 0in 10pt 0.5in; mso-list: l0 level1 lfo1; text-indent: -0.25in;"><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font: 7pt "Times New Roman";"> </span></span></span><span style="font-family: Calibri;">Added more code documentation</span></div>dvanahttp://www.blogger.com/profile/07584985948993945278noreply@blogger.com0tag:blogger.com,1999:blog-5503186409694701719.post-26971031083063485862010-12-20T21:36:00.000-08:002010-12-20T21:36:46.750-08:00Using Silverlight with Access – Part III (What's Next)<div class="wikidoc"><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Calibri;">The part II release needs some improvements. So, sometime next month, we will release part III with a focus on</span></div><div class="MsoListParagraphCxSpFirst" style="margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1; text-indent: -0.25in;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">1.</span><span style="font: 7pt "Times New Roman";"> </span></span></span><span style="font-family: Calibri;">Improving the HtmlBridge Silverlight Reflector</span></div><div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 1in; mso-add-space: auto; mso-list: l0 level2 lfo1; text-indent: -0.25in;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">a.</span><span style="font: 7pt "Times New Roman";"> </span></span></span><span style="font-family: Calibri;">The current Silverlight reflection class does not support all primitive types. The next version will reflect on all primitive types. </span></div><div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 1in; mso-add-space: auto; mso-list: l0 level2 lfo1; text-indent: -0.25in;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">b.</span><span style="font: 7pt "Times New Roman";"> </span></span></span><span style="font-family: Calibri;">The MSHTML Table Object Model will be used to support Table data to/from Access/Silverlight using an IHTMLTable bridge. See example below. </span></div><div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 1in; mso-add-space: auto; mso-list: l0 level2 lfo1; text-indent: -0.25in;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">c.</span><span style="font: 7pt "Times New Roman";"> </span></span></span><span style="font-family: Calibri;">The current version only supports void methods. The next version will support all primitive return types as well as an IHTMLTable bridge return type. </span></div><div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1; text-indent: -0.25in;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">2.</span><span style="font: 7pt "Times New Roman";"> </span></span></span><span style="font-family: Calibri;">Adding more Treeview features. Not sure what we will add at this time, but we want to show more Silverlight control code.</span></div><div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1; text-indent: -0.25in;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">3.</span><span style="font: 7pt "Times New Roman";"> </span></span></span><span style="font-family: Calibri;">Improving source code documentation.</span></div><div class="MsoListParagraphCxSpLast" style="margin: 0in 0in 10pt 0.5in; mso-list: l0 level1 lfo1; text-indent: -0.25in;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">4.</span><span style="font: 7pt "Times New Roman";"> </span></span></span><span style="font-family: Calibri;">Improving ActiveForm.Proxy as needed.</span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><br />
</div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><b style="mso-bidi-font-weight: normal;"><span style="font-family: Calibri;">Add Access Recordset Value to TreeviewPage.Table Example</span></b></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: "Courier New"; font-size: 10pt; line-height: 115%; mso-bidi-font-size: 11.0pt;">mshtml.IHTMLTable rootTable =<span style="mso-spacerun: yes;"> </span></span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: "Courier New"; font-size: 10pt; line-height: 115%; mso-bidi-font-size: 11.0pt;">(mshtml.IHTMLTable)MyDocumentTasks.TreeviewPage.Table(“RootItems”);</span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: "Courier New"; font-size: 10pt; line-height: 115%; mso-bidi-font-size: 11.0pt;"><span style="mso-spacerun: yes;"> </span>mshtml.HTMLTableRow rootItem = rootTable.insertRow();</span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: "Courier New"; font-size: 10pt; line-height: 115%; mso-bidi-font-size: 11.0pt;">mshtml.HTMLTableCell cell = myNewRow.insertCell();</span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="color: #00b050; font-family: "Courier New"; font-size: 10pt; line-height: 115%; mso-bidi-font-size: 11.0pt;">//Assign Recordset value to table cell value</span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: "Courier New"; font-size: 10pt; line-height: 115%; mso-bidi-font-size: 11.0pt;">cell.innerText = rst.Fields["ProductName"].Value;</span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="color: #00b050; font-family: "Courier New"; font-size: 10pt; line-height: 115%; mso-bidi-font-size: 11.0pt;">//Refresh Treeview</span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: "Courier New"; font-size: 10pt; line-height: 115%; mso-bidi-font-size: 11.0pt;">MyDocumentTasks.TreeviewPage.Table(“RootItems”).Refresh();</span></div></div>dvanahttp://www.blogger.com/profile/07584985948993945278noreply@blogger.com0tag:blogger.com,1999:blog-5503186409694701719.post-8441304209911427012010-12-15T21:34:00.000-08:002010-12-15T21:34:36.282-08:00Using Silverlight with Access – Part II<div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Calibri;">We have a new release at </span><a href="http://desktopweb.codeplex.com/SourceControl/list/changesets"><span style="font-family: Calibri;">http://desktopweb.codeplex.com/SourceControl/list/changesets</span></a><span style="font-family: Calibri;">. </span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Calibri;">The first release was more of a concept. The focus of this release was to improve the Silverlight control and Database form coding experience to reduce the time required to create the Silverlight / Access integration. The release simplifies wiring together Silverlight and an Access Database form. We hope the changes result in less code to write. The next blog will show more Silverlight coding.</span></div><h1 style="margin: 24pt 0in 0pt;"><span style="font-size: large;"><span style="color: #365f91;"><span style="font-family: Cambria;">What we have been doing</span></span></span></h1><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Calibri;">The goal of this release was to enable the ability to auto-generate Silverlight Control and Database Form reference classes with minimal lines of code. To accomplish this goal, assembly and database form reflection concepts were incorporated to auto-generate common class patterns. </span></div><div class="MsoNormal" style="background: white; line-height: normal; margin: 0in 0in 16.2pt;"><b><span style="color: #4f81bd; font-family: "Cambria", "serif"; font-size: 13pt; mso-ascii-theme-font: major-latin; mso-bidi-font-family: "Times New Roman"; mso-bidi-theme-font: major-bidi; mso-fareast-font-family: "Times New Roman"; mso-fareast-theme-font: major-fareast; mso-hansi-theme-font: major-latin; mso-themecolor: accent1;">Release Highlights</span></b></div><div class="MsoNormal" style="background: white; line-height: normal; margin: 0in 0in 2.25pt 21pt; mso-list: l0 level1 lfo1; tab-stops: list .5in; text-indent: -0.25in;"><span style="font-family: Symbol; font-size: 10pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font: 7pt "Times New Roman";"> </span></span></span><span style="font-family: Calibri;">Added <b style="mso-bidi-font-weight: normal;">WidgetRelector.Transform()</b> that transforms Silverlight reflection XML into a client-side C# class.</span></div><div class="MsoNormal" style="background: white; line-height: normal; margin: 0in 0in 2.25pt 21pt; mso-list: l0 level1 lfo1; tab-stops: list .5in; text-indent: -0.25in;"><span style="font-family: Symbol; font-size: 10pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font: 7pt "Times New Roman";"> </span></span></span><span style="font-family: Calibri;">Added <b style="mso-bidi-font-weight: normal;">ActiveForm.Proxy.Transform()</b> that transforms a database form into a C# class. Useful for any Access addin project.</span></div><div class="MsoNormal" style="background: white; line-height: normal; margin: 0in 0in 2.25pt 21pt; mso-list: l0 level1 lfo1; tab-stops: list .5in; text-indent: -0.25in;"><span style="font-family: Symbol; font-size: 10pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font: 7pt "Times New Roman";"> </span></span></span><span style="font-family: Calibri;">Added <b style="mso-bidi-font-weight: normal;">Generate Reference Files</b> dialog form. The form uses <b style="mso-bidi-font-weight: normal;">Silverlight.Emit(), WidgetRelector.Transform() and ActiveForm.Proxy.Transform()</b> to auto-generate C# reference proxy files.</span></div><div class="MsoNormal" style="background: white; line-height: normal; margin: 0in 0in 2.25pt 21pt; mso-list: l0 level1 lfo1; tab-stops: list .5in; text-indent: -0.25in;"><span style="font-family: Symbol; font-size: 10pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font: 7pt "Times New Roman";"> </span></span></span><span style="font-family: Calibri;">Enhanced <b style="mso-bidi-font-weight: normal;">TreeviewPage.AddItem(header)</b>. The method now adds a child TreeViewItem to any selected node.</span></div><div class="MsoNormal" style="background: white; line-height: normal; margin: 0in 0in 2.25pt 21pt; mso-list: l0 level1 lfo1; tab-stops: list .5in; text-indent: -0.25in;"><span style="font-family: Symbol; font-size: 10pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font: 7pt "Times New Roman";"> </span></span></span><span style="font-family: Calibri;">Added <b style="mso-bidi-font-weight: normal;">TreeviewPage.RemoveItem()</b> that removes a TreeViewItem.</span></div><div class="MsoNormal" style="background: white; line-height: normal; margin: 0in 0in 2.25pt 21pt; mso-list: l0 level1 lfo1; tab-stops: list .5in; text-indent: -0.25in;"><span style="font-family: Symbol; font-size: 10pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font: 7pt "Times New Roman";"> </span></span></span><span style="font-family: Calibri;">Added an abstract HtmlBridge class that defines recommended .NET EventArgs classes. HTML DOM events raised by Silverlight resemble standard .NET events.</span></div><h2 style="margin: 10pt 0in 0pt;"><span style="font-size: medium;"><span style="color: #4f81bd;"><span style="font-family: Cambria;">Silverlight Control Changes</span></span></span></h2><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Calibri;">An IReflection interface was added that defines an Emit() method.</span></div><h3 style="margin: 10pt 0in 0pt;"><span style="font-size: small;"><span style="color: #4f81bd;"><span style="font-family: Cambria;">IRelection Interface</span></span></span></h3><div class="MsoNormal" style="margin: 0in 0in 10pt;"><b style="mso-bidi-font-weight: normal;"><span style="color: #2a2a2a; font-family: "Tahoma", "sans-serif"; font-size: 10pt; line-height: 115%;">void Emit() Method</span></b></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Calibri;">The Emit() method uses LINQ and Assembly reflection to emit XML describing ScriptableMembers and events available to HtmlBridge. The Emit() method is used to auto-generate a client-side Silverlight control proxy reference file.</span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><b style="mso-bidi-font-weight: normal;"><span style="color: #2a2a2a; font-family: "Tahoma", "sans-serif"; font-size: 10pt; line-height: 115%;">How Silverlight reflection maps to Access / Silverlight Addin Reference class</span></b></div><br />
<table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" style="border-bottom: medium none; border-collapse: collapse; border-left: medium none; border-right: medium none; border-top: medium none; margin: auto auto auto 5.4pt; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-yfti-tbllook: 1184;"><tbody>
<tr style="mso-yfti-firstrow: yes; mso-yfti-irow: 0;"><td style="background-color: transparent; border-bottom: windowtext 1pt solid; border-left: windowtext 1pt solid; border-right: windowtext 1pt solid; border-top: windowtext 1pt solid; mso-border-alt: solid windowtext .5pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 200.95pt;" valign="top" width="268"><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;"><b style="mso-bidi-font-weight: normal;"><span style="color: #2a2a2a; font-family: "Tahoma", "sans-serif"; font-size: 10pt;">XML</span></b></div></td><td style="background-color: transparent; border-bottom: windowtext 1pt solid; border-left: #f0f0f0; border-right: windowtext 1pt solid; border-top: windowtext 1pt solid; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 272.45pt;" valign="top" width="363"><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;"><b style="mso-bidi-font-weight: normal;"><span style="color: #2a2a2a; font-family: "Tahoma", "sans-serif"; font-size: 10pt;">Access / Silverlight Addin Reference class</span></b></div></td></tr>
<tr style="mso-yfti-irow: 1;"><td style="background-color: transparent; border-bottom: windowtext 1pt solid; border-left: windowtext 1pt solid; border-right: windowtext 1pt solid; border-top: #f0f0f0; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 200.95pt;" valign="top" width="268"><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;"><span style="color: #2a2a2a; font-family: "Tahoma", "sans-serif"; font-size: 10pt;"><class name="TreeviewPage">…<b style="mso-bidi-font-weight: normal;"></b></span></div></td><td style="background-color: transparent; border-bottom: windowtext 1pt solid; border-left: #f0f0f0; border-right: windowtext 1pt solid; border-top: #f0f0f0; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 272.45pt;" valign="top" width="363"><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;"><span style="color: #2a2a2a; font-family: "Tahoma", "sans-serif"; font-size: 10pt;">class TreeviewPage</span></div></td></tr>
<tr style="mso-yfti-irow: 2;"><td style="background-color: transparent; border-bottom: windowtext 1pt solid; border-left: windowtext 1pt solid; border-right: windowtext 1pt solid; border-top: #f0f0f0; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 200.95pt;" valign="top" width="268"><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;"><span style="color: #2a2a2a; font-family: "Tahoma", "sans-serif"; font-size: 10pt;"><attribute name="HtmlBridgeEvent.onclick" /></span></div></td><td style="background-color: transparent; border-bottom: windowtext 1pt solid; border-left: #f0f0f0; border-right: windowtext 1pt solid; border-top: #f0f0f0; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 272.45pt;" valign="top" width="363"><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;"><span style="color: #2a2a2a; font-family: "Tahoma", "sans-serif"; font-size: 10pt;">public new event EventHandler<ElementEventArgs> onclick;</span></div></td></tr>
<tr style="mso-yfti-irow: 3;"><td style="background-color: transparent; border-bottom: windowtext 1pt solid; border-left: windowtext 1pt solid; border-right: windowtext 1pt solid; border-top: #f0f0f0; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 200.95pt;" valign="top" width="268"><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;"><span style="color: #2a2a2a; font-family: "Tahoma", "sans-serif"; font-size: 10pt;"><class name="ElementEventArgs"> …</span></div></td><td style="background-color: transparent; border-bottom: windowtext 1pt solid; border-left: #f0f0f0; border-right: windowtext 1pt solid; border-top: #f0f0f0; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 272.45pt;" valign="top" width="363"><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;"><span style="color: #2a2a2a; font-family: "Tahoma", "sans-serif"; font-size: 10pt;">base.onclick += new EventHandler<ElementEventArgs>(TreeviewPage_onclick);</span></div></td></tr>
<tr style="mso-yfti-irow: 4; mso-yfti-lastrow: yes;"><td style="background-color: transparent; border-bottom: windowtext 1pt solid; border-left: windowtext 1pt solid; border-right: windowtext 1pt solid; border-top: #f0f0f0; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 200.95pt;" valign="top" width="268"><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;"><span style="color: #2a2a2a; font-family: "Tahoma", "sans-serif"; font-size: 10pt;"><method name="AddItem"> …</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;"><span style="color: #2a2a2a; font-family: "Tahoma", "sans-serif"; font-size: 10pt;"><parameter name="itemValue"></span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;"><span style="color: #2a2a2a; font-family: "Tahoma", "sans-serif"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span><parameterType name="String" …</span></div></td><td style="background-color: transparent; border-bottom: windowtext 1pt solid; border-left: #f0f0f0; border-right: windowtext 1pt solid; border-top: #f0f0f0; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 272.45pt;" valign="top" width="363"><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;"><span style="color: #2a2a2a; font-family: "Tahoma", "sans-serif"; font-size: 10pt;">public void AddItem(String itemValue)</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;"><span style="color: #2a2a2a; font-family: "Tahoma", "sans-serif"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>base.InvokeScriptableMethod("AddItem('" + itemValue + "')");</span></div></td></tr>
</tbody></table><br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;"><br />
</div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><b style="mso-bidi-font-weight: normal;"><span style="color: #2a2a2a; font-family: "Tahoma", "sans-serif"; font-size: 10pt; line-height: 115%;">Create a Silverlight Control proxy reference file</span></b></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Calibri;">The follow example creates all client-side (Addin) Silverlight reference code.</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="color: #2b91af; font-family: Consolas; font-size: 9.5pt;">WidgetAddinRelector</span><span style="font-family: Consolas; font-size: 9.5pt;"> r = <span style="color: blue;">new</span> <span style="color: #2b91af;">WidgetAddinRelector</span>((mshtml.<span style="color: #2b91af;">HTMLDocument</span>)<span style="color: #2b91af;">ActiveForm</span></span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; text-indent: 0.5in;"><span style="font-family: Consolas; font-size: 9.5pt;">.WebBrowserControls(<span style="color: #2b91af;">ActiveForm</span>.<span style="color: #2b91af;">WebBrowser</span>.Names[0].ToString()).Object.Document);</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;">r.Emit();</span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><br />
</div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="color: #4f81bd;"><span style="font-family: Cambria;"><span style="font-size: small;">Event Attributes</span></span></span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Calibri;">HtmlBridge event attribute classes were added to define class and member level event attributes. The attributes are used to emit which HTML DOM events are raised by a Silverlight control. For example, the onclickAttribute reveals to WidgetReflector that the Silverlight control raises an HTML DOM onclick event. WidgetReflector reflects on event attributes to auto-generate HtmlBridge event code.</span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><b style="mso-bidi-font-weight: normal;"><span style="font-family: Calibri;">How HtmlBridge attributes map to Access / Silverlight Addin Reference</span></b></div><br />
<table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" style="border-bottom: medium none; border-collapse: collapse; border-left: medium none; border-right: medium none; border-top: medium none; margin: auto auto auto 5.4pt; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-yfti-tbllook: 1184;"><tbody>
<tr style="mso-yfti-firstrow: yes; mso-yfti-irow: 0;"><td style="background-color: transparent; border-bottom: windowtext 1pt solid; border-left: windowtext 1pt solid; border-right: windowtext 1pt solid; border-top: windowtext 1pt solid; mso-border-alt: solid windowtext .5pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 200.95pt;" valign="top" width="268"><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;"><b style="mso-bidi-font-weight: normal;"><span style="font-family: Calibri;">HtmlBridge Event Attributes</span></b></div></td><td style="background-color: transparent; border-bottom: windowtext 1pt solid; border-left: #f0f0f0; border-right: windowtext 1pt solid; border-top: windowtext 1pt solid; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 272.45pt;" valign="top" width="363"><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;"><b style="mso-bidi-font-weight: normal;"><span style="font-family: Calibri;">Access / Silverlight Addin Reference</span></b></div></td></tr>
<tr style="mso-yfti-irow: 1;"><td style="background-color: transparent; border-bottom: windowtext 1pt solid; border-left: windowtext 1pt solid; border-right: windowtext 1pt solid; border-top: #f0f0f0; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 200.95pt;" valign="top" width="268"><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;"><span style="font-family: Calibri;"><b style="mso-bidi-font-weight: normal;">[ScriptableType, onclick, onmousedown]</b>public partial class TreeviewPage : UserControl, IReflection<b style="mso-bidi-font-weight: normal;"></b></span></div></td><td style="background-color: transparent; border-bottom: windowtext 1pt solid; border-left: #f0f0f0; border-right: windowtext 1pt solid; border-top: #f0f0f0; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 272.45pt;" valign="top" width="363"><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;"><span style="font-family: Calibri;">public new event EventHandler<ElementEventArgs> onclick;</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;"><span style="font-family: Calibri;">public new event EventHandler<ElementEventArgs> onmousedown;</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;"><span style="font-family: Calibri;">base.onclick += new EventHandler<ElementEventArgs>(TreeviewPage_onclick);</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;"><span style="font-family: Calibri;">base.onmousedown += new EventHandler<ElementEventArgs>(TreeviewPage_ onmousedown);</span></div></td></tr>
<tr style="mso-yfti-irow: 2; mso-yfti-lastrow: yes;"><td style="background-color: transparent; border-bottom: windowtext 1pt solid; border-left: windowtext 1pt solid; border-right: windowtext 1pt solid; border-top: #f0f0f0; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 200.95pt;" valign="top" width="268"><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;"><b style="mso-bidi-font-weight: normal;"><span style="font-family: Calibri;">[ScriptableMember, ondataavailable]</span></b></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;"><span style="font-family: Calibri;">public void AddItem(string itemValue)</span></div></td><td style="background-color: transparent; border-bottom: windowtext 1pt solid; border-left: #f0f0f0; border-right: windowtext 1pt solid; border-top: #f0f0f0; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 272.45pt;" valign="top" width="363"><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;"><span style="font-family: Calibri;">public new event EventHandler<AsyncEventArgs> ondataavailable;</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;"><span style="font-family: Calibri;">base.onclick += new EventHandler<AsyncEventArgs>(TreeviewPage_ ondataavailable);<span style="color: #2a2a2a; font-family: "Tahoma", "sans-serif"; font-size: 10pt;"></span></span></div></td></tr>
</tbody></table><br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;"><br />
</div><h3 style="margin: 10pt 0in 0pt;"><span style="color: #4f81bd;"><span style="font-family: Cambria;"><span style="font-size: small;">HtmlBridge Attribute</span></span></span></h3><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Calibri;">The HtmlBridgeAttribute defines EventArg classes exposed by a Silverlight control.</span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><b style="mso-bidi-font-weight: normal;"><span style="font-family: Calibri;">Example</span></b></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Calibri;">[HtmlBridge]</span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Calibri;">public class ElementEventArgs : EventArgs</span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Calibri;">{</span></div><div class="MsoNormal" style="margin: 0in 0in 10pt; text-indent: 0.5in;"><span style="font-family: Calibri;">public string Qualifier { get; private set; }</span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Calibri;"><span style="mso-spacerun: yes;"> </span><span style="mso-tab-count: 1;"> </span>public string Name { get; private set; }</span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Calibri;"><span style="mso-spacerun: yes;"> </span><span style="mso-tab-count: 1;"> </span><span style="mso-spacerun: yes;"> </span>public string Text { get; private set; }</span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Calibri;"><span style="mso-spacerun: yes;"> </span><span style="mso-tab-count: 1;"> </span><span style="mso-spacerun: yes;"> </span>public string Tag { get; private set; }</span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Calibri;"><span style="mso-spacerun: yes;"> </span><span style="mso-tab-count: 1;"> </span><span style="mso-spacerun: yes;"> </span>public string Value { get; private set; }</span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Calibri;">…</span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><b style="mso-bidi-font-weight: normal;"><span style="font-family: Calibri;">Silverlight onclick Example</span></b></div><div class="MsoNormal" style="margin: 0in 0in 10pt; text-indent: 0.5in;"><span style="color: #2a2a2a; font-family: "Tahoma", "sans-serif"; font-size: 10pt; line-height: 115%;">onclick(new HtmlBridge.ElementEventArgs(item.Header.ToString(), tag));</span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><b style="mso-bidi-font-weight: normal;"><span style="font-family: Calibri;">Access Addin</span></b></div><div class="MsoNormal" style="margin: 0in 0in 10pt 0.5in;"><span style="color: #2a2a2a; font-family: "Tahoma", "sans-serif"; font-size: 10pt; line-height: 115%;">MyDocumentTasks.TreeviewPage.onclick += new EventHandler<ElementEventArgs>(TreeviewPage_onclick);</span></div><div class="MsoNormal" style="margin: 0in 0in 10pt; text-indent: 0.5in;"><span style="color: #2a2a2a; font-family: "Tahoma", "sans-serif"; font-size: 10pt; line-height: 115%;">void TreeviewPage_onclick(object sender, ElementEventArgs e)</span></div><h3 style="margin: 10pt 0in 0pt;"><span style="color: #4f81bd;"><span style="font-family: Cambria;"><span style="font-size: small;">HtmlBridge Utility Class</span></span></span></h3><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Calibri;">An HtmlBridge utility class was added to simplify calling HtmlBridge scripting methods from a Silverlight control.</span></div><br />
<table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" style="border-bottom: medium none; border-collapse: collapse; border-left: medium none; border-right: medium none; border-top: medium none; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-yfti-tbllook: 1184; width: 579px;"><tbody>
<tr style="mso-yfti-firstrow: yes; mso-yfti-irow: 0;"><td style="background-color: transparent; border-bottom: windowtext 1pt solid; border-left: windowtext 1pt solid; border-right: windowtext 1pt solid; border-top: windowtext 1pt solid; mso-border-alt: solid windowtext .5pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 251.55pt;" valign="top" width="335"><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;"><b style="mso-bidi-font-weight: normal;"><span style="color: #2a2a2a; font-family: "Tahoma", "sans-serif"; font-size: 10pt;">Silverlight Control</span></b></div></td><td style="background-color: transparent; border-bottom: windowtext 1pt solid; border-left: #f0f0f0; border-right: windowtext 1pt solid; border-top: windowtext 1pt solid; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 182.85pt;" valign="top" width="244"><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;"><b style="mso-bidi-font-weight: normal;"><span style="color: #2a2a2a; font-family: "Tahoma", "sans-serif"; font-size: 10pt;">HtmlBridge</span></b></div></td></tr>
<tr style="mso-yfti-irow: 1; mso-yfti-lastrow: yes;"><td style="background-color: transparent; border-bottom: windowtext 1pt solid; border-left: windowtext 1pt solid; border-right: windowtext 1pt solid; border-top: #f0f0f0; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 251.55pt;" valign="top" width="335"><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;"><span style="color: #2a2a2a; font-family: "Tahoma", "sans-serif"; font-size: 10pt;">htmlBridge.onclick(new HtmlBridge.ElementEventArgs(item.Header.ToString(), tag));</span></div></td><td style="background-color: transparent; border-bottom: windowtext 1pt solid; border-left: #f0f0f0; border-right: windowtext 1pt solid; border-top: #f0f0f0; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 182.85pt;" valign="top" width="244"><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;"><span style="color: #2a2a2a; font-family: "Tahoma", "sans-serif"; font-size: 10pt;">[HtmlBridgeEvent]</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;"><span style="color: #2a2a2a; font-family: "Tahoma", "sans-serif"; font-size: 10pt;">public void onclick(ElementEventArgs eventArgs)</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;"><span style="color: #2a2a2a; font-family: "Tahoma", "sans-serif"; font-size: 10pt;">{</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;"><span style="color: #2a2a2a; font-family: "Tahoma", "sans-serif"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>FireEvent("onclick", eventArgs);</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;"><span style="color: #2a2a2a; font-family: "Tahoma", "sans-serif"; font-size: 10pt;">}</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;"><span style="color: #2a2a2a; font-family: "Tahoma", "sans-serif"; font-size: 10pt;">public void FireEvent(string eventName)</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;"><span style="color: #2a2a2a; font-family: "Tahoma", "sans-serif"; font-size: 10pt;">{<span style="mso-spacerun: yes;"> </span><span style="mso-spacerun: yes;"> </span>HtmlPage.Window.Eval(_elementName + ".fireEvent('" + eventName + "')");</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;"><span style="color: #2a2a2a; font-family: "Tahoma", "sans-serif"; font-size: 10pt;">}</span></div></td></tr>
</tbody></table><br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;"><br />
</div><h2 style="margin: 10pt 0in 0pt;"><span style="font-size: medium;"><span style="color: #4f81bd;"><span style="font-family: Cambria;">Access Database Changes</span></span></span></h2><h3 style="margin: 10pt 0in 0pt;"><span style="color: #4f81bd;"><span style="font-family: Cambria;"><span style="font-size: small;">WidgetReflector<span style="color: #2a2a2a; font-family: "Tahoma", "sans-serif"; font-size: 10pt; line-height: 115%;"></span></span></span></span></h3><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Calibri;">A WidgetReflector class was added. The class is a primarily a LINQ class that transforms a Silverlight reflection Xml stream into a Silverlight control proxy reference class. The class auto-generates a Silverlight control proxy reference class hiding the Silverlight control plumbing details from the developer.</span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><b style="mso-bidi-font-weight: normal;"><span style="color: #2a2a2a; font-family: "Tahoma", "sans-serif"; font-size: 10pt; line-height: 115%;">Usage</span></b></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; text-indent: 0.5in;"><span style="font-family: Calibri;">WidgetReflector.Transform(sourceXml, sourceCodePath)</span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><br />
</div><h3 style="margin: 10pt 0in 0pt;"><span style="color: #4f81bd;"><span style="font-family: Cambria;"><span style="font-size: small;">ActiveForm</span></span></span></h3><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Calibri;">ActiveForm is a static class for an Access form object wrapper. The class is defined as static since Access creates object instances.</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><br />
</div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><b style="mso-bidi-font-weight: normal;"><span style="color: #2a2a2a; font-family: "Tahoma", "sans-serif"; font-size: 10pt; line-height: 115%;">internal static class Proxy</span></b></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Calibri;">Internal static class that transforms or auto-generates the ActiveForm into a .NET wrapper class. Note that the class has not been tested with all Access controls.</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><br />
</div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><b style="mso-bidi-font-weight: normal;"><span style="color: #2a2a2a; font-family: "Tahoma", "sans-serif"; font-size: 10pt; line-height: 115%;">Usage</span></b></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; text-indent: 0.5in;"><span style="font-family: Calibri;">MyDataAddin.ActiveForm.Proxy.Transform();</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt 0.5in; mso-layout-grid-align: none;"><span style="font-family: Calibri;">The Transform() method auto-generates all database form proxy reference code. For example, calling Transform() on the MyDocumentTasks form auto-generates all code enabling simple implementation methods hiding the addin plumbing details from the developer.</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><br />
</div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><b style="mso-bidi-font-weight: normal;"><span style="color: #2a2a2a; font-family: "Tahoma", "sans-serif"; font-size: 10pt; line-height: 115%;">Examples</span></b></div><br />
<table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" style="border-bottom: medium none; border-collapse: collapse; border-left: medium none; border-right: medium none; border-top: medium none; margin: auto auto auto 5.4pt; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-table-layout-alt: fixed; mso-yfti-tbllook: 1184; width: 588px;"><tbody>
<tr style="mso-yfti-firstrow: yes; mso-yfti-irow: 0;"><td style="background-color: transparent; border-bottom: windowtext 1pt solid; border-left: windowtext 1pt solid; border-right: windowtext 1pt solid; border-top: windowtext 1pt solid; mso-border-alt: solid windowtext .5pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 3.5in;" valign="top" width="336"><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;"><b style="mso-bidi-font-weight: normal;"><span style="color: #2a2a2a; font-family: "Tahoma", "sans-serif"; font-size: 10pt;">Implementation Code</span></b></div></td><td style="background-color: transparent; border-bottom: windowtext 1pt solid; border-left: #f0f0f0; border-right: windowtext 1pt solid; border-top: windowtext 1pt solid; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 189pt;" valign="top" width="252"><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;"><b style="mso-bidi-font-weight: normal;"><span style="color: #2a2a2a; font-family: "Tahoma", "sans-serif"; font-size: 10pt;">Auto-generated Database Form code</span></b></div></td></tr>
<tr style="mso-yfti-irow: 1;"><td style="background-color: transparent; border-bottom: windowtext 1pt solid; border-left: windowtext 1pt solid; border-right: windowtext 1pt solid; border-top: #f0f0f0; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 3.5in;" valign="top" width="336"><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;"><span style="color: #2a2a2a; font-family: "Tahoma", "sans-serif"; font-size: 10pt;">MyDocumentTasks.ItemText.Value</span></div></td><td style="background-color: transparent; border-bottom: windowtext 1pt solid; border-left: #f0f0f0; border-right: windowtext 1pt solid; border-top: #f0f0f0; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 189pt;" valign="top" width="252"><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;"><span style="color: #2a2a2a; font-family: "Tahoma", "sans-serif"; font-size: 10pt;">private static Microsoft.Office.Interop.Access.TextBox _itemText = null;</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;"><span style="color: #2a2a2a; font-family: "Tahoma", "sans-serif"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>public static Microsoft.Office.Interop.Access.TextBox ItemText</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;"><span style="color: #2a2a2a; font-family: "Tahoma", "sans-serif"; font-size: 10pt;">{</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;"><span style="color: #2a2a2a; font-family: "Tahoma", "sans-serif"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>get</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;"><span style="color: #2a2a2a; font-family: "Tahoma", "sans-serif"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>{</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;"><span style="color: #2a2a2a; font-family: "Tahoma", "sans-serif"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>return _itemText;</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;"><span style="color: #2a2a2a; font-family: "Tahoma", "sans-serif"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>}</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;"><span style="color: #2a2a2a; font-family: "Tahoma", "sans-serif"; font-size: 10pt;">}</span></div></td></tr>
<tr style="mso-yfti-irow: 2; mso-yfti-lastrow: yes;"><td style="background-color: transparent; border-bottom: windowtext 1pt solid; border-left: windowtext 1pt solid; border-right: windowtext 1pt solid; border-top: #f0f0f0; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 3.5in;" valign="top" width="336"><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;"><span style="color: #2a2a2a; font-family: "Tahoma", "sans-serif"; font-size: 10pt;">MyDocumentTasks.TreeviewPage.AddItem(itemValue)</span></div></td><td style="background-color: transparent; border-bottom: windowtext 1pt solid; border-left: #f0f0f0; border-right: windowtext 1pt solid; border-top: #f0f0f0; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 189pt;" valign="top" width="252"><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;"><span style="color: #2a2a2a; font-family: "Tahoma", "sans-serif"; font-size: 10pt;">public static TreeviewPage TreeviewPage;</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;"><span style="color: #2a2a2a; font-family: "Tahoma", "sans-serif"; font-size: 10pt;">…</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;"><span style="color: #2a2a2a; font-family: "Tahoma", "sans-serif"; font-size: 10pt;">TreeviewPage = new TreeviewPage((mshtml.HTMLDocument)<br />
_webBrowser.Object.Document);</span></div></td></tr>
</tbody></table><br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;"><br />
</div><h3 style="margin: 10pt 0in 0pt;"><span style="color: #4f81bd;"><span style="font-family: Cambria;"><span style="font-size: small;">HtmlBridge</span></span></span></h3><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Calibri;">Abstract class inherited by Silverlight control providing base HtmlBridge members. </span></div><h3 style="margin: 10pt 0in 0pt;"><span style="color: #4f81bd;"><span style="font-family: Cambria;"><span style="font-size: small;">MyDocumentTasks.Reference</span></span></span></h3><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Calibri;">Class is now auto-generated from ActiveForm.Proxy.Transform().</span></div><h3 style="margin: 10pt 0in 0pt;"><span style="color: #4f81bd;"><span style="font-family: Cambria;"><span style="font-size: small;">TreeviewPage.Reference</span></span></span></h3><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Calibri;">Class is auto-generated from WidgetReflector.Transform().</span></div><h3 style="margin: 10pt 0in 0pt;"><span style="color: #4f81bd;"><span style="font-family: Cambria;"><span style="font-size: small;">Configuration Form</span></span></span></h3><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Calibri;">Added <b style="mso-bidi-font-weight: normal;">Addin Widger Proxy Files</b> ribbon button to Database Tools.</span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Calibri;"><b style="mso-bidi-font-weight: normal;">Addin Widget Proxy Files</b> opens <b style="mso-bidi-font-weight: normal;">Generate Refenence Files</b> dialog form. <b style="mso-bidi-font-weight: normal;">Create</b> button creates Silverlight and Database form proxy reference file. The configuration form was added to Access as a Power Tool.</span></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxQ6woLwb6ZN2Laeh62ClOfzmx5YarkH4s8DCmXOoJ_W5RMdBkabR29AKK2V7fCyOP2r8FR_3IrET-zFMHrWBq22Z1oMDk7Ru_u8zDaRWI6yoXL8_b6t37ir4Zj57sNUAT1Aw_T5lv7Stt/s1600/1.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="220" n4="true" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxQ6woLwb6ZN2Laeh62ClOfzmx5YarkH4s8DCmXOoJ_W5RMdBkabR29AKK2V7fCyOP2r8FR_3IrET-zFMHrWBq22Z1oMDk7Ru_u8zDaRWI6yoXL8_b6t37ir4Zj57sNUAT1Aw_T5lv7Stt/s320/1.PNG" width="320" /></a></div><br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhN7s22GPzCKc_iplbi4r3tHRpLBRwIEujEgV71d4fhUHomGttzG_ZlmihGi7_hglV2wqALQbK6WgTJHHsV8sxwlAhPuM2Hn5nJeqgIo6plp2ptUfWFrDok1jxz5dctTMseYmP1HstLW4eo/s1600/2.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="234" n4="true" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhN7s22GPzCKc_iplbi4r3tHRpLBRwIEujEgV71d4fhUHomGttzG_ZlmihGi7_hglV2wqALQbK6WgTJHHsV8sxwlAhPuM2Hn5nJeqgIo6plp2ptUfWFrDok1jxz5dctTMseYmP1HstLW4eo/s320/2.PNG" width="320" /></a></div><div align="left"><br />
</div><div align="left"></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="mso-no-proof: yes;"><span style="font-family: Calibri;">Running the Generate Reference Files tool hides the Silverlight / Access addin wiring. Thus, implementation code becomes less complicated.</span></span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="mso-no-proof: yes;"><span style="font-family: Calibri;">After running the tool and pasting the code into a .NET class file, a developer can write code similar to the following examples.</span></span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><b style="mso-bidi-font-weight: normal;"><span style="mso-no-proof: yes;"><span style="font-family: Calibri;">Ribbon Button to Open Form</span></span></b></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">public</span><span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: blue;">void</span> myDocumentTasksButton_Click(<span style="color: #2b91af;">IRibbonControl</span> control)</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;">{</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; text-indent: 0.5in;"><span style="color: green; font-family: Consolas; font-size: 9.5pt;">//Open Form with reference to Addin</span><span style="font-family: Consolas; font-size: 9.5pt;"></span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; text-indent: 0.5in;"><span style="color: #2b91af; font-family: Consolas; font-size: 9.5pt;">MyDocumentTasks</span><span style="font-family: Consolas; font-size: 9.5pt;">.Open(<span style="color: blue;">this</span>);</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 2;"> </span></span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 1;"> </span><span style="color: green;">//AddItemCommand</span></span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt 0.5in; mso-layout-grid-align: none;"><span style="color: #2b91af; font-family: Consolas; font-size: 9.5pt;">MyDocumentTasks</span><span style="font-family: Consolas; font-size: 9.5pt;">.AddItemCommand.Click += <span style="color: blue;">new</span> access.<span style="color: #2b91af;">DispCommandButtonEvents_ClickEventHandler</span>(AddItemCommand_Click);</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt 0.5in; mso-layout-grid-align: none;"><span style="color: #2b91af; font-family: Consolas; font-size: 9.5pt;">MyDocumentTasks</span><span style="font-family: Consolas; font-size: 9.5pt;">.AddItemCommand.OnClick = bindEvent;</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 2;"> </span></span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; text-indent: 0.5in;"><span style="color: green; font-family: Consolas; font-size: 9.5pt;">//RemoveItemCommand</span><span style="font-family: Consolas; font-size: 9.5pt;"></span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt 0.5in; mso-layout-grid-align: none;"><span style="color: #2b91af; font-family: Consolas; font-size: 9.5pt;">MyDocumentTasks</span><span style="font-family: Consolas; font-size: 9.5pt;">.RemoveItemCommand.Click += <span style="color: blue;">new</span> access.<span style="color: #2b91af;">DispCommandButtonEvents_ClickEventHandler</span>(RemoveItemCommand_Click);</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt 0.5in; mso-layout-grid-align: none;"><span style="color: #2b91af; font-family: Consolas; font-size: 9.5pt;">MyDocumentTasks</span><span style="font-family: Consolas; font-size: 9.5pt;">.RemoveItemCommand.OnClick = bindEvent;</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 2;"> </span></span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 1;"> </span><span style="color: green;">//TreeviewPage.onclick</span></span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt 0.5in; mso-layout-grid-align: none;"><span style="color: #2b91af; font-family: Consolas; font-size: 9.5pt;">MyDocumentTasks</span><span style="font-family: Consolas; font-size: 9.5pt;">.TreeviewPage.onclick += <span style="color: blue;">new</span> <span style="color: #2b91af;">EventHandler</span><<span style="color: #2b91af;">ElementEventArgs</span>>(TreeviewPage_onclick);</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-tab-count: 1;"> </span></span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt 0.5in; mso-layout-grid-align: none;"><span style="color: green; font-family: Consolas; font-size: 9.5pt;">//TreeviewPage.ondataavailable</span><span style="font-family: Consolas; font-size: 9.5pt;"></span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt 0.5in; mso-layout-grid-align: none;"><span style="color: #2b91af; font-family: Consolas; font-size: 9.5pt;">MyDocumentTasks</span><span style="font-family: Consolas; font-size: 9.5pt;">.TreeviewPage.ondataavailable += <span style="color: blue;">new</span> <span style="color: #2b91af;">EventHandler</span><<span style="color: #2b91af;">AsyncEventArgs</span>>(TreeviewPage_ondataavailable);</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;">}</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><br />
</div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><b style="mso-bidi-font-weight: normal;"><span style="mso-no-proof: yes;"><span style="font-family: Calibri;">Add Item Click Delegate</span></span></b></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">void</span><span style="font-family: Consolas; font-size: 9.5pt;"> AddItemCommand_Click()</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;">{</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; text-indent: 0.5in;"><span style="color: #2b91af; font-family: Consolas; font-size: 9.5pt;">MyDocumentTasks</span><span style="font-family: Consolas; font-size: 9.5pt;">.TreeviewPage.AddItem(<span style="color: #2b91af;">MyDocumentTasks</span>.ItemText.Value);</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;">}</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><b style="mso-bidi-font-weight: normal;"><span style="mso-no-proof: yes;"><span style="font-family: Calibri;">Remove Item Click Delegate</span></span></b></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">void</span><span style="font-family: Consolas; font-size: 9.5pt;"> RemoveItemCommand_Click()</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;">{</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; text-indent: 0.5in;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: #2b91af;">MyDocumentTasks</span>.TreeviewPage.RemoveItem();</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;">}</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><b style="mso-bidi-font-weight: normal;"><span style="mso-no-proof: yes;"><span style="font-family: Calibri;">Silverlight TreeviewPage onclick Delegate</span></span></b></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">void</span><span style="font-family: Consolas; font-size: 9.5pt;"> TreeviewPage_onclick(<span style="color: blue;">object</span> sender, <span style="color: #2b91af;">ElementEventArgs</span> e)</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;">{</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none; text-indent: 0.5in;"><span style="color: #2b91af; font-family: Consolas; font-size: 9.5pt;">MyDocumentTasks</span><span style="font-family: Consolas; font-size: 9.5pt;">.TabControl.Value = e.Tag;</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;">}</span><b><span style="color: #365f91; font-family: "Cambria", "serif"; font-size: 14pt; mso-ascii-theme-font: major-latin; mso-bidi-font-family: "Times New Roman"; mso-bidi-theme-font: major-bidi; mso-fareast-font-family: "Times New Roman"; mso-fareast-theme-font: major-fareast; mso-hansi-theme-font: major-latin; mso-no-proof: yes; mso-themecolor: accent1; mso-themeshade: 191;"></span></b></div><div align="left"><span style="font-family: "Calibri", "sans-serif"; font-size: 11pt; line-height: 115%; mso-ansi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: "Times New Roman"; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-no-proof: yes;"><br clear="all" style="mso-special-character: line-break; page-break-before: always;" /></span><span style="mso-no-proof: yes;"><span style="font-size: large;"><span style="color: #365f91;"><span style="font-family: Cambria;">Enhanced Treeview Methods</span></span></span></span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="mso-no-proof: yes;"><span style="font-family: Calibri;">We enhanced the AddItem() method. The method adds a child TreeViewItem to any selected item. We also added an AddRootItem() and RemoveItem method.</span></span></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTpFx7ftLrUZOMfoNdr9-WdhBG1UqzH_YrYkyQm0GMd5GdcgfMmA7Yil-Q6yQt2coZaoKSbTJNHnDnVFMC-mWJWktMT5N5UDmWPEhDXjWA49MBd9ahhQdixfPtHPGhbzPyb7JCn11CfTgj/s1600/3.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="219" n4="true" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTpFx7ftLrUZOMfoNdr9-WdhBG1UqzH_YrYkyQm0GMd5GdcgfMmA7Yil-Q6yQt2coZaoKSbTJNHnDnVFMC-mWJWktMT5N5UDmWPEhDXjWA49MBd9ahhQdixfPtHPGhbzPyb7JCn11CfTgj/s320/3.PNG" width="320" /></a></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><br />
</div>dvanahttp://www.blogger.com/profile/07584985948993945278noreply@blogger.com0tag:blogger.com,1999:blog-5503186409694701719.post-50862616586077860862010-11-16T12:07:00.000-08:002010-11-16T12:07:29.246-08:00Using Silverlight with Access<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 15pt;"><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;">By Derrick VanArnam, Software Developer and Russell Fox, Database Administrator</span></span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;">This post will show how to integrate Silverlight into an Access database, providing interoperability between Access and a Silverlight Treeview control. The methods outlined below will allow you to use Silverlight's impressive set of controls, including the Treeview, DataGrid, Video, and charts, in your Microsoft Office applications. </span></span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;">Incorporating Silverlight into your existing Access application can breathe new life into an aging system. Also, Silverlight is designed for the web with WCF service support deeply backed into the platform, giving you the ability to blend Silverlight and the Cloud into an Access database. The Silverlight <b style="mso-bidi-font-weight: normal;">HTML Bridge</b> feature makes this possible. On the Access side, we have the Web Browser Control (WBC), native to Access 2010. Silverlight integration into Access is made possible by placing an Access WBC onto a Form and loading an HTML page containing a Silverlight control. </span></span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;">This integration is based on the Observer design pattern wherein an Access Web Browser Control and Silverlight are event publishers and event listeners.<span style="mso-spacerun: yes;"> </span>In addition, Silverlight supports creating scriptable methods that can be called from the WBC. </span></span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;">This blog post will show how to use Silverlight in Access. However, the concepts presented apply to any client application that supports the WBC.</span></span></div><div class="MsoNormal" style="margin: 24pt 0in 0pt; mso-pagination: widow-orphan lines-together; page-break-after: avoid;"><b style="mso-bidi-font-weight: normal;"><span style="color: #365f91; font-family: "Cambria", "serif"; font-size: 14pt; line-height: 115%; mso-bidi-font-family: Cambria; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: Cambria;">Sample Project</span></b></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;">To show the concept, we have a project at </span></span><a href="http://desktopweb.codeplex.com/"><span style="color: blue; mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;">http://DesktopWeb.CodePlex.com</span></span></a><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;">.</span></span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;">The scenario adds a Silverlight web browser page to a form within the Access Project Management sample database. The database has local tables; however, the tables could be linked to a MyDocuments SharePoint list. Clicking a Document Tasks ribbon button opens a My Document Tasks form hosting the Web Browser Control that has a Silverlight Treeview control. </span></span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;">Clicking a document task category fires an onclick event. Access handles the click event by changing a Tab Page. </span></span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;">Clicking an Access button calls the Silverlight Treeview.AddItem() method that adds a Treeview item.</span></span></div><div class="MsoNormal" style="margin: 10pt 0in 0pt; mso-pagination: widow-orphan lines-together; page-break-after: avoid;"><b style="mso-bidi-font-weight: normal;"><span style="color: #4f81bd; font-family: "Cambria", "serif"; font-size: 13pt; line-height: 115%; mso-bidi-font-family: Cambria; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: Cambria;">To Setup the sample database</span></b></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;">To install the sample database:</span></span></div><div class="MsoNormal" style="margin: 0in 0in 10pt 0.5in; mso-list: l0 level1 lfo1; text-indent: -0.25in;"><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">•</span><span style="font-family: "Times New Roman";"> </span></span></span><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;">Go to </span></span><a href="http://desktopweb.codeplex.com/releases/view/54874"><span style="color: blue; mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;">http://desktopweb.codeplex.com/releases/view/54874#DownloadId=162278</span></span></a><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;">.</span></span></div><div class="MsoNormal" style="margin: 0in 0in 10pt 0.5in; mso-list: l0 level1 lfo1; text-indent: -0.25in;"><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">•</span><span style="font-family: "Times New Roman";"> </span></span></span><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;">Click the <b style="mso-bidi-font-weight: normal;">I Agree</b> button on the <b style="mso-bidi-font-weight: normal;">To download …</b> popup.</span></span></div><div class="MsoNormal" style="margin: 0in 0in 10pt 0.5in; mso-list: l0 level1 lfo1; text-indent: -0.25in;"><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">•</span><span style="font-family: "Times New Roman";"> </span></span></span><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;">Run the MyDataAddinsetup.msi file.</span></span></div><div class="MsoNormal" style="margin: 0in 0in 10pt 0.5in; mso-list: l0 level2 lfo1; text-indent: -0.25in;"><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="mso-list: Ignore;"><span style="font-family: "Times New Roman";"> </span></span></span><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;">Note: You can save then run the msi. In addition, source code is available on desktopweb.codeplex.com.</span></span></div><div class="MsoNormal" style="margin: 0in 0in 10pt 0.5in; mso-list: l0 level1 lfo1; text-indent: -0.25in;"><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">•</span><span style="font-family: "Times New Roman";"> </span></span></span><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;">Follow the setup steps.</span></span></div><div class="MsoNormal" style="margin: 0in 0in 10pt 0.5in;"><b style="mso-bidi-font-weight: normal;"><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;">Note</span></span></b></div><div class="MsoNormal" style="margin: 0in 0in 10pt 0.5in;"><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;">The addin solution was created on Windows 7 64 Bit; therefore, the setup location will be at C:\Program Files (x86)\desktopWeb\MyDataAddinSetup.</span></span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;"><span style="mso-tab-count: 1;"> </span>Change the Web Browser Control ControlSource to the following on Windows 32 Bit:</span></span></div><div class="MsoNormal" style="margin: 0in 0in 10pt 0.5in;"><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;"><span style="mso-spacerun: yes;"> </span>="C:\Program Files\desktopWeb\MyDataAddinSetup\DocumentPanelPage_Modified.html"</span></span></div><div class="MsoNormal" style="margin: 10pt 0in 0pt; mso-pagination: widow-orphan lines-together; page-break-after: avoid;"><b style="mso-bidi-font-weight: normal;"><span style="color: #4f81bd; font-family: "Cambria", "serif"; font-size: 13pt; line-height: 115%; mso-bidi-font-family: Cambria; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: Cambria;">To view the Access sample database</span></b></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;">Open the sample database at</span></span></div><div class="MsoNormal" style="margin: 0in 0in 10pt; text-indent: 0.5in;"><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;">C:\Program Files (x86)\desktopWeb\MyDataAddinSetup\Project Management.accdb</span></span></div><div class="MsoNormal" style="margin: 10pt 0in 0pt; mso-pagination: widow-orphan lines-together; page-break-after: avoid;"><b style="mso-bidi-font-weight: normal;"><span style="color: #4f81bd; font-family: "Cambria", "serif"; font-size: 13pt; line-height: 115%; mso-bidi-font-family: Cambria; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: Cambria;">Project Management Sample</span></b></div><div class="MsoNormal" style="margin: 10pt 0in 0pt; mso-pagination: widow-orphan lines-together; page-break-after: avoid;"><b style="mso-bidi-font-weight: normal;"><span style="color: #4f81bd; font-family: "Cambria", "serif"; mso-bidi-font-family: Cambria; mso-fareast-font-family: Cambria;">Sample Ribbon</span></b></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;">After opening the sample database:</span></span></div><div class="MsoNormal" style="margin: 0in 0in 10pt 0.5in; mso-list: l2 level1 lfo2; text-indent: -0.25in;"><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">•</span><span style="font-family: "Times New Roman";"> </span></span></span><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;">Click the MyDocuments ribbon tab</span></span></div><div class="MsoNormal" style="margin: 0in 0in 10pt 0.5in; mso-list: l2 level1 lfo2; text-indent: -0.25in;"><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">•</span><span style="font-family: "Times New Roman";"> </span></span></span><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;">Click the Document Tasks ribbon button to open the sample My Documents Tasks form</span></span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="mso-no-proof: yes;"><shapetype coordsize="21600,21600" filled="f" id="_x0000_t75" o:preferrelative="t" o:spt="75" path="m@4@5l@4@11@9@11@9@5xe" stroked="f"><stroke joinstyle="miter"></stroke><formulas><f eqn="if lineDrawn pixelLineWidth 0"></f><f eqn="sum @0 1 0"></f><f eqn="sum 0 0 @1"></f><f eqn="prod @2 1 2"></f><f eqn="prod @3 21600 pixelWidth"></f><f eqn="prod @3 21600 pixelHeight"></f><f eqn="sum @0 0 1"></f><f eqn="prod @6 1 2"></f><f eqn="prod @7 21600 pixelWidth"></f><f eqn="sum @8 21600 0"></f><f eqn="prod @7 21600 pixelHeight"></f><f eqn="sum @10 21600 0"></f></formulas><path gradientshapeok="t" o:connecttype="rect" o:extrusionok="f"></path><lock aspectratio="t" v:ext="edit"></lock></shapetype></span><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"></span></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVQz6-ScTfAjZV3Pys8fAf_jF9WcdqI7IwCO2WfCV9BKXBm3NppXUNMX7in5wc4JmdrlvL6-S0p79UZZiefIGxABc2apkT3VTccofrAQatKqE3xg0qtKzHQyhNAbXMu2D5HztT5Qz5GLYi/s1600/Fig1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="93" px="true" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVQz6-ScTfAjZV3Pys8fAf_jF9WcdqI7IwCO2WfCV9BKXBm3NppXUNMX7in5wc4JmdrlvL6-S0p79UZZiefIGxABc2apkT3VTccofrAQatKqE3xg0qtKzHQyhNAbXMu2D5HztT5Qz5GLYi/s320/Fig1.png" width="320" /></a></div><div class="MsoNormal" style="margin: 10pt 0in 0pt; mso-pagination: widow-orphan lines-together; page-break-after: avoid;"><br />
</div><div class="MsoNormal" style="margin: 10pt 0in 0pt; mso-pagination: widow-orphan lines-together; page-break-after: avoid;"><b style="mso-bidi-font-weight: normal;"><span style="color: #4f81bd; font-family: "Cambria", "serif"; mso-bidi-font-family: Cambria; mso-fareast-font-family: Cambria;">To use the sample My Documents Tasks form</span></b></div><div class="MsoNormal" style="margin: 0in 0in 10pt 0.5in; mso-list: l1 level1 lfo3; text-indent: -0.25in;"><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">•</span><span style="font-family: "Times New Roman";"> </span></span></span><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;">Click My Tasks, Blog or Links within the Silverlight Treeview to navigate to the corresponding Tab Page</span></span></div><div class="MsoNormal" style="margin: 0in 0in 10pt 0.5in; mso-list: l4 level1 lfo4; text-indent: -0.25in;"><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">•</span><span style="font-family: "Times New Roman";"> </span></span></span><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;">Click the <b style="mso-bidi-font-weight: normal;">Add</b> button to add a <b style="mso-bidi-font-weight: normal;">Treeview Item</b> to the Silverlight Treeview</span></span></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitII3ry2HWnNZ4H4j7ucgB4ArM6sCYw_hRNzy7WbqVu19DkfGtCXCJd8FNdhyr-x4iqUtL0ywyOcZV6CQFbb47bHNf1R2kUbR7jmZ0HSkq5CzoRhhrK8kkASRscGsnesd3Wu40tAjw2WLq/s1600/Fig2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="222" px="true" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitII3ry2HWnNZ4H4j7ucgB4ArM6sCYw_hRNzy7WbqVu19DkfGtCXCJd8FNdhyr-x4iqUtL0ywyOcZV6CQFbb47bHNf1R2kUbR7jmZ0HSkq5CzoRhhrK8kkASRscGsnesd3Wu40tAjw2WLq/s320/Fig2.png" width="320" /></a></div><div class="MsoNormal" style="margin: 0in 0in 10pt 0.5in; mso-list: l4 level1 lfo4; text-indent: -0.25in;"><br />
</div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="mso-no-proof: yes;"></span><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"></span></div><div class="MsoNormal" style="margin: 10pt 0in 0pt; mso-pagination: widow-orphan lines-together; page-break-after: avoid;"><b style="mso-bidi-font-weight: normal;"><span style="color: #4f81bd; font-family: "Cambria", "serif"; font-size: 13pt; line-height: 115%; mso-bidi-font-family: Cambria; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: Cambria;">Access Command Button calling a Silverlight method</span></b></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;">The Access Web Browser can get an HTML element and call a Silverlight script method. Conversely, Access can handle a Silverlight originated event by creating an event delegate on any of the DOMDocument events. For example, you can create an HTMLDocument.onclick event delegate to handle a document click.</span></span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;">Use the <b style="mso-bidi-font-weight: normal;">execScript</b> method on the HTMLDocument window object to call a Silverlight method from the Access Web Browser Control. For example, this code<span style="mso-spacerun: yes;"> </span>calls the AddItem method: </span></span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;"><span style="mso-tab-count: 1;"> </span>"silverlightControl.Content.silverlightScriptableClass.AddItem('New Item');”</span></span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;"><span style="mso-spacerun: yes;"> </span>The following code snippet shows how this is done. Silverlight methods are asynchronous; therefore, the <b style="mso-bidi-font-weight: normal;">AddItem</b> method fires an <b style="mso-bidi-font-weight: normal;">ondataavailable </b>event when the method completes. The sample database immediately fires the event. This blog is for concept demonstration purposes only. A full treatment of asynchronous WCF calls is beyond the scope of this post.</span></span></div><h3 style="margin: 10pt 0in 0pt;"><span style="mso-fareast-font-family: Cambria;"><span style="font-size: small;"><span style="color: #4f81bd;"><span style="font-family: Cambria;">Access Addin</span></span></span></span></h3><div class="MsoNormal" style="margin: 10pt 0in 0pt; mso-pagination: widow-orphan lines-together; page-break-after: avoid;"><b style="mso-bidi-font-weight: normal;"><span style="font-family: Consolas; font-size: 9.5pt; line-height: 115%;">Access CommandButton calling a Silverlight method and Silverlight ondataavailable event</span></b><b style="mso-bidi-font-weight: normal;"><span style="color: #4f81bd; font-family: "Cambria", "serif"; mso-bidi-font-family: Cambria; mso-fareast-font-family: Cambria;"></span></b></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><br />
</div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-layout-grid-align: none;"><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">void</span><span style="font-family: Consolas; font-size: 9.5pt;"> newCommand_Click()</span></div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;">{</span></div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-layout-grid-align: none; text-indent: 0.5in;"><span style="color: #2b91af; font-family: Consolas; font-size: 9.5pt;">MyDocumentTasks</span><span style="font-family: Consolas; font-size: 9.5pt;">.TreeView.AddItem(<span style="color: #2b91af;">MyDocumentTasks</span>.ItemText.Value);</span></div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;">}</span></div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-layout-grid-align: none;"><br />
</div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-layout-grid-align: none;"><span style="color: green; font-family: Consolas; font-size: 9.5pt;">//Silverlight Event Subscriber Delegate</span><span style="font-family: Consolas; font-size: 9.5pt;"></span></div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-layout-grid-align: none;"><span style="color: green; font-family: Consolas; font-size: 9.5pt;">//Maps to HtmlDocumentEvent_ondataavailable</span><span style="font-family: Consolas; font-size: 9.5pt;"></span></div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-layout-grid-align: none;"><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">void</span><span style="font-family: Consolas; font-size: 9.5pt;"> TreeView_ondataavailable(<span style="color: blue;">object</span> sender, <span style="color: #2b91af;">AsyncEventArgs</span> e)</span></div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;">{</span></div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-layout-grid-align: none; text-indent: 0.5in;"><span style="color: #2b91af; font-family: Consolas; font-size: 9.5pt;">MessageBox</span><span style="font-family: Consolas; font-size: 9.5pt;">.Show(<span style="color: #a31515;">"TreeView_ondataavailable Event: "</span> + e.Value, <span style="color: #a31515;">"Silverlight </span></span></div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-layout-grid-align: none; text-indent: 0.5in;"><span style="color: #2b91af; font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span></span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">Sample"</span><span style="font-family: Consolas; font-size: 9.5pt;">);</span></div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;">}</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><b style="mso-bidi-font-weight: normal;"><span style="font-family: Consolas; font-size: 9.5pt;">Treeview AddItem Silverlight Script</span></b><span style="font-family: Consolas; font-size: 9.5pt;"></span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><br />
</div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-layout-grid-align: none;"><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">public</span><span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: blue;">class</span> <span style="color: #2b91af;">Treeview </span>…<span style="color: #2b91af;"> </span>{</span></div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-layout-grid-align: none;"><br />
</div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-layout-grid-align: none;"><span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>public</span><span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: blue;">void</span> AddItem(<span style="color: blue;">string</span> value)</span></div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>{</span></div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-layout-grid-align: none;"><br />
</div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-layout-grid-align: none; text-indent: 0.5in;"><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">string</span><span style="font-family: Consolas; font-size: 9.5pt;"> script = </span></div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-layout-grid-align: none; text-indent: 0.5in;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: #a31515;">"silverlightControl.Content.silverlightScriptableClass</span></span></div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-layout-grid-align: none; text-indent: 0.5in;"><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>.AddItem('"</span><span style="font-family: Consolas; font-size: 9.5pt;"> + value + <span style="color: #a31515;">"');"</span>;</span></div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 1;"> </span></span></div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-layout-grid-align: none; text-indent: 0.5in;"><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">this</span><span style="font-family: Consolas; font-size: 9.5pt;">.HtmlDocument.parentWindow.execScript(script);</span></div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>}</span></div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span></span></div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-layout-grid-align: none;"><span style="color: green; font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>//Silverlight "silverlightControlHost.fireEvent('ondataavailable')"</span><span style="font-family: Consolas; font-size: 9.5pt;"></span></div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">void</span> HtmlDocumentEvent_ondataavailable(mshtml.<span style="color: #2b91af;">IHTMLEventObj</span> pEvtObj)</span></div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>{</span></div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-tab-count: 1;"></span><span style="color: blue;">if</span> (<span style="color: blue;">this</span>.ondataavailable != <span style="color: blue;">null</span>)</span></div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-tab-count: 1;"></span>{</span></div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-layout-grid-align: none; text-indent: 0.5in;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">this</span>.ondataavailable(<span style="color: blue;">this</span>, <span style="color: blue;">new</span> </span></div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-layout-grid-align: none; text-indent: 0.5in;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: #2b91af;">AsyncEventArgs</span>(pEvtObj.srcElement.getAttribute(<span style="color: #a31515;">"value"</span>)));</span></div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>}</span></div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>}</span></div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;">}</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><br />
</div><h3 style="margin: 10pt 0in 0pt;"><span style="mso-fareast-font-family: Cambria;"><span style="font-size: small;"><span style="color: #4f81bd;"><span style="font-family: Cambria;">Silverlight</span></span></span></span></h3><div class="MsoNormal" style="margin: 10pt 0in 0pt; mso-pagination: widow-orphan lines-together; page-break-after: avoid;"><b style="mso-bidi-font-weight: normal;"><span style="font-family: Consolas; font-size: 9.5pt; line-height: 115%;">Silverlight Treeview AddItem method with ondataavailable event</span></b></div><div class="MsoNormal" style="background: #f2f2f2; margin: 10pt 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-pagination: widow-orphan lines-together; page-break-after: avoid;"><span style="font-family: Consolas; font-size: 9.5pt; line-height: 115%; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: Consolas;">[<span style="color: #2b91af;">ScriptableMember</span>]</span><b style="mso-bidi-font-weight: normal;"><span style="font-family: Consolas; font-size: 9.5pt; line-height: 115%;"></span></b></div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242;"><span style="color: blue; font-family: Consolas; font-size: 9.5pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: Consolas;">public</span><span style="font-family: Consolas; font-size: 9.5pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: Consolas;"> <span style="color: blue;">void</span> AddItem(<span style="color: blue;">string</span> text)</span></div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242;"><span style="font-family: Consolas; font-size: 9.5pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: Consolas;">{<span style="mso-spacerun: yes;"> </span></span></div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; text-indent: 0.5in;"><span style="color: green; font-family: Consolas; font-size: 9.5pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: Consolas;">//Call method</span><span style="font-family: Consolas; font-size: 9.5pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: Consolas;"></span></div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; text-indent: 0.5in;"><span style="font-family: Consolas; font-size: 9.5pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: Consolas;">treeView.Items.Add(text);</span></div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242;"><br />
</div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; text-indent: 0.5in;"><span style="color: green; font-family: Consolas; font-size: 9.5pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: Consolas;">//Set EventPublisher Value</span><span style="font-family: Consolas; font-size: 9.5pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: Consolas;"></span></div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242;"><span style="font-family: Consolas; font-size: 9.5pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: Consolas;"><span style="mso-spacerun: yes;"> </span><span style="mso-tab-count: 1;"> </span>System.Windows.Browser.<span style="color: #2b91af;">HtmlPage</span>.Document.GetElementById(<span style="color: #a31515;">"silverlightControlHost"</span>)</span></div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242;"><span style="font-family: Consolas; font-size: 9.5pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: Consolas;"><span style="mso-spacerun: yes;"> </span>.SetAttribute(<span style="color: #a31515;">"value"</span>, <span style="color: #a31515;">"value added by Silverlight method"</span>);</span></div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242;"><br />
</div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; text-indent: 0.5in;"><span style="color: green; font-family: Consolas; font-size: 9.5pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: Consolas;">//Fire ondataavailable event</span><span style="font-family: Consolas; font-size: 9.5pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: Consolas;"></span></div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; text-indent: 0.5in;"><span style="color: #2b91af; font-family: Consolas; font-size: 9.5pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: Consolas;">HtmlPage</span><span style="font-family: Consolas; font-size: 9.5pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: Consolas;">.Window.Eval(<span style="color: #a31515;">"silverlightControlHost.fireEvent('ondataavailable')"</span>);</span></div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242;"><span style="font-family: Consolas; font-size: 9.5pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: Consolas;">}</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;"></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;"><b style="mso-bidi-font-weight: normal;"><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;">Diagram 1 – Access Web Browser Control calling Treeview.AddItem</span></span></b></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;"><br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUAMU3ePWdqbB2tt0yuT7h3NXvTo_NyBeJShOLvitiNNaXxeGPZNKmaDbJZ-Zo4YyGuWLOxak4q5uH3NNX0YzFcEaMH6ZSbUAPeaCa_PObdhnlteIDS5t8c8iyp9srobhg2XUmiAP-wmOu/s1600/Fig3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="201" px="true" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUAMU3ePWdqbB2tt0yuT7h3NXvTo_NyBeJShOLvitiNNaXxeGPZNKmaDbJZ-Zo4YyGuWLOxak4q5uH3NNX0YzFcEaMH6ZSbUAPeaCa_PObdhnlteIDS5t8c8iyp9srobhg2XUmiAP-wmOu/s320/Fig3.png" width="320" /></a></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><br />
</div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;">Silverlight can fire events that the Access WBC can handle. A Silverlight User Control can get an HTML element and fire a DOM event, such as onclick, that a WBC element click delegate handles. Silverlight is the Event Publisher or Subject and the Access WBC is the Event Listener or Observer. <b style="mso-bidi-font-weight: normal;">Diagram 2</b> illustrates the concept:</span></span></div><div class="MsoNormal" style="margin: 0in 0in 10pt 0.5in; mso-list: l5 level1 lfo5; text-indent: -0.25in;"><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">•</span><span style="font-family: "Times New Roman";"> </span></span></span><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;">Get the silverlightControlHost element using Silverlight HTML Bridge.</span></span></div><div class="MsoNormal" style="margin: 0in 0in 10pt 0.5in; mso-list: l5 level1 lfo5; text-indent: -0.25in;"><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">•</span><span style="font-family: "Times New Roman";"> </span></span></span><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;">Set an event attribute allowing the observer to get data from the DOM .</span></span></div><div class="MsoNormal" style="margin: 0in 0in 10pt 0.5in; mso-list: l5 level1 lfo5; text-indent: -0.25in;"><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">•</span><span style="font-family: "Times New Roman";"> </span></span></span><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;">Call HTMLWindow.Eval() to fire silverlightControlHost element onclick event.</span></span></div><div class="MsoNormal" style="margin: 0in 0in 10pt 0.5in; mso-list: l5 level1 lfo5; text-indent: -0.25in;"><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">•</span><span style="font-family: "Times New Roman";"> </span></span></span><span style="font-family: Calibri;"><span style="color: black; mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;">An EventHandler defined from the Access </span><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;">WBC <span style="color: black;">handles the silverlightControlHost onclick event.</span></span></span></div><div class="MsoNormal" style="margin: 0in 0in 10pt 0.25in;"><b style="mso-bidi-font-weight: normal;"><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;">Note</span></span></b></div><div class="MsoNormal" style="margin: 0in 0in 10pt 0.25in;"><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;">Any DOM event can be fired from Silverlight and handled by the WBC DOM element object. </span></span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><b style="mso-bidi-font-weight: normal;"><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;">Diagram 2 – Silverlight Event Publisher, Access Web Browser Control Event Listener</span></span></b></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhX-AbEcSXnzjokPIc8x3Rgi9yjzwGkMnh26-EQRg8pZfrMlx4amnTCI2CINBTgz9MEh18TSux9twcE_xCdYLLvY00mfLC_fiKVyOZ3ns6iQ5BdTomgIAf0ee-3XI7W73JYW5PyFWc3_Mj/s1600/Fig4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="194" px="true" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhX-AbEcSXnzjokPIc8x3Rgi9yjzwGkMnh26-EQRg8pZfrMlx4amnTCI2CINBTgz9MEh18TSux9twcE_xCdYLLvY00mfLC_fiKVyOZ3ns6iQ5BdTomgIAf0ee-3XI7W73JYW5PyFWc3_Mj/s320/Fig4.png" width="320" /></a></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;"><br />
</div><div class="MsoNormal" style="margin: 10pt 0in 0pt; mso-pagination: widow-orphan lines-together; page-break-after: avoid;"><b style="mso-bidi-font-weight: normal;"><span style="color: #4f81bd; font-family: "Cambria", "serif"; font-size: 13pt; line-height: 115%; mso-bidi-font-family: Cambria; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: Cambria;">Silverlight Event Subscriber Delegate</span></b></div><div class="MsoNormal" style="margin: 10pt 0in 0pt; mso-pagination: widow-orphan lines-together; page-break-after: avoid;"><b style="mso-bidi-font-weight: normal;"><span style="color: #4f81bd; font-family: "Cambria", "serif"; mso-bidi-font-family: Cambria; mso-fareast-font-family: Cambria;">Access Web Browser Control</span></b></div><div class="MsoNormal" style="margin: 10pt 0in 0pt; mso-pagination: widow-orphan lines-together; page-break-after: avoid;"><b style="mso-bidi-font-weight: normal;"><span style="font-family: Consolas; font-size: 9.5pt; line-height: 115%;">Treeview Click Delegate (Silverlight Event Subscriber Delegate)</span></b></div><div class="MsoNormal" style="background: #f2f2f2; margin: 10pt 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-pagination: widow-orphan lines-together; page-break-after: avoid;"><span style="color: green; font-family: Consolas; font-size: 9.5pt; line-height: 115%;">//Silverlight Treeview Event</span><b style="mso-bidi-font-weight: normal;"><span style="font-family: Consolas; font-size: 9.5pt; line-height: 115%;"></span></b></div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-layout-grid-align: none;"><span style="color: green; font-family: Consolas; font-size: 9.5pt;">//Maps to HtmlDocumentEvent_onclick</span><span style="font-family: Consolas; font-size: 9.5pt;"></span></div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-layout-grid-align: none;"><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">void</span><span style="font-family: Consolas; font-size: 9.5pt;"> TreeView_onclick(<span style="color: blue;">object</span> sender, <span style="color: #2b91af;">TreeviewItemEventArgs</span> e)</span></div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;">{</span></div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-layout-grid-align: none; text-indent: 0.5in;"><span style="color: #2b91af; font-family: Consolas; font-size: 9.5pt;">MyDocumentTasks</span><span style="font-family: Consolas; font-size: 9.5pt;">.TabControl.Value = e.Tag;</span></div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;">}</span></div><div class="MsoNormal" style="margin: 10pt 0in 0pt; mso-pagination: widow-orphan lines-together; page-break-after: avoid;"><b style="mso-bidi-font-weight: normal;"><span style="font-family: Consolas; font-size: 9.5pt; line-height: 115%;">Treeview DocumentEvent_onclick delegate</span></b></div><div class="MsoNormal" style="background: #f2f2f2; margin: 10pt 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-pagination: widow-orphan lines-together; page-break-after: avoid;"><span style="color: green; font-family: Consolas; font-size: 9.5pt; line-height: 115%;">//Silverlight delegate from "silverlightControlHost.fireEvent('onclick')"</span><b style="mso-bidi-font-weight: normal;"><span style="font-family: Consolas; font-size: 9.5pt; line-height: 115%;"></span></b></div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-layout-grid-align: none;"><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">bool</span><span style="font-family: Consolas; font-size: 9.5pt;"> HtmlDocumentEvent_onclick(mshtml.<span style="color: #2b91af;">IHTMLEventObj</span> pEvtObj)</span></div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;">{</span></div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-layout-grid-align: none; text-indent: 0.5in;"><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">if</span><span style="font-family: Consolas; font-size: 9.5pt;"> (<span style="color: blue;">this</span>.onclick != <span style="color: blue;">null</span>)</span></div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-layout-grid-align: none; text-indent: 0.5in;"><span style="font-family: Consolas; font-size: 9.5pt;">{</span></div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-layout-grid-align: none; text-indent: 0.5in;"><span style="color: green; font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>//Fire Event</span><span style="font-family: Consolas; font-size: 9.5pt;"></span></div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-layout-grid-align: none;"><span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-tab-count: 1;"> </span>this</span><span style="font-family: Consolas; font-size: 9.5pt;">.onclick(<span style="color: blue;">this</span>, <span style="color: blue;">new</span> <span style="mso-spacerun: yes;"> </span></span></div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-layout-grid-align: none; text-indent: 0.5in;"><span style="color: #2b91af; font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>TreeviewItemEventArgs</span><span style="font-family: Consolas; font-size: 9.5pt;">(pEvtObj.srcElement.getAttribute(<span style="color: #a31515;">"header"</span>),</span></div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-tab-count: 1;"> </span><span style="mso-spacerun: yes;"> </span><span style="mso-spacerun: yes;"> </span>pEvtObj.srcElement.getAttribute(<span style="color: #a31515;">"tag"</span>)));</span></div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>}</span></div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-layout-grid-align: none;"><br />
</div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">return</span> <span style="color: blue;">false</span>;</span></div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;">}</span></div><div class="MsoNormal" style="margin: 10pt 0in 0pt; mso-pagination: widow-orphan lines-together; page-break-after: avoid;"><br />
</div><div class="MsoNormal" style="margin: 10pt 0in 0pt; mso-pagination: widow-orphan lines-together; page-break-after: avoid;"><b style="mso-bidi-font-weight: normal;"><span style="color: #4f81bd; font-family: "Cambria", "serif"; mso-bidi-font-family: Cambria; mso-fareast-font-family: Cambria;">Silverlight </span></b></div><div class="MsoNormal" style="margin: 10pt 0in 0pt; mso-pagination: widow-orphan lines-together; page-break-after: avoid;"><b style="mso-bidi-font-weight: normal;"><span style="font-family: Consolas; font-size: 9.5pt; line-height: 115%;">Silverlight onclick event</span></b></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;"><br />
</div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242;"><span style="color: blue; font-family: Consolas; font-size: 9.5pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: Consolas;">private</span><span style="font-family: Consolas; font-size: 9.5pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: Consolas;"> <span style="color: blue;">void</span> treeView1_SelectedItemChanged(<span style="color: blue;">object</span> sender,<span style="mso-spacerun: yes;"> </span></span></div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242;"><span style="font-family: Consolas; font-size: 9.5pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: Consolas;"><span style="mso-spacerun: yes;"> </span><span style="color: #2b91af;">RoutedPropertyChangedEventArgs</span><<span style="color: blue;">object</span>> e)</span></div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242;"><span style="font-family: Consolas; font-size: 9.5pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: Consolas;">{</span></div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; text-indent: 0.5in;"><span style="color: #2b91af; font-family: Consolas; font-size: 9.5pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: Consolas;">TreeViewItem</span><span style="font-family: Consolas; font-size: 9.5pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: Consolas;"> item = (<span style="color: #2b91af;">TreeViewItem</span>)e.NewValue;</span></div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242;"><span style="font-family: Consolas; font-size: 9.5pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: Consolas;"><span style="mso-tab-count: 1;"> </span></span></div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242;"><span style="font-family: Consolas; font-size: 9.5pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: Consolas;"><span style="mso-tab-count: 1;"> </span><span style="color: green;">//Set HTML Document Attribute</span></span></div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; text-indent: 0.5in;"><span style="font-family: Consolas; font-size: 9.5pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: Consolas;">System.Windows.Browser.<span style="color: #2b91af;">HtmlPage</span>.Document</span></div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; text-indent: 0.5in;"><span style="font-family: Consolas; font-size: 9.5pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: Consolas;"><span style="mso-spacerun: yes;"> </span>.GetElementById(<span style="color: #a31515;">"silverlightControlHost"</span>)</span></div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242;"><span style="font-family: Consolas; font-size: 9.5pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: Consolas;"><span style="mso-spacerun: yes;"> </span>.SetAttribute(<span style="color: #a31515;">"header"</span>, item.Header.ToString());</span></div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242;"><span style="font-family: Consolas; font-size: 9.5pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: Consolas;"><span style="mso-tab-count: 1;"> </span></span></div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242;"><span style="font-family: Consolas; font-size: 9.5pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: Consolas;"><span style="mso-tab-count: 1;"> </span><span style="color: green;">//Fire DHTML onclick event</span></span></div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; text-indent: 0.5in;"><span style="font-family: Consolas; font-size: 9.5pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: Consolas;">System.Windows.Browser.<span style="color: #2b91af;">HtmlPage</span>.Window</span></div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242; text-indent: 0.5in;"><span style="font-family: Consolas; font-size: 9.5pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: Consolas;"><span style="mso-spacerun: yes;"> </span>.Eval(<span style="color: #a31515;">"silverlightControlHost.fireEvent('onclick')"</span>);</span></div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242;"><span style="font-family: Consolas; font-size: 9.5pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: Consolas;"><span style="mso-spacerun: yes;"> </span><span style="mso-tab-count: 1;"> </span></span></div><div class="MsoNormal" style="background: #f2f2f2; line-height: normal; margin: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242;"><span style="font-family: Consolas; font-size: 9.5pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: Consolas;">}</span><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"></span></div><h1 style="margin: 24pt 0in 0pt;"><span style="mso-fareast-font-family: Cambria;"><span style="font-size: large;"><span style="color: #365f91;"><span style="font-family: Cambria;">Going further</span></span></span></span></h1><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;">Although wiring the events together appears to be a lot of work, the architecture opens up some cool and interesting Access integration with Silverlight:</span></span></div><div class="MsoNormal" style="margin: 0in 0in 10pt 0.5in; mso-list: l3 level1 lfo6; text-indent: -0.25in;"><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">•</span><span style="font-family: "Times New Roman";"> </span></span></span><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;">a Navigation Treeview</span></span></div><div class="MsoNormal" style="margin: 0in 0in 10pt 0.5in; mso-list: l3 level1 lfo6; text-indent: -0.25in;"><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">•</span><span style="font-family: "Times New Roman";"> </span></span></span><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;">an Accordion navigator</span></span></div><div class="MsoNormal" style="margin: 0in 0in 10pt 0.5in; mso-list: l3 level1 lfo6; text-indent: -0.25in;"><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">•</span><span style="font-family: "Times New Roman";"> </span></span></span><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;">a Bing map</span></span></div><div class="MsoNormal" style="margin: 0in 0in 10pt 0.5in; mso-list: l3 level1 lfo6; text-indent: -0.25in;"><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">•</span><span style="font-family: "Times New Roman";"> </span></span></span><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;">a Content Rotate such as </span></span><a href="http://msdn.microsoft.com/en-us/office/default.aspx"><span style="color: blue; mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;">http://msdn.microsoft.com/en-us/office/default.aspx</span></span></a><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;"> that integrates with Access</span></span></div><div class="MsoNormal" style="margin: 0in 0in 10pt 0.5in; mso-list: l3 level1 lfo6; text-indent: -0.25in;"><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">•</span><span style="font-family: "Times New Roman";"> </span></span></span><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;">a Windows 7 Silverlight App that runs in Access and your Windows 7 phone</span></span></div><div class="MsoNormal" style="margin: 0in 0in 10pt 0.5in; mso-list: l3 level1 lfo6; text-indent: -0.25in;"><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">•</span><span style="font-family: "Times New Roman";"> </span></span></span><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;">seamless integration between SharePoint and Access</span></span></div><div class="MsoNormal" style="margin: 0in 0in 10pt 0.5in; mso-list: l3 level1 lfo6; text-indent: -0.25in;"><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">•</span><span style="font-family: "Times New Roman";"> </span></span></span><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;">or anything that can be done in Silverlight!</span></span></div><div class="MsoNormal" style="margin: 24pt 0in 0pt; mso-pagination: widow-orphan lines-together; page-break-after: avoid;"><b style="mso-bidi-font-weight: normal;"><span style="color: #365f91; font-family: "Cambria", "serif"; font-size: 14pt; line-height: 115%; mso-bidi-font-family: Cambria; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: Cambria;">Sample source code</span></b></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="mso-tab-count: 1;"><span style="font-family: Calibri;"> </span></span></span><a href="http://desktopweb.codeplex.com/SourceControl/list/changesets"><span style="color: blue; mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;">http://desktopweb.codeplex.com/SourceControl/list/changesets</span></span></a><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;"></span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><br />
</div>dvanahttp://www.blogger.com/profile/07584985948993945278noreply@blogger.com4