Code of the MapLayerInfo class

Source: Internet
Author: User
Tags imap

According to the requirements of SKY, the MapLayerInfo class code is provided, which is very simple:

Public class MapLayerInfo
{
Private IFeatureLayer _ FeatureLayer = null;
Private IMap _ Map = null;
// Layer attributes
Private string _ FeatLyrName = null;
Private bool _ Cached = false;
Private string _ DataSourceType = null;
Private string _ DisplayField = null;
Private double _ MaximumScale = 0;
Private double _ MinimunScale = 0;
Private bool _ ScaleSymbols = false;
Private bool _ Selectable = false;
Private bool _ Visible = false;
Private bool _ ShowTips = false;

Public MapLayerInfo (IFeatureLayer pFeatLyr, IMap pMap)
{
This. _ FeatureLayer = pFeatLyr;
This. _ Map = pMap;

This. _ FeatLyrName = pFeatLyr. Name;
This. _ DataSourceType = pFeatLyr. DataSourceType;
This. _ DisplayField = pFeatLyr. DisplayField;
This. _ MaximumScale = pFeatLyr. MaximumScale;
This. _ MinimunScale = pFeatLyr. MinimumScale;
This. _ Cached = pFeatLyr. Cached;
This. _ ScaleSymbols = pFeatLyr. ScaleSymbols;
This. _ Selectable = pFeatLyr. Selectable;
This. _ Visible = pFeatLyr. Visible;
This. _ ShowTips = pFeatLyr. ShowTips;
}

// Use [CategoryAttribute ("layer basic information"), DefaultValueAttribute (true)]
// Displayed in the "layer basic information" column when PropertyGrid is displayed
[CategoryAttribute ("layer basic information"), DefaultValueAttribute (true)]
Public string Name
{
Get {return this. _ FeatLyrName ;}
Set
{
This. _ FeatLyrName = value;
This. _ FeatureLayer. Name = this. _ FeatLyrName;
}
}
[CategoryAttribute ("layer basic information"), DefaultValueAttribute (true)]
Public string DataSourceType
{
Get {return this. _ DataSourceType ;}
Set
{
This. _ DataSourceType = value;
This. _ FeatureLayer. DataSourceType = this. _ DataSourceType;
}
}
[CategoryAttribute ("display information"), DefaultValueAttribute (true)]
Public string DisplayField
{
Get
{
Return this. _ DisplayField;
}
Set
{
This. _ DisplayField = value;
This. _ FeatureLayer. DisplayField = this. _ DisplayField;
}
}
[CategoryAttribute ("display information"), DefaultValueAttribute (true)]
Public double MaximumScale
{
Get {return this. _ MaximumScale ;}
Set
{
This. _ MaximumScale = value;
This. _ FeatureLayer. MaximumScale = this. _ MaximumScale;
}
}
[CategoryAttribute ("display information"), DefaultValueAttribute (true)]
Public double MinimumScale
{
Get {return this. _ MinimunScale ;}
Set
{
This. _ MinimunScale = value;
This. _ FeatureLayer. MinimumScale = this. _ MinimunScale;
}
}
[CategoryAttribute ("Miscellaneous"), DefaultValueAttribute (true)]
Public bool Cached
{
Get {return this. _ Cached ;}
Set
{
This. _ Cached = value;
This. _ FeatureLayer. Cached = this. _ Cached;
}
}
[CategoryAttribute ("Miscellaneous"), DefaultValueAttribute (true)]
Public bool Selectable
{
Get {return this. _ Selectable ;}
Set
{
This. _ Selectable = value;
This. _ FeatureLayer. Selectable = this. _ Selectable;
}
}
[CategoryAttribute ("Miscellaneous"), DefaultValueAttribute (true)]
Public bool ScaleSymbols
{
Get {return this. _ ScaleSymbols ;}
Set
{
This. _ ScaleSymbols = value;
This. _ FeatureLayer. ScaleSymbols = this. _ ScaleSymbols;
}
}
[CategoryAttribute ("Miscellaneous"), DefaultValueAttribute (true)]
Public bool Visible
{
Get {return this. _ Visible ;}
Set
{
This. _ Visible = value;
This. _ FeatureLayer. Visible = this. _ Visible;
IActiveView pAV = (IActiveView) this. _ Map;
PAV. PartialRefresh (esriViewDrawPhase. esriViewGeography, null, null );
}
}
[CategoryAttribute ("Miscellaneous"), DefaultValueAttribute (true)]
Public bool ShowTips
{
Get {return this. _ ShowTips ;}
Set
{
This. _ ShowTips = value;
This. _ FeatureLayer. ShowTips = this. _ ShowTips;
}
}
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.