⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 namingutilities.cs

📁 c#源代码
💻 CS
字号:
// <file>
//     <copyright see="prj:///doc/copyright.txt"/>
//     <license see="prj:///doc/license.txt"/>
//     <owner name="Mike Krueger" email="mike@icsharpcode.net"/>
//     <version value="$version"/>
// </file>

using System;

namespace ICSharpCode.AssemblyAnalyser.Rules
{
	/// <summary>
	/// Description of NamingUtilities.	
	/// </summary>
	public sealed class NamingUtilities
	{
		/// <summary>
		/// Pascal casing is like 'PascalCase'
		/// </summary>
		public static bool IsPascalCase(string name)
		{
			if (name == null || name.Length == 0) {
				return true;
			}
			return Char.IsUpper(name[0]);
		}
		
		public static string PascalCase(string name)
		{
			if (name == null || name.Length == 0) {
				return name;
			}
			return Char.ToUpper(name[0]) + name.Substring(1);
		}
		
		
		/// <summary>
		/// Camel casing is like 'camelCase'
		/// </summary>
		public static bool IsCamelCase(string name)
		{
			if (name == null || name.Length == 0) {
				return true;
			}
			return Char.IsLower(name[0]);
		}
		
		
		public static string CamelCase(string name)
		{
			if (name == null || name.Length == 0) {
				return name;
			}
			return Char.ToLower(name[0]) + name.Substring(1);
		}
		
		public static bool ContainsUnderscore(string name)
		{
			if (name == null || name.Length == 0) {
				return false;
			}
			return name.IndexOf('_') >= 0;
		}
		
		public static string Combine(string typeName, string memberName)
		{
			return String.Concat(typeName, 
			                     '.',
			                     memberName);
		}
		
	}
}

⌨️ 快捷键说明

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