FixTransitionText

This commit is contained in:
Rich 2009-07-30 18:58:16 +00:00
parent 39ef8f06a1
commit 0ff065de42

View File

@ -6,6 +6,7 @@ using Csla.Data;
using System.Xml;
using System.Data.SqlClient;
using System.Data;
using System.Text.RegularExpressions;
namespace VEPROMS.CSLA.Library
{
@ -15,6 +16,18 @@ namespace VEPROMS.CSLA.Library
{
return string.Format("{0} {1}", Number, Text);
}
public void FixTransitionText(TransitionInfo tran)
{
string transText = tran.ResolvePathTo();
string lookFor = string.Format(@"<START\]\\v0 (.*?)\\v #Link:Transition.*?:{0} {1}.*?\[END>", tran.TranType, tran.TransitionID);
Match m = Regex.Match(Text, lookFor);
if (m != null && m.Groups.Count > 1)
{
System.Text.RegularExpressions.Group g = m.Groups[1];
if (g.ToString() != transText)
Text = Text.Substring(0, g.Index) + transText + Text.Substring(g.Index + g.Length);
}
}
}
public partial class ContentInfo
{