Beispiel #1
0
        protected override void ExecuteCrmWorkFlowActivity(CodeActivityContext context, LocalWorkflowContext localContext)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }
            if (localContext == null)
            {
                throw new ArgumentNullException(nameof(localContext));
            }

            string stringToSearch = StringToSearch.Get(context);
            int    numberOfSpaces = NumberOfSpaces.Get(context);
            string pattern        = Pattern.Get(context);

            Regex regex = new Regex(pattern, RegexOptions.IgnoreCase);

            string spaces = "";

            spaces = spaces.PadRight(numberOfSpaces, ' ');

            string replacedString = regex.Replace(stringToSearch, spaces);

            ReplacedString.Set(context, replacedString);
        }
        protected override void Execute(CodeActivityContext executionContext)
        {
            ITracingService tracer = executionContext.GetExtension <ITracingService>();

            try
            {
                int numberOfSpaces = NumberOfSpaces.Get(executionContext);

                string emptyString = new string(' ', numberOfSpaces);

                EmptyString.Set(executionContext, emptyString);
            }
            catch (Exception ex)
            {
                tracer.Trace("Exception: {0}", ex.ToString());
            }
        }
Beispiel #3
0
        protected override void ExecuteCrmWorkFlowActivity(CodeActivityContext context, LocalWorkflowContext localContext)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }
            if (localContext == null)
            {
                throw new ArgumentNullException(nameof(localContext));
            }

            int numberOfSpaces = NumberOfSpaces.Get(context);

            string emptyString = new string(' ', numberOfSpaces);

            EmptyString.Set(context, emptyString);
        }
        protected override void Execute(CodeActivityContext executionContext)
        {
            ITracingService tracer = executionContext.GetExtension <ITracingService>();

            try
            {
                string stringToSearch = StringToSearch.Get(executionContext);
                string valueToReplace = ValueToReplace.Get(executionContext);
                int    numberOfSpaces = NumberOfSpaces.Get(executionContext);

                string spaces = "";
                spaces = spaces.PadRight(numberOfSpaces, ' ');

                string replacedString = stringToSearch.Replace(valueToReplace, spaces);

                ReplacedString.Set(executionContext, replacedString);
            }
            catch (Exception ex)
            {
                tracer.Trace("Exception: {0}", ex.ToString());
            }
        }
Beispiel #5
0
        protected override void ExecuteCrmWorkFlowActivity(CodeActivityContext context, LocalWorkflowContext localContext)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }
            if (localContext == null)
            {
                throw new ArgumentNullException(nameof(localContext));
            }

            string stringToSearch = StringToSearch.Get(context);
            string valueToReplace = ValueToReplace.Get(context);
            int    numberOfSpaces = NumberOfSpaces.Get(context);

            string spaces = "";

            spaces = spaces.PadRight(numberOfSpaces, ' ');

            string replacedString = stringToSearch.Replace(valueToReplace, spaces);

            ReplacedString.Set(context, replacedString);
        }
Beispiel #6
0
        protected override void Execute(CodeActivityContext executionContext)
        {
            ITracingService tracer = executionContext.GetExtension <ITracingService>();

            try
            {
                string stringToSearch = StringToSearch.Get(executionContext);
                int    numberOfSpaces = NumberOfSpaces.Get(executionContext);
                string pattern        = Pattern.Get(executionContext);

                Regex regex = new Regex(pattern, RegexOptions.IgnoreCase);

                string spaces = "";
                spaces = spaces.PadRight(numberOfSpaces, ' ');

                string replacedString = regex.Replace(stringToSearch, spaces);

                ReplacedString.Set(executionContext, replacedString);
            }
            catch (Exception ex)
            {
                tracer.Trace("Exception: {0}", ex.ToString());
            }
        }