<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<title>[mapguide-users] Listing Active selected feature C#</title>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
name="PlaceType"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
name="PlaceName"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
name="State"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
name="country-region"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
name="City"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
name="place"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"Trebuchet MS";
        panose-1:2 11 6 3 2 2 2 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;
        text-decoration:underline;}
p
        {mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman";}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Trebuchet MS";
        color:blue;
        font-weight:normal;
        font-style:normal;
        text-decoration:none none;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>
</head>
<body lang=EN-US link=blue vlink=blue>
<div class=Section1>
<p class=MsoNormal><font size=2 color=blue face="Trebuchet MS"><span
style='font-size:10.0pt;font-family:"Trebuchet MS";color:blue'>Sorry for the
delay… busy day yesterday.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=blue face="Trebuchet MS"><span
style='font-size:10.0pt;font-family:"Trebuchet MS";color:blue'><br>
My C# code goes something like this:<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=blue face="Trebuchet MS"><span
style='font-size:10.0pt;font-family:"Trebuchet MS";color:blue'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=blue face="Trebuchet MS"><span
style='font-size:10.0pt;font-family:"Trebuchet MS";color:blue'>(Note that this example
makes use of the listSelected javascript function. I include that in utilityfunction.aspx.
I have included this code after the C# stuff.)<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=blue face="Trebuchet MS"><span
style='font-size:10.0pt;font-family:"Trebuchet MS";color:blue'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 color=green
face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New";
color:green'>// get the SESSION id and xml SELECTION<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=blue face="Trebuchet MS"><span
style='font-size:10.0pt;font-family:"Trebuchet MS";color:blue'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 color=teal
face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New";
color:teal'>String</span></font><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> mgSessionId =
GetParameters()[<font color=maroon><span style='color:maroon'>"SESSION"</span></font>];<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 color=teal
face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New";
color:teal'>String</span></font><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> xmlSel = GetParameters()[<font
color=maroon><span style='color:maroon'>"SELECTION"</span></font>];<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 color=green
face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New";
color:green'>// Go!<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> <o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 color=blue
face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New";
color:blue'>try<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>{<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> <font
color=green><span style='color:green'>// Initialize the web-tier</span></font>
<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 color=green
face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New";
color:green'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
InitializeWebTier();<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> <font
color=teal><span style='color:teal'>MgUserInformation</span></font> userInfo = <font
color=blue><span style='color:blue'>new</span></font> <font color=teal><span
style='color:teal'>MgUserInformation</span></font>(mgSessionId);<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> <font
color=teal><span style='color:teal'>MgSiteConnection</span></font>
siteConnection = <font color=blue><span style='color:blue'>new</span></font> <font
color=teal><span style='color:teal'>MgSiteConnection</span></font>();<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
siteConnection.Open(userInfo);<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> <font
color=green><span style='color:green'>// Create a ResourceService object and
use it to open the Map<o:p></o:p></span></font></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> <font
color=green><span style='color:green'>// object from the sessions repository.
Create a FeatureService <o:p></o:p></span></font></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> <font
color=green><span style='color:green'>// object to read the feature
information. Create a QueryOptions<o:p></o:p></span></font></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> <font
color=green><span style='color:green'>// object for creating the list of
features.<o:p></o:p></span></font></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 color=green
face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New";
color:green'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> <font
color=teal><span style='color:teal'>MgResourceService</span></font>
resourceService = siteConnection.CreateService(<font color=teal><span
style='color:teal'>MgServiceType</span></font>.ResourceService) <font
color=blue><span style='color:blue'>as</span></font> <font color=teal><span
style='color:teal'>MgResourceService</span></font>;<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> <font
color=teal><span style='color:teal'>MgFeatureService</span></font>
featureService = siteConnection.CreateService(<font color=teal><span
style='color:teal'>MgServiceType</span></font>.FeatureService) <font
color=blue><span style='color:blue'>as</span></font> <font color=teal><span
style='color:teal'>MgFeatureService</span></font>;<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> <font
color=teal><span style='color:teal'>MgFeatureQueryOptions</span></font>
queryOptions = <font color=blue><span style='color:blue'>new</span></font> <font
color=teal><span style='color:teal'>MgFeatureQueryOptions</span></font>();<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> <o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> <font
color=teal><span style='color:teal'>MgMap</span></font> map = <font color=blue><span
style='color:blue'>new</span></font> <font color=teal><span style='color:teal'>MgMap</span></font>();<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
map.Open(resourceService, <font color=maroon><span style='color:maroon'>"Zoning"</span></font>);
<font color=green><span style='color:green'><o:p></o:p></span></font></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> <font
color=green><span style='color:green'>// Create the selection object by
retrieving the current<o:p></o:p></span></font></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> <font
color=green><span style='color:green'>// selection from the map.<o:p></o:p></span></font></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 color=green
face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New";
color:green'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> <font
color=teal><span style='color:teal'>MgSelection</span></font> selection = <font
color=blue><span style='color:blue'>new</span></font> <font color=teal><span
style='color:teal'>MgSelection</span></font>(map, xmlSel);<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> <o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> <font
color=teal><span style='color:teal'>MgReadOnlyLayerCollection</span></font>
layers = selection.GetLayers();<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> <font
color=teal><span style='color:teal'>Int32</span></font> layerCount =
layers.GetCount();<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 color=green
face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New";
color:green'> // Loop through layers<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> <o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> <font
color=blue><span style='color:blue'>if</span></font> (layerCount > 0)<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> {<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
<font color=blue><span style='color:blue'>for</span></font> (<font color=blue><span
style='color:blue'>int</span></font> i = 0; i < layers.GetCount(); i++)<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
{<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
<font color=green><span style='color:green'>// Only check objects on the Parcels
layer<o:p></o:p></span></font></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
<font color=teal><span style='color:teal'>MgLayer</span></font> layer =
layers.GetItem(i);<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> <font
color=blue><span style='color:blue'>if</span></font> (layer.GetName() == <font
color=maroon><span style='color:maroon'>"Parcels"</span></font>)<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
{<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
<font color=green><span style='color:green'>// Create a filter containing the
IDs of the selected<o:p></o:p></span></font></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
<font color=green><span style='color:green'>// features on this layer<o:p></o:p></span></font></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
<font color=blue><span style='color:blue'>string</span></font> layerClassName =
layer.GetFeatureClassName();<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
<font color=blue><span style='color:blue'>string</span></font> selectionString
= selection.GenerateFilter(layer, layerClassName);<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> <o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
<font color=green><span style='color:green'>// Get the feature resource for the
selected layer<o:p></o:p></span></font></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 color=green
face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New";
color:green'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
<font color=blue><span style='color:blue'>string</span></font> layerFeatureID =
layer.GetFeatureSourceId();<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
<font color=teal><span style='color:teal'>MgResourceIdentifier</span></font>
layerFeatureResource = <font color=blue><span style='color:blue'>new</span></font>
<font color=teal><span style='color:teal'>MgResourceIdentifier</span></font>(layerFeatureID);<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
<font color=green><span style='color:green'>// Apply the filter to the feature
resource for the<o:p></o:p></span></font></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
<font color=green><span style='color:green'>// selected layer. This
returns an MgFeatureReader<o:p></o:p></span></font></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
<font color=green><span style='color:green'>// of all the selected features.<o:p></o:p></span></font></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
queryOptions.SetFilter(selectionString);<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
<font color=teal><span style='color:teal'>MgFeatureReader</span></font>
featureReader = featureService.SelectFeatures(layerFeatureResource,
layerClassName, queryOptions);<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
<font color=green><span style='color:green'>// Process each item in the
MgFeatureReader and display the some parcel attributes <o:p></o:p></span></font></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 color=green
face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New";
color:green'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> <font
color=teal><span style='color:teal'>MgAgfReaderWriter</span></font>
geometryReaderWriter = <font color=blue><span style='color:blue'>new</span></font>
<font color=teal><span style='color:teal'>MgAgfReaderWriter</span></font>();<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
<font color=blue><span style='color:blue'>while</span></font>
(featureReader.ReadNext())<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
{ <o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
<font color=blue><span style='color:blue'>string</span></font> pid_long =
featureReader.GetString(<font color=maroon><span style='color:maroon'>"PID_LONG"</span></font>);<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> <font
color=blue><span style='color:blue'>string</span></font> st_num =
featureReader.GetString(<font color=maroon><span style='color:maroon'>"ST_NUM"</span></font>);<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
<font color=blue><span style='color:blue'>string</span></font> st_name =
featureReader.GetString(<font color=maroon><span style='color:maroon'>"ST_NAME"</span></font>);<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
<font color=blue><span style='color:blue'>string</span></font> st_sfx =
featureReader.GetString(<font color=maroon><span style='color:maroon'>"ST_SFX"</span></font>);<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
<font color=blue><span style='color:blue'>string</span></font> zipcode =
featureReader.GetString(<font color=maroon><span style='color:maroon'>"ZIPCODE"</span></font>);<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
<font color=green><span style='color:green'>// Pull geometry for spatial query<o:p></o:p></span></font></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
<font color=teal><span style='color:teal'>MgByteReader</span></font> byteReader
= featureReader.GetGeometry(<font color=maroon><span style='color:maroon'>"Geometry"</span></font>);<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
<font color=teal><span style='color:teal'>MgGeometry</span></font> geometry =
geometryReaderWriter.Read(byteReader);<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
<font color=teal><span style='color:teal'>MgPoint</span></font> point =
geometry.GetCentroid();<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
<font color=blue><span style='color:blue'>double</span></font> x =
point.GetCoordinate().GetX();<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
<font color=blue><span style='color:blue'>double</span></font> y =
point.GetCoordinate().GetY();<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
Response.Write(<font color=maroon><span style='color:maroon'>"<tr><td
colspan=2 class=\"SubTitle\">Parcel</td></tr>"</span></font>);<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
Response.Write(<font color=maroon><span style='color:maroon'>"<tr><td
class=\"InfoText\">Parcel ID</td><td
class=\"InfoText\">"</span></font> + pid_long + <font
color=maroon><span style='color:maroon'>"</td></tr>"</span></font>);<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
Response.Write(<font color=maroon><span style='color:maroon'>"<tr><td
class=\"InfoText\">Address</td><td
class=\"InfoText\">"</span></font> + st_num + <font
color=maroon><span style='color:maroon'>" "</span></font> + st_name +
<font color=maroon><span style='color:maroon'>" "</span></font> +
st_sfx + <font color=maroon><span style='color:maroon'>"</td></tr>"</span></font>);<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
Response.Write(<font color=maroon><span style='color:maroon'>"<tr><td
class=\"InfoText\">Zip</td><td
class=\"InfoText\">"</span></font> + zipcode + <font
color=maroon><span style='color:maroon'>"</td></tr>"</span></font>);<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
<font color=green><span style='color:green'>// Intersect with the Zoning
District Layer <o:p></o:p></span></font></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
<font color=green><span style='color:green'>// to get the District Name<o:p></o:p></span></font></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 color=green
face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New";
color:green'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
<font color=teal><span style='color:teal'>MgResourceIdentifier</span></font>
zlayerFeatureResource = <font color=blue><span style='color:blue'>new</span></font>
<font color=teal><span style='color:teal'>MgResourceIdentifier</span></font>(<font
color=maroon><span style='color:maroon'>"Library://BOS/Data/Zoning_Districts.FeatureSource"</span></font>);<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
<font color=teal><span style='color:teal'>MgFeatureQueryOptions</span></font>
zqueryOptions = <font color=blue><span style='color:blue'>new</span></font> <font
color=teal><span style='color:teal'>MgFeatureQueryOptions</span></font>();<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
zqueryOptions.SetSpatialFilter(<font color=maroon><span style='color:maroon'>"Geometry"</span></font>,
geometry, 4);<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
<font color=teal><span style='color:teal'>MgAgfReaderWriter</span></font>
zgeometryReaderWriter = <font color=blue><span style='color:blue'>new</span></font>
<font color=teal><span style='color:teal'>MgAgfReaderWriter</span></font>();<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
<font color=teal><span style='color:teal'>MgFeatureReader</span></font>
zfeatureReader = featureService.SelectFeatures(zlayerFeatureResource, <font
color=maroon><span style='color:maroon'>"Zoning_Districts"</span></font>,
zqueryOptions);<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
<font color=blue><span style='color:blue'>while</span></font>
(zfeatureReader.ReadNext())<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
{<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
<font color=blue><span style='color:blue'>string</span></font> zDistrict =
zfeatureReader.GetString(<font color=maroon><span style='color:maroon'>"DISTRICT"</span></font>);<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
Response.Write(<font color=maroon><span style='color:maroon'>"<tr><td
class=\"InfoText\">District</td><td
class=\"InfoText\">"</span></font> + zDistrict.ToUpper() + <font
color=maroon><span style='color:maroon'>"</td></tr>"</span></font>);<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
}<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
zfeatureReader.Close();<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
<font color=green><span style='color:green'>// Intersect with the <st1:place
w:st="on"><st1:PlaceName w:st="on">Zoning</st1:PlaceName> <st1:PlaceType w:st="on">SubDistrict</st1:PlaceType></st1:place>
Layer <o:p></o:p></span></font></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
<font color=green><span style='color:green'>// to get the Base Zoning <o:p></o:p></span></font></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 color=green
face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New";
color:green'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
<font color=teal><span style='color:teal'>MgResourceIdentifier</span></font>
zzlayerFeatureResource = <font color=blue><span style='color:blue'>new</span></font>
<font color=teal><span style='color:teal'>MgResourceIdentifier</span></font>(<font
color=maroon><span style='color:maroon'>"Library://BOS/Data/Zoning_SubDistricts.FeatureSource"</span></font>);<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
<font color=teal><span style='color:teal'>MgFeatureQueryOptions</span></font>
zzqueryOptions = <font color=blue><span style='color:blue'>new</span></font> <font
color=teal><span style='color:teal'>MgFeatureQueryOptions</span></font>();<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
zzqueryOptions.SetSpatialFilter(<font color=maroon><span style='color:maroon'>"Geometry"</span></font>,
geometry, 4);<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
<font color=teal><span
style='color:teal'>MgAgfReaderWriter</span></font> zzgeometryReaderWriter = <font
color=blue><span style='color:blue'>new</span></font> <font color=teal><span
style='color:teal'>MgAgfReaderWriter</span></font>();<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
<font color=teal><span style='color:teal'>MgFeatureReader</span></font>
zzfeatureReader = featureService.SelectFeatures(zzlayerFeatureResource, <font
color=maroon><span style='color:maroon'>"Zoning_SubDistricts"</span></font>,
zzqueryOptions);<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
<font color=blue><span style='color:blue'>while</span></font> (zzfeatureReader.ReadNext())<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
{<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
<font color=blue><span style='color:blue'>string</span></font> zzZone =
zzfeatureReader.GetString(<font color=maroon><span style='color:maroon'>"ZONE_"</span></font>);<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
<font color=blue><span style='color:blue'>double</span></font> zzFAR =
zzfeatureReader.GetDouble(<font color=maroon><span style='color:maroon'>"FAR"</span></font>);<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
Response.Write(<font color=maroon><span style='color:maroon'>"<tr><td
class=\"InfoText\">Zone</td><td
class=\"InfoText\">"</span></font> + zzZone + <font
color=maroon><span style='color:maroon'>"</td></tr>"</span></font>);<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
Response.Write(<font color=maroon><span style='color:maroon'>"<tr><td
class=\"InfoText\">Zone FAR</td><td
class=\"InfoText\">"</span></font> + zzFAR + <font
color=maroon><span style='color:maroon'>"</td></tr>"</span></font>);<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
}<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
zzfeatureReader.Close();<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> }
<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
} <o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> } <o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>} <o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=green face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New";color:green'>// listSelected
javascript function – include somewhere in utilityfunctions.aspx<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=blue face="Trebuchet MS"><span
style='font-size:10.0pt;font-family:"Trebuchet MS";color:blue'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 color=blue
face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New";
color:blue'><</span></font><font size=2 color=maroon face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New";color:maroon'>script</span></font><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>
<font color=red><span style='color:red'>language</span></font><font color=blue><span
style='color:blue'>="javascript"><o:p></o:p></span></font></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 color=blue
face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New";
color:blue'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 color=blue
face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New";
color:blue'>function</span></font><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> listSelected()<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>{<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> xmlSel =
ViewerFrame.mapFrame.GetSelectionXML();<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> params = <font
color=blue><span style='color:blue'>new</span></font> Array(<font color=maroon><span
style='color:maroon'>"SESSION"</span></font>,
ViewerFrame.mapFrame.GetSessionId(), <font color=maroon><span style='color:
maroon'>"SELECTION"</span></font>, xmlSel);<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
ViewerFrame.formFrame.Submit(<font color=maroon><span style='color:maroon'>"../brazoning/getzoningtask.aspx"</span></font>,
params, <font color=maroon><span style='color:maroon'>"taskPaneFrame"</span></font>);<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>}<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=blue face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New";color:blue'></</span></font><font
size=2 color=maroon face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New";color:maroon'>script</span></font><font size=2
color=blue face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New";
color:blue'>></span></font><font size=2 color=blue face="Trebuchet MS"><span
style='font-size:10.0pt;font-family:"Trebuchet MS";color:blue'><o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=blue face="Trebuchet MS"><span
style='font-size:10.0pt;font-family:"Trebuchet MS";color:blue'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=blue face="Trebuchet MS"><span
style='font-size:10.0pt;font-family:"Trebuchet MS";color:blue'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=blue face="Trebuchet MS"><span
style='font-size:10.0pt;font-family:"Trebuchet MS";color:blue'><o:p> </o:p></span></font></p>
<div>
<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>
<hr size=2 width="100%" align=center tabindex=-1>
</span></font></div>
<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>
mapguide-users-bounces@lists.osgeo.org [mailto:mapguide-users-bounces@lists.osgeo.org]
<b><span style='font-weight:bold'>On Behalf Of </span></b>Andy Morsell<br>
<b><span style='font-weight:bold'>Sent:</span></b> Sunday, January 21, 2007
2:15 PM<br>
<b><span style='font-weight:bold'>To:</span></b> mapguide-users@lists.osgeo.org<br>
<b><span style='font-weight:bold'>Subject:</span></b> RE: [mapguide-users]
Listing Active selected feature C#</span></font><o:p></o:p></p>
</div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=blue face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:blue'>Greg,</span></font><o:p></o:p></p>
<p class=MsoNormal><font size=2 color=blue face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:blue'>Would it be possible for you to post the
example to the group? The list should accept plain text file attachments
or you could paste it into the message body.</span></font><o:p></o:p></p>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> <o:p></o:p></span></font></p>
</div>
<p><font size=1 face=Tahoma><span style='font-size:7.5pt;font-family:Tahoma'><!-- Converted from text/rtf format -->Andy
</span></font><o:p></o:p></p>
<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>
<hr size=2 width="100%" align=center tabIndex=-1>
</span></font></div>
<p class=MsoNormal style='margin-bottom:12.0pt'><b><font size=2 face=Tahoma><span
style='font-size:10.0pt;font-family:Tahoma;font-weight:bold'>From:</span></font></b><font
size=2 face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>
mapguide-users-bounces@lists.osgeo.org
[mailto:mapguide-users-bounces@lists.osgeo.org] <b><span style='font-weight:
bold'>On Behalf Of </span></b>Knight, Gregory<br>
<b><span style='font-weight:bold'>Sent:</span></b> Sunday, January 21, 2007
10:43 AM<br>
<b><span style='font-weight:bold'>To:</span></b> Nimrod Cnaan;
mapguide-users@lists.osgeo.org<br>
<b><span style='font-weight:bold'>Subject:</span></b> RE: [mapguide-users]
Listing Active selected feature C#</span></font><o:p></o:p></p>
<div id=idOWAReplyText41468>
<div>
<p class=MsoNormal><font size=2 color=black face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:black'>I have a C# example where I am doing
exactly this. I can send you the page via separate means if you are interested.</span></font><o:p></o:p></p>
</div>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> <o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Greg</span></font><o:p></o:p></p>
</div>
</div>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>
<hr size=2 width="100%" align=center tabIndex=-1>
</span></font></div>
<p class=MsoNormal style='margin-bottom:12.0pt'><b><font size=2 face=Tahoma><span
style='font-size:10.0pt;font-family:Tahoma;font-weight:bold'>From:</span></font></b><font
size=2 face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>
mapguide-users-bounces@lists.osgeo.org on behalf of Nimrod Cnaan<br>
<b><span style='font-weight:bold'>Sent:</span></b> Sat 1/20/2007 9:13 AM<br>
<b><span style='font-weight:bold'>To:</span></b> mapguide-users@lists.osgeo.org<br>
<b><span style='font-weight:bold'>Subject:</span></b> [mapguide-users] Listing
Active selected feature C#</span></font><o:p></o:p></p>
</div>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
<p><font size=2 face="Times New Roman"><span style='font-size:10.0pt'>I am
attempting to get the list of selected parcels by using “Invoke
URL”<br>
command, passing “$Current Selection” to my
“listdwfparcels.aspx” page,<br>
through the key & value pair.<br>
<br>
I don’t know what I’m doing wrong, getting unclassified exception<br>
“MgSelection.FromXml” . . .<br>
<br>
Checking the value of my mgkey content “$Current Selection” returns:<br>
<br>
%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%0A%3CFeatureSet%3E%0A%3CLayer%20id%3D%22d6a8101a-ffff-ffff-8003-000000000038%22%3E%0A%3CClass%20id%3D%22Default%3AHelkot%22%3E%0A%3CID%3ETAAAAA%3D%3D%3C%2FID%3E%0A%3CID%3EVwAAAA%3D%3D%3C%2FID%3E%0A%3CID%3EVgAAAA%3D%3D%3C%2FID%3E%0A%3C%2FClass%3E%0A%3C%2FLayer%3E%0A%3C%2FFeatureSet%3E%0A<br>
<br>
Here is portion of the code that I’m using –<br>
<br>
String mgSessionId = GetParameters()["SESSION"];<br>
String mgSelection = GetParameters()["mgkey"];<br>
MgResourceIdentifier layerFeatureResource;<br>
MgReadOnlyLayerCollection layers;<br>
MgSelection selection;<br>
MgLayer layer;<br>
string layerClassName;<br>
string selectionString;<br>
string layerFeatureId;<br>
<br>
<br>
try<br>
{<br>
InitializeWebTier();<br>
<br>
MgUserInformation userInfo = new MgUserInformation(mgSessionId);<br>
MgSiteConnection siteConnection = new MgSiteConnection();<br>
siteConnection.Open(userInfo);<br>
<br>
MgResourceService resourceService =<br>
siteConnection.CreateService(MgServiceType.ResourceService) as<br>
MgResourceService;<br>
MgFeatureService featureService =<br>
siteConnection.CreateService(MgServiceType.FeatureService) as<br>
MgFeatureService;<br>
MgFeatureQueryOptions queryOptions = new MgFeatureQueryOptions();<br>
<br>
MgMap map = new MgMap();<br>
map.Open(resourceService, "HaifaMap");<br>
<br>
if (GetParameters()["SESSION"] != "")<br>
{<br>
selection = new MgSelection(map, mgSelection);<br>
<br>
<<<<< MY ERROR >>>>><br>
An unclassified exception occurred.An unclassified exception occurred.<br>
Exception occurred in method MgSelection.FromXml at line 158 in file<br>
c:\build_tux_area\mgdev_opensource\common\service\maplayer\Selection.cpp<br>
<br>
<br>
Nimrod Cnaan – GIS Senior Programmer<br>
<st1:place w:st="on"><st1:City w:st="on">Haifa Municipality</st1:City>, <st1:country-region
w:st="on">Israel</st1:country-region></st1:place><br>
Phon:972525355483<br>
<br>
--<br>
View this message in context: <a
href="http://www.nabble.com/Listing-Active-selected-feature-C--tf3045397s16610.html#a8465318">http://www.nabble.com/Listing-Active-selected-feature-C--tf3045397s16610.html#a8465318</a><br>
Sent from the MapGuide Users mailing list archive at Nabble.com.<br>
<br>
_______________________________________________<br>
mapguide-users mailing list<br>
mapguide-users@lists.osgeo.org<br>
<a href="http://lists.osgeo.org/mailman/listinfo/mapguide-users">http://lists.osgeo.org/mailman/listinfo/mapguide-users</a></span></font><o:p></o:p></p>
</div>
<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>
<hr size=1 width="100%" align=center>
</span></font></div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
<p><b><font size=3 face="Times New Roman"><span style='font-size:12.0pt;
font-weight:bold'><br>
<strong><b><font face="Times New Roman">The substance of this message,
including any attachments, may be</font></b></strong><br>
<strong><b><font face="Times New Roman">confidential, legally</font></b></strong><br>
<strong><b><font face="Times New Roman">privileged and/or exempt from
disclosure pursuant to <st1:State w:st="on"><st1:place w:st="on">Massachusetts</st1:place></st1:State></font></b></strong><br>
<strong><b><font face="Times New Roman">law. It is intended</font></b></strong><br>
<strong><b><font face="Times New Roman">solely for the addressee. If you
received this in error, please</font></b></strong><br>
<strong><b><font face="Times New Roman">contact the sender and</font></b></strong><br>
<strong><b><font face="Times New Roman">delete the material from any computer.</font></b></strong></span></font></b><o:p></o:p></p>
</div>
</body>
</html>