protected override void Execute(CodeActivityContext executionContext) { var padchar = PadCharacter.Get <string>(executionContext); var pad = (String.IsNullOrEmpty(padchar)) ? ' ' : padchar[0]; var length = FinalLength.Get <int>(executionContext); var text = Text.Get <string>(executionContext); var result = PadOnLeft.Get <bool>(executionContext) ? text.PadLeft(length, pad) : text.PadRight(length, pad); Result.Set(executionContext, result); }
protected override void Execute(CodeActivityContext context) { var inputString = InputString.Get(context); var padCharacter = PadCharacter.Get(context); var padOnLeft = PadOnLeft.Get(context); var finalLength = FinalLength.Get(context); // TODO: Validate padCharacter is only one character? var output = PadString(inputString, padCharacter, padOnLeft, finalLength); OutputString.Set(context, output); }