Represents the layout of the image list view drawing area.
Esempio n. 1
0
        /// <summary>
        /// Initializes a new instance of the ImageListView class.
        /// </summary>
        public ImageListView()
        {
            mColors = new ImageListViewColor();
            SetRenderer(new ImageListViewRenderer());

            AllowColumnClick = true;
            AllowColumnResize = true;
            AllowDrag = false;
            AllowDuplicateFileNames = false;
            AllowPaneResize = true;
            mBorderStyle = BorderStyle.Fixed3D;
            mCacheMode = CacheMode.OnDemand;
            mCacheLimitAsItemCount = 0;
            mCacheLimitAsMemory = 20 * 1024 * 1024;
            mColumns = new ImageListViewColumnHeaderCollection(this);
            ResourceManager manager = new ResourceManager("Manina.Windows.Forms.ImageListViewResources",
                Assembly.GetExecutingAssembly());
            mDefaultImage = manager.GetObject("DefaultImage") as Image;
            mErrorImage = manager.GetObject("ErrorImage") as Image;
            HeaderFont = this.Font;
            mItems = new ImageListViewItemCollection(this);
            MultiSelect = true;
            mPaneWidth = 240;
            mRetryOnError = true;
            mSelectedItems = new ImageListViewSelectedItemCollection(this);
            mCheckedItems = new ImageListViewCheckedItemCollection(this);
            mSortColumn = ColumnType.Name;
            mSortOrder = SortOrder.None;
            SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.Opaque |
                ControlStyles.Selectable | ControlStyles.UserMouse, true);
            ScrollBars = true;
            mShowCheckBoxes = false;
            mCheckBoxAlignment = ContentAlignment.BottomRight;
            mCheckBoxPadding = new Size(2, 2);
            mShowFileIcons = false;
            mIconAlignment = ContentAlignment.TopRight;
            mIconPadding = new Size(2, 2);
            Text = string.Empty;
            mThumbnailSize = new Size(96, 96);
            mUseEmbeddedThumbnails = UseEmbeddedThumbnails.Auto;
            mView = View.Thumbnails;

            mViewOffset = new Point(0, 0);
            hScrollBar = new HScrollBar();
            vScrollBar = new VScrollBar();
            hScrollBar.Visible = false;
            vScrollBar.Visible = false;
            hScrollBar.Scroll += new ScrollEventHandler(hScrollBar_Scroll);
            vScrollBar.Scroll += new ScrollEventHandler(vScrollBar_Scroll);
            layoutManager = new ImageListViewLayoutManager(this);
            forceRefresh = false;

            navigationManager = new ImageListViewNavigationManager(this);

            cacheManager = new ImageListViewCacheManager(this);
            itemCacheManager = new ImageListViewItemCacheManager(this);

            disposed = false;
        }
