Example #1
0
            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;
                }
            }
Example #2
0
        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);
            }
        }
Example #3
0
 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);
 }
Example #4
0
 public PluginStepConfig <T> AddImage(string name, string entityAlias, PluginImageType PluginImageType)
 {
     return(this.AddImage(name, entityAlias, PluginImageType, null));
 }
Example #5
0
 public PluginStepConfig <T> AddImage(PluginImageType PluginImageType, params Expression <Func <T, object> >[] attributes)
 {
     return(this.AddImage(PluginImageType.ToString(), PluginImageType.ToString(), PluginImageType, attributes));
 }
Example #6
0
 public PluginStepConfig <T> AddImage(PluginImageType PluginImageType)
 {
     return(this.AddImage(PluginImageType, null));
 }
Example #7
0
 protected static T GetImage <T>(LocalPluginContext context, PluginImageType PluginImageType) where T : Entity
 {
     return(GetImage <T>(context, PluginImageType, PluginImageType.ToString()));
 }