Beispiel #1
0
        public void Say(string message)
        {
            if (string.IsNullOrEmpty(message))
            {
                throw new ArgumentException(Resources.Client_Join_Cannot_be_empty_or_null, "message");
            }

            IMessageCallback messageCallback = new MessageCallback(this._messageStatus);

            switch (this._roomVersion)
            {
            case RoomVersion.Base:
                RoomPrx room = RoomPrxHelper.checkedCast(this._roomAccess.RoomProxy.ice_context(this._context));
                room.begin_Say(message).whenCompleted(messageCallback.SayCallback, messageCallback.FailureCallback);
                break;

            case RoomVersion.V1:
                RoomAdmPrx roomAdm = RoomAdmPrxHelper.checkedCast(this._roomAccess.RoomProxy.ice_context(this._context), "V1");
                roomAdm.begin_Say(message).whenCompleted(messageCallback.SayCallback, messageCallback.FailureCallback);
                break;

            case RoomVersion.V2:
                RoomV2Prx roomV2 = RoomV2PrxHelper.checkedCast(this._roomAccess.RoomProxy.ice_context(this._context), "V2");
                roomV2.begin_Say(message, DateTime.Now.Ticks).whenCompleted(messageCallback.SayCallback, messageCallback.FailureCallback);
                break;
            }
        }
Beispiel #2
0
        public void Leave()
        {
            try
            {
                switch (this._roomVersion)
                {
                case RoomVersion.Base:
                    RoomPrx room = RoomPrxHelper.checkedCast(this._roomAccess.RoomProxy.ice_context(this._context));
                    room.LeaveRoom();
                    break;

                case RoomVersion.V1:
                    RoomAdmPrx roomAdm = RoomAdmPrxHelper.checkedCast(this._roomAccess.RoomProxy.ice_context(this._context), "V1");
                    roomAdm.LeaveRoom();
                    break;

                case RoomVersion.V2:
                    RoomV2Prx roomV2 = RoomV2PrxHelper.checkedCast(this._roomAccess.RoomProxy.ice_context(this._context), "V2");
                    roomV2.LeaveRoom();
                    break;
                }
            }
            finally
            {
                this._jobQueue.Destroy();
                this._jobQueue.Join();
                this._jobQueue = null;
            }
        }
        private RoomPrx CreateNewRoomProxies(string nick, string topic, ListenerPrx listener)
        {
            RoomI room = new RoomI(topic);

            room.AddListener(nick, listener);
            RoomPrx roomPrx = RoomPrxHelper.uncheckedCast(this.Adapter.addWithUUID(room));

            RoomAdmI roomAdm = new RoomAdmI(topic);

            roomAdm.AddListener(nick, listener);
            RoomAdmTie_ roomAdmTie = new RoomAdmTie_(roomAdm);

            this.Adapter.addFacet(roomAdmTie, roomPrx.ice_getIdentity(), "V1");

            RoomV2I roomV2 = new RoomV2I(topic);

            roomV2.AddListener(nick, listener);
            this.Adapter.addFacet(roomV2, roomPrx.ice_getIdentity(), "V2");

            this._rooms.Add(topic, roomPrx);
            return(roomPrx);
        }
Beispiel #4
0
 public static RoomPrx uncheckedCast(Ice.ObjectPrx b)
 {
     if(b == null)
     {
         return null;
     }
     RoomPrx r = b as RoomPrx;
     if(r == null)
     {
         RoomPrxHelper h = new RoomPrxHelper();
         h.copyFrom__(b);
         r = h;
     }
     return r;
 }
Beispiel #5
0
 public static RoomPrx uncheckedCast(Ice.ObjectPrx b, string f)
 {
     if(b == null)
     {
         return null;
     }
     Ice.ObjectPrx bb = b.ice_facet(f);
     RoomPrxHelper h = new RoomPrxHelper();
     h.copyFrom__(bb);
     return h;
 }
Beispiel #6
0
 public static RoomPrx read__(IceInternal.BasicStream is__)
 {
     Ice.ObjectPrx proxy = is__.readProxy();
     if(proxy != null)
     {
         RoomPrxHelper result = new RoomPrxHelper();
         result.copyFrom__(proxy);
         return result;
     }
     return null;
 }
Beispiel #7
0
 public static RoomPrx checkedCast(Ice.ObjectPrx b, string f, _System.Collections.Generic.Dictionary<string, string> ctx)
 {
     if(b == null)
     {
         return null;
     }
     Ice.ObjectPrx bb = b.ice_facet(f);
     try
     {
         if(bb.ice_isA("::Chat::Room", ctx))
         {
             RoomPrxHelper h = new RoomPrxHelper();
             h.copyFrom__(bb);
             return h;
         }
     }
     catch(Ice.FacetNotExistException)
     {
     }
     return null;
 }
Beispiel #8
0
 public static RoomPrx checkedCast(Ice.ObjectPrx b, string f)
 {
     if(b == null)
     {
         return null;
     }
     Ice.ObjectPrx bb = b.ice_facet(f);
     try
     {
         if(bb.ice_isA("::Chat::Room"))
         {
             RoomPrxHelper h = new RoomPrxHelper();
             h.copyFrom__(bb);
             return h;
         }
     }
     catch(Ice.FacetNotExistException)
     {
     }
     return null;
 }
Beispiel #9
0
 public static RoomPrx checkedCast(Ice.ObjectPrx b, _System.Collections.Generic.Dictionary<string, string> ctx)
 {
     if(b == null)
     {
         return null;
     }
     RoomPrx r = b as RoomPrx;
     if((r == null) && b.ice_isA("::Chat::Room", ctx))
     {
         RoomPrxHelper h = new RoomPrxHelper();
         h.copyFrom__(b);
         r = h;
     }
     return r;
 }
Beispiel #10
0
 public static RoomPrx checkedCast(Ice.ObjectPrx b)
 {
     if(b == null)
     {
         return null;
     }
     RoomPrx r = b as RoomPrx;
     if((r == null) && b.ice_isA("::Chat::Room"))
     {
         RoomPrxHelper h = new RoomPrxHelper();
         h.copyFrom__(b);
         r = h;
     }
     return r;
 }