예제 #1
0
파일: GKBase.cs 프로젝트: xbadcode/Rubezh
		public virtual string GetGKDescriptorName(GKNameGenerationType gkNameGenerationType)
		{
			var result = PresentationName;
			if (result == null)
				return "";
			if (result.Length > 32)
				result = result.Substring(0, 32);
			return result.TrimEnd(' ');
		}
예제 #2
0
파일: GKDevice.cs 프로젝트: xbadcode/Rubezh
		public override string GetGKDescriptorName(GKNameGenerationType gkNameGenerationType)
		{
			var result = ShortName + " " + DottedAddress;
			switch (gkNameGenerationType)
			{
				case GKNameGenerationType.DriverTypePlusAddressPlusDescription:
					if (!string.IsNullOrEmpty(Description))
						result += "(" + Description + ")";
					break;

				case GKNameGenerationType.Description:
					if (!string.IsNullOrEmpty(Description))
						result = Description;
					break;

				case GKNameGenerationType.ProjectAddress:
					if (!string.IsNullOrEmpty(ProjectAddress))
						result = ProjectAddress;
					break;

				case GKNameGenerationType.DescriptionOrProjectAddress:
					if (!string.IsNullOrEmpty(Description))
						result = Description;
					else if (!string.IsNullOrEmpty(ProjectAddress))
						result = ProjectAddress;
					break;

				case GKNameGenerationType.ProjectAddressOrDescription:
					if (!string.IsNullOrEmpty(ProjectAddress))
						result = ProjectAddress;
					else if (!string.IsNullOrEmpty(Description))
						result = Description;
					break;
			}
			if (result.Length > 32)
				result = result.Substring(0, 32);
			return result.TrimEnd(' ');
		}