Exemplo n.º 1
0
        protected override void Execute(CodeActivityContext context)
        {
            PromotionPersistenceParticipant persistenceParticipant = context.GetExtension <PromotionPersistenceParticipant>();

            if (persistenceParticipant != null && this.Name != null && this.Value != null)
            {
                if (this.ClearExistingPromotedData)
                {
                    persistenceParticipant.ClearExistingPromotionData();
                }

                string propertyName  = this.Name;
                T      propertyValue = context.GetValue <T>(this.Value);
                persistenceParticipant.AddPromotedVariable(propertyName, propertyValue);
            }
        }
Exemplo n.º 2
0
        protected override void Execute(CodeActivityContext context)
        {
            PromotionPersistenceParticipant persistenceParticipant = context.GetExtension<PromotionPersistenceParticipant>();

            if (persistenceParticipant != null)
            {
                if (this.ClearExistingPromotedData)
                {
                    persistenceParticipant.ClearExistingPromotionData();
                }

                foreach (KeyValuePair<string, InArgument> promotedProperty in ValuesToPromote)
                {
                    string propertyName = promotedProperty.Key;
                    object propertyValue = promotedProperty.Value != null ? promotedProperty.Value.Get(context) : null;
                    persistenceParticipant.AddPromotedVariable(propertyName, propertyValue);
                }
            }
        }