public void svcStopControl(clsMessageContract mcStopControl) { if (EntsvcStopControl != null) { EntsvcStopControl(mcStopControl); } }
public void svcSetUserList(clsMessageContract mcSetUserList) { if (EntsvcSetUserList != null) { EntsvcSetUserList(mcSetUserList); } }
public void svcSelectedDesktop(clsMessageContract mcSelectedDesktop) { if (EntsvcSelectedDesktop != null) { EntsvcSelectedDesktop(mcSelectedDesktop); } }
public void svcJoin(clsMessageContract mcJoin) { if (EntsvcJoin != null) { EntsvcJoin(mcJoin); } }
public void svcSendMessage(clsMessageContract mcSendMessage) { if (EntsvcSendMessage != null) { EntsvcSendMessage(mcSendMessage); } }
public void svcStopControl(clsMessageContract streamUName) { if (EntsvcStopControl != null) { EntsvcStopControl(streamUName); } }
public void svcSelectedDesktop(clsMessageContract streamUName) { if (EntsvcSelectedDesktop != null) { EntsvcSelectedDesktop(streamUName); } }
public void svcGetUserList(clsMessageContract streamGetUserList) { if (EntsvcGetUserList != null) { EntsvcGetUserList(streamGetUserList); } }
public void svcSendMessage(clsMessageContract streamImage) { if (EntsvcSendMessage != null) { EntsvcSendMessage(streamImage); } }
public void svcJoin(clsMessageContract streamUName) { if (EntsvcJoin != null) { EntsvcJoin(streamUName); } }
void RegDesktopp2pClient(string P2PUri) { try { NetPeerClient npcDummyDesktop = new NetPeerClient(); objNetTcpDesktop = new clsNetTcpDesktop(); ((clsNetTcpDesktop)objNetTcpDesktop).EntsvcJoin += new clsNetTcpDesktop.delsvcJoin(P2PDesktopClient_EntsvcJoin); ((clsNetTcpDesktop)objNetTcpDesktop).EntsvcUnJoin += new clsNetTcpDesktop.delsvcUnJoin(P2PDesktopClient_EntsvcUnJoin); channelNettcpDesktop = (INetTcpDesktopChannel)npcDummyDesktop.OpenClient<INetTcpDesktopChannel>(P2PUri, P2PUri.ToString().Split(':')[2].Split('/')[2], ref objNetTcpDesktop); while (tempcounter < 20) { try { //Stream mmsUName = fncStringToStream(UserName); //channelNettcpDesktop.svcJoin(mmsUName); #region msgContract clsMessageContract objContract = new clsMessageContract(); objContract.blControl = false; objContract.blView = false; objContract.key = 0; objContract.mouseButton = 0; objContract.stremImage = new MemoryStream(); objContract.strFrom = UserName; objContract.strTo = ""; objContract.strType = ""; objContract.x = 0.0; objContract.y = 0.0; #endregion msgContract channelNettcpDesktop.svcJoin(objContract); tempcounter = 20; } catch { tempcounter++; System.Threading.Thread.Sleep(1000); } } } catch { } }
void DesktopDummy_EntsvcSendXY(clsMessageContract objContract) { try { if (lstNodes.Count > 0) { for (int i = 0; i < lstNodes.Count; i++) { if (lstNodes[i].uName == objContract.strTo) { strXY = objContract.strTo; #region 20oct changes objMouse.strFrom = ""; objMouse.strType = ""; objMouse.strTo = objContract.strTo; objMouse.x = objContract.x; objMouse.y = objContract.y; objMouse.stremImage = new MemoryStream(); objMouse.mouseButton = new int(); objMouse.key = new int(); objMouse.blView = new bool(); objMouse.blControl = new bool(); objMouse.id = 8; objMouse.ViewTag = new int(); objMouse.ControlTag = new int(); #endregion 20oct changes } } } } catch (Exception ex) { VMuktiHelper.ExceptionHandler(ex, "DesktopDummy_EntsvcSendXY", "DesktopDummy.cs"); } }
void DesktopDummy_EntsvcAllowControl(clsMessageContract objContract) { try { if (lstNodes.Count > 0) { int ControlTag = 0; if (objContract.blControl) { ControlTag = 1; } else if (!objContract.blControl) { ControlTag = 0; } #region 20oct changes clsGetMessage objGetMessage = new clsGetMessage(); objGetMessage.strFrom = objContract.strFrom; objGetMessage.strType = ""; objGetMessage.strTo = ""; objGetMessage.x = new double(); objGetMessage.y = new double(); objGetMessage.stremImage = new MemoryStream(); objGetMessage.mouseButton = new int(); objGetMessage.key = new int(); objGetMessage.blView = new bool(); objGetMessage.blControl = new bool(); objGetMessage.id = 11; objGetMessage.ViewTag = new int(); objGetMessage.ControlTag =ControlTag ; #endregion 20oct changes for (int i = 0; i < lstNodes.Count; i++) { List<clsGetMessage> lstStream = (List<clsGetMessage>)hashMessages[lstNodes[i].uName]; if (ControlTag == 0) { lstStream.Clear(); } lstStream.Add(objGetMessage); hashMessages[lstNodes[i].uName] = lstStream; } } } catch (Exception ex) { VMuktiHelper.ExceptionHandler(ex, "DesktopDummy_EntsvcAllowControl", "DesktopDummy.cs"); } }
void DesktopDummy_EntsvcSendMessage(clsMessageContract objContract) { try { if (lstNodes.Count > 0) { #region 20oct changes clsGetMessage objGetMessage = new clsGetMessage(); objGetMessage.strFrom = objContract.strFrom; objGetMessage.strType = ""; objGetMessage.strTo = ""; objGetMessage.x = new double(); objGetMessage.y = new double(); objGetMessage.stremImage = objContract.stremImage; objGetMessage.mouseButton = new int(); objGetMessage.key = new int(); objGetMessage.blView = new bool(); objGetMessage.blControl = new bool(); objGetMessage.id = 3; objGetMessage.ControlTag = new int(); objGetMessage.ViewTag = new int(); #endregion 20oct changes string uNameImg = objContract.strFrom; for (int i = 0; i < lstNodes.Count; i++) { if (lstNodes[i].isControlled) { } else if ((!lstNodes[i].isControlled) && (!lstNodes[i].isControlling)) { List<clsGetMessage> lstStream = (List<clsGetMessage>)hashMessages[lstNodes[i].uName]; lstStream.Add(objGetMessage); hashMessages[lstNodes[i].uName] = lstStream; } if (lstNodes[i].isControlling && lstNodes[i].strControlled==uNameImg) { List<clsGetMessage> lstStream = (List<clsGetMessage>)hashMessages[lstNodes[i].uName]; lstStream.Add(objGetMessage); hashMessages[lstNodes[i].uName] = lstStream; } } } } catch (Exception ex) { VMuktiHelper.ExceptionHandler(ex, "DesktopDummy_EntsvcSendMessage", "DesktopDummy.cs"); } }
void DesktopDummy_EntsvcStopControl(clsMessageContract objContract) { try { if (lstNodes.Count > 0) { for (int i = 0; i < lstNodes.Count; i++) { if (lstNodes[i].uName == objContract.strFrom) { #region 20oct changes clsGetMessage objGetMessage = new clsGetMessage(); objGetMessage.strFrom = objContract.strFrom; objGetMessage.strType = ""; objGetMessage.strTo = ""; objGetMessage.x = new double(); objGetMessage.y = new double(); objGetMessage.stremImage = new MemoryStream(); objGetMessage.mouseButton = new int(); objGetMessage.key = new int(); objGetMessage.blView = new bool(); objGetMessage.blControl = new bool(); objGetMessage.id = 5; objGetMessage.ControlTag = new int(); objGetMessage.ViewTag = new int(); #endregion 20oct changes List<clsGetMessage> lstStream = (List<clsGetMessage>)hashMessages[lstNodes[i].uName]; lstStream.Clear(); lstStream.Add(objGetMessage); hashMessages[lstNodes[i].uName] = lstStream; strSelected = ""; lstNodes[i].isControlled = false; } } } } catch (Exception ex) { VMuktiHelper.ExceptionHandler(ex, "DesktopDummy_EntsvcStopControl", "DesktopDummy.cs"); } }
void Http_EntsvcUnJoin(clsMessageContract streamUName) { try { string uName = streamUName.strFrom; #region MsgContract clsMessageContract objContract = new clsMessageContract(); objContract.blControl = false; objContract.blView = false; objContract.key = 0; objContract.mouseButton = 0; objContract.stremImage = new MemoryStream(); objContract.strFrom =uName; objContract.strTo = ""; objContract.strType = ""; objContract.x = 0.0; objContract.y = 0.0; #endregion MsgContract channelNettcpDesktop.svcUnJoin(objContract); } catch (Exception ex) { VMuktiHelper.ExceptionHandler(ex, "Http_EntsvcUnJoin", "DesktopDummy.cs"); } }
void DesktopDummy_EntsvcJoin(clsMessageContract objContract) { try { } catch (Exception ex) { VMuktiHelper.ExceptionHandler(ex, "desktopDummy_EntsvcJoin", "DesktopDummy.cs"); } }
public void svcBtnUp(clsMessageContract mcBtnUp) { if (EntsvcBtnUp != null) { EntsvcBtnUp(mcBtnUp); } }
void Http_EntsvcBtnDown(clsMessageContract streamButtonDown) { try { string mouseButton = string.Empty; string ToBtnDown = string.Empty; mouseButton = streamButtonDown.mouseButton.ToString(); #region recent changes for (int i = 0; i < lstNodes.Count; i++) { if (lstNodes[i].uName == streamButtonDown.strFrom) { lstNodes[i].isControlling = true; lstNodes[i].strControlled = streamButtonDown.strTo; List<clsGetMessage> lstStream = (List<clsGetMessage>)hashMessages[streamButtonDown.strFrom]; lstStream.Clear(); } } #endregion recent changes ToBtnDown = streamButtonDown.strTo; #region MsgContract clsMessageContract objContract = new clsMessageContract(); objContract.blControl = false; objContract.blView = false; objContract.key = 0; objContract.mouseButton = 0; objContract.stremImage = new MemoryStream(); objContract.strFrom = ""; objContract.strTo = strTO; objContract.strType = ""; objContract.x = gX; objContract.y = gY; #endregion MsgContract channelNettcpDesktop.svcSendXY(objContract); #region MsgContract clsMessageContract objContract1 = new clsMessageContract(); objContract1.blControl = false; objContract1.blView = false; objContract1.key = 0; objContract1.mouseButton = int.Parse(mouseButton); objContract1.stremImage = new MemoryStream(); objContract1.strFrom = ""; objContract1.strTo = ToBtnDown; objContract1.strType = ""; objContract1.x = 0.0; objContract1.y = 0.0; #endregion MsgContract channelNettcpDesktop.svcBtnDown(objContract1); } catch (Exception ex) { VMuktiHelper.ExceptionHandler(ex, "Http_EntsvcBtnDown", "DesktopDummy.cs"); } }
void Http_EntsvcStopControl(clsMessageContract streamUName) { try { string uName = streamUName.strTo; string strFrom = streamUName.strFrom; for (int i = 0; i < lstNodes.Count; i++) { if (lstNodes[i].uName == strFrom) { lstNodes[i].isControlling = false; lstNodes[i].strControlled = ""; List<clsGetMessage> lstStream = (List<clsGetMessage>)hashMessages[strFrom]; lstStream.Clear(); } } #region MsgContract clsMessageContract objContract = new clsMessageContract(); objContract.blControl = false; objContract.blView = false; objContract.key = 0; objContract.mouseButton = 0; objContract.stremImage = new MemoryStream(); objContract.strFrom = uName; objContract.strTo = ""; objContract.strType = ""; objContract.x = 0; objContract.y = 0; #endregion MsgContract channelNettcpDesktop.svcStopControl(objContract); strSelected = ""; } catch (Exception ex) { VMuktiHelper.ExceptionHandler(ex, "Http_EntsvcStopControl", "DesktopDummy.cs"); } }
void Http_EntsvcSetUserList(clsMessageContract streamSetUserList) { try { string uName = streamSetUserList.strFrom; #region MsgContract clsMessageContract objContract = new clsMessageContract(); objContract.blControl = false; objContract.blView = false; objContract.key = new int(); objContract.mouseButton = new int(); objContract.stremImage = new MemoryStream(); objContract.strFrom = uName; objContract.strTo = ""; objContract.strType = "Set"; objContract.x = new double(); objContract.y = new double(); #endregion MsgContract channelNettcpDesktop.svcSetUserList(objContract); } catch (Exception ex) { VMuktiHelper.ExceptionHandler(ex, "Http_EntsvcSetUserList", "DesktopDummy.cs"); } }
void DesktopDummy_EntsvcUnJoin(clsMessageContract objContract) { try { #region 20oct changes clsGetMessage objGetMessage = new clsGetMessage(); objGetMessage.strFrom = objContract.strFrom; objGetMessage.strType = ""; objGetMessage.strTo = ""; objGetMessage.x = new double(); objGetMessage.y = new double(); objGetMessage.stremImage = new MemoryStream(); objGetMessage.mouseButton = new int(); objGetMessage.key = new int(); objGetMessage.blView = new bool(); objGetMessage.blControl = new bool(); objGetMessage.id = 12; objGetMessage.ViewTag = new int(); objGetMessage.ControlTag = new int(); #endregion 20oct changes for (int i = 0; i < lstNodes.Count; i++) { List<clsGetMessage> lstStream = (List<clsGetMessage>)hashMessages[lstNodes[i].uName]; lstStream.Add(objGetMessage); hashMessages[lstNodes[i].uName] = lstStream; } } catch (Exception ex) { VMuktiHelper.ExceptionHandler(ex, "DesktopDummy_EntsvcUnJoin", "DesktopDummy.cs"); } }
void Http_EntsvcJoin(clsMessageContract streamUName) { try { string uName = streamUName.strFrom; clsMessage objMessage = new clsMessage(); objMessage.uName = uName; objMessage.isControlled = false; objMessage.isControlling = false; objMessage.strControlled = ""; lstNodes.Add(objMessage); hashMessages.Add(uName, new List<clsGetMessage>()); } catch (Exception ex) { VMuktiHelper.ExceptionHandler(ex, "Http_EntsvcJoin", "DesktopDummy.cs"); } }
void P2PDesktopClient_EntsvcJoin(clsMessageContract objContract) { }
void Http_EntsvcSendMessage(clsMessageContract streamImage) { try { #region MsgContract clsMessageContract objContract = new clsMessageContract(); objContract.blControl = false; objContract.blView = false; objContract.key = 0; objContract.mouseButton = 0; objContract.stremImage = streamImage.stremImage; objContract.strFrom = streamImage.strFrom; objContract.strTo = ""; objContract.strType = ""; objContract.x = 0; objContract.y = 0; #endregion MsgContract channelNettcpDesktop.svcSendMessage(objContract); } catch (Exception ex) { VMuktiHelper.ExceptionHandler(ex, "Http_EntsvcSendMessage", "DesktopDummy.cs"); } }
void Http_EntsvcSendKey(clsMessageContract streamKey) { try { string valKey = string.Empty; string ToKey = string.Empty; ToKey = streamKey.strTo; valKey = streamKey.key.ToString(); #region recent changes for (int i = 0; i < lstNodes.Count; i++) { if (lstNodes[i].uName == streamKey.strFrom) { lstNodes[i].isControlling = true; lstNodes[i].strControlled = streamKey.strTo; List<clsGetMessage> lstStream = (List<clsGetMessage>)hashMessages[streamKey.strFrom]; lstStream.Clear(); } } #endregion recent changes #region MsgContract clsMessageContract objContract = new clsMessageContract(); objContract.blControl = false; objContract.blView = false; objContract.key = int.Parse(valKey); objContract.mouseButton = 0; objContract.stremImage = new MemoryStream(); objContract.strFrom = ""; objContract.strTo = ToKey; objContract.strType = ""; objContract.x = 0.0; objContract.y = 0.0; #endregion MsgContract channelNettcpDesktop.svcSendKey(objContract); } catch (Exception ex) { VMuktiHelper.ExceptionHandler(ex, "Http_EntsvcSendKey", "DesktopDummy.cs"); } }
private void RegNetP2PClient(string netP2pUri) { try { NetPeerClient npcDummyDesktop = new NetPeerClient(); objNetTcpDesktop = new clsNetTcpDesktop(); ((clsNetTcpDesktop)objNetTcpDesktop).EntsvcJoin += new clsNetTcpDesktop.delsvcJoin(DesktopDummy_EntsvcJoin); ((clsNetTcpDesktop)objNetTcpDesktop).EntsvcSendMessage += new clsNetTcpDesktop.delsvcSendMessage(DesktopDummy_EntsvcSendMessage); ((clsNetTcpDesktop)objNetTcpDesktop).EntsvcGetUserList += new clsNetTcpDesktop.delsvcGetUserList(DesktopDummy_EntsvcGetUserList); ((clsNetTcpDesktop)objNetTcpDesktop).EntsvcSetUserList += new clsNetTcpDesktop.delsvcSetUserList(DesktopDummy_EntsvcSetUserList); ((clsNetTcpDesktop)objNetTcpDesktop).EntsvcSelectedDesktop += new clsNetTcpDesktop.delsvcSelectedDesktop(DesktopDummy_EntsvcSelectedDesktop); ((clsNetTcpDesktop)objNetTcpDesktop).EntsvcStopControl += new clsNetTcpDesktop.delsvcStopControl(DesktopDummy_EntsvcStopControl); ((clsNetTcpDesktop)objNetTcpDesktop).EntsvcBtnUp += new clsNetTcpDesktop.delsvcBtnUp(DesktopDummy_EntsvcBtnUp); ((clsNetTcpDesktop)objNetTcpDesktop).EntsvcBtnDown += new clsNetTcpDesktop.delsvcBtnDown(DesktopDummy_EntsvcBtnDown); ((clsNetTcpDesktop)objNetTcpDesktop).EntsvcSendKey += new clsNetTcpDesktop.delsvcSendKey(DesktopDummy_EntsvcSendKey); ((clsNetTcpDesktop)objNetTcpDesktop).EntsvcSendXY += new clsNetTcpDesktop.delsvcSendXY(DesktopDummy_EntsvcSendXY); ((clsNetTcpDesktop)objNetTcpDesktop).EntsvcAllowView += new clsNetTcpDesktop.delsvcAllowView(DesktopDummy_EntsvcAllowView); ((clsNetTcpDesktop)objNetTcpDesktop).EntsvcAllowControl += new clsNetTcpDesktop.delsvcAllowControl(DesktopDummy_EntsvcAllowControl); ((clsNetTcpDesktop)objNetTcpDesktop).EntsvcUnJoin += new clsNetTcpDesktop.delsvcUnJoin(DesktopDummy_EntsvcUnJoin); channelNettcpDesktop = (INetTcpDesktopChannel)npcDummyDesktop.OpenClient<INetTcpDesktopChannel>(netP2pUri.ToString(), netP2pUri.ToString().Split(':')[2].Split('/')[2], ref objNetTcpDesktop); while (tempcounter < 20) { try { #region MsgContract clsMessageContract objContract = new clsMessageContract(); objContract.blControl = false; objContract.blView = false; objContract.key = 0; objContract.mouseButton = 0; objContract.stremImage = new MemoryStream(); objContract.strFrom = UserName; objContract.strTo = ""; objContract.strType = ""; objContract.x = 0; objContract.y = 0; #endregion MsgContract channelNettcpDesktop.svcJoin(objContract); tempcounter = 20; } catch { tempcounter++; System.Threading.Thread.Sleep(1000); } } } catch(Exception ex) { VMuktiHelper.ExceptionHandler(ex, "RegNetP2PClient", "DesktopDummy.cs"); } }
clsGetMessage Http_EntsvcGetMessages(clsMessageContract streamRecipient) { try { string strRecipient = streamRecipient.strFrom; List<clsGetMessage> lstTemp = (List<clsGetMessage>)hashMessages[strRecipient]; if (lstTemp.Count > 0 && lstTemp[0] != null && lstTemp != null) { clsGetMessage objGet = new clsGetMessage(); objGet = lstTemp[0]; lstTemp.RemoveAt(0); hashMessages[strRecipient] = lstTemp; return objGet; } else { clsGetMessage objGet = new clsGetMessage(); objGet.blControl = new bool(); objGet.blView = new bool(); objGet.ControlTag = new int(); objGet.id=new int(); objGet.key=new int(); objGet.mouseButton=new int(); objGet.stremImage = new MemoryStream(); objGet.strFrom = ""; objGet.strTo = ""; objGet.strType = ""; objGet.ViewTag = new int(); objGet.x = new double(); objGet.y = new double(); return objGet; } } catch (Exception ex) { VMuktiHelper.ExceptionHandler(ex, "Http_EntsvcGetMessages", "DesktopDummy.cs"); clsGetMessage objGet = new clsGetMessage(); objGet.blControl = new bool(); objGet.blView = new bool(); objGet.ControlTag = new int(); objGet.id = new int(); objGet.key = new int(); objGet.mouseButton = new int(); objGet.stremImage = new MemoryStream(); objGet.strFrom = ""; objGet.strTo = ""; objGet.strType = ""; objGet.ViewTag = new int(); objGet.x = new double(); objGet.y = new double(); return objGet; } }
void Http_EntsvcSendXY(clsMessageContract streamXY) { try { strTO = streamXY.strTo; gX = streamXY.x; gY = streamXY.y; #region recent changes for (int i = 0; i < lstNodes.Count; i++) { if (lstNodes[i].uName == streamXY.strFrom) { lstNodes[i].isControlling = true; lstNodes[i].strControlled = streamXY.strTo; List<clsGetMessage> lstStream = (List<clsGetMessage>)hashMessages[streamXY.strFrom]; lstStream.Clear(); } } #endregion recent changes } catch (Exception ex) { VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "Http_EntsvcSendXY", "DesktopDummy.cs"); } }
void Http_EntsvcAllowControl(clsMessageContract streamControl) { try { string ToControl = streamControl.strFrom; bool flg = streamControl.blControl; #region MsgContract clsMessageContract objContract = new clsMessageContract(); objContract.blControl = flg; objContract.blView = false; objContract.key = 0; objContract.mouseButton = 0; objContract.stremImage = new MemoryStream(); objContract.strFrom = ToControl; objContract.strTo = ""; objContract.strType = ""; objContract.x = 0.0; objContract.y = 0.0; #endregion MsgContract channelNettcpDesktop.svcAllowControl(objContract); } catch(Exception ex) { VMuktiHelper.ExceptionHandler(ex, "Http_EntsvcAllowControl", "DesktopDummy.cs"); } }