#region Disclaimer / License
// Copyright (C) 2010, Jackie Ng
// http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie@gmail.com
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
//
#endregion
using System;
using System.Collections.Generic;
using System.Text;
using OSGeo.MapGuide.MaestroAPI.Resource;
using System.ComponentModel;
using OSGeo.MapGuide.MaestroAPI;
namespace OSGeo.MapGuide.ObjectModels.LoadProcedure
{
///
/// Defines how to handle duplicate SDF2 keys
///
[System.SerializableAttribute()]
public enum SdfKeyTreatmentType
{
///
AutogenerateAll,
///
DiscardDuplicates,
///
MergeDuplicates,
}
///
/// The types of load procedures
///
public enum LoadType
{
///
///
///
Sdf,
///
///
///
Shp,
///
///
///
Dwf,
///
///
///
Raster,
///
///
///
Dwg,
///
///
///
Sqlite
}
///
/// Represents Load Procedures
///
public interface ILoadProcedure : IResource
{
///
/// Gets the type of the sub.
///
/// The type of the sub.
IBaseLoadProcedure SubType { get; }
}
///
/// A DWG load procedure. Execution not supported by Maestro
///
public interface IDwgLoadProcedure : IBaseLoadProcedure
{
}
///
/// A raster load procedure. Execution not supported by Maestro
///
public interface IRasterLoadProcedure : IBaseLoadProcedure
{
}
///
/// Base type of all load procedures
///
public interface IBaseLoadProcedure : INotifyPropertyChanged
{
///
/// Gets the type.
///
/// The type.
LoadType Type { get; }
///
/// Gets the source files.
///
/// The source files.
BindingList SourceFile { get; }
///
/// Adds the file.
///
/// The file.
void AddFile(string file);
///
/// Removes the file.
///
/// The file.
void RemoveFile(string file);
///
/// Gets or sets the root path.
///
/// The root path.
string RootPath { get; set; }
///
/// Gets or sets the coordinate system to use if none found in the source file.
///
/// The coordinate system.
string CoordinateSystem { get; set; }
///
/// Gets or sets a value indicating whether [generate spatial data sources].
///
///
/// true if [generate spatial data sources]; otherwise, false.
///
bool GenerateSpatialDataSources { get; set; }
///
/// Gets or sets the spatial data sources path.
///
/// The spatial data sources path.
string SpatialDataSourcesPath { get; set; }
///
/// Gets or sets the spatial data sources folder.
///
/// The spatial data sources folder.
string SpatialDataSourcesFolder { get; set; }
///
/// Gets or sets a value indicating whether [generate layers].
///
/// true if [generate layers]; otherwise, false.
bool GenerateLayers { get; set; }
///
/// Gets or sets the layers path.
///
/// The layers path.
string LayersPath { get; set; }
///
/// Gets or sets the layers folder.
///
/// The layers folder.
string LayersFolder { get; set; }
///
/// Gets or sets the generate maps.
///
/// The generate maps.
bool? GenerateMaps { get; set; }
///
/// Gets or sets the maps path.
///
/// The maps path.
string MapsPath { get; set; }
///
/// Gets or sets the maps folder.
///
/// The maps folder.
string MapsFolder { get; set; }
///
/// Not supported by Maestro
///
bool? GenerateSymbolLibraries { get; set; }
///
/// Not supported by Maestro
///
string SymbolLibrariesPath { get; set; }
///
/// Not supported by Maestro
///
string SymbolLibrariesFolder { get; set; }
///
/// Gets or sets the resource id that were created as part of executing this load procedure
///
/// The resource id.
BindingList ResourceId { get; set; }
}
///
/// Extension method class
///
public static class BaseLoadProcedureExtensions
{
///
/// Adds a group of files to this load procedure
///
///
///
public static void AddFiles(this IBaseLoadProcedure proc, IEnumerable files)
{
Check.NotNull(proc, "proc");
Check.NotNull(files, "files");
foreach (var f in files)
{
proc.AddFile(f);
}
}
}
///
/// A DWF load procedure. Execution is supported with limitations
///
public interface IDwfLoadProcedure : IBaseLoadProcedure
{
}
///
/// A SDF load procedure. Execution is supported with limitations
///
public interface ISdfLoadProcedure : IBaseLoadProcedure
{
///
/// Not supported by Maestro
///
double Generalization { get; set; }
///
/// Not supported by Maestro
///
SdfKeyTreatmentType SdfKeyTreatment { get; set; }
}
///
/// A SHP load procedure. Execution is supported with limitations
///
public interface IShpLoadProcedure : IBaseLoadProcedure
{
///
/// Not supported by Maestro
///
double Generalization { get; set; }
///
/// Not supported by Maestro
///
bool ConvertToSdf { get; set; }
}
///
/// A SQLite load procedure. Execution is supported with limitations
///
public interface ISqliteLoadProcedure : IBaseLoadProcedure
{
///
/// Not supported by Maestro
///
double Generalization { get; set; }
}
}