Exemplo n.º 1
0
        private FeatureLayer AddLayer([NotNull] Uri dataSource, string worklistName,
                                      [NotNull] string layerName)
        {
            PluginDatasourceConnectionPath connector =
                new PluginDatasourceConnectionPath(PluginIdentifier, dataSource);

            using (var datastore = new PluginDatastore(connector))
            {
                using (Table table = datastore.OpenTable(worklistName))
                {
                    FeatureLayer worklistLayer =
                        LayerFactory.Instance.CreateFeatureLayer((FeatureClass)table,
                                                                 MapView.Active.Map,
                                                                 LayerPosition.AddToTop, layerName);

                    LayerUtils.SetLayerSelectability(worklistLayer, false);

                    if (!_uriByWorklistName.ContainsKey(worklistName))
                    {
                        _uriByWorklistName.Add(worklistName, LayerUtils.GetUri(worklistLayer));
                    }

                    return(worklistLayer);
                }
            }
        }