protected override void Execute(CodeActivityContext executionContext) { ITracingService tracer = executionContext.GetExtension <ITracingService>(); try { string stringToMeasure = StringToMeasure.Get(executionContext); int stringLength = stringToMeasure.Length; StringLength.Set(executionContext, stringLength); } 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 stringToMeasure = StringToMeasure.Get(context); if (string.IsNullOrEmpty(stringToMeasure)) { StringLength.Set(context, 0); return; } int stringLength = stringToMeasure.Length; StringLength.Set(context, stringLength); }