public override void Execute() { // Define the schema elements. var schema = Schemas.AddSchema(BasePluginConstants.DesignModel_SchemaName, BasePluginConstants.DesignModel_SchemaNamespace); var stringType = DataTypeRegistry.Get(BasePluginConstants.DataType_string); schema .CreateRootElement("DesignModels") .CreateElement("Namespace", "Defines namespace for the design models", c => c.IsMandatory = true) .CreateAttribute("name", stringType, "Namespace name", c => c.IsMandatory = true); // Register parser. DesignModelConverterFactory.RegisterFactory(schema.RootElement.FindChildElement("Namespace"), new NamespaceParser()); }
public override void Execute() { // Define the schema elements. var schema = Schemas.GetSchemaByNamespace(BasePluginConstants.DesignModel_SchemaNamespace); schema .RootElement .FindChildElement("Namespace/Entity") .GetBuilder() .AddDeriveFromSchema("entity", true, true, DataTypeRegistry); // Register parsers. var deriveFromElement = schema.RootElement.FindChildElement("Namespace/Entity/DeriveFrom"); var parser = new ClassDerivationParser(DesignModelCollection); DesignModelConverterFactory.RegisterFactory(deriveFromElement, parser); }
public override void Execute() { var schema = Schemas.AddSchema(CoreConstants.ProjectConfiguration_SchemaName, CoreConstants.ProjectConfiguration_SchemaNamespace); var stringType = DataTypeRegistry.Get(BasePluginConstants.DataType_string); schema .CreateRootElement("ProjectConfiguration") .CreateElement("Solution", "Defines project solution projects", c => c.IsMandatory = true) .CreateAttribute("path", stringType, "Solution path relative to this file", c => c.IsMandatory = true) .CreateElement("Project", "Defines a project", c => c.AllowMultiple = true) .CreateAttribute("name", stringType, "Project name", c => c.IsMandatory = true) .CreateAttribute("path", stringType, "Project location relative to the solution path", c => c.IsMandatory = true) .CreateAttribute("type", stringType, "Project type", c => c.IsMandatory = true) .Parent() .CreateElement("Namespaces", "Defines the namespaces to be used in design models"); DesignModelConverterFactory.RegisterFactory(schema.RootElement, new ProjectConfigurationParser(ProjectCollection)); }
public override void Execute() { // Define the schema elements. var schema = Schemas.GetSchemaByNamespace(BasePluginConstants.DesignModel_SchemaNamespace); var stringType = DataTypeRegistry.Get(BasePluginConstants.DataType_string); schema .RootElement .FindChildElement("Namespace/Entity/Relation") .GetBuilder() .CreateElement("Attribute", "Defines an entity attribute", c => c.AllowMultiple = true) .CreateAttribute("name", stringType, "Attribute name", c => c.IsMandatory = true) .CreateAttribute("type", stringType, "Attribute type", c => c.IsMandatory = true); var designModelElement = schema.RootElement.FindChildElement("Namespace/Entity/Relation/Attribute"); // Register parser. DesignModelConverterFactory.RegisterFactory(designModelElement, new EntityRelationAttributeParser(DataTypeRegistry)); }
public override void Execute() { // Define the schema elements. var schema = Schemas.GetSchemaByNamespace(BasePluginConstants.DesignModel_SchemaNamespace); var stringType = DataTypeRegistry.Get(BasePluginConstants.DataType_string); var boolType = DataTypeRegistry.Get(BasePluginConstants.DataType_bool); schema .RootElement .FindChildElement("Namespace/Entity") .GetBuilder() .CreateElement("Relation", "Defines a relation to another entity") .CreateAttribute("name", stringType, "Relation name") .CreateAttribute("destination", stringType, "Destination entity name", c => c.IsMandatory = true) .CreateAttribute("mandatory", boolType, "Whether this is a mandatory relation", c => c.IsMandatory = true); var designModelElement = schema.RootElement.FindChildElement("Namespace/Entity/Relation"); // Register parser. DesignModelConverterFactory.RegisterFactory(designModelElement, new EntityRelationParser(DesignModelCollection)); }