help2controlsvalidation.cs

来自「c#源代码」· CS 代码 · 共 54 行

CS
54
字号
/* ***********************************************************
 *
 * Help 2.0 Environment for SharpDevelop
 * Help 2.0 Controls Validation
 * Copyright (c) 2005, Mathias Simmack. All rights reserved.
 *
 * ********************************************************* */
namespace HtmlHelp2Service
{
	using System;
	using System.IO;
	using Microsoft.Win32;

	public sealed class Help2ControlsValidation
	{
		public static bool IsTocControlRegistered
		{
			get
			{
				return IsClassRegistered("{314111b8-a502-11d2-bbca-00c04f8ec294}");
			}
		}

		public static bool IsIndexControlRegistered
		{
			get
			{
				return IsClassRegistered("{314111c6-a502-11d2-bbca-00c04f8ec294}");
			}
		}

		private static bool IsClassRegistered(string classId)
		{
			try
			{
				using (RegistryKey tempRegKey = Registry.ClassesRoot.OpenSubKey(String.Format("CLSID\\{0}\\InprocServer32",
				                                                                              classId)))
				{
					string help2Dll        = (string)tempRegKey.GetValue("");
					return (help2Dll != null && help2Dll != "" && File.Exists(help2Dll));
				}
			}
			catch
			{
				return false;
			}
		}

		public Help2ControlsValidation()
		{
		}
	}
}

⌨️ 快捷键说明

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