IGeoFeatureLayer.AnnotationProperties from ILabelingDescription

1380
0
12-20-2010 06:16 AM
MeleKoneya
Occasional Contributor III
I trying to get the ILabelingDescription for an IMapServer3 layer and then use it for the AnnotationProperties of an IGeoFeatureLayer.     My code for the getting the ILabelDescription is shown below:

private ILabelingDescription GetLabelingInfo(int mapLayer)
        {
                IServerSymbolOutputOptions pSSOO = serverContext.CreateObject("esriCarto.ServerSymbolOutputOptions") as IServerSymbolOutputOptions;
                pSSOO.ConvertLabelExpressions = true;
                ILongArray longArray = serverContext.CreateObject("esriSystem.LongArray") as ILongArray;  //new LongArrayClass();
                longArray.Add(mapLayer);
                ILayerDrawingDescriptions lyrDrawDescs = null;
                lyrDrawDescs = (ILayerDrawingDescriptions)mapServer.GetDefaultLayerDrawingDescriptions(mapServer.DefaultMapName, longArray, pSSOO);
                ILayerDrawingDescription lyrDrawDesc = lyrDrawDescs.get_Element(0);
                IFeatureLayerDrawingDescription2 flDrawDesc = (IFeatureLayerDrawingDescription2)lyrDrawDesc;
                ILabelingDescription pLabelDescription = flDrawDesc.LabelingDescription;
                return pLabelDescription;
                }

How can I apply this ILabelingDescription to IGeoFeatureLayer.AnnotationProperties?     What casts are need?

Thanks,

Mele
0 Kudos
0 Replies