protected override void AttachUccSession(IUccSession uccSession) { base.AttachUccSession(uccSession); this.uccImSession = (IUccInstantMessagingSession)this.UccSession; ComEvents.Advise <_IUccInstantMessagingSessionEvents>(this.uccImSession, this); }
/// <summary> /// Send an instance message to remote participant. /// </summary> /// <param name="message"></param> public void SessionSendMessage(string message) { IUccInstantMessagingSession session = this.imSession as IUccInstantMessagingSession; UccOperationContext context = new UccOperationContextClass(); context.Initialize(operationId++, null); session.SendMessage(contentType, message, context); string formatMessage = string.Format("{0}: \r\n {1}", uri, message); this.mainForm.WriteIMMessage(formatMessage); }
public void SendNewMessage(string user, string msg) { IUccSession session = null; if (!this._sessions.TryGetValue(user.ToLower(), out session)) { var context = new UccContext(); UccUri participantUri = this._uriManager.ParseUri("sip:[email protected]"); session = this._sessionManager.CreateSession(UCC_SESSION_TYPE.UCCST_INSTANT_MESSAGING, context); var p = session.CreateParticipant(participantUri, null); Advise <_IUccInstantMessagingSessionParticipantEvents>(p, this); session.AddParticipant(p, null); Advise <_IUccSessionEvents>(session, this); this._sessions.Add(user.ToLower(), session); } IUccInstantMessagingSession ims = session as IUccInstantMessagingSession; ims.SendMessage("text/plain", msg, null); }
/// <summary> /// Stop composing IM message /// </summary> public void StopComposing() { IUccInstantMessagingSession session = this.imSession as IUccInstantMessagingSession; //*** session.StopComposing(); }
/// <summary> /// Start composing IM message /// </summary> /// <param name="composingContentType"></param> /// <param name="idleTimeoutSeconds"></param> public void StartComposing(string composingContentType, int idleTimeoutSeconds) { IUccInstantMessagingSession session = this.imSession as IUccInstantMessagingSession; //*** session.StartComposing(composingContentType, idleTimeoutSeconds); }
protected override void DetachUccSession(bool terminate) { this.uccImSession = null; base.DetachUccSession(terminate); }