/// <summary>
        /// Determines whether all color values of the specified
        /// ImageListViewColor are equal to this instance.
        /// </summary>
        /// <param name="obj">The object to compare with this instance.</param>
        /// <returns>true if the two instances have the same color values;
        /// otherwise false.</returns>
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                throw new NullReferenceException();
            }

            ImageListViewColor other = obj as ImageListViewColor;

            if (other == null)
            {
                return(false);
            }

            foreach (PropertyInfo info in typeof(ImageListViewColor).GetProperties())
            {
                // Walk through color properties
                if (info.PropertyType == typeof(Color))
                {
                    // Compare colors
                    Color color1 = (Color)info.GetValue(this, null);
                    Color color2 = (Color)info.GetValue(other, null);

                    if (color1 != color2)
                    {
                        return(false);
                    }
                }
            }

            return(true);
        }
Example #2
0
        private void colorToolStripComboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            PropertyInfo       field = ((ColorComboBoxItem)colorToolStripComboBox.SelectedItem).Field;
            ImageListViewColor color = (ImageListViewColor)field.GetValue(null, null);

            imageListView1.Colors = color;
        }
        /// <summary>
        /// Sets the color palette to noir colors.
        /// </summary>
        private static ImageListViewColor GetNoirTheme()
        {
            ImageListViewColor c = new ImageListViewColor();

            // control
            c.ControlBackColor  = Color.Black;
            c.DisabledBackColor = Color.Black;

            // item
            c.BackColor = Color.FromArgb(0x31, 0x31, 0x31);
            c.ForeColor = Color.LightGray;

            c.BorderColor = Color.DarkGray;

            c.UnFocusedColor1      = Color.FromArgb(16, SystemColors.GrayText);
            c.UnFocusedColor2      = Color.FromArgb(64, SystemColors.GrayText);
            c.UnFocusedBorderColor = Color.FromArgb(128, SystemColors.GrayText);
            c.UnFocusedForeColor   = Color.LightGray;

            c.HoverColor1      = Color.FromArgb(64, Color.White);
            c.HoverColor2      = Color.FromArgb(16, Color.White);
            c.HoverBorderColor = Color.FromArgb(64, SystemColors.Highlight);

            c.SelectedColor1      = Color.FromArgb(64, 96, 160);
            c.SelectedColor2      = Color.FromArgb(64, 64, 96, 160);
            c.SelectedBorderColor = Color.FromArgb(128, SystemColors.Highlight);
            c.SelectedForeColor   = Color.LightGray;

            c.InsertionCaretColor = Color.FromArgb(96, 144, 240);

            // thumbnails & pane
            c.ImageInnerBorderColor = Color.FromArgb(128, Color.White);
            c.ImageOuterBorderColor = Color.FromArgb(128, Color.Gray);

            // details view
            c.CellForeColor           = Color.WhiteSmoke;
            c.ColumnHeaderBackColor1  = Color.FromArgb(32, 128, 128, 128);
            c.ColumnHeaderBackColor2  = Color.FromArgb(196, 128, 128, 128);
            c.ColumnHeaderHoverColor1 = Color.FromArgb(64, 96, 144, 240);
            c.ColumnHeaderHoverColor2 = Color.FromArgb(196, 96, 144, 240);
            c.ColumnHeaderForeColor   = Color.White;
            c.ColumnSelectColor       = Color.FromArgb(96, 128, 128, 128);
            c.ColumnSeparatorColor    = Color.Gold;
            c.AlternateBackColor      = Color.FromArgb(0x31, 0x31, 0x31);
            c.AlternateCellForeColor  = Color.WhiteSmoke;

            // image pane
            c.PaneBackColor      = Color.FromArgb(0x31, 0x31, 0x31);
            c.PaneSeparatorColor = Color.Gold;
            c.PaneLabelColor     = SystemColors.GrayText;

            // selection rectangke
            c.SelectionRectangleColor1      = Color.FromArgb(160, 96, 144, 240);
            c.SelectionRectangleColor2      = Color.FromArgb(32, 96, 144, 240);
            c.SelectionRectangleBorderColor = Color.FromArgb(64, 96, 144, 240);

            return(c);
        }
        /// <summary>
        /// Sets the color palette to mandarin colors.
        /// </summary>
        private static ImageListViewColor GetMandarinTheme()
        {
            ImageListViewColor c = new ImageListViewColor();

            // control
            c.ControlBackColor  = Color.White;
            c.DisabledBackColor = Color.FromArgb(220, 220, 220);

            // item
            c.BackColor   = Color.White;
            c.ForeColor   = Color.FromArgb(60, 60, 60);
            c.BorderColor = Color.FromArgb(187, 190, 183);

            c.UnFocusedColor1      = Color.FromArgb(235, 235, 235);
            c.UnFocusedColor2      = Color.FromArgb(217, 217, 217);
            c.UnFocusedBorderColor = Color.FromArgb(168, 169, 161);
            c.UnFocusedForeColor   = Color.FromArgb(40, 40, 40);

            c.HoverColor1      = Color.Transparent;
            c.HoverColor2      = Color.Transparent;
            c.HoverBorderColor = Color.Transparent;

            c.SelectedColor1      = Color.FromArgb(244, 125, 77);
            c.SelectedColor2      = Color.FromArgb(235, 110, 60);
            c.SelectedBorderColor = Color.FromArgb(240, 119, 70);
            c.SelectedForeColor   = Color.White;

            c.InsertionCaretColor = Color.FromArgb(240, 119, 70);

            // thumbnails & pane
            c.ImageInnerBorderColor = Color.Transparent;
            c.ImageOuterBorderColor = Color.White;

            // details view
            c.CellForeColor           = Color.FromArgb(60, 60, 60);
            c.ColumnHeaderBackColor1  = Color.FromArgb(247, 247, 247);
            c.ColumnHeaderBackColor2  = Color.FromArgb(235, 235, 235);
            c.ColumnHeaderHoverColor1 = Color.White;
            c.ColumnHeaderHoverColor2 = Color.FromArgb(245, 245, 245);
            c.ColumnHeaderForeColor   = Color.FromArgb(60, 60, 60);
            c.ColumnSelectColor       = Color.FromArgb(34, 128, 128, 128);
            c.ColumnSeparatorColor    = Color.FromArgb(106, 128, 128, 128);
            c.mAlternateBackColor     = Color.FromArgb(234, 234, 234);
            c.mAlternateCellForeColor = Color.FromArgb(40, 40, 40);

            // image pane
            c.PaneBackColor      = Color.White;
            c.PaneSeparatorColor = Color.FromArgb(216, 216, 216);
            c.PaneLabelColor     = Color.FromArgb(156, 156, 156);

            // selection rectangle
            c.SelectionRectangleColor1      = Color.FromArgb(64, 240, 116, 68);
            c.SelectionRectangleColor2      = Color.FromArgb(64, 240, 116, 68);
            c.SelectionRectangleBorderColor = Color.FromArgb(240, 119, 70);

            return(c);
        }
        /// <summary>
        /// Returns a string that represents this instance.
        /// </summary>
        /// <returns>
        /// A string that represents this instance.
        /// </returns>
        public override string ToString()
        {
            ImageListViewColor colors = this;

            // First check if the color matches a predefined color setting
            foreach (MemberInfo info in typeof(ImageListViewColor).GetMembers(BindingFlags.Static | BindingFlags.Public))
            {
                if (info.MemberType == MemberTypes.Property)
                {
                    PropertyInfo propertyInfo = (PropertyInfo)info;
                    if (propertyInfo.PropertyType == typeof(ImageListViewColor))
                    {
                        ImageListViewColor presetValue = (ImageListViewColor)propertyInfo.GetValue(null, null);
                        // If the color setting is equal to a preset value
                        // return the name of the preset
                        if (colors.Equals(presetValue))
                        {
                            return(string.Format("({0})", propertyInfo.Name));
                        }
                    }
                }
            }

            // Serialize all colors which are different from the default setting
            List <string> lines = new List <string>();

            foreach (PropertyInfo info in typeof(ImageListViewColor).GetProperties())
            {
                // Walk through color properties
                if (info.PropertyType == typeof(Color))
                {
                    // Get property name
                    string name = info.Name;
                    // Get the current value
                    Color color = (Color)info.GetValue(colors, null);
                    // Find the default value atribute
                    Attribute[] attributes = (Attribute[])info.GetCustomAttributes(typeof(DefaultValueAttribute), false);
                    if (attributes.Length != 0)
                    {
                        // Get the default value
                        DefaultValueAttribute attribute = (DefaultValueAttribute)attributes[0];
                        Color defaultColor = (Color)attribute.Value;
                        // Serialize only if colors are different
                        if (color != defaultColor)
                        {
                            lines.Add(string.Format("{0} = {1}", name, color.Name));
                        }
                    }
                }
            }

            return(string.Join("; ", lines.ToArray()));
        }
 /// <summary>
 /// Copies color values from the given object.
 /// </summary>
 /// <param name="source">The source object.</param>
 public void CopyFrom(ImageListViewColor source)
 {
     foreach (PropertyInfo info in typeof(ImageListViewColor).GetProperties())
     {
         // Walk through color properties
         if (info.PropertyType == typeof(Color))
         {
             Color color = (Color)info.GetValue(source, null);
             info.SetValue(this, color, null);
         }
     }
 }
        /// <summary>
        /// Initializes a new instance of the ImageListViewColor class
        /// from its string representation.
        /// </summary>
        /// <param name="definition">String representation of the object.</param>
        public ImageListViewColor(string definition)
            : this()
        {
            try
            {
                // First check if the color matches a predefined color setting
                foreach (MemberInfo info in typeof(ImageListViewColor).GetMembers(BindingFlags.Static | BindingFlags.Public))
                {
                    if (info.MemberType == MemberTypes.Property)
                    {
                        PropertyInfo propertyInfo = (PropertyInfo)info;
                        if (propertyInfo.PropertyType == typeof(ImageListViewColor))
                        {
                            // If the color setting is equal to a preset value
                            // return the preset
                            if (definition == string.Format("({0})", propertyInfo.Name) ||
                                definition == propertyInfo.Name)
                            {
                                ImageListViewColor presetValue = (ImageListViewColor)propertyInfo.GetValue(null, null);
                                CopyFrom(presetValue);
                                return;
                            }
                        }
                    }
                }

                // Convert color values
                foreach (string line in definition.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries))
                {
                    // Read the color setting
                    string[] pair  = line.Split(new string[] { "=" }, StringSplitOptions.RemoveEmptyEntries);
                    string   name  = pair[0].Trim();
                    Color    color = Color.FromName(pair[1].Trim());
                    // Set the property value
                    PropertyInfo property = typeof(ImageListViewColor).GetProperty(name);
                    property.SetValue(this, color, null);
                }
            }
            catch
            {
                throw new ArgumentException("Invalid string format", "definition");
            }
        }
        /// <summary>
        /// Converts the given value object to the specified type,
        /// using the specified context and culture information.
        /// </summary>
        /// <param name="context">Format context.</param>
        /// <param name="culture">The culture info. If null is passed, the current culture is assumed.</param>
        /// <param name="value">The objct to convert.</param>
        /// <param name="destinationType">The type to convert to.</param>
        /// <returns>An object that represents the converted value.</returns>
        public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
        {
            if (value != null && value is ImageListViewColor)
            {
                ImageListViewColor colors = (ImageListViewColor)value;

                if (destinationType == typeof(string))
                {
                    return(colors.ToString());
                }
                else if (destinationType == typeof(InstanceDescriptor))
                {
                    // Used by the designer serializer
                    ConstructorInfo consInfo = typeof(ImageListViewColor).GetConstructor(new Type[] { typeof(string) });
                    return(new InstanceDescriptor(consInfo, new object[] { colors.ToString() }));
                }
            }

            return(base.ConvertTo(context, culture, value, destinationType));
        }
