protected void gvConnectionDetails_OnRowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { Literal litProperty = (Literal)e.Row.FindControl("litProperty"); Literal litValue = (Literal)e.Row.FindControl("litValue"); DirectConnection dc = (DirectConnection)e.Row.DataItem; string urlproperty = dc.Property; string urlvalue = dc.Value; litProperty.Text = urlproperty; litValue.Text = urlvalue; if (e.Row.RowState == DataControlRowState.Alternate) { e.Row.Attributes.Add("onmouseover", "doListTableRowOver(this);"); e.Row.Attributes.Add("onmouseout", "doListTableRowOut(this,0);"); e.Row.Attributes.Add("class", "evenRow"); } else { e.Row.Attributes.Add("onmouseover", "doListTableRowOver(this);"); e.Row.Attributes.Add("onmouseout", "doListTableRowOut(this,1);"); e.Row.Attributes.Add("class", "oddRow"); } e.Row.Attributes.Add("onclick", "document.location.href='" + dc.URI + "'"); } }
/// <summary> /// Declines a chat room invite /// </summary> /// <param name="invitationKey">The <see cref="Cookie"/> received with the invitation</param> /// <exception cref="ArgumentException">Thrown when the <paramref name="invitationKey"/> does /// not describe an outstanding chat room invitation.</exception> public void DeclineChatInvitation(Cookie invitationKey) { if (!chatRoomInvitations.ContainsKey(invitationKey)) { throw new ArgumentException("Not a valid chat room invitation key", "invitationKey"); } chatRoomInvitations.Remove(invitationKey); DirectConnection conn = parent.Connections.RemoveDirectConnection(invitationKey); parent.Messages.SendDirectConnectionCancellation(conn, "User declined invitation"); }
protected override bool CanConnect(BaseControl control1, BaseControl control2) { foreach (var c in Controls) { if (c is DirectConnection) { DirectConnection dc = (DirectConnection)c; if (dc.Start == control1 && dc.End == control2) { return(false); } } } return(true); }
protected override void Render() { base.Render(); foreach (var c in _Editor._Panel.Controls) { if (c is AudioStateNode) { AudioStateNode node = (AudioStateNode)c; if (node.NextState != null) { DirectConnection.DrawConnection(node.NextPoint, node.NextState.PrePoint, _NextConnectionColor, 16 * _Editor._Panel.ZoomFactor, _NextConnectionColor, Skill.Editor.Resources.UITextures.ArrowHead, 0); } } } }
public static DirectConnection getInstance() { if (instance != null) { return(instance); } else { lock (lockObject){ if (instance == null) { instance = new DirectConnection(); } return(instance); } } }
public async Task ConnectPlayerAsync(ConnectionType connectionType, IProgress <string> prog) { if (m_user != null) { return; } IConnection connection; switch (connectionType) { case ConnectionType.Tcp: connection = await TcpConnection.ConnectAsync(this.NetStats, "CNet"); break; case ConnectionType.Direct: connection = DirectConnection.Connect(m_server.Game); break; case ConnectionType.Pipe: connection = PipeConnection.Connect(); break; default: throw new Exception(); } var user = new ClientUser(connection); user.DisconnectEvent += OnDisconnected; await user.LogOn("tomba", prog); m_user = user; if (this.UserConnected != null) { this.UserConnected(user); } user.StartProcessingMessages(); }
public void Connect(DirectConnection clientConnection) { DirectConnectionListener.NewConnection(clientConnection); }
public void Connect(DirectConnection clientConnection) { DirectConnectionListener.NewConnection(clientConnection); }