// -------------------------------------------

        /*
         * OnBasicEvent
         */
        private void OnBasicEvent(string _nameEvent, params object[] _list)
        {
            if (_nameEvent == EVENT_IMAGES_LOAD_FROM_SYSTEM_IMAGE)
            {
                UIEventController.Instance.DispatchUIEvent(EVENT_IMAGES_CLEAR_THUMBNAIL_CACHE);
                string fullPath = (string)_list[0];
                m_lastScrollPosition = (float)_list[1];
                if (fullPath.LastIndexOf('/') != -1)
                {
                    m_pathLastFileBrowsed = fullPath.Substring(0, fullPath.LastIndexOf('/'));
                }
                if (fullPath.LastIndexOf('\\') != -1)
                {
                    m_pathLastFileBrowsed = fullPath.Substring(0, fullPath.LastIndexOf('\\'));
                }
                Image imageContainer = (Image)_list[2];
                int   heightTarget   = (int)_list[3];
                int   typeTarget     = (int)_list[4];
                ImageUtils.LoadImage(fullPath, imageContainer, heightTarget, MenusScreenController.Instance.SizeHeightAllowedImages);
                if (typeTarget != RequestModel.IMAGE_TYPE_FINISHED)
                {
                    UIEventController.Instance.DispatchUIEvent(ScreenController.EVENT_FORCE_DESTRUCTION_POPUP);
                }
            }
            if (_nameEvent == EVENT_IMAGES_LOAD_REFERENCE_IMG_WITH_URL)
            {
                string pathFileURL  = (string)_list[0];
                Image  imgContainer = (Image)_list[1];
                int    heightImage  = (int)_list[2];
                byte[] dataImage    = (byte[])_list[3];
                ImageUtils.LoadBytesImage(imgContainer, dataImage, heightImage, MenusScreenController.Instance.SizeHeightAllowedImages);
                BasicSystemEventController.Instance.DispatchBasicSystemEvent(ImageUtils.EVENT_IMAGES_LOAD_CONFIRMATION_FROM_SYSTEM, pathFileURL);
            }
            if (_nameEvent == EVENT_IMAGES_LOAD_REFERENCE_IMG_WITH_IMAGE_URL)
            {
                string pathFileURL  = (string)_list[0];
                Image  imgContainer = (Image)_list[1];
                int    heightImage  = (int)_list[2];
                ImageURLLoader.Instance.LoadURLImage(pathFileURL, imgContainer, heightImage, MenusScreenController.Instance.SizeHeightAllowedImages);
            }
            if (_nameEvent == EVENT_IMAGES_LOAD_FROM_ID)
            {
                m_timeAcumImages = ((GetImageByID((long)_list[1]) != null) ? 1 : 0);
                m_queuedRequests.Add(new ImageRequestedInfo((GameObject)_list[0], (long)_list[1], (Image)_list[2], (int)_list[3], (bool)_list[4]));
            }
            if (_nameEvent == EVENT_IMAGES_LOAD_TOXIC_IMAGE)
            {
                Image  imgContainer = (Image)_list[0];
                int    heightImage  = (int)_list[1];
                byte[] dataImage    = (byte[])_list[2];
                ImageUtils.LoadBytesImage(imgContainer, dataImage, heightImage, MenusScreenController.Instance.SizeHeightAllowedImages);
            }
            if (_nameEvent == EVENT_IMAGES_LOAD_PRIORITY_FROM_ID)
            {
                m_timeAcumImages = ((GetImageByID((long)_list[1]) != null) ? 1 : 0);
                m_queuedRequests.Insert(0, new ImageRequestedInfo((GameObject)_list[0], (long)_list[1], (Image)_list[2], (int)_list[3], (bool)_list[4]));
            }
            if (_nameEvent == EVENT_IMAGES_LOAD_FROM_BYTE_ARRAY)
            {
                ImageUtils.LoadBytesImage((Image)_list[1], (byte[])_list[0], (int)_list[2], MenusScreenController.Instance.SizeHeightAllowedImages);
            }
            if (_nameEvent == EVENT_IMAGES_UPLOAD_TO_SERVER_NEW_IMAGE)
            {
                byte[] dataImg = (byte[])_list[4];

                m_imageTemp          = new ImageModel();
                m_imageTemp.Table    = (string)_list[1];
                m_imageTemp.IdOrigin = (long)_list[2];
                m_imageTemp.Type     = (int)_list[3];
                m_imageTemp.Size     = dataImg.Length;
                m_imageTemp.CopyData(dataImg);
                m_imageTemp.Url = (string)_list[5];

                CommsHTTPConstants.UploadImage((long)_list[0], m_imageTemp.Table, m_imageTemp.IdOrigin, m_imageTemp.Type, dataImg, m_imageTemp.Url);
            }
            if (_nameEvent == EVENT_IMAGES_UPLOAD_TO_SERVER_CONFIRMATION)
            {
                if (_list.Length > 0)
                {
                    if ((bool)_list[0])
                    {
                        if (m_imageTemp != null)
                        {
                            m_imageTemp.Id       = (long)_list[1];
                            m_imageTemp.Table    = (string)_list[2];
                            m_imageTemp.IdOrigin = (long)_list[3];
                            m_images.Add(m_imageTemp.Clone());
                            m_imageTemp = null;
                        }
                    }
                }
            }
            if (_nameEvent == EVENT_IMAGES_LOAD_SERVER_DATA_RECEIVED)
            {
                if (m_imageReferenceTmp != null)
                {
                    if ((bool)_list[0])
                    {
                        ImageModel imageNew = new ImageModel();
                        imageNew.Id       = (long)_list[1];
                        imageNew.Table    = (string)_list[2];
                        imageNew.IdOrigin = (long)_list[3];
                        imageNew.Type     = (int)_list[4];
                        imageNew.Url      = (string)_list[5];
                        imageNew.Size     = (int)_list[6];
                        imageNew.CopyData((byte[])_list[7]);
                        m_images.Add(imageNew);

                        ImageModel imageModel = GetImageByID(imageNew.Id);
                        if (imageModel != null)
                        {
                            if (m_imageReferenceTmp != null)
                            {
                                if (m_imageReferenceTmp.Image != null)
                                {
                                    ImageUtils.LoadBytesImage(m_imageReferenceTmp.Image, imageModel.Data, m_imageReferenceTmp.Height, MenusScreenController.Instance.SizeHeightAllowedImages);
                                    UIEventController.Instance.DispatchUIEvent(EVENT_IMAGE_LOADED_REPORT_SYSTEM, m_imageReferenceTmp.Image, imageNew.Url);
                                }
                            }
                        }
                    }
                }
                m_imageReferenceTmp = null;
            }
            if (_nameEvent == EVENT_IMAGES_LOAD_SERVER_LOCAL_DATA_LOADED)
            {
                m_imageReferenceTmp = null;
            }
            if (_nameEvent == EVENT_IMAGES_CALL_DELETE_IMAGE)
            {
                long idImage = (long)_list[1];
                if (idImage != -1)
                {
                    RemoveImageByID(idImage);
                    CommsHTTPConstants.RemoveImage(idImage);
                }
            }
            if (_nameEvent == EVENT_IMAGES_CANCEL_LOADING_IMAGES)
            {
                m_queuedRequests.Clear();
                // m_imageReferenceTmp = null;
            }
            if (_nameEvent == RequestsController.EVENT_REQUEST_CALL_DELETE_RECORDS)
            {
                m_images.Clear();
                m_queuedRequests.Clear();
                m_imageReferenceTmp = null;
            }
            if (_nameEvent == EVENT_IMAGES_LOAD_THUMBNAIL_FILE_BROWSER)
            {
                if (m_thumbnailRequests.Count < 50)
                {
                    m_thumbnailRequests.Add(new ThumbnailRequestedInfo((GUIContent)_list[0], (string)_list[1], m_heightThumbnail));
                }
            }
            if (_nameEvent == EVENT_IMAGES_CLEAR_THUMBNAIL_CACHE)
            {
                for (int i = 0; i < m_thumbnailRequests.Count; i++)
                {
                    m_thumbnailRequests[i].Destroy();
                }
                m_thumbnailRequests.Clear();
                m_counterThumnail = 0;
                m_timeAcumImages  = 0;
            }
        }