/// <summary> /// 非同期操作実行通信。 /// 非同期実行のトリガをコントロールスレッドでかけて、実行は対象スレッドに任せる。 /// </summary> /// <param name="info">呼び出し情報。</param> /// <param name="receiveWindow">受信ウィンドウ。</param> /// <returns>戻り値。</returns> private ReturnInfo AsyncOperation(ProtocolInfo info, ReceiveAfterSend receiveWindow) { ContextOrderProtocolInfo contextOrder = new ContextOrderProtocolInfo(info, _friendlyConnectorWindowInAppHandle); ReturnInfo ret = CopyDataProtocolTalker.SendAndRecieve(_friendlyConnectorWindowInAppHandleAsync, contextOrder, receiveWindow) as ReturnInfo; if (ret == null) { throw new FriendlyOperationException(ResourcesLocal.Instance.ErrorAppCommunication); } return(ret); }
/// <summary> /// データ受信時の処理。 /// </summary> /// <param name="communicationNo">通信番号。</param> /// <param name="recieveData">受信データ。</param> /// <param name="senderWindow">送信元ウィンドウ。</param> protected override void OnRecieveData(int communicationNo, object recieveData, IntPtr senderWindow) { ContextOrderProtocolInfo contextOrder = recieveData as ContextOrderProtocolInfo; if (contextOrder != null) { FriendlyConnectorWindowInApp async = _manager.FromHandle(contextOrder.ExecuteWindowHandle); SendReturnData(communicationNo, senderWindow, _dotNetFriendlyControl.Execute(async, contextOrder.ProtocolInfo)); } else { ProtocolInfo protocolInfo = recieveData as ProtocolInfo; SendReturnData(communicationNo, senderWindow, _dotNetFriendlyControl.Execute(this, protocolInfo)); } }