- Added RTF command ulnone to StripRtfFormatting

- Fixed ResetParts to also MyContent.RefreshContentParts
 - Removed a using command because it was causing a cached iteminfo to be disposed.
Added DeleteItemAndChildren
This commit is contained in:
Rich
2009-10-22 19:05:08 +00:00
parent 8496e3128a
commit 06c622b5eb
2 changed files with 157 additions and 6 deletions

View File

@@ -981,6 +981,7 @@ namespace VEPROMS.CSLA.Library
string retval = rtf;
retval = Regex.Replace(retval, @"\\b0 ?", "");
retval = Regex.Replace(retval, @"\\b ?", "");
retval = Regex.Replace(retval, @"\\ulnone ?", "");
retval = Regex.Replace(retval, @"\\ul0 ?", "");
retval = Regex.Replace(retval, @"\\ul ?", "");
retval = Regex.Replace(retval, @"\\i0 ?", "");
@@ -1083,9 +1084,20 @@ namespace VEPROMS.CSLA.Library
public static void ResetParts(int itemID)
{
string key = itemID.ToString();
if (_CacheByPrimaryKey.ContainsKey(key))
foreach (ItemInfo itm in _CacheByPrimaryKey[key])
if (_CacheByPrimaryKey.ContainsKey(key))
{
bool firstContent = true;
foreach (ItemInfo itm in _CacheByPrimaryKey[key])
{
itm.ResetParts();
if (itm._MyContent != null && firstContent)
{
firstContent = false;// Only need to do this once.
//RefreshContentParts looks through ContentInfo objects
itm._MyContent.RefreshContentParts();
}
}
}
}
public void ResetParts()
{
@@ -1289,8 +1301,10 @@ namespace VEPROMS.CSLA.Library
_ActiveParent = this.ItemDocVersions[0];
else
{
using (ContentInfo parentContent = ParentContent)
{
//The following using command caused a cached iteminfo to be disposed.
//using (ContentInfo parentContent = ParentContent)
//{
ContentInfo parentContent = ParentContent;
if (parentContent == null || parentContent.ContentItemCount == 0)
_ActiveParent = this;
else
@@ -1300,7 +1314,7 @@ namespace VEPROMS.CSLA.Library
itemID = list[0].ItemID;
_ActiveParent = ItemInfo.Get(itemID);
}
}
//}
}
}
}