Esempio n. 2
0
		/// <summary>
		/// Initializes a new instance of the ImageListView class.
		/// </summary>
		public ImageListView()
		{
			// Renderer parameters
			controlSuspended = false;
			rendererSuspendCount = 0;
			rendererNeedsPaint = true;

			mColors = ImageListViewColor.Default;
			Renderer = new ImageListViewRenderer();

			// Property defaults
			AutoRotateThumbnails = true;
			AllowCheckBoxClick = true;
			AllowColumnClick = true;
			AllowColumnResize = true;
			AllowDrag = false;
			AllowDuplicateFileNames = false;
			AllowPaneResize = true;
			mBorderStyle = BorderStyle.Fixed3D;
			mCacheMode = CacheMode.OnDemand;
			mCacheLimitAsItemCount = 0;
			mCacheLimitAsMemory = 20 * 1024 * 1024;
			mColumns = new ImageListViewColumnHeaderCollection(this);
			resources = new ResourceManager("Manina.Windows.Forms.ImageListViewResources", typeof(ImageListView).Assembly);
			mDefaultImage = resources.GetObject("DefaultImage") as Image;
			mErrorImage = resources.GetObject("ErrorImage") as Image;
			mRatingImage = resources.GetObject("RatingImage") as Image;
			mEmptyRatingImage = resources.GetObject("EmptyRatingImage") as Image;
			GroupHeaderFont = new Font("Microsoft Sans Serif", 8.25f, FontStyle.Bold);
			ColumnHeaderFont = new Font("Microsoft Sans Serif", 8.25f);
			mIntegralScroll = false;
			mItems = new ImageListViewItemCollection(this);
			MultiSelect = true;
			mPaneWidth = 240;
			mRetryOnError = true;
			mSelectedItems = new ImageListViewSelectedItemCollection(this);
			mCheckedItems = new ImageListViewCheckedItemCollection(this);
			mSortColumn = 0;
			mGroupColumn = 0;
			mSortOrder = SortOrder.None;
			mGroupOrder = SortOrder.None;
			SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.Opaque | ControlStyles.Selectable | ControlStyles.UserMouse, true);
			ScrollBars = true;
			ShellIconFallback = true;
			ShellIconFromFileContent = true;
			Size = new Size(120, 100);
			mShowCheckBoxes = false;
			mCheckBoxAlignment = ContentAlignment.BottomRight;
			mCheckBoxPadding = new Size(2, 2);
			mShowFileIcons = false;
			mIconAlignment = ContentAlignment.TopRight;
			mIconPadding = new Size(2, 2);
			Text = string.Empty;
			mThumbnailSize = new Size(96, 96);
			mUseEmbeddedThumbnails = UseEmbeddedThumbnails.Auto;
			mUseWIC = UseWIC.Auto;
			mView = View.Thumbnails;
			mViewOffset = new Point(0, 0);
			mShowScrollBars = true;

			// Child controls
			hScrollBar = new HScrollBar();
			vScrollBar = new VScrollBar();
			hScrollBar.Visible = false;
			vScrollBar.Visible = false;
			hScrollBar.Scroll += hScrollBar_Scroll;
			vScrollBar.Scroll += vScrollBar_Scroll;
			Controls.Add(hScrollBar);
			Controls.Add(vScrollBar);

			// Groups
			groups = new ImageListViewGroupCollection(this);
			showGroups = false;

			// Lazy refresh timer
			lazyRefreshTimer = new System.Timers.Timer();
			lazyRefreshTimer.Interval = ImageListViewRenderer.LazyRefreshInterval;
			lazyRefreshTimer.Enabled = false;
			lazyRefreshTimer.Elapsed += lazyRefreshTimer_Tick;
			lazyRefreshCallback = new RefreshDelegateInternal(Refresh);

			// Helpers
			layoutManager = new ImageListViewLayoutManager(this);
			navigationManager = new ImageListViewNavigationManager(this);

			// Cache nabagers
			defaultAdaptor = new ImageListViewItemAdaptors.FileSystemAdaptor();
			thumbnailCache = new ImageListViewCacheThumbnail(this);
			shellInfoCache = new ImageListViewCacheShellInfo(this);
			metadataCache = new ImageListViewCacheMetadata(this);

			disposed = false;
		}
Esempio n. 3
0
        /// <summary>
        /// Initializes a new instance of the ImageListView class.
        /// </summary>
        public ImageListView()
        {
            SetRenderer(new ImageListViewRenderer());

            AllowColumnClick = true;
            AllowColumnResize = true;
            AllowDrag = false;
            AllowDuplicateFileNames = false;
            AllowPaneResize = true;
            BackColor = SystemColors.Window;
            mBorderStyle = BorderStyle.Fixed3D;
            mCacheMode = CacheMode.OnDemand;
            mCacheLimitAsItemCount = 0;
            mCacheLimitAsMemory = 20 * 1024 * 1024;
            mColumns = new ImageListViewColumnHeaderCollection(this);
            mDefaultImage = ImageListViewResources.image;
            mErrorImage = ImageListViewResources.exclamation;
            HeaderFont = this.Font;
            mItems = new ImageListViewItemCollection(this);
            mPaneWidth = 240;
            mRetryOnError = true;
            mSelectedItems = new ImageListViewSelectedItemCollection(this);
            mSortColumn = ColumnType.Name;
            mSortOrder = SortOrder.None;
            SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.Opaque |
                ControlStyles.Selectable | ControlStyles.UserMouse, true);
            Text = string.Empty;
            mThumbnailSize = new Size(96, 96);
            mUseEmbeddedThumbnails = UseEmbeddedThumbnails.Auto;
            mView = View.Thumbnails;

            mViewOffset = new Point(0, 0);
            hScrollBar = new HScrollBar();
            vScrollBar = new VScrollBar();
            hScrollBar.Visible = false;
            vScrollBar.Visible = false;
            hScrollBar.Scroll += new ScrollEventHandler(hScrollBar_Scroll);
            vScrollBar.Scroll += new ScrollEventHandler(vScrollBar_Scroll);
            layoutManager = new ImageListViewLayoutManager(this);
            forceRefresh = false;

            navigationManager = new ImageListViewNavigationManager(this);

            cacheManager = new ImageListViewCacheManager(this);
            itemCacheManager = new ImageListViewItemCacheManager(this);

            disposed = false;
        }