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 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 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); } }
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 searchFor = SearchFor.Get(context); bool caseSensitive = CaseSensitive.Get(context); bool endsWithString = stringToSearch.EndsWith(searchFor, (caseSensitive) ? StringComparison.CurrentCulture : StringComparison.CurrentCultureIgnoreCase); EndsWithString.Set(context, endsWithString); }