/// <inheritdoc /> public void AddDesignModel(IDesignModel designModel) { _designModelList.Add(designModel); _designModelMap.Add(nameof(IDesignModel.DesignModelType), designModel.DesignModelType, designModel); _designModelMap.Add(nameof(IDesignModel.Name), designModel.Name, designModel); }
public ClassOutputModelBuilder(string outputModelType, IDesignModel designModel, IClassNamingConvention namingConvention) { _namingConvention = namingConvention; _designModel = designModel; _outputModelType = outputModelType; }
public OutputModelBase(string type, INamespace ns, IDesignModel designModel = null, IProjectFile file = null) { this.Type = type; this.Namespace = ns; this.DesignModel = designModel; this.File = file; this.OutputConfiguration = new OutputConfiguration.OutputConfiguration(this.Namespace?.OutputConfiguration); }
public OutputModelBase(string type, INamespace ns, IDesignModel designModel = null, IProjectFile file = null, OutputModelMergeMode mergeMode = OutputModelMergeMode.Skip) { Type = type; Namespace = ns; DesignModel = designModel; File = file; OutputConfiguration = new OutputConfiguration.OutputConfiguration(Namespace?.OutputConfiguration); MergeMode = mergeMode; }
public IEnumerable <IOutputModel> GenerateOutputModels(IDesignModel designModel) { var entity = (Base.Models.Entity.Entity)designModel; return(new[] { _entityConverter.CreateEntityGeneratedClass(entity, BasePluginConstants.Language_CSharp), _entityConverter.CreateEntityCustomClass(entity, BasePluginConstants.Language_CSharp) }); }
public IEnumerable <ITargetPlatform> GetTargetPlatformsForDesignModel(IDesignModel designModel) { var res = _targetPlatformByDesignModelTypeMap.GetOrNull(designModel.DesignModelType); if (res == null && Parent != null) { return(Parent.GetTargetPlatformsForDesignModel(designModel)); } return(res ?? Enumerable.Empty <ITargetPlatform>()); }
private static void ParseProperty(IDesignModel designModel, IXmlElementAttribute attribute) { var definition = attribute.Definition; var name = definition.Name.LocalName; if (designModel.GetProperty(name) != null) { // Property is already defined, so skip attribute. return; } var value = attribute.Value; var property = new DesignModelProperty(definition.Name.LocalName, definition.Type, value, definition, attribute.ParseLocation); designModel.AddProperty(property); }
public virtual void CopyPropertiesFrom(IDesignModel source, IParseLocationInfo parseLocation = null) { var propertiesToCopy = source.Properties.Join( Element.Definition.Attributes, x => x.Name, x => x.Name.LocalName, (x, y) => new { x.Name, y.Type, x.Value, Definition = y } ); foreach (var entry in propertiesToCopy.Where(x => !_propertyMap.ContainsKey(x.Name))) { AddProperty(new DesignModelProperty(entry.Name, entry.Type, entry.Value, entry.Definition, parseLocation)); } }
public void AddDesignModel(IDesignModel designModel) { _designModelsByTypeMap.Add(designModel.DesignModelType, designModel); }
public ClassOutputModel(string type, INamespace ns, IDesignModel designModel, IProjectFile file = null) : base(type, ns, designModel, file) { }
public DesignModelException(IDesignModel model, string message, Exception innerException) : base(FormatMessage(model.Element.Definition.Name, model.ParseLocation, message), innerException) { }