public ChatClient(string[] args, TextBox output, ToolStripStatusLabel messageToolStripSatusLbl) { this._outputTxtBx = output; this._messageStatus = messageToolStripSatusLbl; this._roomVersion = RoomVersion.Base; this.Initialize(args); }
public void Join(string name, string topic, RoomVersion roomVersion) { if (string.IsNullOrEmpty(name)) { throw new ArgumentException(Resources.Client_Join_Cannot_be_empty_or_null, "name"); } if (string.IsNullOrEmpty(topic)) { throw new ArgumentException(Resources.Client_Join_Cannot_be_empty_or_null, "topic"); } if (this._lobby == null) { throw new ApplicationException("Lobby is null"); } ObjectAdapter adapter = this.Communicator.createObjectAdapter(string.Empty); this._jobQueue = new JobQueue(); Listener listener = new ListenerI(this._outputTxtBx, this._jobQueue); ObjectPrx listenerPrx = adapter.addWithUUID(listener); this._jobQueue.Start(); adapter.activate(); this._lobby.ice_getConnection().setAdapter(adapter); this._roomAccess = this._lobby.Join(name, topic, listenerPrx.ice_getIdentity()); this._context = new Dictionary <string, string> { { SESSIONCTXPROP.value, topic }, { AUTHORCTXPROP.value, name } }; }
public void Join(string name, string topic, RoomVersion roomVersion) { if (string.IsNullOrEmpty(name)) throw new ArgumentException(Resources.Client_Join_Cannot_be_empty_or_null, "name"); if (string.IsNullOrEmpty(topic)) throw new ArgumentException(Resources.Client_Join_Cannot_be_empty_or_null, "topic"); if (this._lobby == null) throw new ApplicationException("Lobby is null"); ObjectAdapter adapter = this.Communicator.createObjectAdapter(string.Empty); this._jobQueue = new JobQueue(); Listener listener = new ListenerI(this._outputTxtBx, this._jobQueue); ObjectPrx listenerPrx = adapter.addWithUUID(listener); this._jobQueue.Start(); adapter.activate(); this._lobby.ice_getConnection().setAdapter(adapter); this._roomAccess = this._lobby.Join(name, topic, listenerPrx.ice_getIdentity()); this._context = new Dictionary<string, string> { { SESSIONCTXPROP.value, topic }, {AUTHORCTXPROP.value, name} }; }
private void versionCmbBx_SelectedIndexChanged(object sender, EventArgs e) { RoomVersion roomVersion = this.versionCmbBx.Text.ConvertTo <RoomVersion>(); ((ChatClient)this._chatClient).ChangeRoomVersion(roomVersion); if (this._chatStatus == ChatStatus.Disconnected) { return; } switch (roomVersion) { case RoomVersion.V1: this.EnableRoomAdmToolbar(); break; default: this.DisableRoomAdmToolbar(); break; } }
internal void ChangeRoomVersion(RoomVersion roomVersion) { this._roomVersion = roomVersion; }