From 2e773acb067d153f5d2293de9a9c849b5aa62480 Mon Sep 17 00:00:00 2001 From: Rich Date: Fri, 7 Dec 2007 23:51:51 +0000 Subject: [PATCH] Added LibraryDocumentUsage Property Add Tab and ToolTip Properties --- .../Extension/DocumentExt.cs | 29 +++++++++++++++ .../VEPROMS.CSLA.Library/Extension/ItemExt.cs | 35 +++++++++++++++++++ 2 files changed, 64 insertions(+) diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs index 8a8a7587..5ab58a73 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs @@ -5,6 +5,17 @@ using System.IO; namespace VEPROMS.CSLA.Library { + public partial class Document + { + public string DocumentTitle + { + get + { + if (_LibTitle == "") return string.Format("Document {0}", _DocID); + return _LibTitle; + } + } + } public partial class DocumentInfo { public string DocumentTitle @@ -15,6 +26,24 @@ namespace VEPROMS.CSLA.Library return _LibTitle; } } + public string LibraryDocumentUsage + { + get + { + StringBuilder sb = new StringBuilder(); + string sep = "\r\nUsed In:\r\n "; + foreach (EntryInfo myEntry in DocumentEntries) + { + foreach (ItemInfo myItem in myEntry.MyContent.ContentItems) + { + ItemInfo proc = myItem.MyProcedure; + sb.Append(sep + proc.MyContent.Number + " - " + proc.MyContent.Text); + sep = "\r\n "; + } + } + return sb.ToString(); + } + } } public class DSOFile : IDisposable { diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs index 4c8bddae..f4b03de4 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs @@ -17,6 +17,8 @@ namespace VEPROMS.CSLA.Library { return string.Format("{0} {1}", MyContent.Number, MyContent.Text); } + // TODO: Move to ItemInfo Extension + #region IVEDrillDown public System.Collections.IList GetChildren() { @@ -414,6 +416,39 @@ namespace VEPROMS.CSLA.Library // AddList(nd, "Tables", Tables); // return xn.OwnerDocument; //} + public string TabToolTip + { + get + { + if (MyContent.MyEntry == null) + return MyContent.Number + " - " + MyContent.Text; + string toolTip = MyProcedure.TabToolTip + "\r\n"; + if (MyContent.Number != "") + toolTip += MyContent.Number + " - " + MyContent.Text; + else + toolTip += MyContent.Text; + DocumentInfo myDocument = MyContent.MyEntry.MyDocument; + if (myDocument.LibTitle != "") + { + toolTip += string.Format("\r\n(Library Document - {0})", myDocument.LibTitle); + toolTip += myDocument.LibraryDocumentUsage; + } + return toolTip; + } + } + public string TabTitle + { + get + { + if (MyContent.MyEntry == null) + return MyContent.Number; + if (MyContent.Number != "") + return MyContent.Number; + if (MyContent.Text.Length <= 10) + return MyContent.Text; + return MyContent.Text.Split(" ,.;:-_".ToCharArray())[0] + "..."; + } + } #region IVEReadOnlyItem PartInfoList _PartInfoList; public System.Collections.IList GetChildren()