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