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 stringToTitleCase = StringToTitleCase.Get(context); TextInfo ti = CultureInfo.CurrentCulture.TextInfo; string titleCasedString = ti.ToTitleCase(stringToTitleCase); TitleCasedString.Set(context, titleCasedString); }
protected override void Execute(CodeActivityContext executionContext) { ITracingService tracer = executionContext.GetExtension <ITracingService>(); try { string stringToTitleCase = StringToTitleCase.Get(executionContext); TextInfo ti = CultureInfo.CurrentCulture.TextInfo; string titleCasedString = ti.ToTitleCase(stringToTitleCase); TitleCasedString.Set(executionContext, titleCasedString); } catch (Exception ex) { tracer.Trace("Exception: {0}", ex.ToString()); } }