public static ISchema GetSchemaForDataSourceInfo(DataSourceInfo dataSource) { if (dataSource == null || !dataSource.IsValidWithSource) { return((ISchema) new EmptySchema()); } string errorMessage; ISchema schema = ProjectXamlContext.FromDocumentNode(dataSource.SourceNode).SchemaManager.GetSchemaForDataSourceInternal(dataSource.SourceNode, out errorMessage); if (schema != null && !string.IsNullOrEmpty(dataSource.Path)) { DataSchemaNodePath nodePathFromPath = schema.GetNodePathFromPath(dataSource.Path); if (nodePathFromPath != null) { schema = nodePathFromPath.RelativeSchema; } } return(schema); }
public static ISchema GetSchemaForDataSource(DocumentNode dataSource, out string errorMessage) { return(ProjectXamlContext.FromDocumentNode(dataSource).SchemaManager.GetSchemaForDataSourceInternal(dataSource, out errorMessage)); }