本文整理汇总了C#中Utilities.GetFabricSubLayers方法的典型用法代码示例。如果您正苦于以下问题:C# Utilities.GetFabricSubLayers方法的具体用法?C# Utilities.GetFabricSubLayers怎么用?C# Utilities.GetFabricSubLayers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Utilities
的用法示例。
在下文中一共展示了Utilities.GetFabricSubLayers方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnClick
protected override void OnClick()
{
IArray LineLyrArr;
IArray PolygonLyrArr;
IActiveView pActiveView = ArcMap.Document.ActiveView;
IMap pMap = pActiveView.FocusMap;
Utilities Utils = new Utilities();
if (!Utils.GetFabricSubLayers(pMap, esriCadastralFabricTable.esriCFTLines, out LineLyrArr))
return;
if (!Utils.GetFabricSubLayers(pMap, esriCadastralFabricTable.esriCFTParcels, out PolygonLyrArr))
return;
IFeatureLayer pFlyr = (IFeatureLayer)LineLyrArr.get_Element(0);
IFeatureClass pFabricLinesFC = pFlyr.FeatureClass;
pFlyr = (IFeatureLayer)PolygonLyrArr.get_Element(0);
IFeatureClass pFabricParcelsFC = pFlyr.FeatureClass;
IProjectedCoordinateSystem2 pPCS = null;
IGeoDataset pGeoDS = (IGeoDataset)pFabricLinesFC;
ISpatialReference pFabricSpatRef = pGeoDS.SpatialReference;
double dMetersPerUnit = 1;
bool bFabricIsInGCS = !(pFabricSpatRef is IProjectedCoordinateSystem2);
if (pFabricSpatRef != null)
{
if (!bFabricIsInGCS)
{
pPCS = (IProjectedCoordinateSystem2)pFabricSpatRef;
dMetersPerUnit = pPCS.CoordinateUnit.MetersPerUnit;
}
}
string fileName ="";
if (dMetersPerUnit!=1)
fileName = AssemblyDirectory + "\\QualityControlLayers\\QA Symbology Feet.lyr";
else
fileName = AssemblyDirectory + "\\QualityControlLayers\\QA Symbology Meters.lyr";
bool bIsBefore1022 = false;
string sBuild=Utils.GetDesktopBuildNumberFromRegistry();
int iBuildNumber = 0;
if (Int32.TryParse(sBuild, out iBuildNumber))
bIsBefore1022 = iBuildNumber<3542; //CR278039 was fixed 10.2.2.3542
AddQALayerToActiveView(pMap, pFabricLinesFC, pFabricParcelsFC, fileName, dMetersPerUnit, bIsBefore1022, bFabricIsInGCS);
}