<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Code</title><link>https://www.infopathdev.com:443/forums/45.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Missing Close() Method</title><link>https://www.infopathdev.com:443/forums/thread/56237.aspx</link><pubDate>Sat, 26 Jun 2010 14:03:34 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:56237</guid><dc:creator>cfernald</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/56237.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=56237</wfw:commentRss><description>&lt;p&gt;Yeah, you got that right.&amp;nbsp; Actually, both forms had Browser Compability enabled.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;As an experiment, I unchecked Browser Compatability in the form that was compiling.&amp;nbsp; I compiled and published it but it didn&amp;#39;t work - i.e. it would even load.&amp;nbsp; I sort of expected that.&amp;nbsp; Then I set Browser Compatability back to enabled and now the form won&amp;#39;t compile.&amp;nbsp; This is a good thing in that both forms are now indicating that the Close() method is unavailable.&amp;nbsp; And, as you might expect, the 2 XmlFormHostItem.cs modules are identical.&lt;/p&gt;
&lt;p&gt;Now I still need to figure out how to close the forms&amp;nbsp;programatically.&lt;/p&gt;
&lt;p&gt;Thanks for your help.&lt;/p&gt;
&lt;p&gt;\cbf&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Missing Close() Method</title><link>https://www.infopathdev.com:443/forums/thread/56196.aspx</link><pubDate>Fri, 25 Jun 2010 02:48:41 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:56196</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/56196.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=56196</wfw:commentRss><description>&lt;p&gt;Well, does it have browser compatibility turned on?&amp;nbsp; this.Close() won&amp;#39;t be available if it is.&amp;nbsp; I can tell you that much.&lt;/p&gt;</description></item><item><title>Re: Missing Close() Method</title><link>https://www.infopathdev.com:443/forums/thread/56191.aspx</link><pubDate>Thu, 24 Jun 2010 21:16:18 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:56191</guid><dc:creator>cfernald</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/56191.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=56191</wfw:commentRss><description>&lt;p&gt;Everything in Tools-&amp;gt; Form Options matches between the two, including compatability.&lt;/p&gt;</description></item><item><title>Re: Missing Close() Method</title><link>https://www.infopathdev.com:443/forums/thread/56183.aspx</link><pubDate>Thu, 24 Jun 2010 17:00:07 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:56183</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/56183.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=56183</wfw:commentRss><description>&lt;p&gt;Sounds like your newer form has browser compatibility turned on.&lt;/p&gt;</description></item><item><title>Missing Close() Method</title><link>https://www.infopathdev.com:443/forums/thread/56181.aspx</link><pubDate>Thu, 24 Jun 2010 16:44:18 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:56181</guid><dc:creator>cfernald</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/56181.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=56181</wfw:commentRss><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;I have developed several InfoPath 2007 forms with most of the business logic written in the C# code-behind.&amp;nbsp; The other day I added a custom &amp;#39;Exit&amp;#39; button with a code-behind handler.&amp;nbsp; The handler does a few business-related things and then calls the &amp;quot;Close()&amp;#39; method.&amp;nbsp; Everything works fine.&lt;/p&gt;
&lt;p&gt;I went to add this same logic to one of my other forms and I got a compile error on the line that had the &amp;quot;Close()&amp;quot; call:&amp;nbsp; &amp;quot;&lt;em&gt;The name &amp;#39;Close()&amp;#39; does not exist in the current context&lt;/em&gt;&amp;quot;.&amp;nbsp; Huh?&lt;/p&gt;
&lt;p&gt;So I began to compare the&amp;nbsp;working form code with the non-working form code.&amp;nbsp; The Close() method is defined in a module named &amp;quot;Microsoft.Office.InfoPath.XmlFormHostItem.cs&amp;quot; that resides in the InfoPath cache.&amp;nbsp; When I compared the XmlFormHostItem.cs module of the first form with the second one, I found the following items were missing from the form that won&amp;#39;t compile:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public virtual bool Dirty { get; set; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public virtual object Extension { get; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public virtual object Host { get; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public virtual bool Hosted { get; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public virtual string HostName { get; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public virtual Permission Permission { get; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public virtual bool Recovered { get; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public virtual SignedDataBlockCollection SignedDataBlocks { get; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public virtual TaskPaneCollection TaskPanes { get; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public virtual string UserRole { get; set; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public virtual void Close();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public virtual object GetWorkflowTasks();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public virtual object GetWorkflowTemplates();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public virtual void MergeForm(string fileUrl);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public virtual void MergeForm(XPathNavigator target);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public virtual void Print();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public virtual void Print(bool showPrintDialog);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public virtual void Save();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public virtual void SaveAs(string fileUrl);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public virtual void SetSaveAsDialogFilename(string filename);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public virtual void SetSaveAsDialogLocation(string pathname);&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Notice that Close() is one of the missing methods.&amp;nbsp; I figured this might be the result of some difference in the InfoPath settings between the two forms.&amp;nbsp; I opened Tools/Form Options and compared each category - they were exactly the same.&amp;nbsp; I looked at the Class View and the Object Browser and could find no difference.&amp;nbsp; I&amp;#39;ve cleared cached and re-compiled but the problem still exists.&lt;/p&gt;
&lt;p&gt;Does anyone have any ideas?&amp;nbsp; I thinking of starting over with a fresh project and pasteing-in my existing code.&lt;/p&gt;
&lt;p&gt;Thanks in advance for any feedback.&lt;/p&gt;
&lt;p&gt;\cbf&lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>