public PluginStepImage(string name, string entityAlias, PluginImageType PluginImageType, Expression <Func <T, object> >[] attributes) { this.Name = name; this.EntityAlias = entityAlias; this.PluginImageType = (int)PluginImageType; if (attributes != null && attributes.Length > 0) { this.Attributes = string.Join(",", attributes.Select(x => PluginStepConfig <T> .GetMemberName(x))).ToLower(); } else { this.Attributes = null; } }
protected static T GetImage <T>(LocalPluginContext context, PluginImageType PluginImageType, string name) where T : Entity { EntityImageCollection collection = null; if (PluginImageType == PluginImageType.PreImage) { collection = context.PluginExecutionContext.PreEntityImages; } else if (PluginImageType == PluginImageType.PostImage) { collection = context.PluginExecutionContext.PostEntityImages; } Entity entity; if (collection != null && collection.TryGetValue(name, out entity)) { return(entity.ToEntity <T>()); } else { return(null); } }
public PluginStepConfig <T> AddImage(string name, string entityAlias, PluginImageType PluginImageType, params Expression <Func <T, object> >[] attributes) { this._Images.Add(new PluginStepImage(name, entityAlias, PluginImageType, attributes)); return(this); }
public PluginStepConfig <T> AddImage(string name, string entityAlias, PluginImageType PluginImageType) { return(this.AddImage(name, entityAlias, PluginImageType, null)); }
public PluginStepConfig <T> AddImage(PluginImageType PluginImageType, params Expression <Func <T, object> >[] attributes) { return(this.AddImage(PluginImageType.ToString(), PluginImageType.ToString(), PluginImageType, attributes)); }
public PluginStepConfig <T> AddImage(PluginImageType PluginImageType) { return(this.AddImage(PluginImageType, null)); }
protected static T GetImage <T>(LocalPluginContext context, PluginImageType PluginImageType) where T : Entity { return(GetImage <T>(context, PluginImageType, PluginImageType.ToString())); }