Esempio n. 1
0
            public PluginStepImage(string name, string entityAlias, ImageType imageType, Expression <Func <T, object> >[] attributes)
            {
                this.Name        = name;
                this.EntityAlias = entityAlias;
                this.ImageType   = (int)imageType;

                if (attributes != null && attributes.Length > 0)
                {
                    this.Attributes = string.Join(",", attributes.Select(x => PluginStepConfig <T> .GetMemberName(x))).ToLower();
                }
                else
                {
                    this.Attributes = null;
                }
            }
Esempio n. 2
0
        protected PluginStepConfig <T> RegisterPluginStep <T>(
            EventOperation eventOperation, ExecutionStage executionStage, Action <LocalPluginContext> action)
            where T : Entity
        {
            PluginStepConfig <T> stepConfig = new PluginStepConfig <T>(eventOperation, executionStage);

            this.PluginStepConfigs.Add((IPluginStepConfig)stepConfig);

            this.RegisteredEvents.Add(
                new Tuple <int, string, string, Action <LocalPluginContext> >(
                    stepConfig._ExecutionStage,
                    stepConfig._EventOperation,
                    stepConfig._LogicalName,
                    new Action <LocalPluginContext>(action)));

            return(stepConfig);
        }
Esempio n. 3
0
        protected PluginStepConfig RegisterPluginStep <T>(EventOperation eventOperation, ExecutionStage executionStage, Action <LocalPluginContext> action) where T : Entity
        {
            var e = Activator.CreateInstance <T>();
            //TypedPluginStepConfig stepConfig = new TypedPluginStepConfig(eventOperation, executionStage, (e as Entity).LogicalName);
            var config   = new StepConfig((e as Entity).LogicalName, (int)executionStage, Enum.GetName(typeof(EventOperation), eventOperation), (e as Entity).LogicalName);
            var extended = new ExtendedStepConfig((int)Deployment.ServerOnly, (int)ExecutionMode.Synchronous, (e as Entity).LogicalName, 1, "", null);

            var pluginStepConfig = new PluginStepConfig(config, extended, new List <ImageConfig>());

            this.PluginStepConfigs.Add(pluginStepConfig);

            this.RegisteredEvents.Add(
                new Tuple <int, string, string, Action <LocalPluginContext> >(
                    config.ExecutionStage,
                    config.EventOperation,
                    config.LogicalName,
                    new Action <LocalPluginContext>(action)));

            return(pluginStepConfig);
        }