Example #9
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;
		}
Example #10
0
		/// <summary>
		/// Sets the renderer for this instance.
		/// </summary>
		/// <param name="renderer">An <see cref="ImageListViewRenderer"/> to assign to the control.</param>
		/// <param name="keepColors">true to keep current colors; otherwise false.</param>
		public void SetRenderer(ImageListViewRenderer renderer, bool keepColors)
		{
			if (renderer == null)
				throw new ArgumentNullException("renderer");

			ImageListViewRenderer oldRenderer = mRenderer;

			mRenderer = renderer;
			mRenderer.ImageListView = this;
			if (!keepColors)
			{
				ImageListViewColor[] preferredColors = mRenderer.PreferredColors;
				if (preferredColors != null)
					mColors = preferredColors[0];
				else
					mColors = ImageListViewColor.Default;
			}

			if (oldRenderer != null)
				oldRenderer.Dispose();

			if (layoutManager != null)
				layoutManager.Update(true);

			Refresh();
		}
Example #11
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;
        }
        /// <summary>
        /// Sets the color palette to noir colors.
        /// </summary>
        private static ImageListViewColor GetNoirTheme()
        {
            ImageListViewColor c = new ImageListViewColor();

            // control
            c.ControlBackColor = Color.Black;

            // item
            c.BackColor = Color.FromArgb(0x31, 0x31, 0x31);
            c.ForeColor = Color.LightGray;

            c.BorderColor = Color.DarkGray;

            c.UnFocusedColor1 = Color.FromArgb(16, SystemColors.GrayText);
            c.UnFocusedColor2 = Color.FromArgb(64, SystemColors.GrayText);
            c.UnFocusedBorderColor = Color.FromArgb(128, SystemColors.GrayText);
            c.UnFocusedForeColor = Color.LightGray;

            c.HoverColor1 = Color.FromArgb(64, Color.White);
            c.HoverColor2 = Color.FromArgb(16, Color.White);
            c.HoverBorderColor = Color.FromArgb(64, SystemColors.Highlight);

            c.SelectedColor1 = Color.FromArgb(64, 96, 160);
            c.SelectedColor2 = Color.FromArgb(64, 64, 96, 160);
            c.SelectedBorderColor = Color.FromArgb(128, SystemColors.Highlight);
            c.SelectedForeColor = Color.LightGray;

            c.InsertionCaretColor = Color.FromArgb(96, 144, 240);

            // thumbnails & pane
            c.ImageInnerBorderColor = Color.FromArgb(128, Color.White);
            c.ImageOuterBorderColor = Color.FromArgb(128, Color.Gray);

            // details view
            c.CellForeColor = Color.WhiteSmoke;
            c.ColumnHeaderBackColor1 = Color.FromArgb(32, 128, 128, 128);
            c.ColumnHeaderBackColor2 = Color.FromArgb(196, 128, 128, 128);
            c.ColumnHeaderHoverColor1 = Color.FromArgb(64, 96, 144, 240);
            c.ColumnHeaderHoverColor2 = Color.FromArgb(196, 96, 144, 240);
            c.ColumnHeaderForeColor = Color.White;
            c.ColumnSelectColor = Color.FromArgb(96, 128, 128, 128);
            c.ColumnSeparatorColor = Color.Gold;
            c.AlternateBackColor = Color.FromArgb(0x31, 0x31, 0x31);
            c.AlternateCellForeColor = Color.WhiteSmoke;

            // image pane
            c.PaneBackColor = Color.FromArgb(0x31, 0x31, 0x31);
            c.PaneSeparatorColor = Color.Gold;
            c.PaneLabelColor = SystemColors.GrayText;

            // selection rectangke
            c.SelectionRectangleColor1 = Color.FromArgb(160, 96, 144, 240);
            c.SelectionRectangleColor2 = Color.FromArgb(32, 96, 144, 240);
            c.SelectionRectangleBorderColor = Color.FromArgb(64, 96, 144, 240);

            return c;
        }
        /// <summary>
        /// Sets the color palette to mandarin colors.
        /// </summary>
        private static ImageListViewColor GetMandarinTheme()
        {
            ImageListViewColor c = new ImageListViewColor();

            // control
            c.ControlBackColor = Color.White;

            // item
            c.BackColor = Color.White;
            c.ForeColor = Color.FromArgb(60, 60, 60);
            c.BorderColor = Color.FromArgb(187, 190, 183);

            c.UnFocusedColor1 = Color.FromArgb(235, 235, 235);
            c.UnFocusedColor2 = Color.FromArgb(217, 217, 217);
            c.UnFocusedBorderColor = Color.FromArgb(168, 169, 161);
            c.UnFocusedForeColor = Color.FromArgb(40, 40, 40);

            c.HoverColor1 = Color.Transparent;
            c.HoverColor2 = Color.Transparent;
            c.HoverBorderColor = Color.Transparent;

            c.SelectedColor1 = Color.FromArgb(244, 125, 77);
            c.SelectedColor2 = Color.FromArgb(235, 110, 60);
            c.SelectedBorderColor = Color.FromArgb(240, 119, 70);
            c.SelectedForeColor = Color.White;

            c.InsertionCaretColor = Color.FromArgb(240, 119, 70);

            // thumbnails & pane
            c.ImageInnerBorderColor = Color.Transparent;
            c.ImageOuterBorderColor = Color.White;

            // details view
            c.CellForeColor = Color.FromArgb(60, 60, 60);
            c.ColumnHeaderBackColor1 = Color.FromArgb(247, 247, 247);
            c.ColumnHeaderBackColor2 = Color.FromArgb(235, 235, 235);
            c.ColumnHeaderHoverColor1 = Color.White;
            c.ColumnHeaderHoverColor2 = Color.FromArgb(245, 245, 245);
            c.ColumnHeaderForeColor = Color.FromArgb(60, 60, 60);
            c.ColumnSelectColor = Color.FromArgb(34, 128, 128, 128);
            c.ColumnSeparatorColor = Color.FromArgb(106, 128, 128, 128);
            c.mAlternateBackColor = Color.FromArgb(234, 234, 234);
            c.mAlternateCellForeColor = Color.FromArgb(40, 40, 40);

            // image pane
            c.PaneBackColor = Color.White;
            c.PaneSeparatorColor = Color.FromArgb(216, 216, 216);
            c.PaneLabelColor = Color.FromArgb(156, 156, 156);

            // selection rectangle
            c.SelectionRectangleColor1 = Color.FromArgb(64, 240, 116, 68);
            c.SelectionRectangleColor2 = Color.FromArgb(64, 240, 116, 68);
            c.SelectionRectangleBorderColor = Color.FromArgb(240, 119, 70);

            return c;
        }
 /// <summary>
 /// Copies color values from the given object.
 /// </summary>
 /// <param name="source">The source object.</param>
 public void CopyFrom(ImageListViewColor source)
 {
     foreach (PropertyInfo info in typeof(ImageListViewColor).GetProperties())
     {
         // Walk through color properties
         if (info.PropertyType == typeof(Color))
         {
             Color color = (Color)info.GetValue(source, null);
             info.SetValue(this, color, null);
         }
     }
 }
