public IPropertyType Clone([NotNull] IPropertyTypesContainer container) { IPropertyType result = null; if (container is IPropertySchema schema) { result = new ArrayPropertyType() { _id = _id, _schemaId = schema.Id, _model = schema.Model, _modelId = schema.Model?.Id ?? Guid.Empty, Name = Name, Description = Description, Visible = Visible, DoNotPrint = DoNotPrint, ReadOnly = ReadOnly, CustomPropertyViewer = CustomPropertyViewer, Priority = Priority }; container.Add(result); } return(result); }
public override IPropertyType Clone([NotNull] IPropertyTypesContainer container) { IPropertyType result = null; if (container is IPropertySchema schema) { result = new ListPropertyType { _id = _id, _schemaId = schema.Id, _model = schema.Model, _modelId = schema.Model?.Id ?? Guid.Empty, Name = Name, Description = Description, _listProviderId = _listProviderId, Context = Context, _cachedList = _cachedList, Visible = Visible, DoNotPrint = DoNotPrint, ReadOnly = ReadOnly, Priority = Priority }; container.Add(result); } return(result); }
/// <summary> /// Clone Property Types between Containers. /// </summary> /// <param name="source">Source Container.</param> /// <param name="target">Target Container.</param> public static void ClonePropertyTypes(this IPropertyTypesContainer source, [NotNull] IPropertyTypesContainer target) { var propertyTypes = source?.PropertyTypes?.ToArray(); if (propertyTypes?.Any() ?? false) { foreach (var propertyType in propertyTypes) { propertyType.Clone(target); } } }
/// <summary> /// Merge Property Types between Containers. /// </summary> /// <param name="target">Target Container.</param> /// <param name="source">Source Container.</param> public static void MergePropertyTypes(this IPropertyTypesContainer target, [NotNull] IPropertyTypesContainer source) { var propertyTypes = source?.PropertyTypes?.ToArray(); if (propertyTypes?.Any() ?? false) { foreach (var propertyType in propertyTypes) { var targetPropertyType = target.GetPropertyType(propertyType.Name); if (targetPropertyType == null) { propertyType.Clone(target); } } } }
public IPropertyType Clone([NotNull] IPropertyTypesContainer container) { IPropertyType result = null; if (container is IPropertySchema schema) { result = new StringPropertyType { _id = _id, _schemaId = schema.Id, Name = Name, Description = Description, Visible = Visible, Priority = Priority }; container.Add(result); } return(result); }
public IPropertyType Clone([NotNull] IPropertyTypesContainer container) { IPropertyType result = null; if (container is IPropertySchema schema) { result = new IntegerPropertyType { _id = _id, _schemaId = schema.Id, _model = schema.Model, _modelId = schema.Model?.Id ?? Guid.Empty, Name = Name, Description = Description, Visible = Visible, Priority = Priority }; container.Add(result); } return(result); }
public override IPropertyType Clone([NotNull] IPropertyTypesContainer container) { IPropertyType result = null; if (container is IPropertySchema schema) { result = new ListMultiPropertyType { _id = _id, _schemaId = schema.Id, Name = Name, Description = Description, _listProviderId = _listProviderId, Context = Context, _cachedList = _cachedList, Visible = Visible, Priority = Priority }; container.Add(result); } return(result); }
public virtual IPropertyType Clone(IPropertyTypesContainer container) { return(null); }