<?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: 100.3.0 Graphic Attributes Bug in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/100-3-0-graphic-attributes-bug/m-p/635181#M7832</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are correct that object data type in Attributes dictionary imply any user-defined type&amp;nbsp;may be supported as&amp;nbsp;well. This was also possible in v10.x releases at least in the context of Graphics.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But with v100.x, creation of fields (which defines the columns of database table) are limited to types ArcGIS Server support, which means the Attributes (which represent row values) follow this same restriction.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 23 Aug 2018 21:09:13 GMT</pubDate>
    <dc:creator>JenniferNery</dc:creator>
    <dc:date>2018-08-23T21:09:13Z</dc:date>
    <item>
      <title>100.3.0 Graphic Attributes Bug</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/100-3-0-graphic-attributes-bug/m-p/635178#M7829</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If I create an instance of&amp;nbsp; Esri.ArcGISRuntime.UI.Graphic and add an attribute to it, in which the value of the attribute is a member of an enum, the graphic will not be successfully added to the graphics collection of an overlay.&amp;nbsp; It fails silently and and I'll see this in the output window at debug time:&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Exception thrown: 'System.NotSupportedException' in Esri.ArcGISRuntime.dll&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Error: 'Specified method is not supported.&lt;/EM&gt;'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code that doesn't work:&lt;/P&gt;&lt;P&gt;var sketchGraphic = new Esri.ArcGISRuntime.UI.Graphic(geometry, symbol);&lt;BR /&gt; sketchGraphic.Attributes.Add(_adHocGraphicTypeAttributeName, AdHocGraphicTypeEnum.UserSketch);&lt;BR /&gt; sketchOverlay.Graphics.Add(sketchGraphic);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code that does work:&lt;/P&gt;&lt;P&gt;var sketchGraphic = new Esri.ArcGISRuntime.UI.Graphic(geometry, symbol);&lt;BR /&gt; sketchGraphic.Attributes.Add(_adHocGraphicTypeAttributeName, 1);&lt;BR /&gt; sketchOverlay.Graphics.Add(sketchGraphic);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The enum above is defined as:&lt;/P&gt;&lt;P&gt;public enum AdHocGraphicTypeEnum&lt;BR /&gt; {&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;Unknown = 0,&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;UserSketch = 1,&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;Buffer = 2&lt;BR /&gt; }&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Aug 2018 17:25:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/100-3-0-graphic-attributes-bug/m-p/635178#M7829</guid>
      <dc:creator>Mike_Quetel</dc:creator>
      <dc:date>2018-08-23T17:25:49Z</dc:date>
    </item>
    <item>
      <title>Re: 100.3.0 Graphic Attributes Bug</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/100-3-0-graphic-attributes-bug/m-p/635179#M7830</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Attributes in v100.x only support the following&amp;nbsp;data types&amp;nbsp;&lt;A href="https://developers.arcgis.com/net/latest/wpf/api-reference//html/T_Esri_ArcGISRuntime_Data_FieldType.htm"&gt;https://developers.arcgis.com/net/latest/wpf/api-reference//html/T_Esri_ArcGISRuntime_Data_FieldType.htm&lt;/A&gt;&amp;nbsp;with the exception of Geometry, Xml, Raster, Blob.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have a user-defined enum, you can cast it to int to allow you to store it in graphic.Attribute.&lt;/P&gt;&lt;P&gt;graphic.Attributes[&lt;SPAN style="background-color: #ffffff;"&gt;_adHocGraphicTypeAttributeName] = (int)&lt;SPAN&gt;AdHocGraphicTypeEnum.UserSketch;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;SPAN&gt;and evaluate&amp;nbsp;its value by casting it back to the enum type.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;SPAN&gt;if( (AdHocGraphicTypeEnum) graphic.Attributes[&lt;SPAN style="background-color: #ffffff;"&gt;_adHocGraphicTypeAttributeName]&lt;SPAN&gt;&amp;nbsp; ==&amp;nbsp;AdHocGraphicTypeEnum.&lt;SPAN style="background-color: #ffffff;"&gt;UserSketch) {...}&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Aug 2018 19:51:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/100-3-0-graphic-attributes-bug/m-p/635179#M7830</guid>
      <dc:creator>JenniferNery</dc:creator>
      <dc:date>2018-08-23T19:51:19Z</dc:date>
    </item>
    <item>
      <title>Re: 100.3.0 Graphic Attributes Bug</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/100-3-0-graphic-attributes-bug/m-p/635180#M7831</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Jennifer,&amp;nbsp;your suggestion is a good workaround for me.&amp;nbsp; &amp;nbsp;I'm not used to seeing a dictionary&amp;lt;string,object&amp;gt; that would not take something that ultimately derives from system.object&amp;nbsp; &amp;nbsp;(&lt;EM&gt;enum&lt;/EM&gt;&amp;nbsp;inherits from &lt;EM&gt;valuetype&lt;/EM&gt; which inherits from &lt;EM&gt;object&lt;/EM&gt;).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Aug 2018 20:50:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/100-3-0-graphic-attributes-bug/m-p/635180#M7831</guid>
      <dc:creator>Mike_Quetel</dc:creator>
      <dc:date>2018-08-23T20:50:31Z</dc:date>
    </item>
    <item>
      <title>Re: 100.3.0 Graphic Attributes Bug</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/100-3-0-graphic-attributes-bug/m-p/635181#M7832</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are correct that object data type in Attributes dictionary imply any user-defined type&amp;nbsp;may be supported as&amp;nbsp;well. This was also possible in v10.x releases at least in the context of Graphics.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But with v100.x, creation of fields (which defines the columns of database table) are limited to types ArcGIS Server support, which means the Attributes (which represent row values) follow this same restriction.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Aug 2018 21:09:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/100-3-0-graphic-attributes-bug/m-p/635181#M7832</guid>
      <dc:creator>JenniferNery</dc:creator>
      <dc:date>2018-08-23T21:09:13Z</dc:date>
    </item>
  </channel>
</rss>

