public void CallOperationUpdateArgument() { var o1 = new NotificationObject<string>() { Value1 = "Test", Value2 = "Te", }; var op = new CallOperation<bool>(new OperationContext(), Expression.Call( Expression.MakeMemberAccess( Expression.Constant(o1), typeof(NotificationObject<string>).GetProperty("Value1")), typeof(string).GetMethod("StartsWith", new Type[] { typeof(string) }), Expression.MakeMemberAccess( Expression.Constant(o1), typeof(NotificationObject<string>).GetProperty("Value2")))); Assert.IsTrue(op.Value); o1.Value2 = "st"; Assert.IsFalse(op.Value); o1.Value2 = "Te"; Assert.IsTrue(op.Value); }
public void CallOperationUpdateArgument() { var o1 = new NotificationObject <string>() { Value1 = "Test", Value2 = "Te", }; var op = new CallOperation <bool>(new OperationContext(), Expression.Call( Expression.MakeMemberAccess( Expression.Constant(o1), typeof(NotificationObject <string>).GetProperty("Value1")), typeof(string).GetMethod("StartsWith", new Type[] { typeof(string) }), Expression.MakeMemberAccess( Expression.Constant(o1), typeof(NotificationObject <string>).GetProperty("Value2")))); Assert.IsTrue(op.Value); o1.Value2 = "st"; Assert.IsFalse(op.Value); o1.Value2 = "Te"; Assert.IsTrue(op.Value); }
public void CallOperationRead() { var op = new CallOperation<bool>(new OperationContext(), Expression.Call( Expression.Constant("Test"), typeof(string).GetMethod("StartsWith", new Type[] { typeof(string) }), Expression.Constant("Te"))); Assert.IsTrue(op.Value); }
public void CallOperationRead() { var op = new CallOperation <bool>(new OperationContext(), Expression.Call( Expression.Constant("Test"), typeof(string).GetMethod("StartsWith", new Type[] { typeof(string) }), Expression.Constant("Te"))); Assert.IsTrue(op.Value); }
private void ProcessDeferredOperations() { CallOperation operation = null; while (_defferedOperations.TryDequeue(out operation)) { var localOperation = operation; var del = new Action(localOperation.Execute); del.BeginInvoke(_deferredOperationCallback, del); } }