public Boolean removeEventListener(String name, ContextEventListener contextEventListener,
                                           Boolean sendRemoteCommand)
        {
            try
            {
                init();

                Log.CONTEXT_EVENTS.debug("Removing listener for event '" + name + "' from context '" + this.getPath() + "'");

                var res = base.removeEventListener(name, contextEventListener);

                var ed = getEventData(name);

                if (sendRemoteCommand && ed != null && ed.getListeners().Count == 0)
                {
                    var hashCode = contextEventListener.getListenerCode();

                    if (!notManageRemoteListenersBoolean)
                    {
                        this.controller.sendCommandAndCheckReplyCode(ClientCommandUtils.removeEventListenerOperation(this.getPath(), name, hashCode));
                    }
                }

                return(res);
            }
            catch (Exception ex)
            {
                var msg = String.Format(Cres.get().getString("conErrRemovingListener"), name, this.getPath());
                throw new InvalidOperationException(msg + ": " + ex.Message, ex);
            }
        }
        private void addRemoteListener(String ename, ContextEventListener contextEventListener)
        {
            var hashCode = contextEventListener.getListenerCode();

            if (hashCode == null && AUTO_LISTENED_EVENTS.Contains(ename))
            {
                return;
            }

            if (!notManageRemoteListenersBoolean)
            {
                controller.sendCommandAndCheckReplyCode(ClientCommandUtils.addEventListenerOperation(this.getPath(), ename, hashCode));
            }
        }
 private void sendRemoveListener(String context, String eventString, ContextEventListener listener)
 {
     try
     {
         getController().sendCommandAndCheckReplyCode(ClientCommandUtils.removeEventListenerOperation(context,
                                                                                                      eventString,
                                                                                                      listener.
                                                                                                      getListenerCode
                                                                                                          ()));
     }
     catch (Exception ex)
     {
         var msg = String.Format(Cres.get().getString("conErrRemovingListener"), eventString, context);
         throw new InvalidOperationException(msg + ": " + ex.Message, ex);
     }
 }