Example #15
0
        /// <summary>
        /// Sets the color palette to noir colors.
        /// </summary>
        private static ImageListViewColor GetNoirTheme()
        {
            ImageListViewColor c = new ImageListViewColor
            {
                // control
                ControlBackColor  = Color.Black,
                DisabledBackColor = Color.Black,

                // item
                BackColor = Color.FromArgb(0x31, 0x31, 0x31),
                ForeColor = Color.LightGray,

                BorderColor = Color.DarkGray,

                UnFocusedColor1      = Color.FromArgb(16, SystemColors.GrayText),
                UnFocusedColor2      = Color.FromArgb(64, SystemColors.GrayText),
                UnFocusedBorderColor = Color.FromArgb(128, SystemColors.GrayText),
                UnFocusedForeColor   = Color.LightGray,

                HoverColor1      = Color.FromArgb(64, Color.White),
                HoverColor2      = Color.FromArgb(16, Color.White),
                HoverBorderColor = Color.FromArgb(64, SystemColors.Highlight),

                SelectedColor1      = Color.FromArgb(64, 96, 160),
                SelectedColor2      = Color.FromArgb(64, 64, 96, 160),
                SelectedBorderColor = Color.FromArgb(128, SystemColors.Highlight),
                SelectedForeColor   = Color.LightGray,

                DisabledColor1      = Color.FromArgb(0, SystemColors.GrayText),
                DisabledColor2      = Color.FromArgb(32, SystemColors.GrayText),
                DisabledBorderColor = Color.FromArgb(96, SystemColors.GrayText),
                DisabledForeColor   = Color.LightGray,

                InsertionCaretColor = Color.FromArgb(96, 144, 240),

                // thumbnails & pane
                ImageInnerBorderColor = Color.FromArgb(128, Color.White),
                ImageOuterBorderColor = Color.FromArgb(128, Color.Gray),

                // details view
                CellForeColor           = Color.WhiteSmoke,
                ColumnHeaderBackColor1  = Color.FromArgb(32, 128, 128, 128),
                ColumnHeaderBackColor2  = Color.FromArgb(196, 128, 128, 128),
                ColumnHeaderHoverColor1 = Color.FromArgb(64, 96, 144, 240),
                ColumnHeaderHoverColor2 = Color.FromArgb(196, 96, 144, 240),
                ColumnHeaderForeColor   = Color.White,
                ColumnSelectColor       = Color.FromArgb(96, 128, 128, 128),
                ColumnSeparatorColor    = Color.Gold,
                AlternateBackColor      = Color.FromArgb(0x31, 0x31, 0x31),
                AlternateCellForeColor  = Color.WhiteSmoke,

                // image pane
                PaneBackColor      = Color.FromArgb(0x31, 0x31, 0x31),
                PaneSeparatorColor = Color.Gold,
                PaneLabelColor     = SystemColors.GrayText,

                // selection rectangke
                SelectionRectangleColor1      = Color.FromArgb(160, 96, 144, 240),
                SelectionRectangleColor2      = Color.FromArgb(32, 96, 144, 240),
                SelectionRectangleBorderColor = Color.FromArgb(64, 96, 144, 240)
            };

            return(c);
        }
