Added code to handle Table ROs.
Used generic (static) VlnFlexGrid.ROTableUpdate to determine if the table contents are updated. Added Error Handling around the code that shuts down PROMs Added function to ROFSTLookup to retrieve the Accessory Page ID. Corrected code to handle value changes for Table ROs Created generic (static) VlnFlexGrid.ROTableUpdate to determine if the table contents are updated.
This commit is contained in:
@@ -114,10 +114,10 @@ namespace Volian.Controls.Library
|
||||
{
|
||||
get
|
||||
{
|
||||
return IsGridChanged(this._MyItemInfo.MyContent.MyGrid.Data, this.GetXMLData());
|
||||
return IsGridChanged(this._MyItemInfo.MyContent.MyGrid.Data, this.GetXMLData(), true);
|
||||
}
|
||||
}
|
||||
private bool IsGridChanged(string oldXml, string newXml)
|
||||
private bool IsGridChanged(string oldXml, string newXml, bool checkFormat)
|
||||
{
|
||||
if (this.TableCellEditor.Text.Contains("<NewID>"))
|
||||
return false;
|
||||
@@ -126,16 +126,16 @@ namespace Volian.Controls.Library
|
||||
XmlDocument XdNew = new XmlDocument();
|
||||
XdNew.LoadXml(AdjustHeightAndWidthForDPI(newXml));
|
||||
//check volian borders 1st
|
||||
if (XdNew.SelectSingleNode("C1FlexGrid/Control/MyBorderDetailString").InnerText != XdOld.SelectSingleNode("C1FlexGrid/Control/MyBorderDetailString").InnerText)
|
||||
if (checkFormat && XdNew.SelectSingleNode("C1FlexGrid/Control/MyBorderDetailString").InnerText != XdOld.SelectSingleNode("C1FlexGrid/Control/MyBorderDetailString").InnerText)
|
||||
return true;
|
||||
//check row/col sizes 2nd
|
||||
if (GetRowColSizeString(XdNew) != GetRowColSizeString(XdOld))
|
||||
if (checkFormat && ( GetRowColSizeString(XdNew) != GetRowColSizeString(XdOld)))
|
||||
return true;
|
||||
//check for cell data changes 3rd
|
||||
if (GetCellDataString(XdNew) != GetCellDataString(XdOld))
|
||||
return true;
|
||||
//check for cell format changes 4th
|
||||
if (GetCellFormatString(XdNew) != GetCellFormatString(XdOld))
|
||||
if (checkFormat && GetCellFormatString(XdNew) != GetCellFormatString(XdOld))
|
||||
return true;
|
||||
//check for merged cells 5th
|
||||
if (GetCellMergeString(XdNew) != GetCellMergeString(XdOld))
|
||||
@@ -3589,7 +3589,43 @@ namespace Volian.Controls.Library
|
||||
rtn = ofd.SafeFileName;
|
||||
return rtn;
|
||||
}
|
||||
|
||||
public static List<string> ROTableUpdate(object sender, ROFstInfoROTableUpdateEventArgs args)
|
||||
{
|
||||
string xml = null;
|
||||
string srchtxt = null;
|
||||
Content content = (Content)sender;
|
||||
bool isdirty = false;
|
||||
using (VlnFlexGrid myGrid = new VlnFlexGrid(content.ContentItems[0]))
|
||||
{
|
||||
using (StringReader sr = new StringReader(args.OldGridXml))
|
||||
{
|
||||
myGrid.ReadXml(sr);
|
||||
sr.Close();
|
||||
}
|
||||
string roid = content.ContentRoUsages[0].ROID; //myGrid.ROID;
|
||||
int rodbid = content.ContentRoUsages[0].RODbID; //myGrid.RODbId;
|
||||
myGrid.Visible = false;
|
||||
myGrid.ConvertTableROToGrid(args.ROText, rodbid, roid);
|
||||
myGrid.FixTableCellsHeightWidth();
|
||||
myGrid.AdjustGridControlSize();
|
||||
myGrid.Visible = true;
|
||||
using (StringWriter sw = new StringWriter())
|
||||
{
|
||||
myGrid.WriteXml(sw);
|
||||
xml = sw.GetStringBuilder().ToString();
|
||||
sw.Close();
|
||||
}
|
||||
srchtxt = myGrid.GetSearchableText();
|
||||
isdirty = myGrid.IsGridChanged(args.OldGridXml, xml, false);
|
||||
}
|
||||
List<string> retlist = new List<string>();
|
||||
retlist.Add(srchtxt);
|
||||
if(isdirty)
|
||||
retlist.Add(xml);
|
||||
else
|
||||
retlist.Add(args.OldGridXml);
|
||||
return retlist;
|
||||
}
|
||||
public void ConvertTableROToGrid(string valtext, int rodbid, string roid)
|
||||
{
|
||||
VE_Font vefont = _MyItemInfo.GetItemFont();
|
||||
|
Reference in New Issue
Block a user