/// <summary>
        /// Reloads displayed data from underlaying ResX node
        /// </summary>
        public override void UpdateDataOf(ListViewKeyItem item, bool reloadImages)
        {
            base.UpdateDataOf(item, reloadImages);

            LargeImageList.Images.Add(item.ImageKey, Editor.play);
            SmallImageList.Images.Add(item.ImageKey, Editor.play);

            FileInfo info = null;

            if (item.DataNode.FileRef != null && File.Exists(item.DataNode.FileRef.FileName))
            {
                info = new FileInfo(item.DataNode.FileRef.FileName);
            }

            if (info != null)
            {
                item.SubItems["Size"].Text   = GetFileSize(info.Length);
                item.SubItems["Length"].Text = GetSoundDigits(SoundInfo.GetSoundLength(info.FullName));
                item.FileRefOk = true;
            }
            else
            {
                var stream = item.DataNode.GetValue <MemoryStream>();
                if (stream != null)
                {
                    item.SubItems["Size"].Text   = GetFileSize(stream.Length);
                    item.SubItems["Length"].Text = null;
                    item.FileRefOk = true;
                }
                else
                {
                    item.FileRefOk = false;
                }
            }

            item.UpdateErrorSetDisplay();

            Validate(item);
            NotifyItemsStateChanged();

            if (item.ErrorMessages.Count > 0)
            {
                item.Status = KEY_STATUS.ERROR;
            }
            else
            {
                item.Status       = KEY_STATUS.OK;
                item.LastValidKey = item.Key;
            }

            string p = item.ImageKey;

            item.ImageKey = null;
            item.ImageKey = p;
        }
        /// <summary>
        /// Reloads displayed data from underlaying ResX node
        /// </summary>
        public override void UpdateDataOf(ListViewKeyItem item, bool reloadImages)
        {
            base.UpdateDataOf(item, reloadImages);

            Icon ico = item.DataNode.GetValue <Icon>();

            if (LargeImageList.Images.ContainsKey(item.ImageKey) && reloadImages)
            {
                LargeImageList.Images.RemoveByKey(item.ImageKey);
                SmallImageList.Images.RemoveByKey(item.ImageKey);
            }

            // add the new image, if exists
            if (ico != null)
            {
                LargeImageList.Images.Add(item.ImageKey, ico);
                SmallImageList.Images.Add(item.ImageKey, ico);

                item.SubItems["Size"].Text = string.Format("{0} x {1}", ico.Width, ico.Height);
                item.FileRefOk             = true;
            }
            else
            {
                item.SubItems["Size"].Text = null;
                item.FileRefOk             = false;
            }

            item.UpdateErrorSetDisplay();

            Validate(item);
            NotifyItemsStateChanged();

            if (item.ErrorMessages.Count > 0)
            {
                item.Status = KEY_STATUS.ERROR;
            }
            else
            {
                item.Status       = KEY_STATUS.OK;
                item.LastValidKey = item.Key;
            }

            // update image display
            string p = item.ImageKey;

            item.ImageKey = null;
            item.ImageKey = p;
        }
        /// <summary>
        /// Adds the specified key.
        /// </summary>
        /// <param name="key">The key.</param>
        /// <param name="value">The value.</param>
        public override IKeyValueSource Add(string key, ResXDataNode value)
        {
            ListViewKeyItem item = base.Add(key, value) as ListViewKeyItem;

            if (referenceExistingOnAdd)
            {
                item.FileRefOk = true;
            }
            else
            {
                ListViewItem.ListViewSubItem subSize = new ListViewItem.ListViewSubItem();
                subSize.Name = "Size";
                item.SubItems.Insert(2, subSize);
            }

            UpdateDataOf(item, false);

            return(item);
        }
        /// <summary>
        /// Reloads displayed data from underlaying ResX node
        /// </summary>
        public override void UpdateDataOf(ListViewKeyItem item, bool reloadImages)
        {
            base.UpdateDataOf(item, reloadImages);

            LargeImageList.Images.Add(item.ImageKey, Editor.doc);
            SmallImageList.Images.Add(item.ImageKey, Editor.doc);

            FileInfo info = null;

            if (item.DataNode.FileRef != null && File.Exists(item.DataNode.FileRef.FileName))
            {
                info = new FileInfo(item.DataNode.FileRef.FileName);
            }

            if (info != null)
            {
                item.SubItems["Size"].Text = GetFileSize(info.Length);
                item.FileRefOk             = true;
            }
            else
            {
                if (item.DataNode.HasValue <string>())
                {
                    var val = item.DataNode.GetValue <string>();
                    if (val != null)
                    {
                        item.SubItems["Size"].Text = GetFileSize(Encoding.UTF8.GetBytes(val).Length);
                        item.FileRefOk             = true;
                    }
                    else
                    {
                        item.FileRefOk = false;
                    }
                }
                else
                {
                    var val = item.DataNode.GetValue <byte[]>();
                    if (val != null)
                    {
                        item.SubItems["Size"].Text = GetFileSize(val.Length);
                        item.FileRefOk             = true;
                    }
                    else
                    {
                        item.FileRefOk = false;
                    }
                }
            }

            item.UpdateErrorSetDisplay();

            Validate(item);
            NotifyItemsStateChanged();

            if (item.ErrorMessages.Count > 0)
            {
                item.Status = KEY_STATUS.ERROR;
            }
            else
            {
                item.Status       = KEY_STATUS.OK;
                item.LastValidKey = item.Key;
            }

            // update image display
            string p = item.ImageKey;

            item.ImageKey = null;
            item.ImageKey = p;
        }