This commit is contained in:
parent
b10ade8a14
commit
2830a93e24
@ -350,6 +350,22 @@ namespace VEPROMS.CSLA.Library
|
|||||||
OnPropertyChanged("Section_AutoGen");
|
OnPropertyChanged("Section_AutoGen");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
[Browsable(false)]
|
||||||
|
[DisplayName("Section OriginalSteps")]
|
||||||
|
[RefreshProperties(RefreshProperties.All)]
|
||||||
|
[Description("Section OriginalSteps")]
|
||||||
|
public string Section_OriginalSteps
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return _Xp["Section", "OriginalSteps"];
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_Xp["Section", "OriginalSteps"] = value;
|
||||||
|
OnPropertyChanged("Section_OriginalSteps");
|
||||||
|
}
|
||||||
|
}
|
||||||
[Category("Section")]
|
[Category("Section")]
|
||||||
//PROPGRID: Hide Section NumPages
|
//PROPGRID: Hide Section NumPages
|
||||||
[Browsable(false)]
|
[Browsable(false)]
|
||||||
|
@ -296,7 +296,8 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
int ptr = str.IndexOf('<'); //nextDelimiter("<", str, l);
|
int ptr = str.IndexOf('<'); //nextDelimiter("<", str, l);
|
||||||
int cptr = (ptr == -1) ? -1 : str.IndexOf('>'); //nextDelimiter(">", ptr, strlen(ptr));
|
int cptr = (ptr == -1) ? -1 : str.IndexOf('>'); //nextDelimiter(">", ptr, strlen(ptr));
|
||||||
if (ptr == -1 || (ptr > -1 && cptr == -1))
|
// jsj 2/5/10 added "|| (ptr > cptr)" to fix bug where rawvalue = "Insert token for ->Step<- to transition back to."
|
||||||
|
if (ptr == -1 || (ptr > -1 && ((cptr == -1) || (ptr > cptr))))
|
||||||
{
|
{
|
||||||
//add(new seText(str, l));
|
//add(new seText(str, l));
|
||||||
//str += l;
|
//str += l;
|
||||||
|
@ -93,29 +93,36 @@ namespace VEPROMS.CSLA.Library
|
|||||||
return sb.ToString();
|
return sb.ToString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public ItemInfoList LibraryDocumentUsageList
|
public ItemInfoList LibraryDocumentUsageList
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
bool first = true;
|
bool first = true;
|
||||||
ItemInfoList iil = null;
|
ItemInfoList iil = null;
|
||||||
if (DocumentEntries == null) return null;
|
if (DocumentEntries == null) return null;
|
||||||
foreach (EntryInfo myEntry in DocumentEntries)
|
foreach (EntryInfo myEntry in DocumentEntries)
|
||||||
{
|
{
|
||||||
foreach (ItemInfo myitem in myEntry.MyContent.ContentItems)
|
foreach (ItemInfo myitem in myEntry.MyContent.ContentItems)
|
||||||
{
|
{
|
||||||
if (first)
|
if (first)
|
||||||
{
|
{
|
||||||
iil = new ItemInfoList(myitem);
|
iil = new ItemInfoList(myitem);
|
||||||
first = false;
|
first = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
iil.AddItem(myitem);
|
iil.AddItem(myitem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return iil;
|
return iil;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#region DocumentConfig
|
||||||
|
[NonSerialized]
|
||||||
|
private DocumentConfig _DocumentConfig;
|
||||||
|
public DocumentConfig DocumentConfig
|
||||||
|
{ get { return (_DocumentConfig != null ? _DocumentConfig : _DocumentConfig = new DocumentConfig(this)); } }
|
||||||
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
public partial class DocumentInfoList
|
public partial class DocumentInfoList
|
||||||
{
|
{
|
||||||
@ -276,7 +283,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
_MyFile = new FileInfo(string.Format(@"{0}\tmp_{1}{2}{3}", TemporaryFolder, MyDocument.DocID, Unique, MyDocument.FileExtension));
|
_MyFile = new FileInfo(string.Format(@"{0}\tmp_{1}{2}{3}", TemporaryFolder, MyDocument.DocID, Unique, MyDocument.FileExtension));
|
||||||
FileStream fs = _MyFile.Create();
|
FileStream fs = _MyFile.Create();
|
||||||
fs.Write(MyDocument.DocContent, 0, MyDocument.DocContent.Length);
|
if(MyDocument.DocContent != null)fs.Write(MyDocument.DocContent, 0, MyDocument.DocContent.Length);
|
||||||
fs.Close();
|
fs.Close();
|
||||||
_MyFile.CreationTime = _MyDocument.DTS;
|
_MyFile.CreationTime = _MyDocument.DTS;
|
||||||
_MyFile.LastWriteTime = _MyDocument.DTS;
|
_MyFile.LastWriteTime = _MyDocument.DTS;
|
||||||
|
@ -10,6 +10,7 @@ using System.Data.SqlClient;
|
|||||||
using System.Xml;
|
using System.Xml;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
|
using VEPROMS.CSLA.Library;
|
||||||
|
|
||||||
namespace VEPROMS.CSLA.Library
|
namespace VEPROMS.CSLA.Library
|
||||||
{
|
{
|
||||||
@ -1074,6 +1075,86 @@ namespace VEPROMS.CSLA.Library
|
|||||||
retval = Regex.Replace(retval, @"\\'[0-9A-Fa-f][0-9A-Fa-f]", new MatchEvaluator(ReplaceSpecialHexCharacter));
|
retval = Regex.Replace(retval, @"\\'[0-9A-Fa-f][0-9A-Fa-f]", new MatchEvaluator(ReplaceSpecialHexCharacter));
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public VE_Font GetItemFont()
|
||||||
|
{
|
||||||
|
return GetItemFont(ActiveFormat);
|
||||||
|
}
|
||||||
|
|
||||||
|
public VE_Font GetItemFont(FormatInfo fmt)
|
||||||
|
{
|
||||||
|
VE_Font font = null;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
FormatInfo format = (ActiveFormat != null || fmt == null) ? ActiveFormat : fmt;//_MyItemInfo.ActiveFormat;
|
||||||
|
int type = (int)MyContent.Type;//_MyItemInfo.MyContent.Type;
|
||||||
|
switch (type / 10000)
|
||||||
|
{
|
||||||
|
case 0: // procedure
|
||||||
|
font = format.PlantFormat.FormatData.Font;
|
||||||
|
break;
|
||||||
|
case 1: // section
|
||||||
|
font = format.PlantFormat.FormatData.SectData.SectionHeader.Font;
|
||||||
|
break;
|
||||||
|
case 2: // step types
|
||||||
|
int typindx = type - 20000; // what to do for other types rather than steps
|
||||||
|
font = format.PlantFormat.FormatData.StepDataList[typindx].Font;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Console.WriteLine("GetItemFont(): {0} - {1}", ex.GetType(), ex.Message);
|
||||||
|
}
|
||||||
|
return font;
|
||||||
|
}
|
||||||
|
private string RemoveToken(string str, string token)
|
||||||
|
{
|
||||||
|
// if this token is preceeded by another token and followed by a space
|
||||||
|
// leave the preceeding token the ending space
|
||||||
|
string retval = Regex.Replace(str, @"(\\[^ \\?\r\n\t]*)" + token + " ", "$1 ");
|
||||||
|
if (retval != str)
|
||||||
|
Console.WriteLine("leave the preceeding token the ending space");
|
||||||
|
// otherwise replace the token optionally followed by a space
|
||||||
|
retval = Regex.Replace(retval, token + " ?", "");
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
public string RemoveRtfStyles(string rtf)
|
||||||
|
{
|
||||||
|
return RemoveRtfStyles(rtf, ActiveFormat);
|
||||||
|
}
|
||||||
|
public string RemoveRtfStyles(string rtf, FormatInfo fmt)
|
||||||
|
{
|
||||||
|
string retval = rtf;
|
||||||
|
VE_Font TextFont = GetItemFont(fmt);
|
||||||
|
if (TextFont != null)
|
||||||
|
{
|
||||||
|
// remove rtf commands for any styles that were added. Note that if
|
||||||
|
// the entire item has a style, and also contains 'pieces' of text with
|
||||||
|
// the same style, the underlying rtf box removes the embedded rtf commands,
|
||||||
|
// for example, if the entire step is bolded, and 'THEN' has bold on/off
|
||||||
|
// surrounding it, the rtf box removes the bold around the 'THEN'
|
||||||
|
// These remove the command with a following space or the command alone,
|
||||||
|
// either case may exist, because if there are rtf commands following the
|
||||||
|
// style command, there will be no space character following the style command.
|
||||||
|
if (((TextFont.Style & E_Style.Bold) > 0) || ((TextFont.Style & E_Style.MmBold) > 0))
|
||||||
|
{
|
||||||
|
retval = RemoveToken(retval, @"\\b0");
|
||||||
|
retval = RemoveToken(retval, @"\\b");
|
||||||
|
}
|
||||||
|
if ((TextFont.Style & E_Style.Underline) > 0)
|
||||||
|
{
|
||||||
|
retval = RemoveToken(retval, @"\\ulnone");
|
||||||
|
retval = RemoveToken(retval, @"\\ul");
|
||||||
|
}
|
||||||
|
if ((TextFont.Style & E_Style.Italics) > 0)
|
||||||
|
{
|
||||||
|
retval = RemoveToken(retval, @"\\i0");
|
||||||
|
retval = RemoveToken(retval, @"\\i");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
#region Path and Parent
|
#region Path and Parent
|
||||||
public string Path
|
public string Path
|
||||||
@ -1332,7 +1413,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemInfo MyProcedure
|
public ProcedureInfo MyProcedure
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
@ -1340,7 +1421,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
ItemInfo tmp = this;
|
ItemInfo tmp = this;
|
||||||
while (tmp.ActiveParent != null && tmp.ActiveParent.GetType() != typeof(DocVersionInfo))
|
while (tmp.ActiveParent != null && tmp.ActiveParent.GetType() != typeof(DocVersionInfo))
|
||||||
tmp = (ItemInfo)tmp.ActiveParent;
|
tmp = (ItemInfo)tmp.ActiveParent;
|
||||||
return tmp;
|
return ProcedureInfo.Get(tmp.ItemID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private IVEDrillDownReadOnly _ActiveParent = null;
|
private IVEDrillDownReadOnly _ActiveParent = null;
|
||||||
@ -1416,8 +1497,8 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
if (_ActiveFormat == null)
|
if (_ActiveFormat == null) // jsj added check for NULL ActiveParent
|
||||||
_ActiveFormat = (LocalFormat != null ? LocalFormat : ActiveParent.ActiveFormat);
|
_ActiveFormat = (LocalFormat != null ? LocalFormat : (ActiveParent != null)? ActiveParent.ActiveFormat : null);
|
||||||
//Console.WriteLine("Active {0}", (_ActiveFormat == null) ? "_ActiveFormat is null" : _ActiveFormat.Name);
|
//Console.WriteLine("Active {0}", (_ActiveFormat == null) ? "_ActiveFormat is null" : _ActiveFormat.Name);
|
||||||
return _ActiveFormat;
|
return _ActiveFormat;
|
||||||
}
|
}
|
||||||
@ -2012,6 +2093,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
cm.Parameters.AddWithValue("@IncludeLinks", (int) criteria.IncludeLinks);
|
cm.Parameters.AddWithValue("@IncludeLinks", (int) criteria.IncludeLinks);
|
||||||
cm.Parameters.AddWithValue("@IncludeRtfFormatting", criteria.IncludeRtfFormatting ? 1 : 0);
|
cm.Parameters.AddWithValue("@IncludeRtfFormatting", criteria.IncludeRtfFormatting ? 1 : 0);
|
||||||
cm.Parameters.AddWithValue("@IncludeSpecialCharacters", criteria.IncludeSpecialCharacters ? 1 : 0);
|
cm.Parameters.AddWithValue("@IncludeSpecialCharacters", criteria.IncludeSpecialCharacters ? 1 : 0);
|
||||||
|
cm.CommandTimeout = 120;
|
||||||
using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader()))
|
using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader()))
|
||||||
{
|
{
|
||||||
while (dr.Read())
|
while (dr.Read())
|
||||||
|
@ -306,6 +306,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
_AppendMethods.Add("{?.Sect Hdr}", AddOptionalTranGetSectionHdr);
|
_AppendMethods.Add("{?.Sect Hdr}", AddOptionalTranGetSectionHdr);
|
||||||
_AppendMethods.Add("{Sect Title}", AddTranGetSectionHdr);
|
_AppendMethods.Add("{Sect Title}", AddTranGetSectionHdr);
|
||||||
_AppendMethods.Add("{?.Sect Title}", AddOptionalTranGetSectionHdr);
|
_AppendMethods.Add("{?.Sect Title}", AddOptionalTranGetSectionHdr);
|
||||||
|
_AppendMethods.Add("{Sect Num}", AddTranGetSectionNumber);
|
||||||
}
|
}
|
||||||
public static string GetResolvedText(ItemInfo fromInfo, int tranType, ItemInfo toItem, ItemInfo rangeItem)
|
public static string GetResolvedText(ItemInfo fromInfo, int tranType, ItemInfo toItem, ItemInfo rangeItem)
|
||||||
{
|
{
|
||||||
@ -325,6 +326,8 @@ namespace VEPROMS.CSLA.Library
|
|||||||
tb._FormatData = formatInfo.PlantFormat.FormatData;
|
tb._FormatData = formatInfo.PlantFormat.FormatData;
|
||||||
// get the format of the transition string based on this transition's index into the TransData part of
|
// get the format of the transition string based on this transition's index into the TransData part of
|
||||||
// format....
|
// format....
|
||||||
|
if (tranType > tb._FormatData.TransData.TransTypeList.Count)
|
||||||
|
tranType = 0;
|
||||||
tb._TransFormat = tb._FormatData.TransData.TransTypeList[tranType].TransFormat;
|
tb._TransFormat = tb._FormatData.TransData.TransTypeList[tranType].TransFormat;
|
||||||
tb._TransUI = (E_TransUI)tb._FormatData.TransData.TransTypeList[tranType].TransUI;
|
tb._TransUI = (E_TransUI)tb._FormatData.TransData.TransTypeList[tranType].TransUI;
|
||||||
tb._FromItem = fromInfo;
|
tb._FromItem = fromInfo;
|
||||||
@ -342,10 +345,18 @@ namespace VEPROMS.CSLA.Library
|
|||||||
while ((index = tb._TransFormat.IndexOf("{", startIndex)) > -1)
|
while ((index = tb._TransFormat.IndexOf("{", startIndex)) > -1)
|
||||||
{
|
{
|
||||||
if (index > startIndex) nonToken = tb._TransFormat.Substring(startIndex, index - startIndex);
|
if (index > startIndex) nonToken = tb._TransFormat.Substring(startIndex, index - startIndex);
|
||||||
|
if (startIndex == 0 && nonToken != null && nonToken.Length > 0)
|
||||||
|
{
|
||||||
|
tb._Results.Append(nonToken);
|
||||||
|
//textAdded = true;
|
||||||
|
nonToken = "";
|
||||||
|
}
|
||||||
int endtokn = tb._TransFormat.IndexOf("}", index);
|
int endtokn = tb._TransFormat.IndexOf("}", index);
|
||||||
string token = tb._TransFormat.Substring(index, endtokn - index + 1);
|
string token = tb._TransFormat.Substring(index, endtokn - index + 1);
|
||||||
if (_AppendMethods.ContainsKey(token))
|
if (_AppendMethods.ContainsKey(token))
|
||||||
textAdded = _AppendMethods[token](textAdded, tb, token, nonToken);
|
textAdded = _AppendMethods[token](textAdded, tb, token, nonToken);
|
||||||
|
else
|
||||||
|
tb._Results.Append("\\"+token.Substring(0,token.Length -1)+"\\}");
|
||||||
startIndex = endtokn + 1;
|
startIndex = endtokn + 1;
|
||||||
if (startIndex >= tb._TransFormat.Length) break;
|
if (startIndex >= tb._TransFormat.Length) break;
|
||||||
}
|
}
|
||||||
@ -548,6 +559,14 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
private static bool AddTranGetSectionNumber(bool textAdded, TransitionBuilder tb, string token, string nonToken)
|
||||||
|
{
|
||||||
|
string retstr = TranGetSectionNumber(tb._ToItem);
|
||||||
|
if (textAdded) Append(tb, nonToken, false);
|
||||||
|
Append(tb, retstr, true);
|
||||||
|
if (retstr != null && retstr != "") return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
private static string CapFirstLetterOnly(string retstr, int p)
|
private static string CapFirstLetterOnly(string retstr, int p)
|
||||||
{
|
{
|
||||||
string lretstr = retstr;
|
string lretstr = retstr;
|
||||||
|
@ -225,6 +225,14 @@ namespace VEPROMS.CSLA.Library
|
|||||||
return _TransData == null? _TransData = new TransData(SelectSingleNode("TransData")):_TransData;
|
return _TransData == null? _TransData = new TransData(SelectSingleNode("TransData")):_TransData;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
private ROData _ROData;
|
||||||
|
public ROData ROData
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return _ROData == null ? _ROData = new ROData(SelectSingleNode("ROData")) : _ROData;
|
||||||
|
}
|
||||||
|
}
|
||||||
private StepDataList _StepDataList;
|
private StepDataList _StepDataList;
|
||||||
public StepDataList StepDataList
|
public StepDataList StepDataList
|
||||||
{
|
{
|
||||||
@ -4446,9 +4454,9 @@ namespace VEPROMS.CSLA.Library
|
|||||||
#endregion
|
#endregion
|
||||||
#region RoData
|
#region RoData
|
||||||
[TypeConverter(typeof(ExpandableObjectConverter))]
|
[TypeConverter(typeof(ExpandableObjectConverter))]
|
||||||
public class RoData : vlnFormatItem
|
public class ROData : vlnFormatItem
|
||||||
{
|
{
|
||||||
public RoData(XmlNode xmlNode) : base(xmlNode) { }
|
public ROData(XmlNode xmlNode) : base(xmlNode) { }
|
||||||
private LazyLoad<bool> _AllUnits;
|
private LazyLoad<bool> _AllUnits;
|
||||||
public bool AllUnits
|
public bool AllUnits
|
||||||
{
|
{
|
||||||
|
@ -218,7 +218,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
if (xp != null)
|
if (xp != null)
|
||||||
{
|
{
|
||||||
XmlNodeList xl = xp.SelectNodes(path);
|
XmlNodeList xl = xp.SelectNodes(path);
|
||||||
if (xl != null)
|
if (xl != null && xl.Count > 0)
|
||||||
return xl;
|
return xl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user