Class ResourceValidatorSet
A collection of resource validators. Use this to validate a given resource for common issues.
Inheritance
System.Object
ResourceValidatorSet
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: OSGeo.MapGuide.MaestroAPI.Resource.Validation
Assembly: OSGeo.MapGuide.MaestroAPI.dll
Syntax
public static class ResourceValidatorSet
Examples
This example shows how a ResourceValidatorSet is used
IResource resource;
IServerConnection conn;
...
var context = new ResourceValidationContext(conn);
var issues = ResourceValidatorSet.Validate(context, item, false);
Methods
| Improve this Doc View SourceHasValidator(String, Version)
Determines whether the specified resource types has validator.
Declaration
public static bool HasValidator(string resourceTypes, Version version)
Parameters
Type | Name | Description |
---|---|---|
System.String | resourceTypes | The resource types. |
System.Version | version | The version. |
Returns
Type | Description |
---|---|
System.Boolean |
|
RegisterValidator(IResourceValidator)
Registers the validator.
Declaration
public static void RegisterValidator(IResourceValidator validator)
Parameters
Type | Name | Description |
---|---|---|
IResourceValidator | validator | The validator. |
Validate(ResourceValidationContext, IResource, Boolean)
Validates the specified item using an existing validation context to skip over items already validated
Declaration
public static ValidationIssue[] Validate(ResourceValidationContext context, IResource item, bool recurse)
Parameters
Type | Name | Description |
---|---|---|
ResourceValidationContext | context | |
IResource | item | |
System.Boolean | recurse |
Returns
Type | Description |
---|---|
ValidationIssue[] |
Validate(ResourceValidationContext, IEnumerable<IResource>, Boolean)
Validates the specified items.
Declaration
public static ValidationIssue[] Validate(ResourceValidationContext context, IEnumerable<IResource> items, bool recurse)
Parameters
Type | Name | Description |
---|---|---|
ResourceValidationContext | context | The context. |
System.Collections.Generic.IEnumerable<IResource> | items | The items. |
System.Boolean | recurse | if set to |
Returns
Type | Description |
---|---|
ValidationIssue[] |