internal ImageHandle AddHandle()
        {
            var handle = new ImageHandle(this);

            this.openHandleCount += 1;
            return(handle);
        }
示例#2
0
        /// <summary>
        /// Call this to display <see cref="wantedImageHandle"/> (if it is loaded).
        /// <para>It will display it if possible and set <see cref="displayedHandle"/> accordingly.</para>
        /// <para>There is no point calling this if <see cref="wantedImageHandle"/> is not loaded yet.</para>
        /// </summary>
        private void DisplayWantedImage()
        {
            if (this.wantedImageHandle?.IsLoaded == false || this.wantedImageHandle?.Container == this.displayedHandle?.Container)
            {
                return;
            }

            this.displayedHandle?.Dispose();
            this.displayedHandle = this.wantedImageHandle?.Container.AddHandle();

#if DEBUG
            if (this.displayedHandle?.Image != null && this.mainImageControl.Image == this.displayedHandle?.Image)
            {
                Debug.WriteLine("Displaying the same image again #FIXME");
            }
#endif

            this.mainImageControl.Image = this.displayedHandle?.Image;
            if (Settings.Instance.UseCurrentImageAsWindowIcon)
            {
                this.UpdateWindowIcon();
            }
        }