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);
        }
Beispiel #2
0
        protected override void Execute(CodeActivityContext executionContext)
        {
            ITracingService tracer = executionContext.GetExtension <ITracingService>();

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

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

                if (match.Success)
                {
                    string extractedString = match.Value;
                    ExtractedString.Set(executionContext, extractedString);
                    return;
                }

                ExtractedString.Set(executionContext, null);
            }
            catch (Exception ex)
            {
                tracer.Trace("Exception: {0}", ex.ToString());
            }
        }
Beispiel #3
0
        protected override void Execute(CodeActivityContext executionContext)
        {
            ITracingService tracer = executionContext.GetExtension <ITracingService>();

            try
            {
                string stringToSearch = StringToSearch.Get(executionContext);
                string searchFor      = SearchFor.Get(executionContext);
                bool   caseSensitive  = CaseSensitive.Get(executionContext);

                if (!caseSensitive)
                {
                    stringToSearch = stringToSearch.ToUpper();
                    searchFor      = searchFor.ToUpper();
                }

                bool containsString = stringToSearch.Contains(searchFor);

                ContainsString.Set(executionContext, containsString);
            }
            catch (Exception ex)
            {
                tracer.Trace("Exception: {0}", ex.ToString());
            }
        }
        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 searchFor      = SearchFor.Get(context);
            bool   caseSensitive  = CaseSensitive.Get(context);

            if (!caseSensitive)
            {
                stringToSearch = stringToSearch.ToUpper();
                searchFor      = searchFor.ToUpper();
            }

            bool containsString = stringToSearch.Contains(searchFor);

            ContainsString.Set(context, containsString);
        }
        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 pattern        = Pattern.Get(context);

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

            if (match.Success)
            {
                string extractedString = match.Value;
                ExtractedString.Set(context, extractedString);
                return;
            }

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

            try
            {
                string stringToSearch   = StringToSearch.Get(executionContext);
                string replacementValue = ReplacementValue.Get(executionContext);
                string pattern          = Pattern.Get(executionContext);

                if (string.IsNullOrEmpty(replacementValue))
                {
                    replacementValue = "";
                }

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

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

                ReplacedString.Set(executionContext, replacedString);
            }
            catch (Exception ex)
            {
                tracer.Trace("Exception: {0}", ex.ToString());
            }
        }
Beispiel #7
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 replacementValue = ReplacementValue.Get(context);
            string pattern          = Pattern.Get(context);

            if (string.IsNullOrEmpty(replacementValue))
            {
                replacementValue = "";
            }

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

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

            ReplacedString.Set(context, replacedString);
        }
        protected override void Execute(CodeActivityContext executionContext)
        {
            try
            {
                string stringToSearch = StringToSearch.Get(executionContext);
                string searchFor      = SearchFor.Get(executionContext);
                bool   caseSensitive  = CaseSensitive.Get(executionContext);

                bool startsWithString = stringToSearch.StartsWith(searchFor,
                                                                  (caseSensitive) ? StringComparison.CurrentCulture : StringComparison.CurrentCultureIgnoreCase);

                StartsWithString.Set(executionContext, startsWithString);
            }
            catch (Exception e)
            {
                throw new InvalidPluginExecutionException(e.Message);
            }
        }
Beispiel #9
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 searchFor      = SearchFor.Get(context);
            bool   caseSensitive  = CaseSensitive.Get(context);

            bool endsWithString = stringToSearch.EndsWith(searchFor,
                                                          (caseSensitive) ? StringComparison.CurrentCulture : StringComparison.CurrentCultureIgnoreCase);

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

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

                Regex regex           = new Regex(pattern, RegexOptions.IgnoreCase);
                Match match           = regex.Match(stringToSearch);
                bool  containsPattern = match.Success;

                ContainsPattern.Set(executionContext, containsPattern);
            }
            catch (Exception ex)
            {
                tracer.Trace("Exception: {0}", ex.ToString());
            }
        }
        protected override void Execute(CodeActivityContext executionContext)
        {
            ITracingService tracer = executionContext.GetExtension <ITracingService>();

            try
            {
                string stringToSearch = StringToSearch.Get(executionContext);
                string searchFor      = SearchFor.Get(executionContext);
                bool   caseSensitive  = CaseSensitive.Get(executionContext);

                bool endsWithString = stringToSearch.EndsWith(searchFor,
                                                              (caseSensitive) ? StringComparison.CurrentCulture : StringComparison.CurrentCultureIgnoreCase);

                EndsWithString.Set(executionContext, endsWithString);
            }
            catch (Exception ex)
            {
                tracer.Trace("Exception: {0}", ex.ToString());
            }
        }
        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 pattern        = Pattern.Get(context);

            Regex regex           = new Regex(pattern, RegexOptions.IgnoreCase);
            Match match           = regex.Match(stringToSearch);
            bool  containsPattern = match.Success;

            ContainsPattern.Set(context, containsPattern);
        }
        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 #14
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 #15
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());
            }
        }
Beispiel #16
0
        protected override void Execute(CodeActivityContext executionContext)
        {
            ITracingService tracer = executionContext.GetExtension <ITracingService>();

            try
            {
                string stringToSearch   = StringToSearch.Get(executionContext);
                string valueToReplace   = ValueToReplace.Get(executionContext);
                string replacementValue = ReplacementValue.Get(executionContext);

                if (string.IsNullOrEmpty(replacementValue))
                {
                    replacementValue = "";
                }

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

                ReplacedString.Set(executionContext, replacedString);
            }
            catch (Exception ex)
            {
                tracer.Trace("Exception: {0}", ex.ToString());
            }
        }
Beispiel #17
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);
            string replacementValue = ReplacementValue.Get(context);

            if (string.IsNullOrEmpty(replacementValue))
            {
                replacementValue = "";
            }

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

            ReplacedString.Set(context, replacedString);
        }