public void Add(double x, double y) { double result = x + y; ICallback callback = OperationContext.Current.GetCallbackChannel <ICallback>(); callback.DisplayResult(x, y, result); }
public void Add(double x, double y) { double result = x + y; ICallback callback = OperationContext.Current.GetCallbackChannel <ICallback>(); callback.DisplayResult(x, y, result); Console.WriteLine("客户端已经正常显示结果为:" + result.ToString()); }
public void Add(double x, double y) { Publisher.Instance.NotifyMessage(string.Format("Server - method Add({0},{1}) get called.", x, y)); double result = x + y; ICallback callback = OperationContext.Current.GetCallbackChannel <ICallback>(); callback.DisplayResult(result); }
public void Multiple(double a, double b) { double result = a * b; // 通过客户端实例通道 ICallback callback = OperationContext.Current.GetCallbackChannel <ICallback>(); // 对客户端操作进行回调 callback.DisplayResult(a, b, result); }
public void Add(double x, double y) { Console.WriteLine("Enter Add(), x=" + x + ", y=" + y); double result = x + y; ICallback callback = OperationContext.Current.GetCallbackChannel <ICallback>(); callback.DisplayResult(x, y, result); Console.WriteLine("callback DisplayResult() returned."); }