/// <summary> /// 内容共享 /// </summary> private void btnShare_Click(object sender, EventArgs e) { if (null == _currentCall) { return; } var contentSelectWin = new ContentSelectPanel() { OKAction = (imageFormat, contentType, contentHandle) => { try { if (null == _currentCall) { throw new Exception("当前呼叫不存在"); } _currentCall.StartSendContent(imageFormat, contentType, contentHandle); return(true); } catch (Exception ex) { MessageBox.Show(this, ex.Message, "消息框", MessageBoxButtons.OK, MessageBoxIcon.Error); return(false); } }, OnCancel = () => { } }; qlManager.GetApps((apps) => { contentSelectWin.BindAppData(apps); }); UXMessageMask.ShowForm(ownerContainer, contentSelectWin); }
private void btnShare_Click(object sender, EventArgs e) { if (null == _currentCall) { return; } var contentSelectWin = new ContentSelectPanel() { Monitors = deviceManager.GetDevicesByType(DeviceType.MONITOR), Apps = deviceManager.GetDevicesByType(DeviceType.APPLICATIONS), OKAction = (type, format, monitor, app) => { try { switch (type) { case "Monitor": { MFWCore.StartShareContent(monitor, app); } break; case "BFCP": { var width = Screen.PrimaryScreen.Bounds.Width; var height = Screen.PrimaryScreen.Bounds.Height; MFWCore.SetContentBuffer(format, width, height); MFWCore.StartBFCPContent(); } break; } return(true); } catch (Exception ex) { MessageBox.Show(this, ex.Message, "消息框", MessageBoxButtons.OK, MessageBoxIcon.Error); return(false); } }, OnCancel = () => { } }; UXMessageMask.ShowForm(ownerPnl, contentSelectWin); }
private void btnShare_Click(object sender, EventArgs e) { var contentSelectWin = new ContentSelectPanel() { Monitors = deviceManager.GetDevicesByType(DeviceTypeEnum.DEV_MONITOR), Apps = deviceManager.GetDevicesByType(DeviceTypeEnum.APPLICATIONS), OKAction = (type, format, monitor, app) => { switch (type) { case "Monitor": { var errno = WrapperProxy.StartShareContent(_call.CallHandle, monitor, app); if (errno != ErrorNumberEnum.PLCM_SAMPLE_OK) { MessageBox.Show(this, "共享内容失败!", "消息框", MessageBoxButtons.OK, MessageBoxIcon.Error); return(false); } } break; case "BFCP": { var width = Screen.PrimaryScreen.Bounds.Width; var height = Screen.PrimaryScreen.Bounds.Height; WrapperProxy.SetContentBuffer(format, width, height); var errno = WrapperProxy.StartBFCPContent(_call.CallHandle); if (errno != ErrorNumberEnum.PLCM_SAMPLE_OK) { MessageBox.Show(this, "共享内容失败!", "消息框", MessageBoxButtons.OK, MessageBoxIcon.Error); return(false); } } break; } return(true); }, OnCancel = () => { } }; UXMessageMask.ShowForm(this, contentSelectWin); }