Esempio n. 1
0
        /// <summary>
        /// Attempts to call the open fileName method for any ILayerProvider plugin
        /// that matches the extension on the string.
        /// </summary>
        /// <param name="fileName">A String fileName to attempt to open.</param>
        /// <param name="inRam">A boolean value that if true will attempt to force a load of the data into memory.  This value overrides the property on this LayerManager.</param>
        /// <param name="container">A container to open this layer in</param>
        /// <param name="progressHandler">Specifies the progressHandler to receive progress messages.  This value overrides the property on this LayerManager.</param>
        /// <returns>An ILayer</returns>
        public virtual ILayer OpenLayer(string fileName, bool inRam, ICollection <ILayer> container, IProgressHandler progressHandler)
        {
            if (File.Exists(fileName) == false)
            {
                return(null);
            }
            ILayerManager dm = LayerManager.DefaultLayerManager;

            return(dm.OpenLayer(fileName, inRam, container, progressHandler));
        }
Esempio n. 2
0
        /// <summary>
        /// Opens a new layer and automatically adds it to the specified container.
        /// </summary>
        /// <param name="fileName">A String fileName to attempt to open.</param>
        /// <param name="container">The container (usually a LayerCollection) to add to</param>
        /// <returns>The layer after it has been created and added to the container</returns>
        public static ILayer OpenFile(string fileName, ICollection <ILayer> container)
        {
            if (File.Exists(fileName) == false)
            {
                return(null);
            }
            ILayerManager dm = LayerManager.DefaultLayerManager;

            return(dm.OpenLayer(fileName, container));
        }