C2018-039: Upgrade – User Control of Format
This commit is contained in:
@@ -1027,7 +1027,8 @@ i = 0;
|
||||
//}
|
||||
VEPROMS.CSLA.Library.FormatInfo activeFormat = mySection.ActiveFormat;
|
||||
VEPROMS.CSLA.Library.DocStyle docStyle = mySection.MyDocStyle;
|
||||
Volian.Svg.Library.Svg mySvg = null;
|
||||
Volian.Svg.Library.Svg mySvg = null;
|
||||
// the following line fills in the svg/svggroup/svgparts for all that is defined in the genmac definition (svg for plant)
|
||||
mySvg = SvgSerializer<Volian.Svg.Library.Svg>.StringDeserialize(BuildMyText(activeFormat));
|
||||
mySvg.ViewBox.Height = 1100;
|
||||
mySvg.ViewBox.Width = 850;
|
||||
@@ -1209,6 +1210,31 @@ i = 0;
|
||||
private string BuildMyText(VEPROMS.CSLA.Library.FormatInfo activeFormat)
|
||||
{
|
||||
string sGenMac = activeFormat.GenMac;
|
||||
FormatInfo fibase = activeFormat;
|
||||
// If this format has checkoffs (go through docstyles to see if any sections 'usecheckoffs'), then see if the ucf checkoffs are
|
||||
// defined in the format's genmac:
|
||||
string sGenMacBase = null;
|
||||
foreach (DocStyle ds in activeFormat.PlantFormat.DocStyles.DocStyleList)
|
||||
{
|
||||
if (ds.Inactive == false && ds.UseCheckOffs && !sGenMac.ToUpper().Contains("C100"))
|
||||
{
|
||||
while (fibase.FormatID != fibase.ParentID) fibase = fibase.MyParent;
|
||||
sGenMacBase = fibase.GenMac;
|
||||
if (sGenMacBase != null && sGenMacBase != "")
|
||||
{
|
||||
XmlDocument xDocGenMacBase = new XmlDocument();
|
||||
xDocGenMacBase.LoadXml(sGenMacBase);
|
||||
sGenMacBase = xDocGenMacBase.DocumentElement.InnerXml;
|
||||
sGenMacBase = sGenMacBase.Replace("xmlns=\"http://www.w3.org/2000/svg\"", "");
|
||||
// replace fonts with hls fontname & size
|
||||
string bsfontfamily = activeFormat.PlantFormat.FormatData.StepDataList[0].Font.Family;
|
||||
string bsfontsize = activeFormat.PlantFormat.FormatData.StepDataList[0].Font.Size.ToString();
|
||||
sGenMacBase = sGenMacBase.Replace("{family}", bsfontfamily);
|
||||
sGenMacBase = sGenMacBase.Replace("{size}", bsfontsize);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (sGenMac == null || sGenMac == "")
|
||||
{
|
||||
// If subformat and does not have its own genmac, find an inherited genmac.
|
||||
@@ -1219,7 +1245,11 @@ i = 0;
|
||||
tmpf = FormatInfo.Get(tmpf.ParentID);
|
||||
}
|
||||
if (sGenMac == null || sGenMac == "")
|
||||
sGenMac = "<svg/>";// return "";
|
||||
sGenMac = "<svg></svg>";
|
||||
}
|
||||
if (sGenMacBase != null && sGenMacBase != "")
|
||||
{
|
||||
sGenMac = sGenMac.Replace("</svg>", sGenMacBase + "</svg>");
|
||||
}
|
||||
if (!sGenMac.Contains("xmlns"))
|
||||
sGenMac = sGenMac.Replace("<svg ", "<svg xmlns='http://www.w3.org/2000/svg' ");
|
||||
|
Reference in New Issue
Block a user