[mapguide-commits] r5258 - sandbox/maestro-3.0/Maestro.ResourceValidation

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Thu Oct 7 19:58:46 EDT 2010


Author: jng
Date: 2010-10-07 23:58:46 +0000 (Thu, 07 Oct 2010)
New Revision: 5258

Added:
   sandbox/maestro-3.0/Maestro.ResourceValidation/DrawingSourceValidator.cs
Modified:
   sandbox/maestro-3.0/Maestro.ResourceValidation/Maestro.ResourceValidation.csproj
   sandbox/maestro-3.0/Maestro.ResourceValidation/ResourceValidatorLoader.cs
Log:
Add stub drawing source validator


Added: sandbox/maestro-3.0/Maestro.ResourceValidation/DrawingSourceValidator.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.ResourceValidation/DrawingSourceValidator.cs	                        (rev 0)
+++ sandbox/maestro-3.0/Maestro.ResourceValidation/DrawingSourceValidator.cs	2010-10-07 23:58:46 UTC (rev 5258)
@@ -0,0 +1,43 @@
+#region Disclaimer / License
+// Copyright (C) 2010, Jackie Ng
+// http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie at 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 OSGeo.MapGuide.MaestroAPI;
+
+namespace Maestro.ResourceValidation
+{
+    public class DrawingSourceValidator : IResourceValidator
+    {
+        public ValidationIssue[] Validate(IResource resource, bool recurse)
+        {
+            if (resource.ResourceType != ResourceTypes.DrawingSource)
+                return null;
+
+            return new ValidationIssue[0];
+        }
+
+        public ResourceTypeDescriptor SupportedResourceAndVersion
+        {
+            get { return new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.DrawingSource, "1.0.0"); }
+        }
+    }
+}

Modified: sandbox/maestro-3.0/Maestro.ResourceValidation/Maestro.ResourceValidation.csproj
===================================================================
--- sandbox/maestro-3.0/Maestro.ResourceValidation/Maestro.ResourceValidation.csproj	2010-10-07 17:58:46 UTC (rev 5257)
+++ sandbox/maestro-3.0/Maestro.ResourceValidation/Maestro.ResourceValidation.csproj	2010-10-07 23:58:46 UTC (rev 5258)
@@ -37,6 +37,7 @@
   </ItemGroup>
   <ItemGroup>
     <Compile Include="ApplicationDefinitionValidator.cs" />
+    <Compile Include="DrawingSourceValidator.cs" />
     <Compile Include="FeatureSourceValidator.cs" />
     <Compile Include="LayerDefinitionValidator.cs" />
     <Compile Include="LoadProcedureValidator.cs" />

Modified: sandbox/maestro-3.0/Maestro.ResourceValidation/ResourceValidatorLoader.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.ResourceValidation/ResourceValidatorLoader.cs	2010-10-07 17:58:46 UTC (rev 5257)
+++ sandbox/maestro-3.0/Maestro.ResourceValidation/ResourceValidatorLoader.cs	2010-10-07 23:58:46 UTC (rev 5258)
@@ -36,6 +36,7 @@
             if (m_initialized)
                 return;
 
+            ResourceValidatorSet.RegisterValidator(new DrawingSourceValidator());
             ResourceValidatorSet.RegisterValidator(new FeatureSourceValidator());
             ResourceValidatorSet.RegisterValidator(new LayerDefinitionValidator());
             ResourceValidatorSet.RegisterValidator(new MapDefinitionValidator());



More information about the mapguide-commits mailing list