protected override void Execute(CodeActivityContext context) { int quotient = Dividend.Get(context) / Divisor.Get(context); int remainder = Dividend.Get(context) % Divisor.Get(context); Result.Set(context, quotient); Remainder.Set(context, remainder); }
//protected override void CacheMetadata(NativeActivityMetadata metadata) //{ // metadata.AddChild(this.Body); // if (this.Variables != null) // { // metadata.SetVariablesCollection(this.Variables); // } // var runtimeArguments = new Collection<RuntimeArgument>(); // runtimeArguments.Add(new RuntimeArgument("Dividend", typeof(int), ArgumentDirection.In)); // runtimeArguments.Add(new RuntimeArgument("Divisor", typeof(int), ArgumentDirection.In)); // metadata.Bind(this.Dividend, runtimeArguments[0]); // metadata.Bind(this.Divisor, runtimeArguments[1]); // metadata.SetArgumentsCollection(runtimeArguments); // metadata.AddImplementationChild(Body); //} protected override void Execute(NativeActivityContext context) { int dividend = Dividend.Get(context); int divisor = Divisor.Get(context); int quotient = dividend / divisor; int remainder = dividend % divisor; decimal result = (decimal)dividend / (decimal)divisor; Quotient.Set(context, quotient); Remainder.Set(context, remainder); Result.Set(context, result); }