# Problem with ThemeItem Selection

**URL:** <https://community.thinkgeo.com/t/problem-with-themeitem-selection/1605>\
**Category:** WinForms\
**Created:** [February 25, 2011, 5:46am UTC](https://community.thinkgeo.com/t/problem-with-themeitem-selection/1605 "2011-02-25T05:46:09Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sanjay](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/s/58956e/32.png) [@Sanjay](https://community.thinkgeo.com/u/Sanjay)\
**Post date:** [February 25, 2011, 5:46am UTC](https://community.thinkgeo.com/t/problem-with-themeitem-selection/1605/1 "2011-02-25T05:46:09Z")

</div>

Dear&nbsp;Yale

As&nbsp;per&nbsp;Sample&nbsp;made&nbsp;in&nbsp;C&nbsp;Sharp&nbsp;for&nbsp;Map&nbsp;suite&nbsp;explorer,&nbsp;I&nbsp;have&nbsp;created&nbsp;ThemeItem&nbsp;and&nbsp;ThemeView&nbsp;Control&nbsp;in&nbsp;vb.net.&nbsp;I&nbsp;think&nbsp;there&nbsp;is&nbsp;something&nbsp;missing&nbsp;in&nbsp;code,&nbsp;so&nbsp;the&nbsp;event&nbsp;on&nbsp;check&nbsp;box&nbsp;change&nbsp;and&nbsp;selection&nbsp;of&nbsp;theme&nbsp;item&nbsp;not&nbsp;fire.&nbsp;Pleas&nbsp;help.

Private&nbsp;Sub&nbsp;SetupThemeItem(ByVal&nbsp;layer&nbsp;As&nbsp;Layer)Dim&nbsp;themeItem&nbsp;As&nbsp;New&nbsp;ThemeItem()  
  
themeItem.ShapeName&nbsp;=&nbsp;layer.Name  
  
AddHandler&nbsp;themeItem.ItemCheckedChanged,&nbsp;AddressOf&nbsp;themeItem\_ItemCheckedChanged  
  
AddHandler&nbsp;themeItem.ItemLinkClicked,&nbsp;AddressOf&nbsp;themeItem\_ItemLinkClicked  
  
AddHandler&nbsp;themeItem.ThemeItemClick,&nbsp;AddressOf&nbsp;themeItem\_ThemeItemClick  
  
AddHandler&nbsp;themeItem.ThemeItemRightClick,&nbsp;AddressOf&nbsp;themeItem\_ThemeItemRightClickEnd&nbsp;Sub

Private&nbsp;Sub&nbsp;themeItem\_ItemCheckedChanged(ByVal&nbsp;sender&nbsp;As&nbsp;Object,&nbsp;ByVal&nbsp;e&nbsp;As&nbsp;ShapeEventArgs)If&nbsp;DirectCast(winformsMap1.Overlays(0),&nbsp;LayerOverlay).Layers.Contains(e.ShapeName)&nbsp;Then  
  
winformsMap1.Overlays(0).Lock.EnterWriteLock()  
  
Try  
  
DirectCast(winformsMap1.Overlays(0),&nbsp;LayerOverlay).Layers(e.ShapeName).IsVisible&nbsp;=&nbsp;e.IsShow  
  
Finally  
  
winformsMap1.Overlays(0).Lock.ExitWriteLock()  
  
End&nbsp;Try&nbsp;  
  
&nbsp;Try  
  
DrawImage()  
  
Catch  
  
End&nbsp;Try  
  
End&nbsp;If  
  
End&nbsp;Sub

But&nbsp;the&nbsp;ThemeItem\_ItemCheckedChanged&nbsp;Event&nbsp;not&nbsp;fire.&nbsp;Or&nbsp;Please&nbsp;can&nbsp;you&nbsp;provide&nbsp;Map&nbsp;Suite&nbsp;Explorer&nbsp;Sample&nbsp;copy&nbsp;in&nbsp;Vb.net

Regrards  
  
Sanjay&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;ThemeView.Items.Add(layer.Name,&nbsp;themeItem)

&nbsp;End&nbsp;Sub

---

<div class="post-metadata">

**Author:** ![ThinkGeo](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/thinkgeo/32/25029_2.png) [@ThinkGeo](https://community.thinkgeo.com/u/ThinkGeo)\
**Post date:** [February 25, 2011, 7:53am UTC](https://community.thinkgeo.com/t/problem-with-themeitem-selection/1605/2 "2011-02-25T07:53:34Z")

</div>

Sanjay,

Thanks&nbsp;for&nbsp;your&nbsp;posts&nbsp;and&nbsp;questions.  
&nbsp;  
I&nbsp;am&nbsp;sorry&nbsp;to&nbsp;say&nbsp;that&nbsp;it&nbsp;is&nbsp;very&nbsp;hard&nbsp;to&nbsp;provide&nbsp;the&nbsp;VB&nbsp;sample&nbsp;for&nbsp;Map&nbsp;Suite&nbsp;Explorer&nbsp;for&nbsp;now&nbsp;as&nbsp;the&nbsp;project&nbsp;is&nbsp;somehow&nbsp;huge,&nbsp;is&nbsp;it&nbsp;possible&nbsp;to&nbsp;provide&nbsp;me&nbsp;your&nbsp;sample&nbsp;to&nbsp;recreate&nbsp;this&nbsp;issue,&nbsp;I&nbsp;reviewed&nbsp;the&nbsp;code&nbsp;above&nbsp;and&nbsp;I&nbsp;did&nbsp;not&nbsp;find&nbsp;any&nbsp;problem&nbsp;with&nbsp;it.  
&nbsp;  
Any&nbsp;more&nbsp;questions&nbsp;please&nbsp;feel&nbsp;free&nbsp;to&nbsp;let&nbsp;me&nbsp;know.  
&nbsp;  
Thanks.  
&nbsp;  
Yale

---

<div class="post-metadata">

**Author:** ![Sanjay](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/s/58956e/32.png) [@Sanjay](https://community.thinkgeo.com/u/Sanjay)\
**Post date:** [February 25, 2011, 10:37am UTC](https://community.thinkgeo.com/t/problem-with-themeitem-selection/1605/3 "2011-02-25T10:37:02Z")

</div>

Yale,&nbsp;  
&nbsp;&nbsp;  
&nbsp;I&nbsp;have&nbsp;attached&nbsp;my&nbsp;sample&nbsp;with&nbsp;ticket&nbsp;no&nbsp;3370.&nbsp;Please&nbsp;review&nbsp;my&nbsp;code&nbsp;and&nbsp;correct&nbsp;is&nbsp;if&nbsp;any,&nbsp;so&nbsp;that&nbsp;I&nbsp;will&nbsp;able&nbsp;to&nbsp;check&nbsp;/&nbsp;uncheck&nbsp;the&nbsp;layer&nbsp;and&nbsp;selct&nbsp;that&nbsp;layer&nbsp;for&nbsp;movement&nbsp;up/down&nbsp;  
&nbsp;Regards&nbsp;  
&nbsp;Sanjay

---

<div class="post-metadata">

**Author:** ![ThinkGeo](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/thinkgeo/32/25029_2.png) [@ThinkGeo](https://community.thinkgeo.com/u/ThinkGeo)\
**Post date:** [February 28, 2011, 8:17am UTC](https://community.thinkgeo.com/t/problem-with-themeitem-selection/1605/4 "2011-02-28T08:17:49Z")

</div>

Sanjay,&nbsp;  
&nbsp;&nbsp;  
&nbsp;I&nbsp;have&nbsp;replied&nbsp;to&nbsp;you&nbsp;via&nbsp;the&nbsp;ticket,&nbsp;please&nbsp;check.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Any&nbsp;more&nbsp;questions&nbsp;please&nbsp;feel&nbsp;free&nbsp;to&nbsp;let&nbsp;me&nbsp;know.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Yale&nbsp;

---

<div class="post-metadata">

**Author:** ![Sanjay](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/s/58956e/32.png) [@Sanjay](https://community.thinkgeo.com/u/Sanjay)\
**Post date:** [March 17, 2011, 11:31am UTC](https://community.thinkgeo.com/t/problem-with-themeitem-selection/1605/5 "2011-03-17T11:31:45Z")

</div>

Yale,&nbsp;  
&nbsp;&nbsp;  
&nbsp;I&nbsp;have&nbsp;Tab&nbsp;FeatureLayer,&nbsp;it&nbsp;shows&nbsp;data.&nbsp;I&nbsp;have&nbsp;done&nbsp;thematic&nbsp;color&nbsp;or&nbsp;this&nbsp;layer.&nbsp;So,&nbsp;I&nbsp;before&nbsp;implementing&nbsp;thematic&nbsp;color,&nbsp;I&nbsp;want&nbsp;to&nbsp;make&nbsp;copy&nbsp;of&nbsp;FeatureLayer.&nbsp;So&nbsp;the&nbsp;thematic&nbsp;color&nbsp;can&nbsp;apply&nbsp;on&nbsp;copy&nbsp;of&nbsp;FeatureLayer,&nbsp;and&nbsp;original&nbsp;not&nbsp;be&nbsp;disturbed.&nbsp;&nbsp;  
&nbsp;How&nbsp;to&nbsp;made&nbsp;a&nbsp;clone&nbsp;of&nbsp;FeatureLayer.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Regards&nbsp;  
&nbsp;Sanjay

---

<div class="post-metadata">

**Author:** ![ThinkGeo](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/thinkgeo/32/25029_2.png) [@ThinkGeo](https://community.thinkgeo.com/u/ThinkGeo)\
**Post date:** [March 18, 2011, 9:48am UTC](https://community.thinkgeo.com/t/problem-with-themeitem-selection/1605/6 "2011-03-18T09:48:23Z")

</div>

Sanjay,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks&nbsp;for&nbsp;your&nbsp;post&nbsp;and&nbsp;questions.&nbsp;  
&nbsp;&nbsp;  
&nbsp;We&nbsp;need&nbsp;to&nbsp;consider&nbsp;using&nbsp;the&nbsp;serialization/deserialization&nbsp;for&nbsp;the&nbsp;feature&nbsp;layer,&nbsp;while&nbsp;I&nbsp;am&nbsp;sorry&nbsp;to&nbsp;say&nbsp;that&nbsp;for&nbsp;now&nbsp;not&nbsp;all&nbsp;feature&nbsp;layer&nbsp;can&nbsp;be&nbsp;serialized,&nbsp;following&nbsp;posts&nbsp;shows&nbsp;how&nbsp;to&nbsp;serialize&nbsp;the&nbsp;shape&nbsp;file&nbsp;feature&nbsp;layer,&nbsp;pls&nbsp;take&nbsp;a&nbsp;look&nbsp;if&nbsp;you&nbsp;are&nbsp;intested.&nbsp;  
&nbsp;[gis.thinkgeo.com/Support/DiscussionForums/tabid/143/aff/21/aft/8134/afv/topic/Default.aspx](http://gis.thinkgeo.com/Support/DiscussionForums/tabid/143/aff/21/aft/8134/afv/topic/Default.aspx)&nbsp;  
&nbsp;&nbsp;  
&nbsp;Any&nbsp;more&nbsp;questions&nbsp;please&nbsp;feel&nbsp;free&nbsp;to&nbsp;let&nbsp;me&nbsp;know.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Yale&nbsp;

---

<div class="post-metadata">

**Author:** ![Sanjay](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/s/58956e/32.png) [@Sanjay](https://community.thinkgeo.com/u/Sanjay)\
**Post date:** [March 22, 2011, 12:35am UTC](https://community.thinkgeo.com/t/problem-with-themeitem-selection/1605/7 "2011-03-22T00:35:40Z")

</div>

Yale,&nbsp;  
&nbsp;I&nbsp;don’t&nbsp;want&nbsp;to&nbsp;save&nbsp;layer&nbsp;permanently&nbsp;into&nbsp;my&nbsp;disk.&nbsp;I&nbsp;just&nbsp;want&nbsp;to&nbsp;make&nbsp;copy&nbsp;of&nbsp;feature&nbsp;layer&nbsp;for&nbsp;a&nbsp;session.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Regards&nbsp;  
&nbsp;Sanjay

---

<div class="post-metadata">

**Author:** ![ThinkGeo](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/thinkgeo/32/25029_2.png) [@ThinkGeo](https://community.thinkgeo.com/u/ThinkGeo)\
**Post date:** [March 22, 2011, 12:54am UTC](https://community.thinkgeo.com/t/problem-with-themeitem-selection/1605/8 "2011-03-22T00:54:06Z")

</div>

Sanjay,&nbsp;  
&nbsp;&nbsp;  
&nbsp;You&nbsp;can&nbsp;save&nbsp;all&nbsp;features&nbsp;to&nbsp;a&nbsp;InMemoryFeatureLayer,&nbsp;about&nbsp;how&nbsp;to&nbsp;add&nbsp;feature&nbsp;you&nbsp;can&nbsp;look&nbsp;at&nbsp;HowDoI&nbsp;samples-\>AddFeaturesFromAFeatureLayer&nbsp;sample.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks,&nbsp;  
&nbsp;&nbsp;  
&nbsp;James

---

<div class="post-metadata">

**Author:** ![Sanjay](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/s/58956e/32.png) [@Sanjay](https://community.thinkgeo.com/u/Sanjay)\
**Post date:** [March 22, 2011, 1:22am UTC](https://community.thinkgeo.com/t/problem-with-themeitem-selection/1605/9 "2011-03-22T01:22:51Z")

</div>

James,&nbsp;  
&nbsp;&nbsp;  
&nbsp;I&nbsp;think&nbsp;you&nbsp;didn’t&nbsp;understand&nbsp;properly.&nbsp;I&nbsp;am&nbsp;not&nbsp;trying&nbsp;to&nbsp;copy&nbsp;a&nbsp;feature,&nbsp;although&nbsp;I&nbsp;am&nbsp;trying&nbsp;to&nbsp;copy&nbsp;a&nbsp;TabFileFeatureLayer,&nbsp;which&nbsp;will&nbsp;be&nbsp;treated&nbsp;as&nbsp;different&nbsp;object.&nbsp;  
&nbsp;&nbsp;  
&nbsp;If&nbsp;any&nbsp;thing&nbsp;more&nbsp;you&nbsp;want&nbsp;to&nbsp;clear&nbsp;please&nbsp;let&nbsp;me&nbsp;know.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Regards&nbsp;  
&nbsp;Sanjay

---

<div class="post-metadata">

**Author:** ![ThinkGeo](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/thinkgeo/32/25029_2.png) [@ThinkGeo](https://community.thinkgeo.com/u/ThinkGeo)\
**Post date:** [March 22, 2011, 9:07am UTC](https://community.thinkgeo.com/t/problem-with-themeitem-selection/1605/10 "2011-03-22T09:07:55Z")

</div>

Sanjay,

Thanks&nbsp;for&nbsp;your&nbsp;post&nbsp;and&nbsp;feedbacks.  
&nbsp;  
If&nbsp;you&nbsp;want&nbsp;to&nbsp;keep&nbsp;this&nbsp;copy&nbsp;in&nbsp;memory&nbsp;or&nbsp;session,&nbsp;why&nbsp;not&nbsp;try&nbsp;to&nbsp;save&nbsp;those&nbsp;properties&nbsp;used&nbsp;to&nbsp;construct&nbsp;the&nbsp;feature&nbsp;layer&nbsp;instead,&nbsp;for&nbsp;example,&nbsp;try&nbsp;to&nbsp;keep&nbsp;the&nbsp;pathFileName,&nbsp;idColumnName,&nbsp;featureSchemaName&nbsp;instead&nbsp;of&nbsp;keeping&nbsp;the&nbsp;TabFeatureLayer,&nbsp;and&nbsp;then&nbsp;try&nbsp;to&nbsp;create&nbsp;a&nbsp;new&nbsp;TabFeatureLayer&nbsp;using&nbsp;these&nbsp;properties&nbsp;when&nbsp;needed.&nbsp;What&nbsp;is&nbsp;your&nbsp;opinion?  
&nbsp;  
Any&nbsp;more&nbsp;questions&nbsp;please&nbsp;feel&nbsp;free&nbsp;to&nbsp;let&nbsp;me&nbsp;know.  
&nbsp;  
Thanks.  
&nbsp;  
Yale

---

<div class="post-metadata">

**Author:** ![Sanjay](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/s/58956e/32.png) [@Sanjay](https://community.thinkgeo.com/u/Sanjay)\
**Post date:** [March 23, 2011, 12:12am UTC](https://community.thinkgeo.com/t/problem-with-themeitem-selection/1605/11 "2011-03-23T00:12:07Z")

</div>

Yale,&nbsp;  
&nbsp;&nbsp;  
&nbsp;You&nbsp;mean&nbsp;to&nbsp;say&nbsp;to&nbsp;create&nbsp;a&nbsp;new&nbsp;TabFeatureLayer&nbsp;with&nbsp;different&nbsp;name,&nbsp;whenever&nbsp;required,&nbsp;with&nbsp;help&nbsp;of&nbsp;already&nbsp;loaded&nbsp;tab&nbsp;file.&nbsp;It&nbsp;could&nbsp;be&nbsp;one&nbsp;solution.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Actually&nbsp;where&nbsp;I&nbsp;required&nbsp;a&nbsp;copy&nbsp;of&nbsp;TabFeatureLayer,&nbsp;that&nbsp;is&nbsp;different&nbsp;form.&nbsp;Initially&nbsp;when&nbsp;TabFutureLayer&nbsp;created&nbsp;that&nbsp;process&nbsp;is&nbsp;wriiten&nbsp;on&nbsp;Main&nbsp;form.&nbsp;Also&nbsp;I&nbsp;have&nbsp;to&nbsp;find&nbsp;the&nbsp;file&nbsp;name&nbsp;from&nbsp;a&nbsp;colletion&nbsp;of&nbsp;Tab&nbsp;File.&nbsp;Is&nbsp;the&nbsp;copy&nbsp;facility&nbsp;not&nbsp;availalable&nbsp;in&nbsp;API?&nbsp;  
&nbsp;&nbsp;  
&nbsp;What&nbsp;is&nbsp;cloneDeep?&nbsp;&nbsp;  
&nbsp;It&nbsp;is&nbsp;working&nbsp;with&nbsp;Layer,&nbsp;but&nbsp;not&nbsp;with&nbsp;FeatureLayer?&nbsp;  
&nbsp;&nbsp;  
&nbsp;Regards&nbsp;  
&nbsp;Sanjay&nbsp;

---

<div class="post-metadata">

**Author:** ![ThinkGeo](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/thinkgeo/32/25029_2.png) [@ThinkGeo](https://community.thinkgeo.com/u/ThinkGeo)\
**Post date:** [March 23, 2011, 12:59am UTC](https://community.thinkgeo.com/t/problem-with-themeitem-selection/1605/12 "2011-03-23T00:59:02Z")

</div>

Sanjay,&nbsp;  
&nbsp;&nbsp;  
&nbsp;CloneDeep&nbsp;rely&nbsp;on&nbsp;serializable,&nbsp;however&nbsp;TabFeatureLayer&nbsp;didn’t&nbsp;support&nbsp;serializable&nbsp;so&nbsp;that&nbsp;you&nbsp;couldn’t&nbsp;use&nbsp;CloneDeep&nbsp;to&nbsp;copy&nbsp;it.&nbsp;  
&nbsp;&nbsp;  
&nbsp;I&nbsp;have&nbsp;updated&nbsp;the&nbsp;FdoExtension&nbsp;and&nbsp;make&nbsp;the&nbsp;TabFeatureLayer&nbsp;support&nbsp;it,&nbsp;please&nbsp;get&nbsp;the&nbsp;latest&nbsp;version&nbsp;4.5.143.0&nbsp;tommorrow&nbsp;and&nbsp;have&nbsp;a&nbsp;try.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks,&nbsp;  
&nbsp;&nbsp;  
&nbsp;James

---

<div class="post-metadata">

**Author:** ![Sanjay](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/s/58956e/32.png) [@Sanjay](https://community.thinkgeo.com/u/Sanjay)\
**Post date:** [March 23, 2011, 2:28am UTC](https://community.thinkgeo.com/t/problem-with-themeitem-selection/1605/13 "2011-03-23T02:28:15Z")

</div>

James,&nbsp;  
  
&nbsp;

After&nbsp;download&nbsp;from&nbsp;customer&nbsp;portal,&nbsp;how&nbsp;I&nbsp;use&nbsp;this&nbsp;update.&nbsp;Please&nbsp;guide&nbsp;me.

In&nbsp;updated&nbsp;version,&nbsp;which&nbsp;property&nbsp;will&nbsp;be&nbsp;use.&nbsp;Please&nbsp;brief&nbsp;them.&nbsp;  
  
Regards&nbsp;  
  
Sanjay

---

<div class="post-metadata">

**Author:** ![ThinkGeo](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/thinkgeo/32/25029_2.png) [@ThinkGeo](https://community.thinkgeo.com/u/ThinkGeo)\
**Post date:** [March 23, 2011, 2:46am UTC](https://community.thinkgeo.com/t/problem-with-themeitem-selection/1605/14 "2011-03-23T02:46:06Z")

</div>

Sanjay,

As&nbsp;your&nbsp;mention&nbsp;by&nbsp;using&nbsp;CloneDeep&nbsp;API:

`                TabFileFeatureLayer layer = new TabFileFeatureLayer(@"..\..\SampleData\Data\HoustonMuniBdySamp_Boundary.TAB", "FID", "OGRSchema", "HoustonMuniBdySamp_Boundary", "GEOMETRY");                layer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.CreateSimpleAreaStyle(GeoColor.FromArgb(100, GeoColor.SimpleColors.Green), GeoColor.SimpleColors.Green);                layer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;                TabFileFeatureLayer copiedLayer = layer.CloneDeep() as TabFileFeatureLayer;`

James

---

<div class="post-metadata">

**Author:** ![Sanjay](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/s/58956e/32.png) [@Sanjay](https://community.thinkgeo.com/u/Sanjay)\
**Post date:** [March 23, 2011, 3:38am UTC](https://community.thinkgeo.com/t/problem-with-themeitem-selection/1605/15 "2011-03-23T03:38:44Z")

</div>

James,&nbsp;  
&nbsp;&nbsp;  
&nbsp;How&nbsp;to&nbsp;update&nbsp;DLL&nbsp;file.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Regards

---

<div class="post-metadata">

**Author:** ![ThinkGeo](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/thinkgeo/32/25029_2.png) [@ThinkGeo](https://community.thinkgeo.com/u/ThinkGeo)\
**Post date:** [March 23, 2011, 3:48am UTC](https://community.thinkgeo.com/t/problem-with-themeitem-selection/1605/16 "2011-03-23T03:48:20Z")

</div>

Sanjay,&nbsp;  
&nbsp;&nbsp;  
&nbsp;You&nbsp;can&nbsp;find&nbsp;the&nbsp;old&nbsp;FdoExtension.dll&nbsp;on&nbsp;your&nbsp;disk,&nbsp;delete&nbsp;it&nbsp;and&nbsp;copy&nbsp;the&nbsp;new&nbsp;FdoExtension.dll&nbsp;to&nbsp;the&nbsp;same&nbsp;folder,&nbsp;or&nbsp;you&nbsp;can&nbsp;change&nbsp;the&nbsp;reference&nbsp;of&nbsp;your&nbsp;application&nbsp;and&nbsp;point&nbsp;to&nbsp;the&nbsp;new&nbsp;FdoExtension.dll.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks,&nbsp;  
&nbsp;&nbsp;  
&nbsp;James

---

<div class="post-metadata">

**Author:** ![Sanjay](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/s/58956e/32.png) [@Sanjay](https://community.thinkgeo.com/u/Sanjay)\
**Post date:** [March 25, 2011, 1:09am UTC](https://community.thinkgeo.com/t/problem-with-themeitem-selection/1605/17 "2011-03-25T01:09:07Z")

</div>

James,&nbsp;  
  
  
  
I&nbsp;have&nbsp;changed&nbsp;the&nbsp;FdoExtentio.dll&nbsp;(4.5.0.144&nbsp;and&nbsp;4.5.144.0&nbsp;both&nbsp;Tested),&nbsp;but&nbsp;I&nbsp;am&nbsp;getting&nbsp;error&nbsp;like&nbsp;  
  
  
  
Type&nbsp;'MapSuiteFdoExtension.GeoFdoFeatureSource'&nbsp;in&nbsp;Assembly&nbsp;'MapSuiteFdoExtension,&nbsp;Version=1.0.0.0,&nbsp;Culture=neutral,&nbsp;PublicKeyToken=null'&nbsp;is&nbsp;not&nbsp;marked&nbsp;as&nbsp;serializable.&nbsp;  
  
  
  
Actually&nbsp;my&nbsp;proceess&nbsp;of&nbsp;copy&nbsp;like&nbsp;this,&nbsp;  
  
  
  
Dim&nbsp;Layer&nbsp;As&nbsp;FeatureLayer&nbsp;=&nbsp;winformsMap1.FindFeatureLayer(drpTable.Text.Trim)  
  
&nbsp;'drpTable.Text&nbsp;contains&nbsp;the&nbsp;name&nbsp;of&nbsp;TabFeatureLayer&nbsp;  
  
dim&nbsp;copiedLayer&nbsp;As&nbsp;TabFileFeatureLayer&nbsp;=&nbsp;TryCast(Layer.CloneDeep(),&nbsp;TabFileFeatureLayer)

its&nbsp;generates&nbsp;error,&nbsp;also&nbsp;I&nbsp;have&nbsp;tried&nbsp;like&nbsp;below&nbsp;but&nbsp;same&nbsp;result

Dim

&nbsp;

&nbsp;t&nbsp;As&nbsp;TabFileFeatureLayer&nbsp;=&nbsp;TryCast(Layer,&nbsp;TabFileFeatureLayer)  
  
Dim&nbsp;copiedLayer&nbsp;As&nbsp;TabFileFeatureLayer&nbsp;=&nbsp;t.CloneDeep  
  
Regards&nbsp;  
  
Sanjay

&nbsp;

---

<div class="post-metadata">

**Author:** ![ThinkGeo](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/thinkgeo/32/25029_2.png) [@ThinkGeo](https://community.thinkgeo.com/u/ThinkGeo)\
**Post date:** [March 25, 2011, 3:04am UTC](https://community.thinkgeo.com/t/problem-with-themeitem-selection/1605/18 "2011-03-25T03:04:38Z")

</div>

Sanjay,

You&nbsp;may&nbsp;find&nbsp;the&nbsp;wrong&nbsp;layer&nbsp;which&nbsp;type&nbsp;is&nbsp;not&nbsp;TabFileFeatureLayer,&nbsp;because&nbsp;I&nbsp;did&nbsp;following&nbsp;test,&nbsp;it&nbsp;works&nbsp;properly.

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Dim&nbsp;layer&nbsp;As&nbsp;New&nbsp;TabFileFeatureLayer()  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Dim&nbsp;copiedLayer&nbsp;As&nbsp;TabFileFeatureLayer&nbsp;=&nbsp;TryCast(layer.CloneDeep(),&nbsp;TabFileFeatureLayer)

Thanks,

James

---

<div class="post-metadata">

**Author:** ![Sanjay](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/s/58956e/32.png) [@Sanjay](https://community.thinkgeo.com/u/Sanjay)\
**Post date:** [March 26, 2011, 4:22am UTC](https://community.thinkgeo.com/t/problem-with-themeitem-selection/1605/19 "2011-03-26T04:22:12Z")

</div>

James,

You&nbsp;are&nbsp;right.&nbsp;I&nbsp;am&nbsp;also&nbsp;not&nbsp;getting&nbsp;error&nbsp;when&nbsp;I&nbsp;have&nbsp;created&nbsp;a&nbsp;new&nbsp;TabFeatureLayer&nbsp;and&nbsp;try&nbsp;to&nbsp;use&nbsp;CloneDeep&nbsp;API&nbsp;in&nbsp;the&nbsp;same&nbsp;module.

Please&nbsp;try&nbsp;to&nbsp;like&nbsp;this.

On&nbsp;page&nbsp;load

Dim&nbsp;worldLayer&nbsp;As&nbsp;New&nbsp;TabFileFeatureLayer("D:\Desktop&nbsp;Working\New&nbsp;Folder\upw&nbsp;vector\vector.tab",&nbsp;Nothing)worldLayer.Name&nbsp;=&nbsp;"Vector"  
  
Dim&nbsp;customLineStyle&nbsp;As&nbsp;Style&nbsp;=&nbsp;New&nbsp;AreaStyle(New&nbsp;GeoPen(GeoColor.SimpleColors.Black,&nbsp;1))  
  
Dim&nbsp;customAreaStyle&nbsp;As&nbsp;Style&nbsp;=&nbsp;New&nbsp;LineStyle(New&nbsp;GeoPen(GeoColor.SimpleColors.Black,&nbsp;1))  
  
Dim&nbsp;customPointStyle&nbsp;As&nbsp;Style&nbsp;=&nbsp;New&nbsp;PointStyle(PointSymbolType.Star,&nbsp;New&nbsp;GeoSolidBrush(GeoColor.SimpleColors.LightGreen),&nbsp;10)  
  
worldLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(customAreaStyle)worldLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(customPointStyle)worldLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(customLineStyle)worldLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel&nbsp;=&nbsp;ApplyUntilZoomLevel.Level20  
  
Dim&nbsp;staticOverlay&nbsp;As&nbsp;New&nbsp;LayerOverlay()  
  
staticOverlay.Layers.Add("WorldLayer",&nbsp;worldLayer)  
  
WinformsMap1.Overlays.Add(staticOverlay)  
  
Process.GetCurrentProcess().ProcessorAffinity&nbsp;=&nbsp;CType(1,&nbsp;System.IntPtr)  
  
worldLayer.Open()  
  
WinformsMap1.CurrentExtent&nbsp;=&nbsp;worldLayer.GetBoundingBox  
  
worldLayer.Close()  
  
WinformsMap1.Refresh()

&nbsp;

Now&nbsp;click&nbsp;on&nbsp;copy&nbsp;button&nbsp;and&nbsp;try&nbsp;to&nbsp;use&nbsp;following&nbsp;code:

Dim

&nbsp;Layer&nbsp;As&nbsp;FeatureLayer&nbsp;=&nbsp;WinformsMap1.FindFeatureLayer("WorldLayer")  
  
Layer.Close()  
  
Dim&nbsp;copiedLayer&nbsp;As&nbsp;TabFileFeatureLayer&nbsp;=&nbsp;TryCast(Layer.CloneDeep(),&nbsp;TabFileFeatureLayer)

We&nbsp;can&nbsp;not&nbsp;careate&nbsp;a&nbsp;new&nbsp;TabFeatureLayer&nbsp;(as&nbsp;you&nbsp;shown)&nbsp;for&nbsp;copy&nbsp;purpose,&nbsp;beacuse&nbsp;TabFeatureLayer&nbsp;is&nbsp;already&nbsp;created.&nbsp;We&nbsp;have&nbsp;to&nbsp;find&nbsp;the&nbsp;FeatureLayer&nbsp;to&nbsp;create&nbsp;copy,&nbsp;I&nbsp;tried&nbsp;with&nbsp;above&nbsp;code.&nbsp;If&nbsp;anything&nbsp;wrong&nbsp;with&nbsp;code&nbsp;please&nbsp;let&nbsp;me&nbsp;know.&nbsp;In&nbsp;other&nbsp;way&nbsp;you&nbsp;can&nbsp;try&nbsp;to&nbsp;make&nbsp;copy&nbsp;with&nbsp;WinForms1.FindFeatureLayer

Thanks

Sanjay&nbsp;  
  
&nbsp;

WinformsMap1.MapUnit&nbsp;=&nbsp;GeographyUnit.DecimalDegree  
  
WinformsMap1.BackgroundOverlay.BackgroundBrush&nbsp;=&nbsp;New&nbsp;GeoSolidBrush(GeoColor.SimpleColors.Transparent)

Now&nbsp;Create&nbsp;a&nbsp;Button&nbsp;to&nbsp;copy&nbsp;above&nbsp;created&nbsp;TabFileFeatureLayer:  
  
I&nbsp;have&nbsp;Created&nbsp;Like&nbsp;below:  
  
Dim&nbsp;Layer&nbsp;As&nbsp;FeatureLayer&nbsp;=&nbsp;WinformsMap1.FindFeatureLayer("WorldLayer")  
  
Layer.Close()  
  
Dim&nbsp;copiedLayer&nbsp;As&nbsp;TabFileFeatureLayer&nbsp;=&nbsp;TryCast(Layer.CloneDeep(),&nbsp;TabFileFeatureLayer)WinformsMap1.CurrentExtent&nbsp;=New&nbsp;RectangleShape(-90,&nbsp;45,&nbsp;90,&nbsp;-45)  
  
&nbsp;

---

<div class="post-metadata">

**Author:** ![ThinkGeo](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/thinkgeo/32/25029_2.png) [@ThinkGeo](https://community.thinkgeo.com/u/ThinkGeo)\
**Post date:** [March 27, 2011, 8:57pm UTC](https://community.thinkgeo.com/t/problem-with-themeitem-selection/1605/20 "2011-03-27T20:57:42Z")

</div>

Sanjay,&nbsp;  
&nbsp;&nbsp;  
&nbsp;I&nbsp;tested&nbsp;your&nbsp;code&nbsp;and&nbsp;I&nbsp;can&nbsp;recreate&nbsp;your&nbsp;problem,&nbsp;I&nbsp;think&nbsp;you&nbsp;need&nbsp;to&nbsp;CloneDeep&nbsp;TabFileFeatureLayer&nbsp;before&nbsp;calling&nbsp;TabFileFeatureLayer.Open(),&nbsp;otherwise&nbsp;it&nbsp;will&nbsp;throw&nbsp;exception,&nbsp;the&nbsp;reason&nbsp;is&nbsp;that&nbsp;when&nbsp;you&nbsp;call&nbsp;open&nbsp;method,&nbsp;it&nbsp;will&nbsp;load&nbsp;some&nbsp;unmanaged&nbsp;source&nbsp;which&nbsp;can’t&nbsp;be&nbsp;serialize.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Sorry&nbsp;for&nbsp;inconvenice.&nbsp;  
&nbsp;&nbsp;  
&nbsp;James

[Next page](https://community.thinkgeo.com/t/problem-with-themeitem-selection/1605.md?page=2)
