#region Disclaimer / License
// Copyright (C) 2009, Kenneth Skovhede
// http://www.hexad.dk, opensource@hexad.dk
//
// 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;
namespace OSGeo.MapGuide.MaestroAPI
{
///
/// Represents the common resource types in MapGuide
///
public enum ResourceTypes
{
///
/// Map Definition
///
MapDefinition,
///
/// Layer Definition
///
LayerDefinition,
///
/// Feature Source
///
FeatureSource,
///
/// Web Layout
///
WebLayout,
///
/// Runtime Map
///
RuntimeMap,
///
/// Folder
///
Folder,
///
/// Fusion Flexible Layout
///
ApplicationDefinition,
///
/// Print Layout
///
PrintLayout,
///
/// Symbol Definition
///
SymbolDefinition,
///
/// Load Procedure
///
LoadProcedure,
///
/// Drawing Source
///
DrawingSource,
///
/// DWF-based Symbol Library
///
SymbolLibrary,
///
/// A watermark
///
WatermarkDefinition,
}
///
/// Represents a method involving a resource id
///
///
///
public delegate void ResourceEventHandler(object sender, ResourceEventArgs e);
///
/// Contains the resource id
///
public class ResourceEventArgs : EventArgs
{
///
/// Constructor
///
///
public ResourceEventArgs(string resourceID) { this.ResourceID = resourceID; }
///
/// Gets or sets the resource id
///
public string ResourceID { get; set; }
}
///
/// Helper class to filter into the ones that are
/// editable
///
public static class SiteResourceType
{
private static ResourceTypes[] _resTypes;
static SiteResourceType()
{
_resTypes = new ResourceTypes[]
{
ResourceTypes.ApplicationDefinition,
ResourceTypes.DrawingSource,
ResourceTypes.FeatureSource,
ResourceTypes.LayerDefinition,
ResourceTypes.LoadProcedure,
ResourceTypes.MapDefinition,
ResourceTypes.PrintLayout,
ResourceTypes.SymbolDefinition,
ResourceTypes.SymbolLibrary,
ResourceTypes.WebLayout
};
}
///
/// Returns an array of all editable values
///
///
public static ResourceTypes[] All()
{
return _resTypes;
}
}
internal class EnumHelper
{
private static string[] ResourceTypeNames = new string[]
{
"MapDefinition",
"LayerDefinition",
"FeatureSource",
"WebLayout",
"Map",
"",
"ApplicationDefinition",
};
internal static string ResourceName(ResourceTypes type)
{
return ResourceName(type, false);
}
internal static string ResourceName(ResourceTypes type, bool prefixWithDot)
{
if (type == ResourceTypes.Folder || !prefixWithDot)
return ResourceTypeNames[(int)type];
else
return "." + ResourceTypeNames[(int)type];
}
}
///
/// Flags that can be used for the QueryMapFeatures operation
///
public enum QueryMapFeaturesLayerAttributes : int
{
///
/// All layers
///
AllLayers = 0,
///
/// Only visible
///
OnlyVisible = 1,
///
/// Only selectable
///
OnlySelectable = 2,
///
/// Default
///
Default = 3,
///
/// Only with tooltips
///
OnlyWithToolTips = 4,
///
/// Visible with tooltips
///
VisibleWithToolTips = 5
}
///
/// Defines the types of unmananged data
///
public enum UnmanagedDataTypes : int
{
///
/// Files
///
Files,
///
/// Folders
///
Folders,
///
/// Files and Folders
///
Both
}
}