コード例 #1
0
        /**
         * Get all the details of a contact according to its id
         *
         * @param contact  id to search for
         * @param callback called for return
         * @since v2.0
         */
        public void GetContact(ContactUid contact, IContactResultCallback callback)
        {
            // Start logging elapsed time.
            long     tIn    = TimerUtil.CurrentTimeMillis();
            ILogging logger = AppRegistryBridge.GetInstance().GetLoggingBridge();

            if (logger != null)
            {
                logger.Log(ILoggingLogLevel.Debug, this.apiGroup.ToString(), "ContactBridge executing getContact...");
            }

            if (this._delegate != null)
            {
                this._delegate.GetContact(contact, callback);
                if (logger != null)
                {
                    logger.Log(ILoggingLogLevel.Debug, this.apiGroup.ToString(), "ContactBridge executed 'getContact' in " + (TimerUtil.CurrentTimeMillis() - tIn) + "ms.");
                }
            }
            else
            {
                if (logger != null)
                {
                    logger.Log(ILoggingLogLevel.Error, this.apiGroup.ToString(), "ContactBridge no delegate for 'getContact'.");
                }
            }
        }
コード例 #2
0
        /**
         * Search contacts according to a term with a filter and send it to the callback
         *
         * @param term     string to search
         * @param callback called for return
         * @param filter   to search for
         * @since v2.0
         */
        public void SearchContactsWithFilter(string term, IContactResultCallback callback, IContactFilter[] filter)
        {
            // Start logging elapsed time.
            long     tIn    = TimerUtil.CurrentTimeMillis();
            ILogging logger = AppRegistryBridge.GetInstance().GetLoggingBridge();

            if (logger != null)
            {
                logger.Log(ILoggingLogLevel.Debug, this.apiGroup.ToString(), "ContactBridge executing searchContactsWithFilter...");
            }

            if (this._delegate != null)
            {
                this._delegate.SearchContactsWithFilter(term, callback, filter);
                if (logger != null)
                {
                    logger.Log(ILoggingLogLevel.Debug, this.apiGroup.ToString(), "ContactBridge executed 'searchContactsWithFilter' in " + (TimerUtil.CurrentTimeMillis() - tIn) + "ms.");
                }
            }
            else
            {
                if (logger != null)
                {
                    logger.Log(ILoggingLogLevel.Error, this.apiGroup.ToString(), "ContactBridge no delegate for 'searchContactsWithFilter'.");
                }
            }
        }