codecoverageimagelist.cs

来自「SharpDevelop2.0.0 c#开发免费工具」· CS 代码 · 共 59 行

CS
59
字号
// <file>
//     <copyright see="prj:///doc/copyright.txt"/>
//     <license see="prj:///doc/license.txt"/>
//     <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
//     <version>$Revision: 1068 $</version>
// </file>

using ICSharpCode.Core;
using System;
using System.Drawing;
using System.Windows.Forms;

namespace ICSharpCode.CodeCoverage
{
	public enum CodeCoverageImageListIndex
	{
		Module                    = 0,
		Namespace                 = 2,
		Class                     = 4,
		Method                    = 6,
		MethodWithZeroCoverage    = 7
	}
	
	public class CodeCoverageImageList
	{
		static ImageList imageList;
		
		CodeCoverageImageList()
		{
		}
		
		public static ImageList ImageList {
			get {
				if (imageList == null) {
					GetImageList();
				}
				return imageList;
			}
		}
		
		static void GetImageList()
		{
			imageList = new ImageList();
			imageList.ColorDepth = ColorDepth.Depth32Bit;
			
			AddBitmap(ResourceService.GetBitmap("Icons.16x16.Library"), 0.2f);
			AddBitmap(ResourceService.GetBitmap("Icons.16x16.NameSpace"), 0.4f);
			AddBitmap(ResourceService.GetBitmap("Icons.16x16.Class"), 0.15f);
			AddBitmap(ResourceService.GetBitmap("Icons.16x16.Method"), 0.2f);
		}
		
		static void AddBitmap(Bitmap bitmap, float brightness)
		{
			imageList.Images.Add(bitmap);
			imageList.Images.Add(GrayScaleBitmap.FromBitmap(bitmap, brightness));
		}
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?