Example #16
0
        /// <summary>
        /// Sets the color palette to mandarin colors.
        /// </summary>
        private static ImageListViewColor GetMandarinTheme()
        {
            ImageListViewColor c = new ImageListViewColor
            {
                // control
                ControlBackColor  = Color.White,
                DisabledBackColor = Color.FromArgb(220, 220, 220),

                // item
                BackColor   = Color.White,
                ForeColor   = Color.FromArgb(60, 60, 60),
                BorderColor = Color.FromArgb(187, 190, 183),

                UnFocusedColor1      = Color.FromArgb(235, 235, 235),
                UnFocusedColor2      = Color.FromArgb(217, 217, 217),
                UnFocusedBorderColor = Color.FromArgb(168, 169, 161),
                UnFocusedForeColor   = Color.FromArgb(40, 40, 40),

                HoverColor1      = Color.Transparent,
                HoverColor2      = Color.Transparent,
                HoverBorderColor = Color.Transparent,

                SelectedColor1      = Color.FromArgb(244, 125, 77),
                SelectedColor2      = Color.FromArgb(235, 110, 60),
                SelectedBorderColor = Color.FromArgb(240, 119, 70),
                SelectedForeColor   = Color.White,

                DisabledColor1      = Color.FromArgb(217, 217, 217),
                DisabledColor2      = Color.FromArgb(197, 197, 197),
                DisabledBorderColor = Color.FromArgb(128, 128, 128),
                DisabledForeColor   = Color.FromArgb(128, 128, 128),

                InsertionCaretColor = Color.FromArgb(240, 119, 70),

                // thumbnails & pane
                ImageInnerBorderColor = Color.Transparent,
                ImageOuterBorderColor = Color.White,

                // details view
                CellForeColor           = Color.FromArgb(60, 60, 60),
                ColumnHeaderBackColor1  = Color.FromArgb(247, 247, 247),
                ColumnHeaderBackColor2  = Color.FromArgb(235, 235, 235),
                ColumnHeaderHoverColor1 = Color.White,
                ColumnHeaderHoverColor2 = Color.FromArgb(245, 245, 245),
                ColumnHeaderForeColor   = Color.FromArgb(60, 60, 60),
                ColumnSelectColor       = Color.FromArgb(34, 128, 128, 128),
                ColumnSeparatorColor    = Color.FromArgb(106, 128, 128, 128),
                mAlternateBackColor     = Color.FromArgb(234, 234, 234),
                mAlternateCellForeColor = Color.FromArgb(40, 40, 40),

                // image pane
                PaneBackColor      = Color.White,
                PaneSeparatorColor = Color.FromArgb(216, 216, 216),
                PaneLabelColor     = Color.FromArgb(156, 156, 156),

                // selection rectangle
                SelectionRectangleColor1      = Color.FromArgb(64, 240, 116, 68),
                SelectionRectangleColor2      = Color.FromArgb(64, 240, 116, 68),
                SelectionRectangleBorderColor = Color.FromArgb(240, 119, 70)
            };

            return(c);
        }