<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>SoulTech</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/soultech/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/soultech/feed.xml</link>
    <description />
    <lastBuildDate>Wed, 17 Apr 2019 03:50:27 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>MVVM: Tips when implementing INotifyPropertyChanged</title>
      <link>https://docs.microsoft.com/archive/blogs/soultech/mvvm-tips-when-implementing-inotifypropertychanged</link>
      <pubDate>Tue, 07 Jun 2011 17:02:00 GMT</pubDate>
      <dc:creator><![CDATA[ScottBurk67]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/soultech/2011/06/07/mvvm-tips-when-implementing-inotifypropertychanged/</guid>
      <description><![CDATA[The Context



Pattern:
Model View ViewModel (MVVM) - I'm not going to delve into the pattern...]]></description>
      <content:encoded><![CDATA[<h3>The Context</h3>
<table border="0" cellpadding="4">
<tbody>
<tr>
<td valign="top">Pattern:</td>
<td valign="top">Model View ViewModel (MVVM) - I'm not going to delve into the pattern itself, just the implications of some decisions faced during its application in a WPF or SilverLight application. For a better understanding of the MVVM pattern, see this <a target="_blank" title="MVVM with WPF MSDN article by Josh Smith" href="https://msdn.microsoft.com/en-us/magazine/dd419663.aspx">MSDN article</a> by Josh Smith, or this great <a target="_blank" title="MSDN article about using MEF along with MVVM" href="https://msdn.microsoft.com/en-us/magazine/gg535672.aspx">MSDN article about using MEF along with MVVM</a>, by
<a id="ctl00_MTContentSelector1_mainContentContainer_ctl01" href="https://msdn.microsoft.com/magazine/ee532098.aspx?sdmr=SandrinoDiMattia&amp;sdmi=authors">Sandrino Di Mattia</a>
</td>
</tr>
<tr>
<td valign="top">Pattern Applications:</td>
<td valign="top">Primarily used in the .NET world for SilverLight, WPF, WP7 applications</td>
</tr>
<tr>
<td valign="top">At Issue:</td>
<td valign="top">Deciding at which layer to implement the <a target="_blank" title="INotifyPropertyChanged .NET Help Page" href="https://msdn.microsoft.com/en-us/library/system.componentmodel.inotifypropertychanged.aspx#Y722"><span style="font-family: courier new,courier;">INotifyPropertyChanged</span></a> interface</td>
</tr>
<tr>
<td valign="top"></td>
<td valign="top"></td>
</tr>
<tr>
<td valign="top"><a title="MVVM Depiction" href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/62/1541.MVVM_3.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-62/1541.MVVM_5F00_3.jpg"><img title="MVVM Depiction" style="border: 0pt none;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/62/1541.MVVM_3.jpg" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-62/1541.MVVM_5F00_3.jpg" alt="MVVM Image" width="150" /></a></td>
<td valign="top">
<p>At left, a depiction of the MVVM pattern: In a typical WPF or SilverLight 
implementation the View portion is generally XAML, the ViewModel is C#, 
and the Model is C#. The <span style="font-family: courier new,courier;">View</span> owns the <span style="font-family: courier new,courier;">ViewModel</span> instance, and the <span style="font-family: courier new,courier;">ViewModel</span> owns the <span style="font-family: courier new,courier;">Model</span> instance.</p>
<p>In some cases the <span style="font-family: courier new,courier;">Model</span> might be re-instantiated multiple times during the life of the <span style="font-family: courier new,courier;">View</span> - an example would be when loading, binding, and rendering a new data record from the middle tier at the user's request.</p>
<p>In other cases the <span style="font-family: courier new,courier;">Model</span> might be loaded once with the <span style="font-family: courier new,courier;">View</span> and remain inert after that - an example might be a simple toolbar and the meta data that drives its commands and icons.</p>
<p>Using XAML, the <span style="font-family: courier new,courier;">View</span> can bind to the <span style="font-family: courier new,courier;">ViewModel</span> and the <span style="font-family: courier new,courier;">Model</span> (typically through view Properties), depending on the UI requirements.</p>
</td>
</tr>
</tbody>
</table>
<h3>The Question</h3>
<p>A friend of mine wrote recently and asked the following question regarding an implementation of the MVVM pattern: <em>"Is
it generally desirable to implement <span style="font-family: courier new,courier;">INotifyPropertyChanged </span>on Model classes,
ViewModel classes, or both?</em>"</p>
<p>The answer is, ironically or frustratingly... both are good.&nbsp; The appropriate approach for your application depends on the way the <span style="font-family: courier new,courier;">Model</span> is managed by the <span style="font-family: courier new,courier;">ViewModel</span>. While the "Context" in this table does not address the full complexity of an application's requirements, the table entries attempt to depict typical scenarios and provide guidance when you're making implementation decisions.</p>
<table style="background-color: #f5f5f5; width: 550px; border: 0pt solid #184949;" border="0" cellpadding="4" cellspacing="2">
<tbody>
<tr>
<td valign="top"><strong>Object</strong></td>
<td valign="top"><strong>Context</strong></td>
<td valign="top"><strong>Implement?</strong></td>
<td valign="top"><strong><em>Comments about <span style="font-family: courier new,courier;">IPropertyNotifyChanged</span></em></strong></td>
</tr>
<tr>
<td valign="top"><span style="font-family: courier new,courier;">ViewModel</span><br /></td>
<td valign="top">
<p><strong>R</strong>ead-only UI<strong>&nbsp;</strong></p>
<p><strong>V</strong>iew renders asynchronously loaded data, perhaps even more than once<strong></strong></p>
<p><strong>T</strong>he user does not modify the data.</p>
</td>
<td valign="top"><strong>Yes</strong></td>
<td valign="top">
<p>If you load your data asynchronously or if the user can load a new set of data (a new file or record) the <span style="font-family: courier new,courier;">IPropertyNotifyChanged</span> interface implementation will be beneficial.</p>
</td>
</tr>
<tr>
<td valign="top"><span style="font-family: courier new,courier;">ViewModel</span></td>
<td valign="top">
<p><strong>R</strong>ead-only UI<strong></strong></p>
<p><strong>V</strong>iew renders synchronously loaded data once <strong></strong></p>
<p><strong>T</strong>he user does not modify the data</p>
</td>
<td valign="top"><strong>No</strong></td>
<td valign="top">
<p>There is no use to implementing the IPropertyNotifyChanged interface<strong>, unless </strong>the data for your <strong>model is loaded asynchronously </strong>- in this case you would benefit from implementing the interface.<strong> <br /></strong></p>
</td>
</tr>
<tr>
<td valign="top"><span style="font-family: courier new,courier;">Model</span></td>
<td valign="top">
<p><strong>I</strong>nteractive UI<strong></strong></p>
<p><strong>V</strong>iew load is synchronous or asynchronous<strong></strong></p>
<p><strong>S</strong>pecific consideration is that <span style="font-family: courier new,courier;">Model </span>properties change based on UI actions or background data synching.</p>
</td>
<td valign="top"><strong>Yes</strong></td>
<td valign="top">
<p>Scenario one: UI updates the model properties during user interaction - the benefit of implementing the <span style="font-family: courier new,courier;">IPropertyNotifyChanged </span>interface can be realized in real-time data validation and/or real-time data updates to the middle-tier.<strong>&nbsp;</strong></p>
<p>Scenario two: The UI needs to be updated due to background data synchronization tasks (either server push or client poll) - the <span style="font-family: courier new,courier;">IPropertyNotifyChanged </span>interface implementation allows the UI to keep fresh when new data arrives.</p>
</td>
</tr>
<tr>
<td valign="top"><span style="font-family: courier new,courier;">Model</span></td>
<td valign="top">
<p><strong>R</strong>ead-only UI</p>
<p><strong>M</strong>odel properties do not change due to UI interaction or background data synchronization.</p>
</td>
<td valign="top">
<p><strong>No</strong></p>
</td>
<td valign="top">
<p>There may be no benefit to implementing the <span style="font-family: courier new,courier;">IPropertyNotifyChanged </span>interface. While some use-cases may differ, generally in this context you don't need to implement the interface.</p>
</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<h3>How can you say "both"?</h3>
<p>The appropriate application of this <span style="font-family: courier new,courier;">INotifyPropertyChanged </span>interface is deterministic, and has to be evaluated in terms of the specific requirements of your application and UI. I hope this helps to provide some useful guidance in your adoption of the MVVM pattern!</p>]]></content:encoded>
    </item>
    <item>
      <title>Why override ToString()? Use DebuggerDisplayAttribute instead</title>
      <link>https://docs.microsoft.com/archive/blogs/soultech/why-override-tostring-use-debuggerdisplayattribute-instead</link>
      <pubDate>Tue, 05 Apr 2011 20:30:00 GMT</pubDate>
      <dc:creator><![CDATA[ScottBurk67]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/soultech/2011/04/05/why-override-tostring-use-debuggerdisplayattribute-instead/</guid>
      <description><![CDATA[Debugging and Runtime Inspection
The Visual Studio 2010 debugger is an awesome tool, no doubt about...]]></description>
      <content:encoded><![CDATA[<h3>Debugging and Runtime Inspection</h3>
<p>The Visual Studio 2010 debugger is an awesome tool, no doubt about it. It's likely the most powerful and capable debugger ever developed for Windows or any other platform. And yet, there are times when you wish it 'knew' or exposed&nbsp;more detail. When you're debugging a runtime instance of your application or inspecting a mini-dump to gain insight into&nbsp;the state of your application, often the&nbsp;most useful details are the&nbsp;values of the variables&nbsp;that characterize the state of your app at that particular moment. Or if you unwind a stack trace and wish to see the state of objects prior to the call that failed, you may be disappointed by the lack of simple exposure to object state displayed in the hover-tooltips by default.&nbsp; </p>
<p>When you're inspecting the state of an application while debugging and drilling down on your own type instances, or inspecting&nbsp;3rd party assembly/DLL exposed types, the experience is likely a bit less than intuitive or optimal. </p>
<p>Imagine this situation, you've definately encountered it but probably never realized you had any power over the situation... You're stopped on a breakpoint in the debugger and using the mouse to hover over variables in the debugger - you're depending on the Visual Studio hover-tooltips to inspect various instance or static variable values in order&nbsp;to build a mental image of the state of your application. </p>
<p>Often times you wait for the popup window, then you start clicking on the '+' signs to dig deeper,&nbsp;but then your mouse&nbsp;cursor drifts off the tolerance gap of Visual Studio and the inspection pane&nbsp;disappears!&nbsp;Or you get lucky and after clicking enough you get to inspect the value of properties within an array of object instances, or subordinate to the particular object you happen to be inspecting.&nbsp; But you have to click a whole-bunch-of-more-times to inspect the other instances of your type in a collection/array...</p>
<p>With simple native types VS quickly displays useful runtime value information. If you hover the mouse over an <span style="font-family: courier new,courier;">int</span> or a <span style="font-family: courier new,courier;">double</span> you will be quickly presented with the instance value. As well, with complex types that Visual Studio is already aware of you will see similarly useful inspection details exposed. </p>
<p><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/62/7384.NativeIntValue.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-39-62/7384.NativeIntValue.png" border="0" /></p>
<p><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/62/0535.ComplexDecimalValue.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-39-62/0535.ComplexDecimalValue.png" border="0" /></p>
<p>But with our own types or 3rd party types, often times all we see is the Type name. You can see by the declaration of the <span style="font-family: courier new,courier;">employees</span> array below that&nbsp;each <span style="font-family: courier new,courier;">employee</span> has distinct details that would be valuable to discern at runtime when debugging. But observe the <b>Value</b> column in the QuickWatch snapshot just below the&nbsp;<span style="font-family: courier new,courier;">employees</span>&nbsp;array declaration - it simply displays the facts: </p>
<ol>
<li>there's 11 items in the collection</li>
<li>the value of each is {DebuggerDisplayAttr.Employee}</li>
</ol>
<p>Not very useful! To discover more you will have to start aiming and clicking on little plus-signs and stuff...</p>
<p><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/62/1263.DebuggerDisplayMissing%202.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/640x0/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-39-62/1263.DebuggerDisplayMissing-2.png" border="0" /></p>
<p>Again, to actually discover the values and build our mental state we have to drill down into each entry by expanding the '+' to expose deeper details. Frequently multiple levels of inspection are required to find the information we need to elucidate our mental image and derive practical benefit from our debugging exercise... </p>
<h3>Just add a ToString() implementation...</h3>
<p>There's a couple of options available to programmers to resolve this 'problem':</p>
<p>You can override the <span style="font-family: courier new,courier;">Employee</span> object's <span style="font-family: courier new,courier;">ToString()</span> method to expose a hard-coded, specific view of the internal state of your object instance... "Let's just add a <span style="font-family: courier new,courier;">ToString()</span> implementation" you say - we all know that's how to expose details that the debugger recognizes. Let's see what happens...</p>
<p><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/62/6014.ToStringImpl.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-39-62/6014.ToStringImpl.png" border="0" /></p>
<p>The debugger now leverages the <span style="font-family: courier new,courier;">ToString()</span> conversion to display the runtime instance values in our array:</p>
<p><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/62/6710.ToStringDebuggerOutput.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-39-62/6710.ToStringDebuggerOutput.png" border="0" /></p>
<p>This seems like a much better situation. Now when we expand our array in the debugger&nbsp;we see useful instance information. But it is not ideal. Let me explain: you may have a need to use ToString() for UI purposes that differentiate it from the debugging experience. Or you may have no need to declare ToString() at all on your objects, as you don't intend to render them to the UI via string casts...</p>
<h3>There's a better way</h3>
<p>Wouldn't it be much more useful if the debugger provided the distinct details regarding each instance in the <span style="font-family: courier new,courier;">employees</span> list, but did so in such a&nbsp;way that we could implement <span style="font-family: courier new,courier;">ToString()</span> for an object for UI display purposes, or completely disregard the need to even implement a <span style="font-family: courier new,courier;">ToString()</span> method... And <b><i>what if</i></b> we could do it declaratively? As you'll see in a later post we <i>can </i>describe our inspection format declaratively... but&nbsp;in this post&nbsp;I will strive only&nbsp;to differentiate <span style="font-family: courier new,courier;">ToString()</span> from the debugging inspection experience.</p>
<h3>Why not just leverage the ToString() override?</h3>
<p>For one thing, it will affect every situation where an object's instance is converted (i.e., casted) to a string - this may not be what you want. It may even conflict with your requirements! For example, you may actually need a richer (or poorer) implementation of the <span style="font-family: courier new,courier;">ToString()</span> override to fill in a list box or write to the active window of your application. Or if that's not the case, you'll find that doing this extra,&nbsp;hard-coded work is overkill - maybe all you want is debugger exposure and clarity!</p>
<p>If clarity is your goal there's a better, more dynamic solution.</p>
<h3>The DebuggerDisplay Attribute</h3>
<p>By leveraging the <a target="_blank" href="https://msdn.microsoft.com/en-us/library/x810d419.aspx" title="DebuggerDisplayAttribute">DebuggerDisplayAttribute</a>&nbsp;you can specify the display format for your object instance to the debugger. And what's more, while you <i>can </i>do this in the code with a simple attribute&nbsp;declaration, there's a way to deliver this type-exposure information to Visual Studio in a way that it recognizes and utilizes for non-native types on the fly. You don't have to modify your code, and if you want to modify what's exposed you can do so outside the context of your application (i.e., no rebuild of your app, no re-deploy, no approvals...).&nbsp; </p>
<p>And that's not all! In my next post I will tell you how you can use this facility to expose details of 3rd party type instances&nbsp;that you wish to inspect in the debugger, that may not already implement a useful <span style="font-family: courier new,courier;">ToString()</span> method, let alone a <span style="font-family: courier new,courier;">DebuggerDisplayAttribute</span>!</p>
<p>First, let's see how to accomplish this in our code. It's straight forward:</p>
<pre class="scroll"><code class="csharp"><span style="font-size: small;">namespace DebuggerDisplayAttr<br />{<br />    <b><span style="color: #800000;">[DebuggerDisplay("Name = {Name}, Phone Number = {PhoneNumber}, Manager = {EmployeeManager}")]<br /></span></b>    public class Employee<br />    {<br />        /// &lt;summary&gt;<br />        /// Properties<br />        /// &lt;/summary&gt;<br />        public string Name { get { return new StringBuilder(FirstName).AppendFormat(" {0}", LastName).ToString(); } }<br />        public string FirstName { get; set; }<br />        public string LastName { get; set; }<br />        public string PhoneNumber { get; set; }<br />        public int ManagerId { get; set; }<br />
        public string EmployeeManager { get { return LookupMgr(ManagerId); } }<br /><br />        /// &lt;summary&gt;<br />        /// Accessor that accepts an ID and performs a lookup via the Manager class<br />        /// &lt;/summary&gt;<br />        private string LookupMgr(int id)<br />        {<br />            return Manager.Find(id) ?? string.Empty;<br />        }<br />
        public override string ToString()<br />        {<br />            return string.Format("Name: {0}, Phone Number: {1}", Name, PhoneNumber).ToString();<br />        }<br />    }<br />}</span></code></pre>
<p>The key detail above is the <span style="font-family: courier new,courier;"><span style="color: #993300;"><b><span style="color: #800000;">DebuggerDisplay</span></b></span></span> attribute declaration. It specifies the instance display format in metadata that the debugger recognizes at debug-time. You can leverage properties, fields, methods... anything declared in your class - note: the debugger doesn't differentiate between access modifiers - private, protected, and public fields, properties and methods are all fair game for use in this exercise. </p>
<p>For example, the attribute declaration leverages the EmployeeManager property, which is resolved via a call to the Manager object's Find() method... details not shown here but obviously a complex method and one who's output&nbsp;enrichens our debugging experience. And you might also notice that I've also left in place the <span style="font-family: courier new,courier;">ToString()</span> method on the object. </p>
<p>But let's look at the inspection output in the debugger now...</p>
<p><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/62/5383.DebuggerDisplayPresent%201.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/750x0/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-39-62/5383.DebuggerDisplayPresent-1.png" border="0" />&nbsp;</p>
<p>Hmmmm, perhaps my demonstration is underwhelming. But if you look at the code and what's going on, you'll see the advantages of this approach. The Visual Studio debugger gives <i>precendence</i> to the <span style="font-family: courier new,courier;">DebuggerDisplayAttribute</span> declaration when inspecting instance values. Conversly, at runtime, when converting your object to a string for display on a form or casting it to display its value in a window, there's no knowledge of the <span style="font-family: courier new,courier;"><span style="font-family: courier new,courier;">DebuggerDisplayAttribute</span></span> declaration; Precedence falls to the <span style="font-family: courier new,courier;">ToString()</span> declaration.</p>
<h4>Some details to observe...</h4>
<ol>
<li>The [DebuggerDisplay(...)] attribute is in the <span style="font-family: courier new,courier;">System.Diagnostics</span> namespace, so you'll need to declare the following in your entity/DTO class:<br /><br /><span style="font-family: courier new,courier;"><span style="color: #3366ff;"><b>using</b></span> </span><span style="color: Black"><span style="font-family: courier new,courier;">System.Diagnostics;<br /></span></span><span style="color: Black"><br /></span></li>
<li>
<p>You can leverage composite properties in the attribute declaration... see the {Name} property for example.</p>
</li>
<li>
<p>You can utilize lookup methods on subordinate properties to resolve string values... the {EmployeeManager} property is an example of this technique.</p>
</li>
<li>
<p>In case you are not aware of this detail regarding attributes, <span style="font-family: courier new,courier;"><b>[DebuggerDisplay(...)]</b></span> is equivalent to <span style="font-family: courier new,courier;"><b>[DebuggerDisplayAttribute(...)]</b></span> as far as the csharp compiler is concerned... it resolves the declaration either way as long as the namespace is referenced and declared in a <span style="font-family: courier new,courier;">'using'</span> statement.</p>
</li>
</ol>
<h3>But what's the catch?</h3>
<p>There's always a catch, right?&nbsp; Think about the performance implications of the work that's performed by VS as a result of leveraging this technique... the debugger has to re-evaluate the attribute expression every single time it encounters an instance of your object. Depending on how you construct the display string, this could cost you! If you have 10,000 items of your type in a collection or array you're going to experience latency as the debugger resolves (evaluates) the display criteria for your type when you access the hover-tooltips and expand your collection, when you add your collection to a Watch Window and expand it, or when you access your collection instance in Quick Watch and expand it. That's why they decided to call <span style="font-family: courier new,courier;">ToString()</span> in the first place! It's a single method that's already included on every object by definition. It's compiled, optimized, and executed quickly on every type instance.</p>
<p>Here's a link to some <a target="_blank" title="best practices" href="https://blogs.msdn.com/b/jaredpar/archive/2011/03/18/debuggerdisplay-attribute-best-practices.aspx">best practices</a> regarding the <b><span style="color: #800000;"><span style="font-family: courier new,courier;">DebuggerDisplayAttribute</span></span></b> (courtesy of <span class="user-name">Juozas Kontvainis). I think these have to be tempered with you're own justifications and awareness of how you use the types for which you're declaring display details, but these guidelines were gained from experience and are worth considering.<br /></span></p>
<h3>Okay, that was simple...</h3>
<p>Well now the fun really starts! see my next post, <b><span style="font-family: arial black,avant garde;">Dynamic DebuggerDisplayAttribute</span></b>, to find out how you can accomplish this without any code at all. And as I mentioned above, you can use the following technique to modify the inspection visibility of 3rd party types as well.</p>]]></content:encoded>
    </item>
    <item>
      <title>The Bridge - a pattern to leverage Managed C# code from an Unmanaged C++ code base</title>
      <link>https://docs.microsoft.com/archive/blogs/soultech/the-bridge-a-pattern-to-leverage-managed-c-code-from-an-unmanaged-c-code-base</link>
      <pubDate>Tue, 27 Jul 2010 16:25:00 GMT</pubDate>
      <dc:creator><![CDATA[ScottBurk67]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/soultech/2010/07/27/the-bridge-a-pattern-to-leverage-managed-c-code-from-an-unmanaged-c-code-base/</guid>
      <description><![CDATA[Building bridges from unmanaged C++ to managed C# using the CLI features
[note: attached code...]]></description>
      <content:encoded><![CDATA[<h1>Building bridges from unmanaged C++ to managed C# using the CLI features</h1>
<p>[note: attached code contains the full example solution implementing this pattern]</p>
<p>If you write or maintain C++ applications, you may want to leverage your (or your co-worker's) C# components - these could be visual components or logical components. You can leverage them directly,&nbsp;without COM enabling them or using COM wrappers! You can actually integrate them straight into your C++ application and leverage the managed assemblies as you would a project in your Visual Studio C++ solution. You can debug and step straight across the Unmanaged C++ / Managed C++ / Managed C# (or other CLR languages)</p>
<p>You can realize a variety of benefits:</p>
<ol>
<li>You don't have to attach to multiple debugee's and jump through hoops to inspect and comprehend the state of your application and its dependencies at a given moment in real time.</li>
<li>You can debug straight through from the unmanaged <span style="font-family: courier new,courier;">WinMain</span> down into&nbsp;your C# component, across each of the layers, without aggravation.</li>
<li>Your deployments will be simplified (no need to register COM components)</li>
<li>Your friends and coworkers&nbsp;will think you're amazingly brilliant</li>
</ol>
<p>Its actually pretty straight foward to do this, and the results are pretty clean. I'll&nbsp;present some Patterns you can follow to help you achieve this, and&nbsp;walk through a sample app to demonstrate an implementation of the pattern:</p>
<p>The sample consists of:</p>
<ul>
<li>A native C++ windows console app project with a WinMain()</li>
<li>An .h header file and a .cpp implementation file that implement a C++ to C# bridging pattern that bridges the gap from unmanaged C++ code to managed C# code</li>
<li>A&nbsp;simple C# component containing methods and properties that we want to&nbsp;invoke from our native C++ console application</li>
</ul>
<h3>The Complete Solution</h3>
<p>Generate this solution yourself in Visual Studio 2010 - invoke the <strong>File / New / Project... </strong>menu choice. In the New Project dialog, navigate to Other Languages node and click&nbsp;on "<strong>Visual C++</strong>" to see the list of project templates.&nbsp;&nbsp;From this templates list, click on "<strong>Win32 Console Application</strong>". Give it a cool name like <strong>CliTest </strong>or something and put it somewhere useful in your regular PoC project location.&nbsp; I named mine "<strong>CliExample</strong>"</p>
<p><img border="0" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/62/0027.NewConsoleApp.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-39-62/0027.NewConsoleApp.png" /></p>
<p>After Visual Studio gyrates for a bit you'll end up with a new solution containing the C++ project you just added.&nbsp; You'll see the initial project displayed in the Solution Explorer view - if that's not appearing for you, go to the View menu and click on "<strong>Solution Explorer</strong>".</p>
<p>We want to add the C# managed component now, so right-click on the '<strong>Solution</strong>' at the top of the Solution Explorer view and choose "<strong>Add -&gt; New Project...</strong>". You'll see the "New Project" window once again, and this time just make sure "Visual C#" is selected in the 'Installed Templates' list and then click on 'Class Library' in the list of project templates. Once again give it a cool name like '<strong>CSharpy'</strong> or whatever.</p>
<p><img border="0" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/62/3122.NewClassLibrary.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-39-62/3122.NewClassLibrary.png" /></p>
<p>For me, I named my projects 'Cli Example' and 'ManagedComponent'... Here's what it all looks like if you get it right.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/62/6102.clip_image001.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-62/6102.clip_5F00_image001.jpg"><img border="0" alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/62/6102.clip_image001.jpg" original-url="https://blogs.msdn.com/resized-image.ashx/__size/198x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-62/6102.clip_5F00_image001.jpg" /></a><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/62/2112.clip_image001.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-62/2112.clip_5F00_image001.jpg"></a></p>
<p>The <strong>CliExample </strong>project is a simple C++ Windows Console Application project. The only files I've added to the template solution generated by Visual Studio 2010 are the ManagedBridge.h and ManagedBridge.cpp files.</p>
<ol>
<li>The ManagedBridge.h file includes a forward reference to the managed Bridge class declared in the ManagedBridge.cpp file. This is necessary because Bridge is the boundary C++ managed class that bridges the gap between Unmanaged and Managed C++, and provides the gateway to the Managed C# (or CLR) components we wish to leverage.</li>
<li>ManagedBridge.cpp has a special compile setting: Common Language RunTime Support is set to /clr.&nbsp; The rest of the project is a normal 'cplusplus' project<br /><br /><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/62/2642.clip_image004.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-62/2642.clip_5F00_image004.jpg"><img border="0" alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/62/2642.clip_image004.jpg" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-62/2642.clip_5F00_image004.jpg" width="693" height="211" /></a></li>
<li>The CliExample project itself is configured for Mixed debugging &ndash; this allows you to step across the boundary and set breakpoints on both sides <br /><br /><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/62/6201.clip_image005.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-62/6201.clip_5F00_image005.jpg"><img border="0" alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/62/6201.clip_image005.jpg" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-62/6201.clip_5F00_image005.jpg" /></a></li>
<li>The ClIExample project also contains a reference to the managed component &ndash; this is done via the Add Reference button at the bottom of the following dialog<br /><br /><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/62/2055.clip_image006.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-62/2055.clip_5F00_image006.jpg"><img border="0" alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/62/2055.clip_image006.jpg" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-62/2055.clip_5F00_image006.jpg" /></a></li>
</ol><hr style="border: 1px solid #cccccc; width: 100%; height: 1px; color: #ffffff;" size="1" width="100%" noshade="noshade" />
<p>The <strong>ManagedComponent</strong> project contains our (super simple) C# component. The relevant parts of this pattern are best discovered via interactive debugging and stepping through the code from the outside C++ console app all the way into the ManagedComponent class. There's subleties encountered in wiring the various classes and layers together to construct the bridge that are hard to descibe but easy to see in the code.&nbsp; Here's a snapshot of the final teasingly tiny managed method that's invoked via C++ pointers and the bridge across the boundaries...</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/62/5873.clip_image003.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-62/5873.clip_5F00_image003.jpg"><img border="0" alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/62/5873.clip_image003.jpg" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-62/5873.clip_5F00_image003.jpg" /></a></p>
<hr style="border: 1px solid #cccccc; width: 100%; height: 1px; color: #ffffff;" size="1" width="100%" noshade="noshade" />
<p><span style="font-family: courier new,courier;">CliExample.cpp</span> contains the main entry point for the console application, and its about as simple as it can get. But lets look at it to see what's in there.</p>
<div class="codeBox">
<pre style="font-family: consolas;"><span style="color: green;">//&nbsp;CliExample.cpp&nbsp;:&nbsp;Defines&nbsp;the&nbsp;entry&nbsp;point&nbsp;for&nbsp;the&nbsp;console&nbsp;application.</span></pre>
<pre style="background: white; color: black; font-family: Consolas;"><span style="color: blue;">#include</span>&nbsp;<span style="color: #a31515;">"stdafx.h"</span>
<span style="color: blue;">#include</span>&nbsp;<span style="color: #a31515;">"ManagedBridge.h"</span>
 
<span style="color: blue;">using</span>&nbsp;<span style="color: blue;">namespace</span>&nbsp;ManagedBridge;
 
Bridge*&nbsp;ptr&nbsp;=&nbsp;NULL;
	
<span style="color: blue;">int</span>&nbsp;_tmain(<span style="color: blue;">int</span>&nbsp;argc,&nbsp;_TCHAR*&nbsp;argv[])
{
	ptr&nbsp;=&nbsp;<span style="color: blue;">new</span>&nbsp;Bridge();
 
	ptr-&gt;PrintMessage(<span style="color: #a31515;">"Call&nbsp;1&nbsp;to&nbsp;managed&nbsp;component&nbsp;through&nbsp;CLI&nbsp;boundary.&nbsp;Value&nbsp;should&nbsp;display&nbsp;as&nbsp;0"</span>);
	ptr-&gt;SetValue(15);
	ptr-&gt;PrintMessage(<span style="color: #a31515;">"Call&nbsp;2&nbsp;to&nbsp;managed&nbsp;component&nbsp;through&nbsp;CLI&nbsp;boundary.&nbsp;Value&nbsp;should&nbsp;display&nbsp;as&nbsp;15."</span>);
	
	<span style="color: blue;">delete</span>&nbsp;ptr;
	<span style="color: blue;">return</span>&nbsp;0;
}&nbsp;</pre>
</div>
<p>This code is pretty straight forward: we #include the <span style="font-family: courier new,courier;">ManagedBridge.h</span> file and&nbsp;declare a <strong>namespace</strong> for convenience. Then we allocate the mysterious <strong>Bridge</strong> class, make some normal looking C++ calls and then, like every good citizen,&nbsp;deallocate the <strong>Bridge</strong> object before terminating.&nbsp; Hmmm, no rocket science here.&nbsp;</p>
<p>But what happens behind the scenes is a bit more interesting! Within the&nbsp;<strong>Bridge</strong> class&nbsp;we allocate&nbsp;the <strong>MngdAdapter</strong> class (<strong>gcnew MngdAdapter</strong>) on the CLRs managed memory pool. In C++ terms this is a pointer we don't really have a reference to. Its not ours! This is a garbage collected memory footprint that we've allocated and asked for a handle to. Since it's an auto_gcroot we don't have to treat it specially. Its scope and lifetime are managed by the CLR's managed memory pool.</p>
<p>The instantiation of the <strong>MngdAdapter</strong> results in the allocation of the <strong>ManagedComponent </strong>instance&nbsp;(which is our C# component!). The adapter lives only to enable&nbsp;proxied calls from the Bridge to the ManagedComponent's API: The&nbsp;<span style="font-family: courier new,courier;">PrintMessage</span>, <span style="font-family: courier new,courier;">SetCount</span>, and&nbsp;<span style="font-family: courier new,courier;">GetCount&nbsp;</span>calls..&nbsp;</p>
<p>So what do we see when we build and run this application?</p>
<pre style="background: white; color: black; font-family: Consolas;"><span style="color: #a31515;">Call&nbsp;1&nbsp;to&nbsp;managed&nbsp;component&nbsp;through&nbsp;CLI&nbsp;boundary.&nbsp;Value&nbsp;should&nbsp;display&nbsp;as&nbsp;0: <br />Value: 0</span></pre>
<pre style="background: white; color: black; font-family: Consolas;"><span style="color: #a31515;">Call&nbsp;2&nbsp;to&nbsp;managed&nbsp;component&nbsp;through&nbsp;CLI&nbsp;boundary.&nbsp;Value&nbsp;should&nbsp;display&nbsp;as&nbsp;15: <br />Value 15</span></pre>
<pre style="background: white; color: black; font-family: Consolas;"><span style="color: #a31515;"></span></pre>
<h3>Let's dig a bit deeper</h3>
<p>Earlier we referenced the ManagedBridge.h file included in CliExample.cpp.&nbsp; Let's take a look inside it now:</p>
<div class="codeBox">
<pre style="background: white; color: black; font-family: Consolas;"><span style="color: blue;">#pragma</span>&nbsp;<span style="color: blue;">once</span>
 
<span style="color: blue;">namespace</span>&nbsp;ManagedBridge&nbsp;{
	
	<span style="color: green;">//&nbsp;anonymous&nbsp;pre-declaration&nbsp;of&nbsp;the&nbsp;adapter&nbsp;class&nbsp;that&nbsp;we'll&nbsp;instantiate</span>
	<span style="color: green;">//&nbsp;in&nbsp;the&nbsp;c++&nbsp;code&nbsp;implementation&nbsp;of&nbsp;our&nbsp;class.&nbsp;It&nbsp;has&nbsp;to&nbsp;be&nbsp;anonymously&nbsp;pre-declared</span>
	<span style="color: green;">//&nbsp;as&nbsp;it's&nbsp;a&nbsp;managed&nbsp;class&nbsp;</span>
	<span style="color: blue;">class</span>&nbsp;MngdAdapter;
 
	<span style="color: blue;">class</span>&nbsp;Bridge
	{
	<span style="color: blue;">private</span>:
		MngdAdapter*&nbsp;adapter;
 
	<span style="color: blue;">public</span>:
		Bridge();		
		~Bridge();
 
		<span style="color: blue;">void</span>&nbsp;Bridge::SetValue(<span style="color: blue;">int</span>&nbsp;value);
		<span style="color: blue;">int</span>&nbsp;Bridge::GetValue();
 
		<span style="color: blue;">void</span>&nbsp;PrintMessage(<span style="color: blue;">const</span>&nbsp;<span style="color: blue;">char</span>*&nbsp;sMsg);
	};
};</pre>
</div>
<p>A couple of things of note here: The <strong>MngdAdapter </strong>reference is declared anonymously with a forward reference (<span style="font-family: courier new,courier;">class MngdAdapter;</span>). This ManagedBridge.h file is included in the native C++ ManagedBridge.cpp implementation.&nbsp;As a result of the compiler settings for the CliExample.cpp file,&nbsp;it is&nbsp;compiled natively. This is so important that you should spend time making sure you get what I'm saying - look at the code and examine the modified compiler settings.&nbsp; Comment on this post if you think I can be clearer!&nbsp;</p>
<p>Remember, our intention is to build a bridge from the unmanaged to the managed code, so the <strong>Bridge</strong> class is fully defined giving us an API we can use in the unmanaged native code, with the assumption that it will bridge the gap for us.</p>
<p>As you'll soon see we&nbsp;define the <strong>MngdAdapter </strong><strong></strong>class in the associated implementation file (fully declared obnoxiously in the ManagedBridge.cpp).&nbsp; Thus we just use the forward reference&nbsp;and ask the compiler to trust us that it will be defined before linking commences. Both of these classes end up proxying calls into the managed components, though you could look at&nbsp;either like a facade in a richer example as there's no necessity that the bridge and or coupler proxy calls to a single managed component.</p>
<pre style="background: white; color: black; font-family: Consolas;"><span style="color: green;">//&nbsp;ManagedBridge.cpp&nbsp;implementation&nbsp;file&nbsp;with&nbsp;definition&nbsp;of&nbsp;'MngdAdapter'&nbsp;class&nbsp;mysteriously&nbsp;referenced</span>
<span style="color: green;">//&nbsp;in&nbsp;the&nbsp;ManagedBridge.h&nbsp;file&nbsp;with&nbsp;a&nbsp;forward&nbsp;reference</span>
</pre>
<pre style="background: white; color: black; font-family: Consolas;"><span style="color: blue;">#include</span>&nbsp;<span style="color: #a31515;">"stdafx.h"</span>
 
<span style="color: blue;">#include</span>&nbsp;<span style="color: #a31515;">"ManagedBridge.h"</span>
 
 
<span style="color: blue;">#include</span>&nbsp;<span style="color: #a31515;">&lt;msclr/auto_gcroot.h&gt;</span>
<span style="color: blue;">using</span>&nbsp;msclr::auto_gcroot;
 
<span style="color: blue;">#using</span>&nbsp;<span style="color: #a31515;">&lt;System.dll&gt;</span>
<span style="color: blue;">using</span>&nbsp;<span style="color: blue;">namespace</span>&nbsp;System;
<span style="color: blue;">using</span>&nbsp;<span style="color: blue;">namespace</span>&nbsp;ManagedComponent;
 
<span style="color: blue;">namespace</span>&nbsp;ManagedBridge&nbsp;{
 
	<span style="color: green;">///</span>
	<span style="color: green;">//&nbsp;adapter&nbsp;needed&nbsp;to&nbsp;hide&nbsp;clr&nbsp;stuff&nbsp;from&nbsp;our&nbsp;main&nbsp;.h&nbsp;file&nbsp;so&nbsp;client&nbsp;app&nbsp;</span>
	<span style="color: green;">//&nbsp;code&nbsp;can&nbsp;compile&nbsp;cleanly;&nbsp;Provides&nbsp;adapter&nbsp;to&nbsp;the&nbsp;CSharp&nbsp;component</span>
	<span style="color: green;">//&nbsp;that&nbsp;we&nbsp;wish&nbsp;to&nbsp;interact&nbsp;with</span>
	<span style="color: green;">///</span>
	<span style="color: blue;">public</span>&nbsp;<span style="color: blue;">class</span>&nbsp;MngdAdapter
	{
	<span style="color: blue;">private</span>:
		auto_gcroot&lt;MngdComponent^&gt;&nbsp;adapter;
 
	<span style="color: blue;">public</span>:
		MngdAdapter()&nbsp;:&nbsp;adapter(<span style="color: blue;">gcnew</span>&nbsp;MngdComponent())&nbsp;{}
 
		<span style="color: blue;">int</span>&nbsp;GetValue()
		{
			<span style="color: blue;">return</span>&nbsp;adapter-&gt;Value;
		}
 
		<span style="color: blue;">void</span>&nbsp;SetValue(<span style="color: blue;">int</span>&nbsp;value)
		{
			adapter-&gt;Value&nbsp;=&nbsp;value;
		}
 
		<span style="color: blue;">void</span>&nbsp;PrintMessage(<span style="color: blue;">const</span>&nbsp;<span style="color: blue;">char</span>*&nbsp;sMsg)
		{
			adapter-&gt;PrintMessage(<span style="color: blue;">gcnew</span>&nbsp;String(sMsg));
		}
	};
	
	<span style="color: green;">///</span>
	<span style="color: green;">//&nbsp;Bridges&nbsp;Unmanaged&nbsp;to&nbsp;managed&nbsp;code&nbsp;-&nbsp;uses&nbsp;a&nbsp;adapter&nbsp;to&nbsp;thunk&nbsp;the&nbsp;gap</span>
	<span style="color: green;">///</span>
	Bridge::Bridge()&nbsp;
	{
		adapter&nbsp;=&nbsp;<span style="color: blue;">new</span>&nbsp;MngdAdapter();
	}
		
	Bridge::~Bridge()&nbsp;
	{
		<span style="color: blue;">delete</span>&nbsp;adapter;
	}
 
	<span style="color: blue;">int</span>&nbsp;Bridge::GetValue()
	{
		<span style="color: blue;">return</span>&nbsp;adapter-&gt;GetValue();
	}
 
	<span style="color: blue;">void</span>&nbsp;Bridge::SetValue(<span style="color: blue;">int</span>&nbsp;value)
	{
		adapter-&gt;SetValue(value);
	}
 
	<span style="color: blue;">void</span>&nbsp;Bridge::PrintMessage(<span style="color: blue;">const</span>&nbsp;<span style="color: blue;">char</span>*&nbsp;sMsg)
	{
		adapter-&gt;PrintMessage(sMsg);
	}
 }</pre>
<p>As you can see, the calls flow like this:</p>
<p>Console App (Unamaged : CliExample.cpp) -&gt; Bridge (Unmanaged -&gt; Managed : C++ ManagedBridge.h)&nbsp;-&gt; MngdAdapter (Managed C++ :&nbsp;ManagedBridge.cpp)&nbsp;-&gt; ManagedComponent (Managed C# : ManagedComponent.cs)</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/39/62/8836.CliExample.zip" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-62/8836.CliExample.zip">https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-62/8836.CliExample.zip</a></p>]]></content:encoded>
    </item>
  </channel>
</rss>