MapSuiteGisEditor/GisEditorInfrastructure/Plugins/Layers/LayerPlugin.cs
/// <summary>
/// This method creates layers instance.
/// In this method, it might popup a dialog to configuration.
/// For example, a ShapeFileFeatureLayer is based on a shapefile, we need popup an OpenFileDialog to choose a file.
/// Or MSSql layer needs a connection string to connect to the server, etc.
/// </summary>
/// <returns>A set of specific layers that created by this plugin.</returns>
This method creates layers instance.
In this method, it might popup a dialog to configuration.
For example, a ShapeFileFeatureLayer is based on a shapefile, we need popup an OpenFileDialog to choose a file.
Or MSSql layer needs a connection string to connect to the server, etc.
This method creates layers instance . In this method it might popup a dialog to configuration . For example a ShapeFileFeatureLayer is based on a shapefile we need popup an OpenFileDialog to choose a file . Or MSSql layer needs a connection string to connect to the server etc .
protected virtual Collection<Layer> GetLayersCore(GetLayersParameters getLayersParameters)
        {
            if (!String.IsNullOrEmpty(ExtensionFilter) && (getLayersParameters == null || getLayersParameters.LayerUris.Count == 0))
            {
                if (openFileDialog == null)
                {
                    openFileDialog = new OpenFileDialog();
                    openFileDialog.Multiselect = true;
                    openFileDialog.Filter = ExtensionFilter;
                }
                if (openFileDialog.ShowDialog().GetValueOrDefault())
                {
                    foreach (string fileName in openFileDialog.FileNames)
                    {
                        getLayersParameters.LayerUris.Add(new Uri(fileName));
                    }
                }
            }
            return new Collection<Layer>();
        }
protected virtual Collection < Layer > GetLayersCore ( GetLayersParameters getLayersParameters ) { if ( ! String . IsNullOrEmpty ( ExtensionFilter ) && ( getLayersParameters == null || getLayersParameters . LayerUris . Count == 0 ) ) { if ( openFileDialog == null ) { openFileDialog = new OpenFileDialog ( ) ; openFileDialog . Multiselect = true ; openFileDialog . Filter = ExtensionFilter ; } if ( openFileDialog . ShowDialog ( ) . GetValueOrDefault ( ) ) { foreach ( string fileName in openFileDialog . FileNames ) { getLayersParameters . LayerUris . Add ( new Uri ( fileName ) ) ; } } } return new Collection < Layer > ( ) ; }
This method creates layers instance.
This method creates layers instance .
A set of specific layers that created by this plugin.
A set of specific layers that created by this plugin .
getLayersParameters
GetLayersParameters