<?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: AddAttachment in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/addattachment/m-p/514461#M13139</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I would also like to implement: AttachmentResult and Exception .&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The two last arguments of AddAttachments are callbacks giving you the result and the exception.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;You can use them with code like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&lt;SPAN style="color:blue;"&gt;var&lt;/SPAN&gt; callback = (Action&amp;lt;&lt;SPAN style="color:#2b91af;"&gt;AttachmentResult&lt;/SPAN&gt;&amp;gt;)&lt;SPAN style="color:blue;"&gt;delegate&lt;/SPAN&gt;(&lt;SPAN style="color:#2b91af;"&gt;AttachmentResult&lt;/SPAN&gt; result)
{
&lt;SPAN style="color:#2b91af;"&gt; MessageBox&lt;/SPAN&gt;.Show(&lt;SPAN style="color:#a31515;"&gt;"Added attachment to "&lt;/SPAN&gt; + result.ObjectID);
};
 
&lt;SPAN style="color:blue;"&gt;var&lt;/SPAN&gt; errorCallback = (Action&amp;lt;&lt;SPAN style="color:#2b91af;"&gt;Exception&lt;/SPAN&gt;&amp;gt;)&lt;SPAN style="color:blue;"&gt;delegate&lt;/SPAN&gt;(&lt;SPAN style="color:#2b91af;"&gt;Exception&lt;/SPAN&gt; result)
{
&lt;SPAN style="color:#2b91af;"&gt; MessageBox&lt;/SPAN&gt;.Show("Error adding attachment : " + result.Message);
};
 
featureLayer.AddAttachment(theNewObjectID, stream, ofdWorksheet.File.Name, callback, errorCallback);
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 22:29:10 GMT</pubDate>
    <dc:creator>DominiqueBroux</dc:creator>
    <dc:date>2021-12-11T22:29:10Z</dc:date>
    <item>
      <title>AddAttachment</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/addattachment/m-p/514460#M13138</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am trying to add an attachment (.jpg file) to a feature.&amp;nbsp; Does anyone have a simple code example? &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;featureLayer.AddAttachment(theNewObjectID, stream, ofdWorksheet.File.Name, null, null);&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would also like to implement: AttachmentResult and Exception&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jul 2011 18:45:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/addattachment/m-p/514460#M13138</guid>
      <dc:creator>CraigPerreault</dc:creator>
      <dc:date>2011-07-27T18:45:29Z</dc:date>
    </item>
    <item>
      <title>Re: AddAttachment</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/addattachment/m-p/514461#M13139</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I would also like to implement: AttachmentResult and Exception .&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The two last arguments of AddAttachments are callbacks giving you the result and the exception.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;You can use them with code like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&lt;SPAN style="color:blue;"&gt;var&lt;/SPAN&gt; callback = (Action&amp;lt;&lt;SPAN style="color:#2b91af;"&gt;AttachmentResult&lt;/SPAN&gt;&amp;gt;)&lt;SPAN style="color:blue;"&gt;delegate&lt;/SPAN&gt;(&lt;SPAN style="color:#2b91af;"&gt;AttachmentResult&lt;/SPAN&gt; result)
{
&lt;SPAN style="color:#2b91af;"&gt; MessageBox&lt;/SPAN&gt;.Show(&lt;SPAN style="color:#a31515;"&gt;"Added attachment to "&lt;/SPAN&gt; + result.ObjectID);
};
 
&lt;SPAN style="color:blue;"&gt;var&lt;/SPAN&gt; errorCallback = (Action&amp;lt;&lt;SPAN style="color:#2b91af;"&gt;Exception&lt;/SPAN&gt;&amp;gt;)&lt;SPAN style="color:blue;"&gt;delegate&lt;/SPAN&gt;(&lt;SPAN style="color:#2b91af;"&gt;Exception&lt;/SPAN&gt; result)
{
&lt;SPAN style="color:#2b91af;"&gt; MessageBox&lt;/SPAN&gt;.Show("Error adding attachment : " + result.Message);
};
 
featureLayer.AddAttachment(theNewObjectID, stream, ofdWorksheet.File.Name, callback, errorCallback);
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 22:29:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/addattachment/m-p/514461#M13139</guid>
      <dc:creator>DominiqueBroux</dc:creator>
      <dc:date>2021-12-11T22:29:10Z</dc:date>
    </item>
  </channel>
</rss>

