Exemplo n.º 1
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Checks to see if the text properties are for a hyperlink.
		/// </summary>
		/// <param name="ttp">The text properties.</param>
		/// <returns><c>true</c> if the properties are for a hyperlink; <c>false</c> otherwise.
		/// </returns>
		/// ------------------------------------------------------------------------------------
		public static bool IsHyperlink(ITsTextProps ttp)
		{
			string objData = ttp.ObjData();
			if (!String.IsNullOrEmpty(objData) && objData.Length > 1 && objData[0] == Convert.ToChar((int)FwObjDataTypes.kodtExternalPathName))
			{
				return true;
			}
			return false;
		}
Exemplo n.º 2
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Get a Guid from the given text props.
		/// </summary>
		/// <param name="ttp">The text props</param>
		/// <param name="desiredOrcTypes">Set of ORC types that we're interested in, dude; or
		/// null if it don't make no difference</param>
		/// <param name="odt">Actual object type</param>
		/// <returns>The GUID from the text props or Guid.Empty if the props do not contain
		/// a GUID or have a type of ORC that is not one of the desired kinds</returns>
		/// ------------------------------------------------------------------------------------
		public static Guid GetGuidFromProps(ITsTextProps ttp, FwObjDataTypes[] desiredOrcTypes, out FwObjDataTypes odt)
		{
			odt = 0;
			string sObjData = ttp.ObjData();

			if (sObjData != null)
			{
				odt = (FwObjDataTypes)Convert.ToByte(sObjData[0]);
				// See if it's one of the types of objects we want.
				if (desiredOrcTypes == null || desiredOrcTypes.Contains(odt))
				{
					// Get GUID for ORC
					return MiscUtils.GetGuidFromObjData(sObjData.Substring(1));
				}
			}
			return Guid.Empty;
		}