<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Simple question? Sharing data among tools and commands in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/simple-question-sharing-data-among-tools-and/m-p/20062#M487</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Steven,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you share what you mean by "data"?&amp;nbsp;&amp;nbsp; I know you want to share data between the tools and commands, but can you be specific?&amp;nbsp; Data from where?&amp;nbsp; Hardcoded?&amp;nbsp; From an external source? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Obviously you need a model that handles the logic for data that is shared between these tools and commands.&amp;nbsp; Where/When do you initialize such a model?&amp;nbsp; Do the tools and commands have a natural workflow? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Have you considered an application extension?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/0001/0001000004m1000000.htm"&gt;http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/0001/0001000004m1000000.htm&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 26 Mar 2013 15:04:53 GMT</pubDate>
    <dc:creator>LeoDonahue</dc:creator>
    <dc:date>2013-03-26T15:04:53Z</dc:date>
    <item>
      <title>Simple question? Sharing data among tools and commands</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/simple-question-sharing-data-among-tools-and/m-p/20058#M483</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am customizing ArcMap using VS2008 with the Developer Kit for .NET.&amp;nbsp; I have created a C# project with some commands and tools and an associated toolbar.&amp;nbsp; I want to share some data among these items within the project (so that the data is available to each tool or command when it is executing), but I can't figure out how to do it.&amp;nbsp; I'm pretty sure this is a simple question, but it's got me stumped for now.&amp;nbsp; Can anyone give me some suggestions?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Mar 2013 14:12:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/simple-question-sharing-data-among-tools-and/m-p/20058#M483</guid>
      <dc:creator>StevenHill1</dc:creator>
      <dc:date>2013-03-26T14:12:14Z</dc:date>
    </item>
    <item>
      <title>Re: Simple question? Sharing data among tools and commands</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/simple-question-sharing-data-among-tools-and/m-p/20059#M484</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt; I have created a C# project with some commands and tools and an associated toolbar.&amp;nbsp; I want to share some data among these items within the project (so that&amp;nbsp; the data is available to each tool or command when it is executing)&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;This would be a design pattern, what you choose is up to you.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;All commands and tools are in the same project?&amp;nbsp; Is your customization an Add-in?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Mar 2013 14:29:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/simple-question-sharing-data-among-tools-and/m-p/20059#M484</guid>
      <dc:creator>LeoDonahue</dc:creator>
      <dc:date>2013-03-26T14:29:54Z</dc:date>
    </item>
    <item>
      <title>Re: Simple question? Sharing data among tools and commands</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/simple-question-sharing-data-among-tools-and/m-p/20060#M485</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;All commands, tools and the toolbar are in the same project, which is an add-in (to be implemented via Tools/Customization).&amp;nbsp; As to design patterns, right now I have no choices - as I said, I am stumped, but I think I am missing something really obvious...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Mar 2013 14:41:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/simple-question-sharing-data-among-tools-and/m-p/20060#M485</guid>
      <dc:creator>StevenHill1</dc:creator>
      <dc:date>2013-03-26T14:41:28Z</dc:date>
    </item>
    <item>
      <title>Re: Simple question? Sharing data among tools and commands</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/simple-question-sharing-data-among-tools-and/m-p/20061#M486</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;All commands, tools and the toolbar are in the same project, which is an add-in (to be implemented via Tools/Customization).&amp;nbsp; As to design patterns, right now I have no choices - as I said, I am stumped, but I think I am missing something really obvious...&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can try a singleton. Only one instance can exist in the AppDomain at a particular time.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/ff650316.aspx"&gt;http://msdn.microsoft.com/en-us/library/ff650316.aspx&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Mar 2013 14:45:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/simple-question-sharing-data-among-tools-and/m-p/20061#M486</guid>
      <dc:creator>JasonPike</dc:creator>
      <dc:date>2013-03-26T14:45:38Z</dc:date>
    </item>
    <item>
      <title>Re: Simple question? Sharing data among tools and commands</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/simple-question-sharing-data-among-tools-and/m-p/20062#M487</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Steven,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you share what you mean by "data"?&amp;nbsp;&amp;nbsp; I know you want to share data between the tools and commands, but can you be specific?&amp;nbsp; Data from where?&amp;nbsp; Hardcoded?&amp;nbsp; From an external source? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Obviously you need a model that handles the logic for data that is shared between these tools and commands.&amp;nbsp; Where/When do you initialize such a model?&amp;nbsp; Do the tools and commands have a natural workflow? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Have you considered an application extension?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/0001/0001000004m1000000.htm"&gt;http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/0001/0001000004m1000000.htm&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Mar 2013 15:04:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/simple-question-sharing-data-among-tools-and/m-p/20062#M487</guid>
      <dc:creator>LeoDonahue</dc:creator>
      <dc:date>2013-03-26T15:04:53Z</dc:date>
    </item>
    <item>
      <title>Re: Simple question? Sharing data among tools and commands</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/simple-question-sharing-data-among-tools-and/m-p/20063#M488</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;OK, here is an example of what I mean - one of the tools is going to generate, through user input on the map, an angle.&amp;nbsp; I want the value of the angle to be available to other commands and tools in the project.&amp;nbsp; How do I do that?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Mar 2013 15:46:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/simple-question-sharing-data-among-tools-and/m-p/20063#M488</guid>
      <dc:creator>StevenHill1</dc:creator>
      <dc:date>2013-03-26T15:46:39Z</dc:date>
    </item>
    <item>
      <title>Re: Simple question? Sharing data among tools and commands</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/simple-question-sharing-data-among-tools-and/m-p/20064#M489</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Somewhere in the event of the tool, initialize an object that stores that data.&amp;nbsp; As Jason suggested, you could make it a singleton.&amp;nbsp; It would only ever have one instance throughout the duration of your Add-in.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You should be able to access the instance of that object from other classes that represent your other tools / commands.&amp;nbsp; You will want to make sure that the other tools / commands know how to repsond when the instance has not been created.&amp;nbsp; In other words, check to see if the instance has been created, then you can call properties or methods that retrieve the data you want.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That is one option.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Mar 2013 16:09:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/simple-question-sharing-data-among-tools-and/m-p/20064#M489</guid>
      <dc:creator>LeoDonahue</dc:creator>
      <dc:date>2013-03-26T16:09:36Z</dc:date>
    </item>
    <item>
      <title>Re: Simple question? Sharing data among tools and commands</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/simple-question-sharing-data-among-tools-and/m-p/20065#M490</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In ArcGIS desktop ArcObjects, the design I always have used for this is an ArcGIS desktop extension.&amp;nbsp; Singletons, in my opinion, are almost like global variables, so are static members on a class.&amp;nbsp; An ArcGIS extension can be used outside the assembly (by using COM interfaces) and offer a pattern that is easy to implement.&amp;nbsp; All your commands can get access to your extension through the Application class passed in during oncreate.&amp;nbsp; They are guaranteed only one instance per session and fit in with the design pattern of the application.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Mar 2013 16:43:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/simple-question-sharing-data-among-tools-and/m-p/20065#M490</guid>
      <dc:creator>AlexanderGray</dc:creator>
      <dc:date>2013-03-26T16:43:51Z</dc:date>
    </item>
    <item>
      <title>Re: Simple question? Sharing data among tools and commands</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/simple-question-sharing-data-among-tools-and/m-p/20066#M491</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks to all for the help - I have used a singleton class and it looks like it will do the job -still have a long way to go.&amp;nbsp; I understand that I could also make my set of tools etc and extension, but I'm trying to avoid that additional level of complexity.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Mar 2013 18:36:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/simple-question-sharing-data-among-tools-and/m-p/20066#M491</guid>
      <dc:creator>StevenHill1</dc:creator>
      <dc:date>2013-03-26T18:36:30Z</dc:date>
    </item>
  </channel>
</rss>

