public void OnAttach(MachineInstance machine, out IVariable[] variables, out MethodInfo[] methods, out IRuntimeContextInstance instance) { variables = new IVariable[this.Count]; for (int i = 0; i < variables.Length; i++) { variables[i] = Variable.CreateContextPropertyReference(this, i); } methods = new MethodInfo[0]; instance = this; }
public void OnAttach(MachineInstance machine, out IVariable[] variables, out MethodInfo[] methods) { variables = new IVariable[this.Count]; var props = GetProperties().OrderBy(x => x.Value).Select(x => x.Key).ToArray(); Debug.Assert(props.Length == variables.Length); for (var i = 0; i < variables.Length; i++) { variables[i] = Variable.CreateContextPropertyReference(this, i, props[i]); } methods = new MethodInfo[0]; }