Move - convert formats for 16 bit to old

This commit is contained in:
2026-08-26 10:17:15 -04:00
parent 46feeed669
commit 51d52fa0c7
94 changed files with 0 additions and 26039 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

File diff suppressed because it is too large Load Diff
-58
View File
@@ -1,58 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
//
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.*")]
//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
// (*) If no key is specified, the assembly is not signed.
// (*) KeyName refers to a key that has been installed in the Crypto Service
// Provider (CSP) on your machine. KeyFile refers to a file which contains
// a key.
// (*) If the KeyFile and the KeyName values are both specified, the
// following processing occurs:
// (1) If the KeyName can be found in the CSP, that key is used.
// (2) If the KeyName does not exist and the KeyFile does exist, the key
// in the KeyFile is installed into the CSP and used.
// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
// When specifying the KeyFile, the location of the KeyFile should be
// relative to the project output directory which is
// %Project Directory%\obj\<configuration>. For example, if your KeyFile is
// located in the project directory, you would specify the AssemblyKeyFile
// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
// documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]
Binary file not shown.
Binary file not shown.
-76
View File
@@ -1,76 +0,0 @@
using System;
using System.IO;
using System.Collections.Generic;
using System.Text;
using System.Xml;
namespace fmtxml
{
class EntireFormat
{
private string MyPath;
public EntireFormat(string mxml, string path)
{
MyPath = path;
XmlDocument xmldoc = new XmlDocument();
XmlComment copyright = xmldoc.CreateComment("Proprietary Information - Copyright 2012 - Volian Enterprises, Inc. All rights reserved.");
XmlElement top = xmldoc.CreateElement("PlantFormat");
xmldoc.AppendChild(copyright);
xmldoc.AppendChild(top);
try
{
XmlReaderSettings settings = new XmlReaderSettings();
settings.IgnoreWhitespace = true;
StreamReader strrdr = new StreamReader(mxml);
XmlTextReader rdr = new XmlTextReader(strrdr);
using (rdr)
{
rdr.MoveToContent();
XmlNode fmt = xmldoc.ReadNode(rdr);
top.AppendChild(fmt);
}
rdr.Close();
// load page xml
string pagename = mxml.Substring(0, mxml.Length - 5) + "p.xml";
using (XmlReader reader = XmlReader.Create(pagename, settings))
{
reader.MoveToContent();
XmlNode pag = xmldoc.ReadNode(reader);
top.AppendChild(pag);
}
string docname = mxml.Substring(0, mxml.Length - 5) + "d.xml";
using (XmlReader reader = XmlReader.Create(docname, settings))
{
reader.MoveToContent();
XmlNode doc = xmldoc.ReadNode(reader);
top.AppendChild(doc);
}
string outname = MyPath + @"\fmtall\" + mxml.Substring(mxml.IndexOf("\\")+1,mxml.Length - 13) + "all.xml";
XmlWriterSettings settingsout = new XmlWriterSettings();
settingsout.Encoding = Encoding.Unicode;
settingsout.Indent = true;
settingsout.IndentChars = "\t";
XmlWriter xmlwrite = XmlWriter.Create(outname,settingsout);
xmldoc.WriteContentTo(xmlwrite);
xmlwrite.Close();
XmlDocument newDoc = new XmlDocument();
newDoc.Load(outname);
XmlNodeReader xtr = new XmlNodeReader(newDoc);
XmlTextWriter xtw = new XmlTextWriter(outname, Encoding.Unicode);
xtw.Formatting = Formatting.Indented;
xtw.Indentation = 1;
xtw.IndentChar = '\t';
xtw.WriteNode(xtr, true);
xtr.Close();
xtw.Close();
}
catch (Exception ex)
{
Console.WriteLine("Error on merge, format = {0}, msg = {1}", mxml, ex.Message);
}
}
}
}
Binary file not shown.
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
-689
View File
@@ -1,689 +0,0 @@
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
namespace fmtxml
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.Button btnCvtPagDoc;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button btnExit;
private System.Windows.Forms.ListBox listBox1;
private System.Windows.Forms.Button btnCvtGenmac;
private System.Windows.Forms.Button btnCvtXmlToSVG;
//private C1.C1Pdf.C1PdfDocument c1PdfDocument1;
private Button btnCvtFormat;
private Button btnMergeFmtPagDoc;
private Label lblPathFmt;
private Button btnBrowseFmt;
private TextBox tbFmtPath;
private TextBox tbGenmacPath;
private Button btnBrowseGenmac;
private Label lblPathGenmac;
private Label lblResult;
private TextBox tbResultPath;
private Button btnBrowseResult;
private StatusStrip statusStrip1;
private ToolStripStatusLabel tsslStatus;
private Button btnRtfToSvg;
private Button btnWestinghouse;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
if (Directory.Exists(@"c:\16bit\ve-proms\format"))
tbFmtPath.Text = @"c:\16bit\ve-proms\format";
else if (Directory.Exists(@"c:\16-bit\ve-proms\format"))
tbFmtPath.Text = @"c:\16-bit\ve-proms\format";
else
MessageBox.Show("Specify Path for format files.", "Cannot find 16 Bit Formats", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
tbGenmacPath.Text = @"C:\16bit\promsnt\genmac";
tbResultPath.Text = @"c:\development\";
//
// TODO: Add any constructor code after InitializeComponent call
//
}
public string MyStatus
{
get { return tsslStatus.Text; }
set { tsslStatus.Text = value; Application.DoEvents(); }
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.btnCvtPagDoc = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.btnExit = new System.Windows.Forms.Button();
this.listBox1 = new System.Windows.Forms.ListBox();
this.btnCvtGenmac = new System.Windows.Forms.Button();
this.btnCvtXmlToSVG = new System.Windows.Forms.Button();
this.btnCvtFormat = new System.Windows.Forms.Button();
this.btnMergeFmtPagDoc = new System.Windows.Forms.Button();
this.lblPathFmt = new System.Windows.Forms.Label();
this.btnBrowseFmt = new System.Windows.Forms.Button();
this.tbFmtPath = new System.Windows.Forms.TextBox();
this.tbGenmacPath = new System.Windows.Forms.TextBox();
this.btnBrowseGenmac = new System.Windows.Forms.Button();
this.lblPathGenmac = new System.Windows.Forms.Label();
this.lblResult = new System.Windows.Forms.Label();
this.tbResultPath = new System.Windows.Forms.TextBox();
this.btnBrowseResult = new System.Windows.Forms.Button();
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
this.tsslStatus = new System.Windows.Forms.ToolStripStatusLabel();
this.btnRtfToSvg = new System.Windows.Forms.Button();
this.btnWestinghouse = new System.Windows.Forms.Button();
this.statusStrip1.SuspendLayout();
this.SuspendLayout();
//
// btnCvtPagDoc
//
this.btnCvtPagDoc.Location = new System.Drawing.Point(217, 63);
this.btnCvtPagDoc.Name = "btnCvtPagDoc";
this.btnCvtPagDoc.Size = new System.Drawing.Size(201, 51);
this.btnCvtPagDoc.TabIndex = 0;
this.btnCvtPagDoc.Text = "Convert Page and Doc Styles in format directory (Step 2)";
this.btnCvtPagDoc.Click += new System.EventHandler(this.btnCvtPagDoc_Click);
//
// label1
//
this.label1.Location = new System.Drawing.Point(12, 237);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(200, 18);
this.label1.TabIndex = 1;
this.label1.Text = "Converted:";
//
// btnExit
//
this.btnExit.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnExit.Location = new System.Drawing.Point(560, 224);
this.btnExit.Name = "btnExit";
this.btnExit.Size = new System.Drawing.Size(63, 28);
this.btnExit.TabIndex = 2;
this.btnExit.Text = "Exit";
this.btnExit.Click += new System.EventHandler(this.btnExit_Click);
//
// listBox1
//
this.listBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.listBox1.ItemHeight = 16;
this.listBox1.Location = new System.Drawing.Point(10, 258);
this.listBox1.Name = "listBox1";
this.listBox1.Size = new System.Drawing.Size(613, 212);
this.listBox1.TabIndex = 3;
//
// btnCvtGenmac
//
this.btnCvtGenmac.Enabled = false;
this.btnCvtGenmac.Location = new System.Drawing.Point(10, 172);
this.btnCvtGenmac.Name = "btnCvtGenmac";
this.btnCvtGenmac.Size = new System.Drawing.Size(183, 46);
this.btnCvtGenmac.TabIndex = 4;
this.btnCvtGenmac.Text = "Convert genmac files to XML (Genmac Step 1)";
this.btnCvtGenmac.Click += new System.EventHandler(this.btnCvtGenmac_Click);
//
// btnCvtXmlToSVG
//
this.btnCvtXmlToSVG.Enabled = false;
this.btnCvtXmlToSVG.Location = new System.Drawing.Point(199, 170);
this.btnCvtXmlToSVG.Name = "btnCvtXmlToSVG";
this.btnCvtXmlToSVG.Size = new System.Drawing.Size(183, 50);
this.btnCvtXmlToSVG.TabIndex = 5;
this.btnCvtXmlToSVG.Text = "Convert Genmac_XML to SVG (Genmac Step 2)";
this.btnCvtXmlToSVG.Click += new System.EventHandler(this.btnCvtXmlToSVG_Click);
//
// btnCvtFormat
//
this.btnCvtFormat.Location = new System.Drawing.Point(10, 63);
this.btnCvtFormat.Name = "btnCvtFormat";
this.btnCvtFormat.Size = new System.Drawing.Size(201, 51);
this.btnCvtFormat.TabIndex = 8;
this.btnCvtFormat.Text = "Convert Format in format directory (Step 1)";
this.btnCvtFormat.UseVisualStyleBackColor = true;
this.btnCvtFormat.Click += new System.EventHandler(this.btnCvtFormat_Click);
//
// btnMergeFmtPagDoc
//
this.btnMergeFmtPagDoc.Location = new System.Drawing.Point(424, 63);
this.btnMergeFmtPagDoc.Name = "btnMergeFmtPagDoc";
this.btnMergeFmtPagDoc.Size = new System.Drawing.Size(201, 51);
this.btnMergeFmtPagDoc.TabIndex = 9;
this.btnMergeFmtPagDoc.Text = "Integrate Fmt, Doc & Pag to single xml (Step 3)";
this.btnMergeFmtPagDoc.UseVisualStyleBackColor = true;
this.btnMergeFmtPagDoc.Click += new System.EventHandler(this.btnMergeFmtPagDoc_Click);
//
// lblPathFmt
//
this.lblPathFmt.AutoSize = true;
this.lblPathFmt.Location = new System.Drawing.Point(7, 42);
this.lblPathFmt.Name = "lblPathFmt";
this.lblPathFmt.Size = new System.Drawing.Size(139, 17);
this.lblPathFmt.TabIndex = 10;
this.lblPathFmt.Text = "Path To Format Files";
//
// btnBrowseFmt
//
this.btnBrowseFmt.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnBrowseFmt.Location = new System.Drawing.Point(476, 36);
this.btnBrowseFmt.Name = "btnBrowseFmt";
this.btnBrowseFmt.Size = new System.Drawing.Size(153, 23);
this.btnBrowseFmt.TabIndex = 11;
this.btnBrowseFmt.Text = "Browse (Format)";
this.btnBrowseFmt.UseVisualStyleBackColor = true;
this.btnBrowseFmt.Click += new System.EventHandler(this.btnBrowseFmt_Click);
//
// tbFmtPath
//
this.tbFmtPath.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.tbFmtPath.Location = new System.Drawing.Point(155, 37);
this.tbFmtPath.Name = "tbFmtPath";
this.tbFmtPath.Size = new System.Drawing.Size(303, 22);
this.tbFmtPath.TabIndex = 12;
//
// tbGenmacPath
//
this.tbGenmacPath.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.tbGenmacPath.Enabled = false;
this.tbGenmacPath.Location = new System.Drawing.Point(155, 144);
this.tbGenmacPath.Name = "tbGenmacPath";
this.tbGenmacPath.Size = new System.Drawing.Size(303, 22);
this.tbGenmacPath.TabIndex = 15;
//
// btnBrowseGenmac
//
this.btnBrowseGenmac.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnBrowseGenmac.Enabled = false;
this.btnBrowseGenmac.Location = new System.Drawing.Point(476, 143);
this.btnBrowseGenmac.Name = "btnBrowseGenmac";
this.btnBrowseGenmac.Size = new System.Drawing.Size(153, 23);
this.btnBrowseGenmac.TabIndex = 14;
this.btnBrowseGenmac.Text = "Browse (Genmac)";
this.btnBrowseGenmac.UseVisualStyleBackColor = true;
this.btnBrowseGenmac.Click += new System.EventHandler(this.btnBrowseGenmac_Click);
//
// lblPathGenmac
//
this.lblPathGenmac.AutoSize = true;
this.lblPathGenmac.Enabled = false;
this.lblPathGenmac.Location = new System.Drawing.Point(7, 149);
this.lblPathGenmac.Name = "lblPathGenmac";
this.lblPathGenmac.Size = new System.Drawing.Size(148, 17);
this.lblPathGenmac.TabIndex = 13;
this.lblPathGenmac.Text = "Path To Genmac Files";
//
// lblResult
//
this.lblResult.AutoSize = true;
this.lblResult.Location = new System.Drawing.Point(16, 10);
this.lblResult.Name = "lblResult";
this.lblResult.Size = new System.Drawing.Size(163, 17);
this.lblResult.TabIndex = 16;
this.lblResult.Text = "Path To Result Directory";
//
// tbResultPath
//
this.tbResultPath.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.tbResultPath.Location = new System.Drawing.Point(185, 8);
this.tbResultPath.Name = "tbResultPath";
this.tbResultPath.Size = new System.Drawing.Size(273, 22);
this.tbResultPath.TabIndex = 17;
//
// btnBrowseResult
//
this.btnBrowseResult.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnBrowseResult.Location = new System.Drawing.Point(476, 3);
this.btnBrowseResult.Name = "btnBrowseResult";
this.btnBrowseResult.Size = new System.Drawing.Size(153, 24);
this.btnBrowseResult.TabIndex = 18;
this.btnBrowseResult.Text = "Browse (Result)";
this.btnBrowseResult.UseVisualStyleBackColor = true;
this.btnBrowseResult.Click += new System.EventHandler(this.btnBrowseResult_Click);
//
// statusStrip1
//
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.tsslStatus});
this.statusStrip1.Location = new System.Drawing.Point(0, 545);
this.statusStrip1.Name = "statusStrip1";
this.statusStrip1.Size = new System.Drawing.Size(631, 25);
this.statusStrip1.TabIndex = 19;
this.statusStrip1.Text = "statusStrip1";
//
// tsslStatus
//
this.tsslStatus.Name = "tsslStatus";
this.tsslStatus.Size = new System.Drawing.Size(50, 20);
this.tsslStatus.Text = "Ready";
//
// btnRtfToSvg
//
this.btnRtfToSvg.Location = new System.Drawing.Point(424, 167);
this.btnRtfToSvg.Name = "btnRtfToSvg";
this.btnRtfToSvg.Size = new System.Drawing.Size(182, 51);
this.btnRtfToSvg.TabIndex = 20;
this.btnRtfToSvg.Text = "Convert Genmac RTF to SVG (GenMac One Step)";
this.btnRtfToSvg.Click += new System.EventHandler(this.btnRtfToSvg_Click);
//
// btnWestinghouse
//
this.btnWestinghouse.Location = new System.Drawing.Point(387, 224);
this.btnWestinghouse.Name = "btnWestinghouse";
this.btnWestinghouse.Size = new System.Drawing.Size(164, 26);
this.btnWestinghouse.TabIndex = 21;
this.btnWestinghouse.Text = "Copy New Formats";
this.btnWestinghouse.UseVisualStyleBackColor = true;
this.btnWestinghouse.Click += new System.EventHandler(this.btnWestinghouse_Click);
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 15);
this.ClientSize = new System.Drawing.Size(631, 570);
this.Controls.Add(this.btnWestinghouse);
this.Controls.Add(this.btnRtfToSvg);
this.Controls.Add(this.statusStrip1);
this.Controls.Add(this.btnBrowseResult);
this.Controls.Add(this.tbResultPath);
this.Controls.Add(this.lblResult);
this.Controls.Add(this.tbGenmacPath);
this.Controls.Add(this.btnBrowseGenmac);
this.Controls.Add(this.lblPathGenmac);
this.Controls.Add(this.tbFmtPath);
this.Controls.Add(this.btnBrowseFmt);
this.Controls.Add(this.lblPathFmt);
this.Controls.Add(this.btnMergeFmtPagDoc);
this.Controls.Add(this.btnCvtFormat);
this.Controls.Add(this.btnCvtXmlToSVG);
this.Controls.Add(this.btnCvtGenmac);
this.Controls.Add(this.listBox1);
this.Controls.Add(this.btnExit);
this.Controls.Add(this.label1);
this.Controls.Add(this.btnCvtPagDoc);
this.Name = "Form1";
this.Text = "Form1";
this.statusStrip1.ResumeLayout(false);
this.statusStrip1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private static string[] _ExcludeList = "ANO,ATA,ATLAS,LPL,MYA,NAE,NAI,NAS,PAC,RBN,ROB,SCE,SRS,VP,WPF,YAE".Split(",".ToCharArray());
public static bool Excluded(FileInfo fi)
{
foreach (string prefix in _ExcludeList)
if (fi.Name.ToUpper().StartsWith(prefix)) return true;
return false;
}
private void btnCvtPagDoc_Click(object sender, System.EventArgs e)
{
CleanupDestinationFolder("*p.xml");
CleanupDestinationFolder("*d.xml");
// get all of the files in the e:\ve-proms\format directory.
DirectoryInfo di = new DirectoryInfo(tbFmtPath.Text); // "C:\\16bit\\ve-proms\\format");
FileInfo[] fis = di.GetFiles("*.pag");
ClearListBox();
foreach (FileInfo fi in fis)
{
if (!Excluded(fi))
{
string fn = fi.Name.Substring(0, fi.Name.Length - 4);
AddFileToListBox(fi);
FmtToXml fx = new FmtToXml(fn, tbFmtPath.Text);
}
}
fis = di.GetFiles("*.z*");
foreach (FileInfo fi in fis)
{
if (!Excluded(fi))
{
AddFileToListBox(fi);
FmtToXml fx = new FmtToXml(fi.Name, tbFmtPath.Text);
}
}
MessageBox.Show("DONE Converting Page and Document Styles to XML");
}
private void AddFileToListBox(FileInfo fi)
{
this.listBox1.Items.Add(fi.Name);
this.listBox1.SelectedIndex = this.listBox1.Items.Count - 1;
MyStatus = "Processing " + fi.Name;
Application.DoEvents();
}
private void ClearListBox()
{
listBox1.Items.Clear();
}
private void btnExit_Click(object sender, System.EventArgs e)
{
Application.Exit();
}
private void btnCvtGenmac_Click(object sender, System.EventArgs e)
{
// before doing the genmac change, use cpp -DRTF file after genmac.h
// has been emptied out on files in \promsnt\genmac. This creates
// precompiled files only, i.e. gets rid of some of the junk in the files.
// This conversion is done 1 time. After 32-bit print is done, the xml
// files will be used rather than the genmac.
DirectoryInfo di = new DirectoryInfo(tbGenmacPath.Text + @"\preproc"); // "C:\\16bit\\promsnt\\genmac\\preproc");
FileInfo[] fis = di.GetFiles("*.i");
ClearListBox();
foreach (FileInfo fi in fis)
{
// results go to e:\\proms.net\\genmac.xml\\convert
if (!Excluded(fi))
{
AddFileToListBox(fi);
GenToXml gn = new GenToXml(fi.Name, tbGenmacPath.Text, tbResultPath.Text);
}
}
MessageBox.Show("DONE Converting genmacs to XML - Results are in " + tbResultPath.Text + @"\genmacall\convert");
}
private void btnCvtXmlToSVG_Click(object sender, System.EventArgs e)
{
// delete current svg's
DirectoryInfo disvg = new DirectoryInfo(tbResultPath.Text + @"\genmacall"); //(@"C:\development\proms.net\genmac.xml");
FileInfo[] fissvg = disvg.GetFiles("*.svg");
foreach (FileInfo fi in fissvg)fi.Delete();
DirectoryInfo di = new DirectoryInfo(tbResultPath.Text + @"\genmacall\convert");
FileInfo[] fis = di.GetFiles("*.xml");
ClearListBox();
foreach (FileInfo fi in fis)
{
// results go to e:\proms.net\genmac.xml
AddFileToListBox(fi);
GenXmlToSvg gn = new GenXmlToSvg(fi.Name, tbResultPath.Text);
}
MessageBox.Show("DONE Converting genmacs.xmls to drawing svg - Results are in " + tbResultPath.Text + @"\genmacall");
}
private void btnCvtFormat_Click(object sender, EventArgs e)
{
CleanupDestinationFolder("*f.xml");
DateTime tStart = DateTime.Now;
// first convert base format - for now use genfmt.
MyStatus = "Processing Base";
FmtFileToXml gx = new FmtFileToXml(null, "BASE", "GEN", tbFmtPath.Text); // Create BASE from GEN format
// get all of the format files in the e:\ve-proms\format directory.
DirectoryInfo di = new DirectoryInfo(tbFmtPath.Text); // "C:\\16bit\\ve-proms\\format");
//DirectoryInfo di = new DirectoryInfo("E:\\proms.net\\exe\\fmtxml");
// This excludes Background format files *.BFM which use a different structure
FileInfo[] fis = di.GetFiles("*.fmt");
ClearListBox();
foreach (FileInfo fi in fis)
{
if (!Excluded(fi))
{
string fn = fi.Name.Substring(0, fi.Name.Length - 4);
if (fn.ToLower() != "base")
{
AddFileToListBox(fi);
FmtFileToXml fx = new FmtFileToXml(gx, fn, fn, tbFmtPath.Text);
}
}
}
MyStatus = string.Format("DONE Converting Formats to XML {0:F3} seconds", TimeSpan.FromTicks(DateTime.Now.Ticks - tStart.Ticks).TotalSeconds);
MessageBox.Show("DONE Converting Formats to XML");
}
private void CleanupDestinationFolder(string pattern)
{
DirectoryInfo di = new DirectoryInfo("fmt_xml");
if (di.Exists == false)
di.Create();
FileInfo[] fis = di.GetFiles(pattern);
foreach (FileInfo fi in fis) fi.Delete();
}
private void btnMergeFmtPagDoc_Click(object sender, EventArgs e)
{
ClearResults(tbResultPath.Text);
DateTime tStart = DateTime.Now;
MyStatus = "Merging...";
// get all of the generated xml format files in the fmt_xml directory and merge
// the fmt/doc/pag & subformats into one file.
DirectoryInfo di = new DirectoryInfo("fmt_xml");
//testDirectoryInfo di = new DirectoryInfo("E:\\proms.net\\exe\\fmtxml");
FileInfo[] fis = di.GetFiles("*f.xml");
ClearListBox();
foreach (FileInfo fi in fis)
{
// see if all three, format, doc & pag exist - if not, print error,
// if so, process
string docname = "fmt_xml\\" + fi.Name.Substring(0, fi.Name.Length - 5) + "p.xml";
string pagname = "fmt_xml\\" + fi.Name.Substring(0, fi.Name.Length - 5) + "d.xml";
if (File.Exists(docname) && File.Exists(pagname))
{
AddFileToListBox(fi);
EntireFormat ef = new EntireFormat("fmt_xml\\" + fi.Name, tbResultPath.Text);
}
else
Console.WriteLine("For {0}, page or document file does not exist.", fi.Name);
}
MyStatus = string.Format("DONE Merging Formats {0:F3} seconds", TimeSpan.FromTicks(DateTime.Now.Ticks - tStart.Ticks).TotalSeconds);
MessageBox.Show("DONE Merging Formats - Results are in " + tbResultPath.Text + @"fmtall'");
}
private void ClearResults(string path)
{
DirectoryInfo di = new DirectoryInfo(path);
if (di.Exists == false) return;
di = di.GetDirectories("fmtall")[0];
FileInfo[] fis = di.GetFiles("*.xml");
foreach (FileInfo fi in fis)
{
if (fi.IsReadOnly) fi.IsReadOnly = false;
fi.Delete();
}
}
private void btnBrowseFmt_Click(object sender, EventArgs e)
{
FolderBrowserDialog fbd = new FolderBrowserDialog();
fbd.SelectedPath = tbFmtPath.Text;
if (fbd.ShowDialog() == DialogResult.OK)
if (Directory.Exists(fbd.SelectedPath)) tbFmtPath.Text = fbd.SelectedPath;
}
private void btnBrowseGenmac_Click(object sender, EventArgs e)
{
FolderBrowserDialog fbd = new FolderBrowserDialog();
fbd.SelectedPath = tbFmtPath.Text;
if (fbd.ShowDialog() == DialogResult.OK)
{
if (Directory.Exists(fbd.SelectedPath)) tbGenmacPath.Text = fbd.SelectedPath;
}
}
private void btnBrowseResult_Click(object sender, EventArgs e)
{
FolderBrowserDialog fbd = new FolderBrowserDialog();
fbd.SelectedPath = tbResultPath.Text;
if (fbd.ShowDialog() == DialogResult.OK)
{
if (Directory.Exists(fbd.SelectedPath)) tbResultPath.Text = fbd.SelectedPath + @"\";
}
}
private void btnRtfToSvg_Click(object sender, EventArgs e)
{
// delete current svg's
DirectoryInfo disvg = new DirectoryInfo(tbResultPath.Text + @"\genmacall"); //(@"C:\development\proms.net\genmac.xml");
FileInfo[] fissvg = disvg.GetFiles("*.svg");
foreach (FileInfo fi in fissvg)
{
if (fi.IsReadOnly) fi.IsReadOnly = false;
fi.Delete();
}
DirectoryInfo di = new DirectoryInfo(tbFmtPath.Text);
FileInfo[] fis = di.GetFiles("*.rtf");
ClearListBox();
foreach (FileInfo fi in fis)
{
if (!Excluded(fi))
{
// results go to e:\proms.net\genmac.xml
AddFileToListBox(fi);
RtfToSvg myConvert = new RtfToSvg(fi);
if (myConvert.IsGenMac)
myConvert.Save(tbResultPath.Text + @"genmacall\" + fi.Name.ToLower().Replace(".rtf", ".svg"));
}
}
// The NSPIFG2 file did not exist. Copy over NSPIFG to it.
FileInfo fix = new FileInfo(tbResultPath.Text + @"genmacall\nspifg.svg");
fix.CopyTo(tbResultPath.Text + @"genmacall\nspifg2.svg");
MessageBox.Show("DONE converting GenMac RTF files to drawing svg - Results are in " + tbResultPath.Text + @"genmacall");
}
private void btnWestinghouse_Click(object sender, EventArgs e)
{
DateTime tStart = DateTime.Now;
CopyFormat("wst1all.xml");
CopyFormat("wst2all.xml");
CopyFormat("wstcklall.xml");
CopyFormat("wstalrall.xml");
CopyFormat("wstbckall.xml");
CopyFormat("wstdcsall.xml");
CopySVG("wst1.svg");
CopySVG("wst2.svg");
CopySVG("wstckl.svg");
CopySVG("wstalr.svg");
CopySVG("wstbck.svg");
CopySVG("wstdcs.svg");
CopyFormat("fnpnmpall.xml");
CopySVG("fnpnmp.svg");
CopyFormat("hlpfsgall.xml");
CopySVG("hlpfsg.svg");
// Comanche Peak Flex Format
CopyFormat("ComPeakFlexall.xml");
CopySVG("ComPeakFlex.svg");
MyStatus = string.Format("Copied Developed Formats/Genmacs {0:F3} seconds", TimeSpan.FromTicks(DateTime.Now.Ticks - tStart.Ticks).TotalSeconds);
MessageBox.Show("DONE Copy Developed Formats/Genmacs - Results are in " + tbResultPath.Text + @"fmtall' and 'genmacall'");
}
private void CopyFormat(string fileName)
{
FileInfo fi1 = new FileInfo(Application.StartupPath + "\\" + fileName);
FileInfo fi2 = new FileInfo(@"..\..\" + fileName);
if (fi2.Exists && (!fi1.Exists ||(fi1.Exists && fi2.LastAccessTimeUtc > fi1.LastAccessTimeUtc)))
{
if (fi1.Exists && fi1.IsReadOnly) fi1.IsReadOnly = false;
fi2.CopyTo(fi1.FullName, true);
fi1 = new FileInfo(Application.StartupPath + "\\" + fileName);
}
if (fi1.Exists)
{
FileInfo fio = new FileInfo(tbResultPath.Text + @"fmtall\" + fileName);
if (fio.Exists && fio.IsReadOnly) fio.IsReadOnly = false;
fi1.CopyTo(fio.FullName, true);
}
}
private void CopySVG(string fileName)
{
FileInfo fi1 = new FileInfo(Application.StartupPath + "\\" + fileName);
FileInfo fi2 = new FileInfo(@"..\..\" + fileName);
if (fi2.Exists && (!fi1.Exists || (fi1.Exists && fi2.LastAccessTimeUtc > fi1.LastAccessTimeUtc)))
{
if (fi1.Exists && fi1.IsReadOnly) fi1.IsReadOnly = false;
fi2.CopyTo(fi1.FullName, true);
fi1 = new FileInfo(Application.StartupPath + "\\" + fileName);
}
if (fi1.Exists)
{
FileInfo fio = new FileInfo(tbResultPath.Text + @"genmacall\" + fileName);
if (fio.Exists && fio.IsReadOnly) fio.IsReadOnly = false;
fi1.CopyTo(fio.FullName, true);
}
}
// old code:
//private void button5_Click(object sender, System.EventArgs e)
//{
// DirectoryInfo di = new DirectoryInfo("C:\\16bit\\ve-proms.net\\genmac.xml");
// FileInfo[] fis = di.GetFiles("*.xml");
// listBox1.Items.Clear();
// foreach (FileInfo fi in fis)
// {
// this.listBox1.Items.Add(fi.Name);
// //XmlToPdf pdf = new XmlToPdf("C:\\16bit\\ve-proms.net\\genmac.xml",fi.Name);
// }
// MessageBox.Show("DONE generating PDF files from XML");
//}
//private void button6_Click(object sender, System.EventArgs e)
//{
// DirectoryInfo di = new DirectoryInfo("C:\\16bit\\proms.net\\genmac.xml");
// FileInfo[] fis = di.GetFiles("*.svg");
// listBox1.Items.Clear();
// foreach (FileInfo fi in fis)
// {
// this.listBox1.Items.Add(fi.Name);
// //SvgToPdf pdf = new SvgToPdf("C:\\16bit\\proms.net\\genmac.xml", fi.Name);
// }
// MessageBox.Show("DONE generating PDF files from SVG");
//}
}
}
-123
View File
@@ -1,123 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>
-69
View File
@@ -1,69 +0,0 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{68A28293-001C-4726-AA1A-7783E0FA6439}</ProjectGuid>
<OutputType>WinExe</OutputType>
<NoStandardLibraries>false</NoStandardLibraries>
<AssemblyName>Format, Genmac To XML, SVG</AssemblyName>
<RootNamespace>Format__Genmac_To_XML__SVG</RootNamespace>
<SccProjectName>SAK</SccProjectName>
<SccLocalPath>SAK</SccLocalPath>
<SccAuxPath>SAK</SccAuxPath>
<SccProvider>SAK</SccProvider>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>.\bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>.\bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Reference Include="c1.c1pdf, Version=1.1.20052.40, Culture=neutral, PublicKeyToken=bc8d9c59cf1b601f" />
<Reference Include="C1.Common, Version=1.0.20031.116, Culture=neutral, PublicKeyToken=e272bb32d11b1948" />
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Content Include="App.ico" />
</ItemGroup>
<ItemGroup>
<Compile Include="AssemblyInfo.cs" />
<Compile Include="EntireFormat.cs" />
<Compile Include="FmtFileToXml.cs" />
<Compile Include="FmtToXml.cs" />
<Compile Include="Form1.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="GenToXml.cs" />
<Compile Include="GenXmlToSvg.cs" />
<Compile Include="SvgToPdf.cs" />
<Compile Include="XmlToPdf.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Volian.Utils.Library\CvtFont\CvtFont.csproj">
<Project>{652EB5F6-18DD-4F22-9C0B-62EB46613C4D}</Project>
<Name>CvtFont</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
<ProjectExtensions>
<VisualStudio AllowExistingFolder="true" />
</ProjectExtensions>
</Project>
-37
View File
@@ -1,37 +0,0 @@
Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Format To XML", "Format To XML.csproj", "{68A28293-001C-4726-AA1A-7783E0FA6439}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CvtFont", "..\Volian.Utils.Library\CvtFont\CvtFont.csproj", "{652EB5F6-18DD-4F22-9C0B-62EB46613C4D}"
EndProject
Global
GlobalSection(SourceCodeControl) = preSolution
SccNumberOfProjects = 2
SccProjectUniqueName0 = ..\\Volian.Utils.Library\\CvtFont\\CvtFont.csproj
SccProjectName0 = \u0022$/PROMS/Volian.Utils.Library/CvtFont\u0022,\u0020TRDAAAAA
SccLocalPath0 = ..\\Volian.Utils.Library\\CvtFont
SccProvider0 = MSSCCI:Microsoft\u0020Visual\u0020SourceSafe
SccProjectUniqueName1 = Format\u0020To\u0020XML.csproj
SccProjectName1 = \u0022$/PROMS/fmtxml\u0022,\u0020URDAAAAA
SccLocalPath1 = .
SccProvider1 = MSSCCI:Microsoft\u0020Visual\u0020SourceSafe
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{68A28293-001C-4726-AA1A-7783E0FA6439}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{68A28293-001C-4726-AA1A-7783E0FA6439}.Debug|Any CPU.Build.0 = Debug|Any CPU
{68A28293-001C-4726-AA1A-7783E0FA6439}.Release|Any CPU.ActiveCfg = Release|Any CPU
{68A28293-001C-4726-AA1A-7783E0FA6439}.Release|Any CPU.Build.0 = Release|Any CPU
{652EB5F6-18DD-4F22-9C0B-62EB46613C4D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{652EB5F6-18DD-4F22-9C0B-62EB46613C4D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{652EB5F6-18DD-4F22-9C0B-62EB46613C4D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{652EB5F6-18DD-4F22-9C0B-62EB46613C4D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
-155
View File
@@ -1,155 +0,0 @@
using System;
using System.IO;
using System.Text.RegularExpressions;
using System.Windows.Forms;
namespace fmtxml
{
/// <summary>
/// Summary description for GenToXml.
/// </summary>
public class GenToXml
{
private StreamWriter strGenXml;
private string genName;
private string MyPath;
private string MyResPath;
public GenToXml(string nm, string path, string resPath)
{
MyPath = path;
MyResPath = resPath;
genName = nm;
try
{
OpenFiles();
ConvertGenToXml();
CloseFiles();
}
catch (Exception ex)
{
MessageBox.Show("Genmac name = " + nm, ex.Message);
}
}
public void OpenFiles()
{
if (!Directory.Exists(MyResPath + @"\genmacall\convert"))
Directory.CreateDirectory(MyResPath + @"\genmacall\convert");
string fnm = MyResPath + @"\genmacall\convert" + @"\" + genName;
string outnm = fnm.Substring(0,fnm.LastIndexOf(".")) + ".xml";
strGenXml = new StreamWriter(outnm,false,System.Text.Encoding.ASCII);
}
public void CloseFiles()
{
strGenXml.Close();
}
public void ConvertGenToXml()
{
string linein;
try
{
// use regular expressions to read in the genmac C file and convert to XML.
StreamReader sr = new StreamReader(MyPath + @"\preproc\"+genName);
linein = sr.ReadToEnd();
sr.Close();
}
catch (Exception e)
{
// Let the user know what went wrong.
MessageBox.Show("File cannot be written " + genName + " error is " + e.Message);
return;
}
if (linein==null)return;
int indxb = linein.IndexOf("BEGIN");
string line = linein.Substring(indxb,linein.Length-indxb);
linein=null;
// first Find defmac - endmac -> convert these do an element.
Regex defmacs = new Regex(@"DEFMAC(\s*|.*?)*ENDMAC",RegexOptions.IgnoreCase|RegexOptions.Compiled);
Match m;
strGenXml.Write("<" + genName.Substring(0,genName.LastIndexOf(".")) + "_GENMAC>\n");
for (m = defmacs.Match(line); m.Success; m = m.NextMatch())
{
strGenXml.Write("<MACRO><NAME>");
string mt = line.Substring(m.Index,m.Length);
//Find the macro name, i.e. DEFMAC(xyz)
int indxend = mt.IndexOf(")");
string macname = mt.Substring(7,indxend-7);
strGenXml.Write(macname+"</NAME>\n<DEFINITION>\n");
// the '+3' is to remove the \n\r also. The -9 is to account for the +3 &
// also remove the endmac
string macstr = mt.Substring(indxend+3,mt.Length-indxend-9);
// take x chars for the name & put out the name & definition.
string macnocomment = Regex.Replace(macstr, @"(\/\*(\s*|.*?)*\*\/)|(\/\/.*)", "");
mt = Regex.Replace(macnocomment,";","");
macnocomment = Regex.Replace(mt,@"\r\n",";");
mt = Regex.Replace(macnocomment,@";+",";"); // eliminate multiple ';'
macnocomment = mt;
if (mt.IndexOf("&")>-1)
macnocomment = mt.Replace("&","&amp;");
strGenXml.Write(macnocomment);
strGenXml.Write("\n</DEFINITION>\n</MACRO>\n");
}
// next find userdef - endmac -> convert these do an element.
defmacs = new Regex(@"USERDEF(\s*|.*?)*ENDMAC",RegexOptions.IgnoreCase|RegexOptions.Compiled);
for (m = defmacs.Match(line); m.Success; m = m.NextMatch())
{
strGenXml.Write("<USERDEF><NAME>");
string mt = line.Substring(m.Index,m.Length);
//Find the macro name, i.e. USERDEF(xyz)
int indxend = mt.IndexOf(")");
string macname = mt.Substring(8,indxend-8);
strGenXml.Write(macname+"\n</NAME>\n<DEFINITION>\n");
// the '+3' is to remove the \n\r also. The -9 is to account for the +3 &
// also remove the endmac
string macstr = mt.Substring(indxend+3,mt.Length-indxend-9);
// take x chars for the name & put out the name & definition.
string macnocomment = Regex.Replace(macstr, @"(\/\*(\s*|.*?)*\*\/)|(\/\/.*)", "");
mt = Regex.Replace(macnocomment,";","");
macnocomment = Regex.Replace(mt,@"\r\n",";");
mt = Regex.Replace(macnocomment,@";+",";"); // eliminate multiple ';'
macnocomment = mt;
if (mt.IndexOf("&")>-1)
macnocomment = mt.Replace("&","&amp;");
strGenXml.Write(macnocomment);
strGenXml.Write("\n</DEFINITION>\n</USERDEF>\n");
}
// last find static functions - these have macro definitions too.
Regex defmacf = new Regex(@"static void (\s*|.*?)*}",RegexOptions.IgnoreCase|RegexOptions.Compiled);
for (m = defmacf.Match(line); m.Success; m = m.NextMatch())
{
strGenXml.Write("<STATICVOID><NAME>");
string mt = line.Substring(m.Index,m.Length);
//Find the function name, i.e. static void boxx. Parameters are on an different node(int i)
int indxbeg= mt.IndexOf("(");
string fnname = mt.Substring(12,indxbeg-12);
strGenXml.Write(fnname+"</NAME>\n<PARAMETERS>\"");
int indxend=mt.IndexOf(")");
string param = null;
if (indxend-1==indxbeg)
param = "none";
else
param = mt.Substring(indxbeg+1,indxend-1-indxbeg);
strGenXml.Write(param+"\"\n</PARAMETERS>\n<DEFINITION>");
// now get past the opening curly.
indxbeg = mt.IndexOf("{");
string fnstr = mt.Substring(indxbeg+2,mt.Length-indxbeg-3);
string macnocomment = Regex.Replace(fnstr, @"(\/\*(\s*|.*?)*\*\/)|(\/\/.*)", ""); // matches multi/single line comments: (\/\*(\s*|.*?)*\*\/)|(\/\/.*)
mt = Regex.Replace(macnocomment,";","");
macnocomment = Regex.Replace(mt,@"\r\n",";");
mt = Regex.Replace(macnocomment,@";+",";");
if (mt.IndexOf("&")>-1)
mt = mt.Replace("&","&amp;");
strGenXml.Write(mt);
strGenXml.Write("\n</DEFINITION>\n</STATICVOID>\n");
}
strGenXml.Write("</" + genName.Substring(0,genName.LastIndexOf(".")) + "_GENMAC>");
}
}
}
-809
View File
@@ -1,809 +0,0 @@
using System;
using System.IO;
using System.Xml;
using System.Text;
using System.Drawing;
using System.Windows.Forms;
namespace fmtxml
{
/// <summary>
/// Convert genmac xml files to svg. svg (Scalar Vector Graphics
/// in XML format), so that genmac can be used in the 32-bit proms
/// system. The generated files will be used by developers and
/// customer service persons to do macros.
/// </summary>
public class GenXmlToSvg
{
private string genName;
private XmlDocument xmlDoc;
private XmlDocument xmlOutDoc;
private XmlElement topOutElement;
private int Convertn = 300, I = 300, C = 118, D = 1, N = 0;
private float Wid = 3;
private int RTFFontSize = 20;
private int RTFFontFamily = 3;
private string [] FontChoice =
{
"Times New Roman",
"VESymb XXXXXX",
"VolianDraw XXXXXX",
"Prestige Elite Tall",
"Courier New",
"Arial",
"Letter Gothic",
"Times New Roman",
"Letter Gothic Tall",
"Letter Gothic Tall",
"Gothic Ultra",
"VolianScript"
};
private string [] OldName =
{
"BOX1",
"BOX2",
"BOX3",
"BOX4",
"BOX5",
"HDR1",
"HDR2",
"HDR3",
"HDR4",
"HDR5",
"BOLDX",
"CNUM",
"CHKBOX",
"CHKBOX2",
"CHKBOX3",
"CHKBOX4",
"CHKBOX5",
"CHKBOX6",
"CHKBOX7",
"CHKBOX8",
"CHKBOX9",
"CHKBOX10",
"CHKBOX11",
"CHKBOX12",
"CHKBOX13",
"CHKBOX14",
"CHKBOX15",
"CHKBOX16",
"CHKBOX17",
"PLNTPLMAC",
"PLNTPLMAC2",
"GRAPHMAC0",
"GRAPHMAC1",
"RIGHTCHECKOFF",
"HPGLCOMMAND0",
"HPGLCOMMAND1",
"HPGLCOMMAND2",
"HPGLCOMMAND3",
"HPGLCOMMAND4",
"HPGLCOMMAND5",
"HPGLCOMMAND6",
"HPGLCOMMAND7",
"HPGLCOMMAND8",
"HPGLCOMMAND9",
"LTCO",
"SECDBLBXVERT",
"BOX6",
"BOX7",
"BOX8",
"ACAS_CHECKBOX",
"ACAS_CHECKLINE",
};
private string [] NewName =
{
"B1",
"B2",
"B3",
"B4",
"B5",
"H1",
"H2",
"H3",
"H4",
"H5",
"m33",
"C0",
"C1",
"C2",
"C3",
"C4",
"C5",
"C6",
"C7",
"C8",
"C9",
"C10",
"C11",
"C12",
"C13",
"C14",
"C15",
"C16",
"C17",
"m18",
"m19",
"m20",
"m21",
"C22",
"m23",
"m24",
"m25",
"m26",
"m27",
"m28",
"m29",
"m30",
"m31",
"m32",
"m20",
"m34",
"B6",
"B7",
"B8",
"m35",
"m36",
};
private int RTFBUI = 0;
private int Sp = -1;
private float cx = 0;
private float cy = 0;
private int fidx=0;
private int [] fontfam;
private int [] fontsiz;
private float [] PPx;
private float [] PPy;
// the following define RTFBUI values
private static int BOLD = 0x01;
private static int UNDERLINE = 0x02;
private static int ITALICS = 0x04;
private string MyResultPath;
/*
* The following svg group must be added for WCN2 for its box on the cover page:
*
<g id="B9">
<rect x="4" y="-3" width="352.5" height="120" fill="none" stroke="black" stroke-width="1.2" />
<line x1="4" y1="21" x2="355.5" y2="21" stroke-width="1.2" />
<line x1="4" y1="45" x2="355.5" y2="45" stroke-width="1.2" />
<line x1="4" y1="69" x2="355.5" y2="69" stroke-width="1.2" />
<line x1="4" y1="93" x2="355.5" y2="93" stroke-width="1.2" />
<line x1="263" y1="-3" x2="263" y2="118" stroke-width="1.2" />
</g>
*/
public GenXmlToSvg(string nm, string resPath)
{
MyResultPath = resPath;
genName = nm;
try
{
fontfam = new int[20];
fontsiz = new int[20];
PPx = new float[12];
PPy = new float[12];
ReadXml();
ConvertGenXmlToDIXml();
WriteXml();
}
catch (Exception ex)
{
Console.WriteLine("Genmac.xml name = " + nm + ". Error is " + ex.Message);
}
}
private float CPoint(float x)
{
if (Convertn == C)
{
// convert from x (in centimeters) to inches & then to points
return (float) (.3937 * x * 72);
} // convert from x (in inches) to points
else if (Convertn == I)
return (float)(x * 72);
else if (Convertn == N)
return (float)x;
else // convert from x (in dots) to twips & then points
return (float)(((4.8 * x + 0.5)/1440f)*72);
}
private void WriteXml()
{
string path = MyResultPath + @"\genmacall\" + genName.Substring(0, genName.LastIndexOf(".")) + ".svg";
XmlTextWriter writer = new XmlTextWriter(path,System.Text.Encoding.Unicode);
writer.Formatting=System.Xml.Formatting.Indented;
xmlOutDoc.Save(writer);
}
private void ReadXml()
{
string fnm = MyResultPath + @"\genmacall\convert\" + genName;
xmlDoc = new XmlDocument();
XmlTextReader reader = new XmlTextReader(fnm);
xmlDoc.Load(reader);
reader.Close();
}
private void ConvertGenXmlToDIXml()
{
// first create the document for the svg version of the macro files
// and add the top svg element.
xmlOutDoc = new XmlDocument();
topOutElement = xmlOutDoc.CreateElement("svg");
topOutElement.SetAttribute("width","8in");
topOutElement.SetAttribute("height","10in");
topOutElement.SetAttribute("viewBox","0 0 576 720");
// topOutNode.Attributes.Append(attr);
// topOutNode.Attributes.Append<svg width="8in" height="10in" viewBox="0 0 576 720"
// xmlns="http://www.w3.org/2000/svg" version="1.1">
xmlOutDoc.AppendChild(topOutElement);
// Next add the description node, which is the name of the plant format.
XmlElement descNode = xmlOutDoc.CreateElement("desc");
descNode.InnerText = genName.Substring(0,genName.LastIndexOf("."));
topOutElement.AppendChild(descNode);
XmlElement top = (XmlElement) xmlDoc.FirstChild;
XmlNode sv = top.SelectSingleNode("STATICVOID");
XmlNodeList xmlNds = top.SelectNodes("MACRO");
// Now for each macro, create a svg group with the name given to
// it. Later we may change this to map to what was created in 16-bit
// proms (for example BOX1 -> B1)
bool hasC0 = false;
foreach (XmlNode nd in xmlNds)
{
XmlNode name = nd.SelectSingleNode("NAME");
XmlElement elm = (XmlElement) name;
XmlElement grp = xmlOutDoc.CreateElement("g");
string cname = GetName(name.InnerText);
if (cname == "CNUM") hasC0 = true;
grp.SetAttribute("id",cname);
topOutElement.AppendChild(grp);
XmlNode definition = nd.SelectSingleNode("DEFINITION");
try
{
string str = ProcessMacroDefinition(grp,definition,sv);
}
catch (Exception e)
{
MessageBox.Show("Error processing macro definition for " + this.genName, e.Message);
}
}
// if the C0 (circle string) macro didn't exist, add a default. This is done so special code
// does not have to be written to do the circle string in edit/print.
/* Add the C0 macro if not there!
<g id="C0">
<ellipse cx="-76" cy="-306" rx="504" ry="504" fill="none" stroke="black" stroke-width="39" />
</g>
*/
if (!hasC0)
{
int savconvertn = Convertn;
Convertn = 0; // don't convert size
XmlElement grp = xmlOutDoc.CreateElement("g");
grp.SetAttribute("id", "C0");
topOutElement.AppendChild(grp);
// these numbers were gotten from hlp backup circle. They may need adjusted
// as genmacs are used!
cx = -76;
cy = -306;
grp.AppendChild(Ellipse(430,450));
Convertn = savconvertn;
}
xmlNds = top.SelectNodes("USERDEF");
// Now for each user defined macro, create a svg group with the
// name given to it.
foreach (XmlNode nd in xmlNds)
{
XmlNode name = nd.SelectSingleNode("NAME");
XmlElement elm = (XmlElement) name;
XmlElement grp = xmlOutDoc.CreateElement("g");
string tmpdebug = name.InnerText.Trim("\n".ToCharArray());
grp.SetAttribute("id",tmpdebug);
topOutElement.AppendChild(grp);
XmlNode definition = nd.SelectSingleNode("DEFINITION");
try
{
string str = ProcessMacroDefinition(grp,definition,sv);
}
catch (Exception e)
{
MessageBox.Show("Error processing macro definition for " + this.genName, e.Message);
}
}
}
// convert the macro names as was done in 16-bit code?
string GetName(string oname)
{
for (int i=0; i<51 ; i++)
{
if (oname == OldName[i]) return NewName[i];
}
return "NONAME";
}
private void PushFont()
{
if( fidx < 19 )
{
fontfam[fidx] = RTFFontFamily;
fontsiz[fidx] = RTFFontSize;
fidx++;
}
return;
}
private void PopFont()
{
if( fidx > 0 )
{
fidx--;
RTFFontFamily = fontfam[fidx];
RTFFontSize = fontsiz[fidx];
}
return;
}
private void PushPos()
{
if (Sp < 11)
{
Sp++;
PPx[Sp] = cx;
PPy[Sp] = cy;
}
}
private void PopPos()
{
if (Sp > -1)
{
cx = PPx[Sp];
cy = PPy[Sp];
Sp--;
}
}
private XmlElement RTFAdjust(float x, float y)
{
// This was used for RTF export only.
return null;
}
private XmlElement GDIAdjust(float x, float y)
{
// can't quite figure out what this is doing
// KBR TODO: gdiadjust
return null;
}
private float GetOneFloat(string cmd)
{
int indxlp = cmd.IndexOf("(");
int indxrp = cmd.IndexOf(")");
string tmp = cmd.Substring(indxlp+1,indxrp-indxlp-1);
return (float) Convert.ToDouble(tmp);
}
private void GetTwoFloats(string cmd, ref float x, ref float y)
{
int indxlp = cmd.IndexOf("(");
int indxcm = cmd.IndexOf(",");
int indxrp = cmd.IndexOfAny("),".ToCharArray(),indxcm+1);
x = (float) Convert.ToDouble(cmd.Substring(indxlp+1,indxcm-indxlp-1));
y = (float) Convert.ToDouble(cmd.Substring(indxcm+1,indxrp-indxcm-1));
}
private XmlElement DefineMacro(string str)
{
byte x = Convert.ToByte(173);
cx=cy=0;
return null;
}
private XmlElement HorizontalLine(float X)
{
XmlElement box = this.xmlOutDoc.CreateElement("line");
box.SetAttribute("x1",cx.ToString());
box.SetAttribute("y1",cy.ToString());
box.SetAttribute("x2",(cx+CPoint(X)).ToString());
box.SetAttribute("y2",cy.ToString());
box.SetAttribute("stroke-width",Wid.ToString());
return box;
}
private XmlElement VerticalLine(float Y)
{
XmlElement box = this.xmlOutDoc.CreateElement("line");
box.SetAttribute("x1",cx.ToString());
box.SetAttribute("y1",cy.ToString());
box.SetAttribute("x2",cx.ToString());
box.SetAttribute("y2",(cy+CPoint(Y)).ToString());
box.SetAttribute("stroke-width",Wid.ToString());
return box;
}
private XmlElement DiagLine(float X, float Y)
{
XmlElement box = this.xmlOutDoc.CreateElement("line");
box.SetAttribute("x1",cx.ToString());
box.SetAttribute("y1",cy.ToString());
box.SetAttribute("x2",(cx+CPoint(X)).ToString());
box.SetAttribute("y2",(cy+CPoint(Y)).ToString());
box.SetAttribute("stroke-width",Wid.ToString());
return box;
}
private XmlElement Box(float X, float Y)
{
XmlElement box = this.xmlOutDoc.CreateElement("rect");
box.SetAttribute("x",cx.ToString());
box.SetAttribute("y",cy.ToString());
box.SetAttribute("width",CPoint(X).ToString());
box.SetAttribute("height",CPoint(Y).ToString());
box.SetAttribute("fill","none");
box.SetAttribute("stroke","black");
box.SetAttribute("stroke-width",Wid.ToString());
return box;
}
private XmlElement Ellipse(float X, float Y)
{
XmlElement ellipse = this.xmlOutDoc.CreateElement("ellipse");
ellipse.SetAttribute("cx",cx.ToString());
ellipse.SetAttribute("cy",cy.ToString());
ellipse.SetAttribute("rx",(CPoint(X)).ToString());
ellipse.SetAttribute("ry",(CPoint(Y)).ToString());
ellipse.SetAttribute("fill","none");
ellipse.SetAttribute("stroke","black");
ellipse.SetAttribute("stroke-width",Wid.ToString());
return ellipse;
}
private XmlElement Text(float X, float Y, string str)
{
//text-decoration="underline"
//font-weight="bold"
//font-style="italic"
XmlElement text = this.xmlOutDoc.CreateElement("text");
text.SetAttribute("x",(cx+CPoint(X)).ToString());
text.SetAttribute("y",(cy+CPoint(Y)).ToString());
text.SetAttribute("font-family",FontChoice[RTFFontFamily]);
text.SetAttribute("font-size",(RTFFontSize/2).ToString());
if ((RTFBUI&BOLD)==1) text.SetAttribute("font-weight","bold");
if ((RTFBUI&UNDERLINE)==1) text.SetAttribute("text-decoration", "underline");
if ((RTFBUI&ITALICS)==1) text.SetAttribute("font-style","italic");
text.InnerText = str;
return text;
}
private XmlElement[] RTFBox3(float x, float y)
{
XmlElement[] elearr = new XmlElement[3];
PushPos();
elearr[0] = VerticalLine(y);
cy += CPoint(y);
elearr[1] = HorizontalLine(x);
cx += CPoint(x);
float ftmp = (float) (y*-1.0);
cy += CPoint(ftmp);
elearr[2] = VerticalLine(y);
PopPos();
return elearr;
}
private XmlElement BitMap(float X, float Y, string str)
{
XmlElement bmap = xmlOutDoc.CreateElement("image");
bmap.SetAttribute("x",(cx+CPoint(X)).ToString());
bmap.SetAttribute("y",(cy+CPoint(Y)).ToString());
Bitmap bmp= new Bitmap(str);
bmap.SetAttribute("width",bmp.Width.ToString()+"px");
bmap.SetAttribute("height",bmp.Height.ToString()+"px");
bmap.SetAttribute("xlink:href", str);
//bmap.SetAttribute("href", str);
return bmap;
}
private void GetFont(string fontexp)
{
if (fontexp==null||fontexp=="")
{
RTFFontFamily = 3;
RTFFontSize = 20;
}
else if (fontexp.IndexOf("PICA")>-1)
{
RTFFontFamily = 4;
RTFFontSize = 24;
}
else if (fontexp.IndexOf("EXPANDED")>-1)
{
RTFFontSize = 24;
}
else if(fontexp.IndexOf("SANSERIF")>-1)
{
RTFFontFamily = 6;
RTFFontSize = 20;
}
else if (fontexp.IndexOf("PROPT12")>-1)
{
RTFFontFamily = 5;
RTFFontSize = 22;
}
else if (fontexp.IndexOf("COMPRESSED")>-1)
{
RTFFontFamily = 6;
RTFFontSize = 14;
}
if (fontexp.IndexOf("BOLD")>-1) RTFBUI |= BOLD; else RTFBUI &= 0xFFFE;
if (fontexp.IndexOf("UNDERLINE")>-1) RTFBUI |= UNDERLINE; else RTFBUI &= 0xFFFD;
if (fontexp.IndexOf("ITALICS")>-1) RTFBUI |= ITALICS; else RTFBUI &= 0xFFFB;
}
private string ProcessMacroDefinition(XmlElement grp, XmlNode idef, XmlNode functions)
{
XmlElement elm = (XmlElement) idef;
string def = elm.InnerText;
StringBuilder str_result = new StringBuilder();
fidx=0;
cx = 0;
cy = 0;
Wid = 3;
RTFFontSize = 20;
RTFFontFamily = 3;
Sp = -1;
// for each element, process the token for the element and add it to the
// xml tree (ProcessToken does both).
int lindx = 0;
int indx = def.IndexOf(";");
while (indx>-1)
{
ProcessToken(grp, def, lindx, indx, functions);
lindx = indx+1;
indx = def.IndexOf(";",lindx);
}
return str_result.ToString();
}
private void ProcessToken(XmlElement grp, string def, int lindx, int indx, XmlNode functions)
{
float x=0,y=0;
XmlElement retval = null;
//get the token, i.e. from last index to this one.
string token = def.Substring(lindx,indx-lindx).Trim();
if (token==null||token=="")return;
string cmd = token; // cmd has the command without parens/values
if (token.IndexOf("(")>-1) cmd = token.Substring(0,token.IndexOf("("));
if (token.IndexOf("RTFFontSize")>-1)cmd = "RTFFontSize";
if (token.IndexOf("RTFFontFamily")>-1)cmd = "RTFFontFamily";
if (token.IndexOf("RTFBUI")>-1) cmd = "RTFBUI";
if (token.IndexOf("DEFMAC")>-1) cmd = "DEFMAC";
if (token.IndexOf("HLINE")>-1) cmd = "HLINE";
if (token.IndexOf("TEXT")>-1) cmd = "TEXT";
if (token.IndexOf("BITMAP")>-1) cmd = "BITMAP";
if (cmd==null)return;
try
{
switch (cmd)
{
case "DEFMAC": // command is DEFMAC(xyz)
MessageBox.Show("DEFMAC found, format = " + genName + " not converted - do manually");
int indxl = token.IndexOf("(");
int indxr = token.IndexOf(")");
string strx = token.Substring(indxl+1,indxr-indxl-1).Trim();
retval = DefineMacro(strx);
break;
case "PUSHF":
PushFont();
break;
case "POPF":
PopFont();
break;
case "PUSHP":
PushPos();
break;
case "POPP":
PopPos();
break;
case "UNIT":
if (token.IndexOf("C")>-1)Convertn = C;
else if (token.IndexOf("I",4)>-1)Convertn = I;
else if (token.IndexOf("D")>-1)Convertn = D;
break;
case "RTFADJ": // command is RTFADJ(x,y)
GetTwoFloats(token, ref x, ref y);
retval = RTFAdjust(x, y);
break;
case "GDIADJ": // command is GDIADJ(x,y)
GetTwoFloats(token, ref x, ref y);
retval = GDIAdjust(x, y);
break;
case "FONT": //comand is FONT(FONTSTR)
GetFont(token);
break;
case "RTFFontSize": // command is RTFFontSize = x
int indxe = token.IndexOf("=");
string numstr = token.Substring(indxe+1,token.Length-indxe-1).Trim();
if (numstr.IndexOf("*")>-1)
{
int i1 = Convert.ToInt32(numstr.Substring(0,numstr.IndexOf("*")));
int i2 = Convert.ToInt32(numstr.Substring(numstr.IndexOf("*")+1,numstr.Length-numstr.IndexOf("*")-1));
RTFFontSize = i1*i2;
}
else
RTFFontSize = Convert.ToInt32(numstr);
break;
case "RTFBUI":
// command either sets it '=' or ORs it '|= ', look for these.
int ieq = token.IndexOf("=");
string val = token.Substring(ieq+1,token.Length-ieq-1).Trim();
int amt=0;
if (token.IndexOf("0x")<0)
amt = Convert.ToInt32(val);
else
amt = Convert.ToInt32(val,16);
int operor = token.IndexOf("|=");
int operand = token.IndexOf("&=");
if (operor<0 && operand<0)
RTFBUI = amt;
else if (operor>0)
RTFBUI |= amt;
else
RTFBUI &= amt;
break;
case "RTFFontFamily": // command is RTFFontFamily = x
indxe = token.IndexOf("=");
numstr = token.Substring(indxe+1,token.Length-indxe-1).Trim();
RTFFontFamily = Convert.ToInt32(numstr);
break;
case "LNWID": // command is LNWID(w)
float w = GetOneFloat(token);
Wid = CPoint(w);
break;
case "MOVA": // command is MOVA(x, y)
GetTwoFloats(token,ref x, ref y);
cx = CPoint(x);
cy = CPoint(y);
break;
case "MOVR": // command is MOVR(x, y)
GetTwoFloats(token,ref x, ref y);
cx += CPoint(x);
cy += CPoint(y);
break;
case "HLINE": // command is HLINE(x)
x = GetOneFloat(token);
grp.AppendChild(HorizontalLine(x));
break;
case "VLINE": // command is VLINE(y)
y = GetOneFloat(token);
grp.AppendChild(VerticalLine(y));
break;
case "DLINE": // command is DLINE(x, y)
GetTwoFloats(token, ref x, ref y);
grp.AppendChild(DiagLine(x, y));
break;
case "BOX": // command is BOX(x, y)
GetTwoFloats(token,ref x, ref y);
grp.AppendChild(Box(x,y));
break;
case "BOX3SIDES": // command is BOX3SIDES(X,Y)
GetTwoFloats(token, ref x, ref y);
XmlElement [] bxsd = new XmlElement[3];
bxsd = RTFBox3(x, y);
for (int ib = 0;ib < 3; ib++) grp.AppendChild(bxsd[ib]);
break;
case "DBOX": // * DBOX(X,Y,A) DoubleBox((double)X,(double)Y,(double)A);
MessageBox.Show("Not supported - ANO only");
break;
case "CIRCLE": // command is CIRCLE(X,Y)
GetTwoFloats(token, ref x, ref y);
grp.AppendChild(Ellipse(x,y));
break;
case "TEXT": // command is TEXT(x, y, str)
GetTwoFloats(token,ref x, ref y);
int indxrp = token.IndexOf(",");
indxrp = token.IndexOf(",",indxrp+1);
// this found the last argument, i.e. text - now find the "
indxrp = token.IndexOf("\"",indxrp+1);
string str = token.Substring(indxrp+1,token.LastIndexOf("\"")-indxrp-1);
// only trim if has characters?
// if (str!=null)str = str.Trim();
if (str!=null && str!="") grp.AppendChild(Text(x, y, str));
break;
case "BITMAP":
int ibm = token.IndexOf("BITMAP");
int ibmq = token.IndexOf("\"",ibm);
string thestr = token.Substring(ibm,ibmq-ibm);
string [] bmap = thestr.Split(" ".ToCharArray(),4);
x=(float)Convert.ToDouble(bmap[1]);
y=(float)Convert.ToDouble(bmap[2]);
thestr=bmap[3];
if (thestr.IndexOf("~FORMAT\\")>-1) thestr=thestr.Replace("~FORMAT","E:\\VE-PROMS\\FORMAT");
grp.AppendChild(BitMap(x,y,thestr));
break;
case "ABSOLUTE": // no-op ?
break;
default: // function calls
// see if in the STATICVOID list. The name is the function name
// without () or parameters...
XmlNode parent = functions.ParentNode;
XmlNode foundsv = parent.SelectSingleNode("STATICVOID[NAME = \""+cmd+"\"]");
if (foundsv==null)
Console.WriteLine("Name " + genName + " failed. The token is not in list, token = " +token);
else
{
XmlNode param = foundsv.SelectSingleNode("PARAMETERS");
XmlNode deffn = foundsv.SelectSingleNode("DEFINITION");
// get the argument value to pass in.
int ilp = token.IndexOf("(");
int irp = token.IndexOf(")");
string aval=null;
if (ilp>0&&irp>0) aval = token.Substring(ilp+1,irp-ilp-1);
ProcessFunctions(grp, param.InnerText,functions, aval, deffn.InnerText);
}
break;
}
}
catch (Exception e)
{
Console.WriteLine("Name = " + genName + ". Error in token: " + token, e.Message);
retval = null;
}
return;
}
private void ProcessFunctions(XmlElement grp, string param, XmlNode functions, string val, string fntext)
{
// Each function contains a series of commands that must be processed for the
// function. Results are added to the group element for this group (macro).
string repstr=null;
// if there is a parameter, get the substitution string...
if (param.IndexOf("none")==-1)
{
int chrindx = param.IndexOf("char *");
int end = -1;
if (chrindx>-1)
{
end = param.IndexOf("\"",chrindx);
repstr = param.Substring(chrindx+6,end-chrindx-6);
}
else
{
chrindx = param.IndexOf("int ");
if (chrindx>-1)
{
end = param.IndexOf("\"",chrindx);
repstr = param.Substring(chrindx+4,end-chrindx-4);
}
}
}
// find the function commands and include them here.
string funstr = fntext;
if (repstr!=null)funstr = funstr.Replace(repstr,val);
// for each element, process commands.
int lindx = 0;
int indx = funstr.IndexOf(";");
while (indx>-1)
{
ProcessToken(grp, funstr, lindx, indx, functions);
lindx = indx+1;
indx = funstr.IndexOf(";",lindx);
}
}
}
}
Binary file not shown.
-210
View File
@@ -1,210 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Xml;
using System.Text.RegularExpressions;
namespace fmtxml
{
public partial class FmtFileToXml
{
private bool _DoingFields = false;
private int NumBoxes = 0;
private int NumTexts = 0;
private int NumFields = 0;
private int CountForLists = 0;
private Regex removeComment = new Regex("/[*].*?[*]/");
private Regex removeComment1 = new Regex("/[*].*?$");
private Regex removeComment2 = new Regex("[*]/");
private string RemoveComments(string inStr)
{
string str = removeComment.Replace(inStr, "");
str = removeComment1.Replace(str, "");
str = removeComment2.Replace(str, "");
return str.Trim();
}
public void PsiIniToXml(ref FormatData fmtdata, string path)
{
string sLine;
StreamReader myReader = new StreamReader(path);// Open file
while ((sLine = myReader.ReadLine()) != null)// read line-by-line
{
try
{
if (sLine.Length > 0)
{
switch (sLine.Substring(0, 1))
{
case "[":
if (sLine.Contains("[OBJECT COUNT]"))
{
// read in the count of objects - these may not be in order, fix this:
sLine = myReader.ReadLine();
while(sLine.StartsWith(";")) sLine = myReader.ReadLine(); // Skip Comments
int indx = sLine.IndexOf("=");
string tmp = sLine.Substring(indx + 1, sLine.Length - indx - 1);
if (sLine.Contains("BOXES"))
NumBoxes = tmp == "" ? 1 : Convert.ToInt32(RemoveComments(tmp)) + 1;
else if (sLine.Contains("TEXT"))
NumTexts = tmp == "" ? 1 : Convert.ToInt32(RemoveComments(tmp)) + 1;
else if (sLine.Contains("FIELDS"))
NumFields = tmp == "" ? 1 : Convert.ToInt32(RemoveComments(tmp)) + 1;
sLine = myReader.ReadLine();
while (sLine.StartsWith(";")) sLine = myReader.ReadLine(); // Skip Comments
indx = sLine.IndexOf("=");
tmp = sLine.Substring(indx + 1, sLine.Length -indx - 1);
if (sLine.Contains("BOXES"))
NumBoxes = tmp == "" ? 1 : Convert.ToInt32(RemoveComments(tmp)) + 1;
else if (sLine.Contains("TEXT"))
NumTexts = tmp == "" ? 1 : Convert.ToInt32(RemoveComments(tmp)) + 1;
else if (sLine.Contains("FIELDS"))
NumFields = tmp == "" ? 1 : Convert.ToInt32(RemoveComments(tmp)) + 1;
sLine = myReader.ReadLine();
while (sLine.StartsWith(";")) sLine = myReader.ReadLine(); // Skip Comments
indx = sLine.IndexOf("=");
tmp = sLine.Substring(indx + 1, sLine.Length -indx - 1);
if (sLine.Contains("BOXES"))
NumBoxes = tmp == "" ? 1 : Convert.ToInt32(RemoveComments(tmp)) + 1;
else if (sLine.Contains("TEXT"))
NumTexts = tmp == "" ? 1 : Convert.ToInt32(RemoveComments(tmp)) + 1;
else if (sLine.Contains("FIELDS"))
NumFields = tmp == "" ? 1 : Convert.ToInt32(RemoveComments(tmp)) + 1;
if (NumBoxes == 0) NumBoxes++;
if (NumTexts == 0) NumTexts++;
if (NumFields == 0) NumFields++;
fmtdata.ProcData.Psi.Boxes = new PsiBox[NumBoxes];
fmtdata.ProcData.Psi.Labels = new PsiLabel[NumTexts];
fmtdata.ProcData.Psi.Fields = new PsiField[NumFields];
break;
}
if (sLine.Contains("[DIALOG]") || sLine.Contains("[BOXES]") || sLine.Contains("[TEXT]") || sLine.Contains("[FIELDS]"))
{
_DoingFields = sLine.Contains("[FIELDS]");
CountForLists = 0;
break;
}
break;
case ";":
break;
case "/":
if (sLine[1] == '*') break; // if it isn't a comment, fall thru to the default.
if (sLine.IndexOf("=") >= 0)
{
AddParam(ref fmtdata, RemoveComments(sLine));
}
break;
default:
if (sLine.IndexOf("=") >= 0)
{
AddParam(ref fmtdata, RemoveComments(sLine));
}
break;
}
}
}
catch (Exception ex)
{
Console.WriteLine(string.Format("error parsing .INI file: {0}, message: {1}", path, ex.Message));
}
}
myReader.Close();
}
private Regex findBOX = new Regex("^BOX[0-9]+$");
private Regex findSIZE = new Regex("^SIZE$");
private Regex findFONT = new Regex("^FONT$");
private Regex findCAPTION = new Regex("^CAPTION$");
private Regex findBUTTONSONBOTTOM = new Regex("^BUTTONSONBOTTOM$");
private Regex findTEXT = new Regex("^TEXT[0-9]+$");
private void AddParam(ref FormatData fmtdata, string sParam)
{
int i = sParam.IndexOf("=");
string attrname = sParam.Substring(0, i);
if (findSIZE.IsMatch(attrname))
{
int end = (sParam.IndexOf(";") > -1) ? sParam.IndexOf(";") : sParam.Length;
string sb = sParam.Substring(i + 1, end - i - 1);
string[] split = sb.Split(new char[] { ',' });
fmtdata.ProcData.Psi.x = Convert.ToInt32(split[0].Trim());
fmtdata.ProcData.Psi.y = Convert.ToInt32(split[1].Trim());
return;
}
if (findFONT.IsMatch(attrname))
{
int end = (sParam.IndexOf(";") > -1) ? sParam.IndexOf(";") : sParam.Length;
string sb = sParam.Substring(i + 1, end - i - 1);
string[] split = sb.Split(new char[] { ',' });
fmtdata.ProcData.Psi.font = split[0].Trim();
return;
}
if (findCAPTION.IsMatch(attrname))
{
int end = (sParam.IndexOf(";") > -1) ? sParam.IndexOf(";") : sParam.Length;
fmtdata.ProcData.Psi.Caption = sParam.Substring(i + 1, end-i-1).Replace("\"","");
return;
}
if (findBUTTONSONBOTTOM.IsMatch(attrname))
{
int end = (sParam.IndexOf(";") > -1) ? sParam.IndexOf(";") : sParam.Length;
fmtdata.ProcData.Psi.ButtonsOnBottom = sParam.Substring(i + 1, end - i - 1);
return;
}
if (findBOX.IsMatch(attrname)) // attrname.StartsWith("BOX"))
{
//<Box style="BLACKFRAME" x="4" y="4" width="192" height="112"/>
int end = (sParam.IndexOf(";") > -1) ? sParam.IndexOf(";") : sParam.Length;
string sb = sParam.Substring(i + 1, end - i - 1);
string[] split = sb.Split(new char[] { ',' });
if (CountForLists <= NumBoxes - 1)
{
fmtdata.ProcData.Psi.Boxes[CountForLists].style = split[0].Trim();
fmtdata.ProcData.Psi.Boxes[CountForLists].x = Convert.ToInt32(split[1].Trim());
fmtdata.ProcData.Psi.Boxes[CountForLists].y = Convert.ToInt32(split[2].Trim());
fmtdata.ProcData.Psi.Boxes[CountForLists].width = Convert.ToInt32(split[3].Trim());
fmtdata.ProcData.Psi.Boxes[CountForLists].height = Convert.ToInt32(split[4].Trim());
}
CountForLists++;
return;
}
if (findTEXT.IsMatch(attrname))
{
//<Label text="Responsible Manager's Title:" Justify="LEFT" x="12" y="11" width="100" height="8" />
int end = (sParam.IndexOf(";") > -1) ? sParam.IndexOf(";") : sParam.Length;
string sb = sParam.Substring(i + 1, end - i - 1);
string[] split = sb.Split(new char[] { ',' });
fmtdata.ProcData.Psi.Labels[CountForLists].text = split[0].Trim();
fmtdata.ProcData.Psi.Labels[CountForLists].Justify = split[1].Trim();
fmtdata.ProcData.Psi.Labels[CountForLists].x = Convert.ToInt32(split[2].Trim());
fmtdata.ProcData.Psi.Labels[CountForLists].y = Convert.ToInt32(split[3].Trim());
fmtdata.ProcData.Psi.Labels[CountForLists].width = Convert.ToInt32(split[4].Trim());
fmtdata.ProcData.Psi.Labels[CountForLists].height = Convert.ToInt32(split[5].Trim());
CountForLists++;
return;
}
if (_DoingFields)
{
//<Field type="TEXT" name="CLASSIFICATION" length="51" x="12" y="20" width="180" height="12" />
//<Field type ="LOGICAL" name="USESETID" text="Some optional text" x="12" y="20" />
int end = (sParam.IndexOf(";") > -1) ? sParam.IndexOf(";") : sParam.Length;
string sb = sParam.Substring(i + 1, end - i - 1);
string[] split = sb.Split(new char[] { ',' });
// first check whether it is a text field or a logical (checkbox) field:
fmtdata.ProcData.Psi.Fields[CountForLists].name = attrname;
fmtdata.ProcData.Psi.Fields[CountForLists].type = split[0].Trim();
string typ = fmtdata.ProcData.Psi.Fields[CountForLists].type;
fmtdata.ProcData.Psi.Fields[CountForLists].text = split[1] == null ? null : split[1].Trim();
if (typ.ToUpper() == "TEXT")
fmtdata.ProcData.Psi.Fields[CountForLists].Length = Convert.ToInt32(split[2].Trim());
else
fmtdata.ProcData.Psi.Fields[CountForLists].Length = 0;
fmtdata.ProcData.Psi.Fields[CountForLists].x = Convert.ToInt32(split[3].Trim());
fmtdata.ProcData.Psi.Fields[CountForLists].y = Convert.ToInt32(split[4].Trim());
fmtdata.ProcData.Psi.Fields[CountForLists].width = Convert.ToInt32(split[5].Trim());
fmtdata.ProcData.Psi.Fields[CountForLists].height = Convert.ToInt32(split[6].Trim());
CountForLists++;
}
}
}
}
-221
View File
@@ -1,221 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
namespace fmtxml
{
public partial class FmtFileToXml
{
private void AddCWEfmt(ref FormatData fmtdata)
{
fmtdata.ProcData.CheckOffData.SkipSpaces = "True";
fmtdata.ProcData.CheckOffData.CheckOffList[2].Macro = "C3";
fmtdata.ProcData.CheckOffData.CheckoffOnSubStepsOnly = "True";
fmtdata.SectData.StepSectionData.StpSectLayData.WidSTablePrint = "475.2,252.2,144";
fmtdata.SectData.ReplaceStrData[3].Flag = "RNO, Caution, Note, Table, Substep, Attach";
fmtdata.SectData.ReplaceStrData[4].Flag = "RNO, Caution, Note, Table, Substep, Attach";
fmtdata.StepData[9].TabData.Ident = " {!C2}{numeric} ";
fmtdata.StepData[9].TabData.RNOIdent = " {!C2}{numeric} ";
fmtdata.BoxData[2].TabPos = 265F;
fmtdata.BoxData[2].Start = 128F;
fmtdata.BoxData[2].End = 420F;
fmtdata.BoxData[2].TxtStart = 151F;
fmtdata.BoxData[2].TxtWidth = 254F;
fmtdata.BoxData[1].TabPos = 265F;
fmtdata.BoxData[1].Start = 128F;
fmtdata.BoxData[1].End = 420F;
fmtdata.BoxData[1].TxtStart = 151F;
fmtdata.BoxData[1].TxtWidth = 254F;
fmtdata.SectData.StepSectionData.StpSectLayData.RNOWidthAlt = "212,212";
fmtdata.SectData.StepSectionData.StpSectLayData.RNOWidthAdj = "-40";
fmtdata.StepData[6].StepLayoutData.EveryNLines = "-99";
fmtdata.StepData[7].StepLayoutData.EveryNLines = "-99";
// Transitions
fmtdata.TransData.TransTypeData[4].TransFormat = "{Sect Hdr}, Step {First Step}";
fmtdata.TransData.TransTypeData[4].TransMenu = "{Sect Hdr}, Step {First Step}";
}
private void AddCWE00fmt(ref FormatData fmtdata)
{
fmtdata.SectData.StepSectionData.StpSectLayData.WidSTablePrint = "489,229.2,144";
fmtdata.StepData[2].TabData.Ident = "{ALPHA}. ";
fmtdata.StepData[1].TabData.Ident = "{alpha}) ";
fmtdata.SectData.StepSectionData.StpSectLayData.BoxLeftAdj = "-43.2";
fmtdata.StepData[6].StepLayoutData.EveryNLines = "-99";
fmtdata.StepData[7].StepLayoutData.EveryNLines = "-99";
}
private void AddEXCLNfmt(ref FormatData fmtdata)
{
fmtdata.ProcData.CheckOffData.SkipSpaces = "True";
fmtdata.ProcData.CheckOffData.CheckOffList[2].Macro = "C3";
fmtdata.ProcData.CheckOffData.CheckoffOnSubStepsOnly = "True";
fmtdata.SectData.StepSectionData.StpSectLayData.WidSTablePrint = "475.2,229.2,144";
fmtdata.SectData.StepSectionData.StpSectLayData.ColRTable = "0,236.4,135.6";
fmtdata.SectData.ReplaceStrData[3].Flag = "RNO, Caution, Note, Table, Substep, Attach";
fmtdata.SectData.ReplaceStrData[4].Flag = "RNO, Caution, Note, Table, Substep, Attach";
fmtdata.StepData[9].TabData.Ident = " {!C2}{numeric} ";
fmtdata.StepData[9].TabData.RNOIdent = " {!C2}{numeric} ";
fmtdata.StepData[1].TabData.Ident = "{alpha}) ";
fmtdata.BoxData[2].TabPos = 265F;
fmtdata.BoxData[2].Start = 128F;
fmtdata.BoxData[2].End = 420F;
fmtdata.BoxData[2].TxtStart = 151F;
fmtdata.BoxData[2].TxtWidth = 254F;
fmtdata.BoxData[1].TabPos = 265F;
fmtdata.BoxData[1].Start = 128F;
fmtdata.BoxData[1].End = 420F;
fmtdata.BoxData[1].TxtStart = 151F;
fmtdata.BoxData[1].TxtWidth = 254F;
fmtdata.StepData[6].StepLayoutData.EveryNLines = "-99";
fmtdata.StepData[7].StepLayoutData.EveryNLines = "-99";
// Transitions
fmtdata.TransData.TransTypeData[4].TransFormat = "{Sect Hdr}, Step {First Step}";
fmtdata.TransData.TransTypeData[4].TransMenu = "{Sect Hdr}, Step {First Step}";
}
private void AddEXCLN00fmt(ref FormatData fmtdata)
{
fmtdata.SectData.StepSectionData.StpSectLayData.WidSTablePrint = "489,229.2,144";
fmtdata.StepData[2].TabData.Ident = "{ALPHA}. ";
fmtdata.StepData[1].TabData.Ident = "{alpha}) ";
}
private void AddEXCLN00_OVRfmt(ref FormatData fmtdata)
{
fmtdata.BoxData[1].Index = 1;
fmtdata.BoxData[1].BXHorz = ConvertText("\x0C4");
fmtdata.BoxData[1].BXLLC = ConvertText("\x0C0");
fmtdata.BoxData[1].BXLRC = ConvertText("\x0D9");
fmtdata.BoxData[1].BXULC = ConvertText("\x0DA");
fmtdata.BoxData[1].BXURC = ConvertText("\x0BF");
fmtdata.BoxData[1].BXVert = ConvertText("\x0B3");
fmtdata.BoxData[1].Height = 0;
fmtdata.BoxData[1].TabPos = 213F;
fmtdata.BoxData[1].Start = 85F;
fmtdata.BoxData[1].End = 377F;
fmtdata.BoxData[1].TxtStart = 108F;
fmtdata.BoxData[1].TxtWidth = 254F;
fmtdata.BoxData[1].Font = new VE_Font();
fmtdata.BoxData[1].Font.FontFamily = "Courier New";
fmtdata.BoxData[1].Font.FontSize = "12";
fmtdata.BoxData[1].Font.CPI = "10";
fmtdata.BoxData[2].Index = 2;
fmtdata.BoxData[2].BXHorz = "*";
fmtdata.BoxData[2].BXLLC = "*";
fmtdata.BoxData[2].BXLRC = "*";
fmtdata.BoxData[2].BXULC = "*";
fmtdata.BoxData[2].BXURC = "*";
fmtdata.BoxData[2].BXVert = "*";
fmtdata.BoxData[2].BXMLS = "*";
fmtdata.BoxData[2].BXMRS = "*";
fmtdata.BoxData[2].BXMID = "*";
fmtdata.BoxData[2].BXUMID = "*";
fmtdata.BoxData[2].BXLMID = "*";
fmtdata.BoxData[2].Height = 0;
fmtdata.BoxData[2].TabPos = 213F;
fmtdata.BoxData[2].Start = 85F;
fmtdata.BoxData[2].End = 377F;
fmtdata.BoxData[2].TxtStart = 108F;
fmtdata.BoxData[2].TxtWidth = 254F;
fmtdata.BoxData[2].Font = new VE_Font();
fmtdata.BoxData[2].Font.FontFamily = "Courier New";
fmtdata.BoxData[2].Font.FontSize = "12";
fmtdata.BoxData[2].Font.CPI = "10";
}
private void AddEXCLN01fmt(ref FormatData fmtdata)
{
fmtdata.SectData.StepSectionData.StpSectLayData.WidSTablePrint = "489,229.2,144";
fmtdata.SectData.StepSectionData.StpSectLayData.BoxLeftAdj = "-43.2";
fmtdata.StepData[6].StepLayoutData.EveryNLines = "-99";
fmtdata.StepData[7].StepLayoutData.EveryNLines = "-99";
}
private void AddEXEDEVfmt(ref FormatData fmtdata)
{
fmtdata.SectData.StepSectionData.StpSectLayData.WidSTablePrint = "471,180,120";
fmtdata.SectData.StepSectionData.StpSectLayData.RNOWidthAlt = "200,200";
fmtdata.SectData.StepSectionData.StpSectLayData.ColS = 66F;
fmtdata.SectData.StepSectionData.StpSectLayData.WidT = 526F;
fmtdata.StepData[2].TabData.RNOIdent = "ERG STEP : ";
fmtdata.StepData[3].TabData.RNOIdent = "ERG NOTE : ";
fmtdata.StepData[6].TabData.RNOIdent = "ERG CAUTION : ";
fmtdata.StepData[7].TabData.RNOIdent = "ERG NOTE : ";
fmtdata.StepData[9].TabData.RNOIdent = "ERG CAUTION : ";
fmtdata.StepData[43].ColOverride = "42";
fmtdata.SectData.StepSectionData.StpSectLayData.UseRNOParentIdent = "True";
fmtdata.SectData.StepSectionData.StpSectLayData.DevNoteOrCautionTabOffset = "42";
}
}
public partial class FmtToXml
{
private void AddCWEfmt(ref PageStyles pgstyles)
{
pgstyles.PgStyles[0].Items[5].Col = 270F;
}
private void AddEXCLN00fmt(ref PageStyles pgstyles)
{
pgstyles.PgStyles[0].Items[4].Col = 446F;
pgstyles.PgStyles[0].Items[4].Row = 30F;
pgstyles.PgStyles[0].Items[5].Col = 230F;
}
private void AddEXCLN00Doc(ref DocStyles dcstyles)
{
dcstyles.DcStyles[0].PageWidth = 576.2F;
dcstyles.DcStyles[0].PageLength = 600F;
dcstyles.DcStyles[0].FooterLen = 24F;
}
private void AddCWEDoc(ref DocStyles dcstyles)
{
dcstyles.DcStyles[0].PageWidth = 580.2F;
dcstyles.DcStyles[1].LeftMargin = 48F;
dcstyles.DcStyles[1].PageWidth = 579.2F;
dcstyles.DcStyles[1].PageLength = 578F;
}
private void CWEDocFixCB(ref DocStyles dcstyles)
{
for(int i=0;i<dcstyles.DcStyles.Length;i++)
{
DocStyle ds = dcstyles.DcStyles[i];
if (ds.CBLoc == 0 && ds.ContBottom != null)
dcstyles.DcStyles[i].CBLoc = 5;
}
}
private void AddEXEDEVDoc(ref DocStyles dcstyles)
{
dcstyles.DcStyles[0].LeftMargin = 36F;
}
}
public partial class RtfToSvg
{
private void AddCWE(XmlDocument myDoc)
{
XmlDocument xdNew = new XmlDocument();
xdNew.LoadXml("<svg xmlns=\"http://www.w3.org/2000/svg\"> <g id=\"C2\">" +
"<line x1=\"7\" y1=\"-16\" x2=\"-5\" y2=\"-4\" stroke=\"black\" stroke-width=\"0.85\" />" +
"<line x1=\"-5\" y1=\"-4\" x2=\"7\" y2=\"8\" stroke=\"black\" stroke-width=\"0.85\" />" +
"<line x1=\"7\" y1=\"8\" x2=\"19\" y2=\"-4\" stroke=\"black\" stroke-width=\"0.85\" />" +
"<line x1=\"19\" y1=\"-4\" x2=\"7\" y2=\"-16\" stroke=\"black\" stroke-width=\"0.85\" />" +
"</g></svg>");
myDoc.DocumentElement.AppendChild(myDoc.ImportNode(xdNew.DocumentElement.ChildNodes[0], true));
xdNew.LoadXml("<svg xmlns=\"http://www.w3.org/2000/svg\"> <g id=\"C3\">" +
"<text x=\"-10\" y=\"0\" font-family=\"Courier New\" font-size=\"12\">*</text>" +
"</g></svg>");
myDoc.DocumentElement.AppendChild(myDoc.ImportNode(xdNew.DocumentElement.ChildNodes[0], true));
}
private void AddEXCLN(XmlDocument myDoc)
{
XmlDocument xdNew = new XmlDocument();
xdNew.LoadXml("<svg xmlns=\"http://www.w3.org/2000/svg\"> <g id=\"C2\">" +
"<line x1=\"7\" y1=\"-16\" x2=\"-5\" y2=\"-4\" stroke=\"black\" stroke-width=\"0.85\" />" +
"<line x1=\"-5\" y1=\"-4\" x2=\"7\" y2=\"8\" stroke=\"black\" stroke-width=\"0.85\" />" +
"<line x1=\"7\" y1=\"8\" x2=\"19\" y2=\"-4\" stroke=\"black\" stroke-width=\"0.85\" />" +
"<line x1=\"19\" y1=\"-4\" x2=\"7\" y2=\"-16\" stroke=\"black\" stroke-width=\"0.85\" />" +
"</g></svg>");
myDoc.DocumentElement.AppendChild(myDoc.ImportNode(xdNew.DocumentElement.ChildNodes[0], true));
xdNew.LoadXml("<svg xmlns=\"http://www.w3.org/2000/svg\"> <g id=\"C3\">" +
"<text x=\"-10\" y=\"0\" font-family=\"Courier New\" font-size=\"12\">*</text>" +
"</g></svg>");
myDoc.DocumentElement.AppendChild(myDoc.ImportNode(xdNew.DocumentElement.ChildNodes[0], true));
}
}
}
-528
View File
@@ -1,528 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
namespace fmtxml
{
public partial class FmtFileToXml
{
private void AddBGEALNfmt(ref FormatData fmtdata)
{
fmtdata.TPL = "0, 0, 0, 0, 0, 0, title\n1, 1, 65, 10,-19, -32768,\n2, 42, 0, 26, -1, 0,DEVICE\n2, 42, 27, 31, -1, 0,SETPOINT\n2, 42, 0, 77, 0, 0,POSSIBLE CAUSES\n2, 42, 0, 77, 0, 0,AUTOMATIC ACTIONS\n2, 42, 0, 0, 12294, 5186, CONDITION RESPONSE\n2, 42, 0, 77, 0, 0,ANNUNCIATOR COMPENSATORY ACTIONS\n2, 42, 0, 77, 0, 0,REFERENCES\n\n";
fmtdata.SectData.StepSectionData.StpSectLayData.CautionNoteOrder = "7,6,22"; // Note,Caution,Warning
fmtdata.SectData.StepSectionData.CompressHPSub = "False";
fmtdata.SectData.StepSectionData.CompressPropSubSup = "True";
fmtdata.PrintData.UnitNumber = "True";
fmtdata.PrintData.SpecialCaseCalvert = "True"; // do I need this for alarms
fmtdata.PrintData.SpecialCaseCalvertAlarm = "True";
fmtdata.ProcData.TitleLength = 37;
fmtdata.ProcData.CoverTitleLength = 45;
fmtdata.SectData.StepSectionData.SequentialTabFormat[1].TabFormat = " {seq}. ";
fmtdata.SectData.StepSectionData.SequentialTabFormat[1].PrintTabFormat = " {seq}. ";
fmtdata.StepData[2].TabData.IdentEdit = "WINDOW ";
fmtdata.StepData[2].TabData.Ident = "WINDOW ";
fmtdata.StepData[2].UseOldTemplate = "True";
//fmtdata.StepData[6].StepLayoutData.EveryNLines = "-99";
//fmtdata.StepData[7].StepLayoutData.EveryNLines = "-99";
// Table
fmtdata.StepData[8].Font.FontFamily = "Lucida Console";
// AER Table
fmtdata.StepData[10].Font.FontFamily = "Lucida Console";
fmtdata.StepData[20].StepLayoutData.EveryNLines = "1";
//fmtdata.StepData[22].StepLayoutData.EveryNLines = "-99";
// Title
fmtdata.StepData[12].StepEditData.Searchable = "True";
//TitleWithTextRight
fmtdata.StepData[42].StepEditData.Searchable = "True";
// TitleWithTextBelow
fmtdata.StepData[43].UseOldTemplate = "True";
fmtdata.StepData[43].StepEditData.Searchable = "True";
fmtdata.StepData[14].StepLayoutData.EveryNLines = "-99";
fmtdata.StepData[31].StepLayoutData.EveryNLines = "-99"; // not sure if I need this - inheritance
fmtdata.StepData[20].StepPrintData.Justify = "Center";
fmtdata.StepData[20].OneLineBeforeTab = "True";
fmtdata.StepData[20].SpaceIn = "True";
fmtdata.StepData[20].StepLayoutData.EveryNLines = "1";
fmtdata.StepData[0].Font.CPI = "12";
fmtdata.BoxData[1].TxtStart = 356;
fmtdata.BoxData[1].TxtWidth = 130;
fmtdata.BoxData[1].BXMLS = null;
fmtdata.BoxData[1].BXMRS = null;
fmtdata.BoxData[2].TxtWidth = 440;
fmtdata.BoxData[3].TxtWidth = 440;
fmtdata.BoxData[4].TxtWidth = 440;
fmtdata.SectData.ReplaceStrData[10].ReplaceWord = @"(\[B\w*\])";
fmtdata.SectData.ReplaceStrData[10].ReplaceWith = @"\b $1\b0 ";
}
private void AddBGEEOPfmt(ref FormatData fmtdata)
{
fmtdata.SectData.StepSectionData.CompressHPSub = "False";
fmtdata.SectData.StepSectionData.CompressPropSubSup = "True";
fmtdata.PrintData.UnitNumber = "True";
fmtdata.PrintData.SpecialCaseCalvert = "True";
fmtdata.SectData.SectionNumber.Level0Big = "True";
fmtdata.SectData.SectionHeader.Level0Big = "True";
fmtdata.SectData.StepSectionData.StpSectLayData.ColS = 30;
fmtdata.SectData.StepSectionData.StpSectLayData.ColRTable = "0,192,126";
fmtdata.SectData.StepSectionData.StpSectLayData.ColT = -16;
fmtdata.SectData.StepSectionData.StpSectLayData.WidT = 442;
fmtdata.SectData.StepSectionData.StpSectLayData.TabPtsPerChar = 6.2f;
fmtdata.SectData.StepSectionData.StpSectLayData.CautionNoteOrder = "29,7,6,22"; // Message,Note,Caution,Warning
fmtdata.SectData.StepSectionData.SequentialTabFormat[4].TabFormat = "{seq})";
fmtdata.SectData.StepSectionData.SequentialTabFormat[4].PrintTabFormat = "{seq})";
fmtdata.TransData.UseSpecificTransitionModifier = "True";
fmtdata.TransData.UseSpecificPageNo = "True";
fmtdata.StepData[2].TabData.Ident = " {numeric}. ";
fmtdata.StepData[2].TabData.IdentEdit = " {numeric}. ";
fmtdata.StepData[2].TabData.RNOIdent = " . ";
fmtdata.StepData[2].TabData.RNOIdentEdit = " . ";
fmtdata.StepData[6].SeparateBox = "True";
//fmtdata.StepData[6].MatchUpRNO = "False";
fmtdata.StepData[7].SeparateBox = "True";
//fmtdata.StepData[7].MatchUpRNO = "False";
// Table
fmtdata.StepData[8].Font.FontFamily = "Lucida Console";
// AER Table
fmtdata.StepData[10].Font.FontFamily = "Lucida Console";
fmtdata.StepData[29].CenterOneLineOnly = "False"; // this is BGE's message type (used as paragraph off section.
fmtdata.StepData[29].MatchUpRNO = "False";
fmtdata.StepData[29].AlignNullTabWSectHead = "True";
// fix caution/notes starting xlocation:
fmtdata.StepData[6].ColOverride = "72";
fmtdata.StepData[7].ColOverride = "72";
fmtdata.StepData[20].ColOverride = "72";
fmtdata.StepData[21].ColOverride = "72";
fmtdata.StepData[22].ColOverride = "72";
fmtdata.StepData[23].ColOverride = "72";
fmtdata.StepData[26].ColOverride = "72";
fmtdata.StepData[27].ColOverride = "72";
fmtdata.StepData[28].ColOverride = "72";
fmtdata.StepData[29].ColOverride = "72";
fmtdata.StepData[32].ColOverride = "72";
// equip list - don't override width:
fmtdata.StepData[31].WidthOverride = null;
fmtdata.StepData[31].WidthOverrideEdit = null;
fmtdata.TransData.TransTypeData[4].TransFormat = @"{Sect Num}, \ul {Sect Title}\ulnone , Step {First Step}";
fmtdata.TransData.TransTypeData[5].TransFormat = @"{Proc Num}, \ul {Proc Title}\ulnone , {Sect Num}, \ul {Sect Title}\ulnone , Step {First Step}";
fmtdata.TransData.TransTypeData[6].TransFormat = @"{Sect Num}, \ul {Sect Title}\ulnone , Step {First Step}{Page Num}";
fmtdata.TransData.TransTypeData[9].TransFormat = @"{Proc Num} {IND}\ul {Proc Title}\ulnone ";
fmtdata.TransData.TransTypeData[10].TransFormat = @"{First Step}, \ul {Step Text}\ulnone {Page Num}";
fmtdata.SectData.ReplaceStrData[27].ReplaceWord = @"(\[B\w*\])";
fmtdata.SectData.ReplaceStrData[27].ReplaceWith = @"\b $1\b0 ";
}
private void AddBGEEOPOverridefmt(ref FormatData fmtdata)
{
fmtdata.TransData.TransTypeData[0].TransUI = "ProcMenu, SectDefault, StepAllowNone, StepFirst";
fmtdata.TransData.TransTypeData[4].TransUI = "ProcCur, SectMenuAny, StepAllowNone, StepFirst";
fmtdata.TransData.TransTypeData[5].TransUI = "ProcMenu, SectMenuAny, StepAllowNone, StepFirst";
}
}
public partial class FmtToXml
{
private void AddBGEEOPDOC(ref DocStyles dcstyles)
{
dcstyles.DcStyles[0].TopMargin = 96;
dcstyles.DcStyles[0].CBLoc = 6;
dcstyles.DcStyles[1].PageLength = 600;
dcstyles.DcStyles[1].PageWidth = 552;
dcstyles.DcStyles[1].EndMargin = 206;
dcstyles.DcStyles[2].CBMargin = 96;
dcstyles.DcStyles[2].CBMarginR = 335;
dcstyles.DcStyles[2].CBLoc = 6;
dcstyles.DcStyles[2].EndMargin = 75;
dcstyles.DcStyles[2].PageWidth = 552;
dcstyles.DcStyles[2].CenterLineX = 240;
dcstyles.DcStyles[2].CenterLineYTop = 647;
dcstyles.DcStyles[2].CenterLineYBottom = 24;
dcstyles.DcStyles[3].PageWidth = 552;
dcstyles.DcStyles[3].CenterLineX = 240;
dcstyles.DcStyles[3].CenterLineYTop = 624;
dcstyles.DcStyles[3].CenterLineYBottom = 24;
// Attachment Step
dcstyles.DcStyles[4].FooterLen = 0;
dcstyles.DcStyles[4].PageWidth = 552;
// EOP Placekeeper
dcstyles.DcStyles[12].TopMargin = 138;
dcstyles.DcStyles[12].PageLength = 609;
dcstyles.DcStyles[12].LeftMargin = 106;
// AOP Placekeeper
dcstyles.DcStyles[13].TopMargin = 138;
dcstyles.DcStyles[13].PageLength = 609;
dcstyles.DcStyles[13].LeftMargin = 106;
// various styles without DONTCOUNTINTOC
dcstyles.DcStyles[6].DocStructStyle.DocStyle = "DontNumberInTOC"; // Cover page
dcstyles.DcStyles[10].DocStructStyle.DocStyle = "DontNumberInTOC"; // list of effective pages
dcstyles.DcStyles[11].DocStructStyle.DocStyle = "TableOfContents"; // Table of Contents
}
private void AddBGEEOPDOC_Y00(ref DocStyles dcstyles)
{
// AOP PlaceKeeper w/ Initials
dcstyles.DcStyles[2].TopMargin = 138;
dcstyles.DcStyles[2].PageLength = 609;
dcstyles.DcStyles[2].LeftMargin = 76;
}
private void AddBGEEOPPage(ref PageStyles pgstyles)
{
pgstyles.PgStyles[0].Items[2].Col = 480;
pgstyles.PgStyles[0].Items[3].Col = 480;
pgstyles.PgStyles[0].Items[4].Col = 480;
pgstyles.PgStyles[1].Items[2].Col = 480;
pgstyles.PgStyles[1].Items[3].Col = 480;
pgstyles.PgStyles[1].Items[4].Col = 480;
pgstyles.PgStyles[2].Items[2].Col = 480;
pgstyles.PgStyles[2].Items[3].Col = 480;
pgstyles.PgStyles[2].Items[4].Col = 480;
pgstyles.PgStyles[2].Items[6].Col = 120;
pgstyles.PgStyles[3].Items[6].Col = 246;
pgstyles.PgStyles[4].Items[2].Col = 480;
pgstyles.PgStyles[4].Items[3].Col = 480;
pgstyles.PgStyles[5].Items[2].Col = 480;
pgstyles.PgStyles[5].Items[3].Col = 480;
pgstyles.PgStyles[6].Items[2].Col = 474;
pgstyles.PgStyles[6].Items[3].Col = 474;
pgstyles.PgStyles[6].Items[4].Col = 474;
pgstyles.PgStyles[7].Items[2].Col = 474;
pgstyles.PgStyles[7].Items[3].Col = 474;
pgstyles.PgStyles[8].Items[2].Col = 474;
pgstyles.PgStyles[8].Items[3].Col = 474;
pgstyles.PgStyles[8].Items[4].Col = 474;
// EOP Placekeeper
pgstyles.PgStyles[9].Items[1].Col = -16; // BOX5
pgstyles.PgStyles[9].Items[2].Col = 464; // EOPNUM
pgstyles.PgStyles[9].Items[3].Col = 464; // REVUNIT
pgstyles.PgStyles[9].Items[4].Col = 463; // Page {PAGE} of {OF}
pgstyles.PgStyles[9].Items[5].Col = 227; // PLACEKEEPER
Array.Resize<PSItem>(ref pgstyles.PgStyles[9].Items, 7);
pgstyles.PgStyles[9].Items[6].Token = "NOTE: Continuously applicable steps are designated with a \"C\" in the DONE column."; // Continuous foot note
pgstyles.PgStyles[9].Items[6].Row = 750; // Continuous foot note
pgstyles.PgStyles[9].Items[6].Col = 227; // Continuous foot note
pgstyles.PgStyles[9].Items[6].Justify = "PSCenter"; // Continuous foot note
pgstyles.PgStyles[9].Items[6].Style = new VE_Font();
pgstyles.PgStyles[9].Items[6].Style.FontFamily = "Arial";
pgstyles.PgStyles[9].Items[6].Style.FontSize = "10";
pgstyles.PgStyles[9].Items[6].Style.FontStyle = "None";
pgstyles.PgStyles[9].Items[6].Style.CPI = "12";
pgstyles.PgStyles[10].Items[2].Col = 474;
pgstyles.PgStyles[10].Items[3].Col = 474;
pgstyles.PgStyles[11].Items[2].Col = 480;
pgstyles.PgStyles[11].Items[3].Col = 480;
pgstyles.PgStyles[11].Items[4].Col = 480;
pgstyles.PgStyles[13].Items[2].Col = 474;
pgstyles.PgStyles[13].Items[3].Col = 474;
pgstyles.PgStyles[13].Items[4].Col = 474;
// AOP Placekeeper
pgstyles.PgStyles[14].Items[1].Col = -16; // BOX5
pgstyles.PgStyles[14].Items[2].Col = 464; // EOPNUM
pgstyles.PgStyles[14].Items[3].Col = 464; // REVUNIT
pgstyles.PgStyles[14].Items[4].Col = 227; // SECTIONLEVELNUMBER
pgstyles.PgStyles[14].Items[5].Col = 227; // Page {PAGE} of {OF}
pgstyles.PgStyles[14].Items[6].Col = 227; // PLACEKEEPER
Array.Resize<PSItem>(ref pgstyles.PgStyles[14].Items, 8);
pgstyles.PgStyles[14].Items[7].Token = "NOTE: Continuously applicable steps are designated with a \"C\"; in the DONE column."; // Continuous foot note
pgstyles.PgStyles[14].Items[7].Row = 750; // Continuous foot note
pgstyles.PgStyles[14].Items[7].Col = 227; // Continuous foot note
pgstyles.PgStyles[14].Items[7].Justify = "PSCenter"; // Continuous foot note
pgstyles.PgStyles[14].Items[7].Style = new VE_Font();
pgstyles.PgStyles[14].Items[7].Style.FontFamily = "Arial";
pgstyles.PgStyles[14].Items[7].Style.FontSize = "10";
pgstyles.PgStyles[14].Items[7].Style.FontStyle = "None";
pgstyles.PgStyles[14].Items[7].Style.CPI = "12";
}
private void AddBGEEOPPage_Z00(ref PageStyles pgstyles)
{
// AOP PlaceKeeper w/ Initials
pgstyles.PgStyles[1].Items[1].Col = -16; // BOX5
pgstyles.PgStyles[1].Items[2].Col = 458; // EOPNUM
pgstyles.PgStyles[1].Items[3].Col = 458; // REVUNIT
pgstyles.PgStyles[1].Items[4].Col = 227; // SECTIONLEVELNUMBER
pgstyles.PgStyles[1].Items[5].Col = 227; // Page {PAGE} of {OF}
pgstyles.PgStyles[1].Items[6].Col = 227; // PLACEKEEPER
Array.Resize<PSItem>(ref pgstyles.PgStyles[1].Items, 8);
pgstyles.PgStyles[1].Items[7].Token = "NOTE: Continuously applicable steps are designated with a \"C\"in the DONE column."; // Continuous foot note
pgstyles.PgStyles[1].Items[7].Row = 750; // Continuous foot note
pgstyles.PgStyles[1].Items[7].Col = 227; // Continuous foot note
pgstyles.PgStyles[1].Items[7].Justify = "PSCenter"; // Continuous foot note
pgstyles.PgStyles[1].Items[7].Style = new VE_Font();
pgstyles.PgStyles[1].Items[7].Style.FontFamily = "Arial";
pgstyles.PgStyles[1].Items[7].Style.FontSize = "10";
pgstyles.PgStyles[1].Items[7].Style.FontStyle = "None";
pgstyles.PgStyles[1].Items[7].Style.CPI = "12";
}
private void AddBGEALNPage(ref PageStyles pgstyles)
{
pgstyles.PgStyles[1].Items[4].Token = "{COVERPROCTITLE}";
// remove the INIT item in proc steps:
int numstyles = pgstyles.PgStyles.Length; // number of current PgStyles
PageStyle[] pgs = new PageStyle[numstyles+1];
PageStyle ps;
// copy existing page lists except for the one with the INIT
for (int i = 0; i < numstyles - 1; i++)
{
if (i != 4)
{
ps = new PageStyle();
ps = pgstyles.PgStyles[i];
pgs[i] = ps;
}
}
// now do the proc step pageslists without the INIT
ps = new PageStyle();
ps.Name = "Procedure Steps";
ps.Index = 4;
PSItem[] Fpsitms = null;
Fpsitms = new PSItem[6];
PSItem pi = new PSItem();
pi.Token = "{DRAFTPAGE}{REFERENCEPAGE}{MASTERPAGE}{SAMPLEPAGE}";
pi.Row = 12;
pi.Col = -3;
pi.Justify = "PSCenter";
pi.Style = new VE_Font();
pi.Style.FontFamily = "Prestige Elite Tall";
pi.Style.FontSize = "10";
pi.Style.FontStyle = "None";
pi.Style.CPI = "12";
Fpsitms[0] = pi;
pi = new PSItem();
pi.Token = "{EOPNUM}";
pi.Row = 24;
pi.Col = 432;
pi.Justify = "PSLeft";
pi.Style = new VE_Font();
pi.Style.FontFamily = "Arial";
pi.Style.FontSize = "11";
pi.Style.FontStyle = "Bold";
pi.Style.CPI = "12";
Fpsitms[1] = pi;
pi = new PSItem();
pi.Token = "Rev. {REVUNIT}";
pi.Row = 36;
pi.Col = 432;
pi.Justify = "PSLeft";
pi.Style = new VE_Font();
pi.Style.FontFamily = "Arial";
pi.Style.FontSize = "11";
pi.Style.FontStyle = "Bold";
pi.Style.CPI = "12";
Fpsitms[2] = pi;
pi = new PSItem();
pi.Token = "{PROCTITLE}";
pi.Row = 36;
pi.Col = 255;
pi.Justify = "PSCenter";
pi.Style = new VE_Font();
pi.Style.FontFamily = "Arial";
pi.Style.FontSize = "11";
pi.Style.FontStyle = "Bold";
pi.Style.CPI = "12";
Fpsitms[3] = pi;
pi = new PSItem();
pi.Token = "Page {PAGE} of {OF}";
pi.Row = 48;
pi.Col = 432;
pi.Justify = "PSLeft";
pi.Style = new VE_Font();
pi.Style.FontFamily = "Arial";
pi.Style.FontSize = "11";
pi.Style.FontStyle = "Bold";
pi.Style.CPI = "12";
Fpsitms[4] = pi;
pi = new PSItem();
pi.Token = "{BOX5}";
pi.Row = 48;
pi.Col = 6;
pi.Justify = "PSLeft";
pi.Style = new VE_Font();
pi.Style.FontFamily = "Arial";
pi.Style.FontSize = "11";
pi.Style.FontStyle = "None";
pi.Style.CPI = "12";
Fpsitms[5] = pi;
ps.Items = Fpsitms;
pgs[4] = ps;
// now add the Attachment Step - No Header
ps = new PageStyle();
ps.Name = "Attachment Step - No Header";
ps.Index = 5;
Fpsitms = new PSItem[8];
pi = new PSItem();
pi.Token = "{DRAFTPAGE}{REFERENCEPAGE}{MASTERPAGE}{SAMPLEPAGE}";
pi.Row = 12;
pi.Col = -3;
pi.Justify = "PSCenter";
pi.Style = new VE_Font();
pi.Style.FontFamily = "Prestige Elite Tall";
pi.Style.FontSize = "10";
pi.Style.FontStyle = "None";
pi.Style.CPI = "12";
Fpsitms[0] = pi;
pi = new PSItem();
pi.Token = "{EOPNUM}";
pi.Row = 24;
pi.Col = 438;
pi.Justify = "PSLeft";
pi.Style = new VE_Font();
pi.Style.FontFamily = "Arial";
pi.Style.FontSize = "11";
pi.Style.FontStyle = "Bold";
pi.Style.CPI = "12";
Fpsitms[1] = pi;
pi = new PSItem();
pi.Token = "{SECTIONLEVELNUMBER}";
pi.Row = 36;
pi.Col = 438;
pi.Justify = "PSLeft";
pi.Style = new VE_Font();
pi.Style.FontFamily = "Arial";
pi.Style.FontSize = "11";
pi.Style.FontStyle = "Bold";
pi.Style.CPI = "12";
Fpsitms[2] = pi;
pi = new PSItem();
pi.Token = "Rev. {REVUNIT}";
pi.Row = 48;
pi.Col = 438;
pi.Justify = "PSLeft";
pi.Style = new VE_Font();
pi.Style.FontFamily = "Arial";
pi.Style.FontSize = "11";
pi.Style.FontStyle = "Bold";
pi.Style.CPI = "12";
Fpsitms[3] = pi;
pi = new PSItem();
pi.Token = "{PROCTITLE}";
pi.Row = 48;
pi.Col = 255;
pi.Justify = "PSCenter";
pi.Style = new VE_Font();
pi.Style.FontFamily = "Arial";
pi.Style.FontSize = "11";
pi.Style.FontStyle = "Bold";
pi.Style.CPI = "12";
Fpsitms[4] = pi;
pi = new PSItem();
pi.Token = "Page {DOCCURPAGE} of {DOCTOTPAGE}";
pi.Row = 60;
pi.Col = 438;
pi.Justify = "PSLeft";
pi.Style = new VE_Font();
pi.Style.FontFamily = "Arial";
pi.Style.FontSize = "11";
pi.Style.FontStyle = "Bold";
pi.Style.CPI = "12";
Fpsitms[5] = pi;
pi = new PSItem();
pi.Token = "{BOX5}";
pi.Row = 60;
pi.Col = 6;
pi.Justify = "PSLeft";
pi.Style = new VE_Font();
pi.Style.FontFamily = "Prestige Elite Tall";
pi.Style.FontSize = "10";
pi.Style.FontStyle = "None";
pi.Style.CPI = "12";
Fpsitms[6] = pi;
pi = new PSItem();
pi.Token = "{SECTIONLEVELTITLE}";
pi.Row = 96;
pi.Col = 255;
pi.Justify = "PSCenter";
pi.Style = new VE_Font();
pi.Style.FontFamily = "Arial";
pi.Style.FontSize = "14";
pi.Style.FontStyle = "Underline, Bold";
pi.Style.CPI = "12";
Fpsitms[7] = pi;
ps.Items = Fpsitms;
pgs[5] = ps;
pgstyles.PgStyles = pgs; // save new pagelist
}
private void AddBGEALNDOC(ref DocStyles dcstyles)
{
dcstyles.DcStyles[0].ComponentList = true;
dcstyles.DcStyles[0].PageWidth = 558;
dcstyles.DcStyles[0].CBLoc = 4;
dcstyles.DcStyles[0].CBMargin = 35;
dcstyles.DcStyles[0].CBMarginR = 287;
//adding new "Attachment Step - No Header" docstyle
Array.Resize<DocStyle>(ref dcstyles.DcStyles, dcstyles.DcStyles.Length + 1);
dcstyles.DcStyles[5].Name = "Attachment Step - No Header";
dcstyles.DcStyles[5].Index = 5;
dcstyles.DcStyles[5].numberingsequence = 4;
dcstyles.DcStyles[5].IsStepSection = true;
dcstyles.DcStyles[5].UseCheckOffs = false;
dcstyles.DcStyles[5].UseColSByLevel = true;
dcstyles.DcStyles[5].oldtonew = 1048576;
dcstyles.DcStyles[5].CancelSectTitle = true;
dcstyles.DcStyles[5].SpecialStepsFoldout = false;
dcstyles.DcStyles[5].UndSpecialStepsFoldout = false;
dcstyles.DcStyles[5].ExtraLineHeader = false;
dcstyles.DcStyles[5].AlignHLSTabWithSect = false;
dcstyles.DcStyles[5].pagestyle = 5;
dcstyles.DcStyles[5].TopMargin = 120F;
dcstyles.DcStyles[5].FooterLen = 0F;
dcstyles.DcStyles[5].PageLength = 600;
dcstyles.DcStyles[5].PageWidth = 576F;
dcstyles.DcStyles[5].LeftMargin = 48F;
dcstyles.DcStyles[5].dstyle = new VE_Font();
dcstyles.DcStyles[5].dstyle.FontFamily = "Arial";
dcstyles.DcStyles[5].dstyle.FontSize = "11";
dcstyles.DcStyles[5].dstyle.FontStyle = "None";
dcstyles.DcStyles[5].dstyle.CPI = "12";
dcstyles.DcStyles[5].DocStructStyle = new VE_DocStyle();
dcstyles.DcStyles[5].DocStructStyle.DocStyleUse = E_DocStyleUse.UseOnAllPages;
dcstyles.DcStyles[5].DocStructStyle.DocStyle = "DontNumberInTOC";
}
}
}
-203
View File
@@ -1,203 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
namespace fmtxml
{
public partial class FmtFileToXml
{
private void AddCATADEVfmt(ref FormatData fmtdata)
{
fmtdata.ProcData.TitleLength = 45;
// Fix Logic for CAPSPIfLastLower
fmtdata.ROData.CapRoIfLastLower = "False";
fmtdata.ROData.CapSPIfLastLower = "True";
fmtdata.SectData.ReplaceWordsInROs = "False";
}
private void AddCATDEVfmt(ref FormatData fmtdata)
{
fmtdata.SectData.ReplaceWordsInROs = "False";
}
private void AddCATfmt(ref FormatData fmtdata) // Catawba
{
// Fix Logic for CAPSPIfLastLower
fmtdata.ROData.CapRoIfLastLower = "False";
fmtdata.ROData.CapSPIfLastLower = "True";
fmtdata.FontData.FontSize = "12";
//fmtdata.SectData.StepSectionData.StpSectLayData.Separator.SeparatorLocation = 2;
fmtdata.SectData.StepSectionData.StpSectLayData.ColT = -3;
// ColS="42" WidT="454" ColRTable="0,264,138" WidSTableEdit="432,221,120" WidSTablePrint="480,221,120"
fmtdata.SectData.StepSectionData.StpSectLayData.ColS = 42;
fmtdata.SectData.StepSectionData.StpSectLayData.WidT = 455;
fmtdata.SectData.StepSectionData.StpSectLayData.ColRTable = "0,264,138";
fmtdata.SectData.StepSectionData.StpSectLayData.WidSTableEdit = "432,221,120";
fmtdata.SectData.StepSectionData.StpSectLayData.WidSTablePrint = "480,221,120";
fmtdata.SectData.StepSectionData.AdjustRNOCautionNoteWidth = "True";
fmtdata.SectData.ReplaceWordsInROs = "False";
fmtdata.ProcData.TitleLength = 45;
// Base
fmtdata.StepData[0].StepLayoutData.STExtraSpace = "0";
// High
fmtdata.StepData[2].StepLayoutData.STExtraSpace = "12";
for (int i = 0; i < fmtdata.StepData.Length; i++)
{
if (fmtdata.StepData[i].Font != null && fmtdata.StepData[i].Font.FontFamily == "Arial")
fmtdata.StepData[i].Font.FontSize = "12";
if (fmtdata.StepData[i].TabData.Font.FontFamily == "Arial")
fmtdata.StepData[i].TabData.Font.FontSize = "12";
}
// caution separator
//fmtdata.StepData[6].StepLayoutData.STBoxindex = "1";
fmtdata.StepData[6].TabData.Bullet.Separate = "True";
fmtdata.StepData[6].TabData.Bullet.Font = new VE_Font();
fmtdata.StepData[6].TabData.Bullet.Font.FontFamily = "Arial";
fmtdata.StepData[6].TabData.Bullet.Font.FontSize = "12";
fmtdata.StepData[6].TabData.Bullet.Font.FontStyle = "none";
fmtdata.StepData[6].TabData.Bullet.Font.CPI = "12";
// note location/tab
//fmtdata.StepData[7].StepLayoutData.STBoxindex = "1";
fmtdata.StepData[7].TabData.Ident = "NOTE ";
fmtdata.StepData[7].TabData.IdentEdit = "NOTE ";
fmtdata.StepData[7].TabData.RNOIdent = "NOTE ";
fmtdata.StepData[7].TabData.Bullet.Separate = "True";
fmtdata.StepData[7].TabData.Bullet.Font = new VE_Font();
fmtdata.StepData[7].TabData.Bullet.Font.FontFamily = "Arial";
fmtdata.StepData[7].TabData.Bullet.Font.FontSize = "12";
fmtdata.StepData[7].TabData.Bullet.Font.FontStyle = "none";
fmtdata.StepData[7].TabData.Bullet.Font.CPI = "12";
// Bulleted High Level Step
fmtdata.StepData[9].TabData.Ident = "{bullet} ";
fmtdata.StepData[9].TabData.IdentEdit = "{bullet} ";
fmtdata.StepData[9].TabData.RNOIdent = "{bullet} ";
fmtdata.StepData[9].TabData.RNOIdentEdit = "{bullet} ";
// RNOType
fmtdata.StepData[40].Font.FontFamily = "Arial";
fmtdata.StepData[40].Font.FontSize = "12";
fmtdata.StepData[40].StepLayoutData.STExtraSpace = "0";
//// note location (create a box to locate it)
//fmtdata.BoxData[1].Index = 1;
//fmtdata.BoxData[1].Start = 6;
//fmtdata.BoxData[1].End = 240;
//fmtdata.BoxData[1].TxtStart = 12;
//fmtdata.BoxData[1].TxtWidth = 450;
//fmtdata.BoxData[1].BXULC = " ";
//Disable extra Cautions and notes
// Caution 1
fmtdata.StepData[20].Inactive = "True";
// Caution 2
fmtdata.StepData[21].Inactive = "True";
// Caution 3
fmtdata.StepData[27].Inactive = "True";
// Caution 4
fmtdata.StepData[29].Inactive = "True";
// Note 1
fmtdata.StepData[22].Inactive = "True";
// Note 2
fmtdata.StepData[23].Inactive = "True";
// Note 3
fmtdata.StepData[26].Inactive = "True";
// Note 4
fmtdata.StepData[28].Inactive = "True";
// Note 5
fmtdata.StepData[32].Inactive = "True";
}
private void AddCATfmtOVR(ref FormatData fmtdata) // Catawba
{
// Transitions
fmtdata.TransData.TransTypeData[0].TransFormat = "{Proc Num} ({Proc Title}), Step {First Step}";
fmtdata.TransData.TransTypeData[0].TransMenu = "{Proc Num} ({Proc Title}), Step {First Step}";
fmtdata.TransData.TransTypeData[3].TransFormat = "{First Step} through {Last Step} of {?.Proc Num} ({?.Proc Title}), {?.Sect Num} ({?.Sect Title})";
fmtdata.TransData.TransTypeData[3].TransMenu = "{First Step} through {Last Step} of {Proc Num} ({Proc Title}), {Sect Num} ({Sect Title})";
fmtdata.TransData.TransTypeData[3].TransUI = "ProcMenu, SectMenuStep, StepFirst, StepLast";
fmtdata.TransData.TransTypeData[4].TransFormat = "{Sect Num} ({Sect Title}), Step {First Step}";
fmtdata.TransData.TransTypeData[4].TransMenu = "{Sect Num} ({Sect Title}), Step {First Step}";
fmtdata.TransData.TransTypeData[4].TransUI = "ProcCur, SectMenuAny, StepAllowNone, StepFirst";
fmtdata.TransData.TransTypeData[5].TransFormat = "{Proc Num} ({Proc Title}), {Sect Num} ({Sect Title}), Step {First Step}";
fmtdata.TransData.TransTypeData[5].TransMenu = "{Proc Num} ({Proc Title}), {Sect Num} ({Sect Title}), Step {First Step}";
fmtdata.TransData.TransTypeData[5].TransUI = "ProcMenu, SectMenuAny, StepAllowNone, StepFirst";
fmtdata.TransData.TransTypeData[6].TransUI = "ProcCur, SectMenuStep, StepFirst";
//RNO Separator
fmtdata.SectData.StepSectionData.StpSectPrtData.RNOSepString = "\xA0 ";
}
}
public partial class FmtToXml
{
private void AddCATPage(ref PageStyles pgstyles)
{
// proc steps
pgstyles.PgStyles[0].Items[2].Token = "PAGE NO.";
pgstyles.PgStyles[0].Items[6].Token = "{PAGE} of {OF}";
pgstyles.PgStyles[0].Items[9].Token = "Revision {REV}";
// proc steps - no header
pgstyles.PgStyles[1].Items[2].Token = "PAGE NO.";
pgstyles.PgStyles[1].Items[6].Token = "{PAGE} of {OF}";
pgstyles.PgStyles[1].Items[9].Token = "Revision {REV}";
// enclosures
pgstyles.PgStyles[2].Items[2].Token = "PAGE NO.";
pgstyles.PgStyles[2].Items[6].Token = "{PAGE} of {OF}";
pgstyles.PgStyles[2].Items[8].Token = "Revision {REV}";
// Attachments
pgstyles.PgStyles[4].Items[2].Token = "PAGE NO.";
pgstyles.PgStyles[4].Items[6].Token = "{PAGE} of {OF}";
pgstyles.PgStyles[4].Items[8].Token = "Revision {REV}";
// Status Tree
pgstyles.PgStyles[5].Items[2].Token = "PAGE NO.";
pgstyles.PgStyles[5].Items[6].Token = "{PAGE} of {OF}";
pgstyles.PgStyles[5].Items[8].Token = "Revision {REV}";
// Table of contents
pgstyles.PgStyles[6].Items[2].Token = "PAGE NO.";
pgstyles.PgStyles[6].Items[5].Token = "{ROMANPAGE}";
pgstyles.PgStyles[6].Items[7].Token = "Revision {REV}";
}
private void AddCATDOC(ref DocStyles dcstyles)
{
SetCatawbaDocStyleFont(ref dcstyles);
dcstyles.DcStyles[0].CBMargin = 50;
//dcstyles.DcStyles[0].CBLoc = 3;
dcstyles.DcStyles[0].PageLength = 624;
dcstyles.DcStyles[1].CBMargin = 50;
//dcstyles.DcStyles[1].CBLoc = 3;
dcstyles.DcStyles[1].PageLength = 624;
dcstyles.DcStyles[2].CBMargin = 50;
//dcstyles.DcStyles[2].CBLoc = 3;
dcstyles.DcStyles[2].PageLength = 624;
}
private static void SetCatawbaDocStyleFont(ref DocStyles dcstyles)
{
int i = 0;
int ii = 0;
// Set font to Arial 12 pt
for (i = 0; i < dcstyles.DcStyles.Length; i++)
{
dcstyles.DcStyles[i].dstyle.FontFamily = "Arial";
dcstyles.DcStyles[i].dstyle.FontSize = "12";
dcstyles.DcStyles[i].ContStyle.FontFamily = "Arial";
dcstyles.DcStyles[i].ContStyle.FontSize = "12";
}
return;
}
}
public partial class RtfToSvg
{
private void AddCAT(XmlDocument myDoc)
{
}
}
}
-347
View File
@@ -1,347 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
namespace fmtxml
{
public partial class FmtFileToXml
{
private void AddTuecfmt(ref FormatData fmtdata) // Comanche Peak
{
fmtdata.PrintData.PrintCommonForZeroUnit = "True";
// SectionNumber
fmtdata.SectData.SectionNumber.Pos = 0;
fmtdata.SectData.SectionNumber.Just = "PSLeft";
fmtdata.SectData.SectionNumber.Font.FontFamily = "Prestige Elite Tall";
fmtdata.SectData.SectionNumber.Font.FontSize = "10";
fmtdata.SectData.SectionNumber.Font.FontStyle = "None";
fmtdata.SectData.SectionNumber.Font.CPI = "12";
// SectionHeader
fmtdata.SectData.SectionHeader.Pos = 19;
fmtdata.SectData.SectionHeader.Just = "PSLeft";
fmtdata.SectData.SectionHeader.Font.FontFamily = "Prestige Elite Tall";
fmtdata.SectData.SectionHeader.Font.FontSize = "10";
fmtdata.SectData.SectionHeader.Font.FontStyle = "Underline";
fmtdata.SectData.SectionHeader.Font.CPI = "12";
// StepSectionData
fmtdata.SectData.StepSectionData.StpSectLayData.WidSTableEdit = "426,198,120"; //"426,192,120";
fmtdata.SectData.StepSectionData.StpSectLayData.WidSTablePrint = "426,198,120"; //"426,192,120";
fmtdata.SectData.StepSectionData.StpSectLayData.ShowSectionTitles = "True";
// High Level Step
fmtdata.StepData[2].TabData.Ident = " {numeric} ";
// Imediate Action High Level Step
fmtdata.StepData[3].TabData.Ident = "{!C0}{numeric} ";
// Caution
fmtdata.StepData[6].OneLineBeforeTab = "True";
// Note
fmtdata.StepData[7].OneLineBeforeTab = "True";
// Continuous Action High Level Step
fmtdata.StepData[9].TabData.Ident = "*{numeric} ";
// LossOfAC - still working on this
fmtdata.StepData[18].ColOverride = "38";
fmtdata.StepData[18].ColOverrideEdit = "38";
fmtdata.StepData[18].WidthOverride = "438,198,120"; //"438,192,120";
fmtdata.StepData[18].WidthOverrideEdit = "438,198,120"; //"438,192,120";
fmtdata.StepData[18].StepEditData.TypeMenu.MenuItem = "Symptoms and Entry Step";
fmtdata.StepData[18].TabData.IdentEdit = "{numeric}) ";
fmtdata.StepData[18].TabData.Ident = "{numeric}) ";
fmtdata.StepData[18].TabData.RNOIdentEdit = " ";
//fmtdata.StepData[18].TabData.Justify = "Left";
// Caution 2
fmtdata.StepData[21].ParentType = "Base";
// Paragraph
fmtdata.StepData[24].StepEditData.TypeMenu.MenuItem = "Indented Paragraph";
fmtdata.StepData[24].TabData.IdentEdit = "{!.+?}{!.+?}"; // {!.+?} gets replaced with a space in PROMS
fmtdata.StepData[24].TabData.Ident = "{!.+?}{!.+?}";
fmtdata.StepData[24].TabData.RNOIdent = "{!.+?}{!.+?}";
fmtdata.StepData[24].TabData.RNOIdentEdit = "{!.+?}{!.+?}";
// High5
fmtdata.StepData[41].ColOverride = "20";
fmtdata.StepData[41].ColOverrideEdit = "20";
fmtdata.StepData[41].WidthOverride = "456,198,120"; //"456,192,120";
fmtdata.StepData[41].WidthOverrideEdit = "456,198,120"; //"456,192,120";
fmtdata.StepData[41].StepEditData.TypeMenu.MenuItem = "Unnumbered High Level Step";
}
private void AddTuecfmtOVR(ref FormatData fmtdata) // Comanche Peak - override after inheritance
{
// Note
fmtdata.StepData[7].Inactive = "False";
// Note 1
fmtdata.StepData[22].Inactive = "True";
// Note 2
fmtdata.StepData[23].Inactive = "True";
// Note 3
fmtdata.StepData[26].Inactive = "True";
// Note 4
fmtdata.StepData[28].Inactive = "True";
// Note 5
fmtdata.StepData[32].Inactive = "True";
}
private void AddTuecDevfmt(ref FormatData fmtdata) // Comanche Peak
{
fmtdata.StepData[40].NoSpaceMultipleRNOs = true;
}
//private void AddCPLOverridefmt(ref FormatData fmtdata)
//{
// fmtdata.BoxData[1].BXLLC = "-12345"; //this will put in a null string
// fmtdata.BoxData[1].BXULC = "-12345"; //this will put in a null string
// fmtdata.BoxData[1].BXVert = "-12345"; //this will put in a null string
// fmtdata.BoxData[1].BXURC = "-12345"; //this will put in a null string
// fmtdata.BoxData[1].BXULC = "-12345"; //this will put in a null string
//}
}
public partial class FmtToXml
{
private void AddTUECPage(ref PageStyles pgstyles)
{
// Procedure Steps
pgstyles.PgStyles[0].Items[2].Token = "UNIT {UNITNUMBER}";
// Cover Page
pgstyles.PgStyles[1].Items[3].Token = "UNIT {UNITNUMBER}";
// Cover Page with ECC Stamp
pgstyles.PgStyles[2].Items[3].Token = "UNIT {UNITNUMBER}";
// Introduction & Appendix Pages
pgstyles.PgStyles[3].Items[3].Token = "UNIT {UNITNUMBER}";
//Cover Page with Small Stamp
pgstyles.PgStyles[4].Items[3].Token = "UNIT {UNITNUMBER}";
// we need to add one new pgstyle
// expand the pgstyles.PgStyles array by one;
int numstyles = pgstyles.PgStyles.Length; // number of current PgStyles
numstyles += 1; // adding one more page styles
PageStyle[] pgs = new PageStyle[numstyles];
PageStyle ps;// new PageStyle();
// copy existing page lists
for (int i = 0; i < numstyles - 1; i++)
{
ps = new PageStyle();
ps = pgstyles.PgStyles[i];
pgs[i] = ps;
}
// Attachmet (Step Editor)
ps = new PageStyle();
ps.Name = "Attachmet (Step Editor)";
ps.Index = 5;
PSItem[] Fpsitms = null;
Fpsitms = new PSItem[10];
PSItem pi = new PSItem();
pi.Token = "{DRAFTPAGE}{REFERENCEPAGE}{MASTERPAGE}{SAMPLEPAGE}";
pi.Row = 12;
pi.Col = -3;
pi.Justify = "PSCenter";
pi.Style = new VE_Font();
pi.Style.FontFamily = "Prestige Elite Tall";
pi.Style.FontSize = "10";
pi.Style.FontStyle = "None";
pi.Style.CPI = "12";
Fpsitms[0] = pi;
pi = new PSItem();
pi.Token = "{HEADER1}";
pi.Row = 24;
pi.Col = -18;
pi.Justify = "PSLeft";
pi.Style = new VE_Font();
pi.Style.FontFamily = "Prestige Elite Tall";
pi.Style.FontSize = "10";
pi.Style.FontStyle = "None";
pi.Style.CPI = "12";
Fpsitms[1] = pi;
pi = new PSItem();
pi.Token = "{EOPNUM}";
pi.Row = 48;
pi.Col = 447;
pi.Justify = "PSCenter";
pi.Style = new VE_Font();
pi.Style.FontFamily = "Prestige Elite Tall";
pi.Style.FontSize = "10";
pi.Style.CPI = "12";
pi.Style.FontStyle = "None";
Fpsitms[2] = pi;
pi = new PSItem();
pi.Token = "UNIT {UNITNUMBER}";
pi.Row = 48;
pi.Col = 339;
pi.Justify = "PSCenter";
pi.Style = new VE_Font();
pi.Style.FontFamily = "Prestige Elite Tall";
pi.Style.FontSize = "10";
pi.Style.CPI = "12";
pi.Style.FontStyle = "None";
Fpsitms[3] = pi;
pi = new PSItem();
pi.Token = "{PROCTITLE}";
pi.Row = 84;
pi.Col = 129;
pi.Justify = "PSCenter";
pi.Style = new VE_Font();
pi.Style.FontFamily = "Prestige Elite Tall";
pi.Style.FontSize = "10";
pi.Style.CPI = "12";
pi.Style.FontStyle = "None";
Fpsitms[4] = pi;
pi = new PSItem();
pi.Token = "REVISION NO. {REV}";
pi.Row = 84;
pi.Col = 339;
pi.Justify = "PSCenter";
pi.Style = new VE_Font();
pi.Style.FontFamily = "Prestige Elite Tall";
pi.Style.FontSize = "10";
pi.Style.CPI = "12";
pi.Style.FontStyle = "None";
Fpsitms[5] = pi;
pi = new PSItem();
pi.Token = "PAGE {PAGE} OF {OF}";
pi.Row = 84;
pi.Col = 447;
pi.Justify = "PSCenter";
pi.Style = new VE_Font();
pi.Style.FontFamily = "Prestige Elite Tall";
pi.Style.FontSize = "10";
pi.Style.CPI = "12";
pi.Style.FontStyle = "Bold";
Fpsitms[6] = pi;
pi = new PSItem();
pi.Token = "{BOX1}";
pi.Row = 96;
pi.Col = -18;
pi.Justify = "PSLeft";
pi.Style = new VE_Font();
pi.Style.FontFamily = "Prestige Elite Tall";
pi.Style.FontSize = "10";
pi.Style.CPI = "12";
pi.Style.FontStyle = "None";
Fpsitms[7] = pi;
pi = new PSItem();
pi.Token = "{SECTIONLEVELNUMBER}";
pi.Row = 120;
pi.Col = 244;
pi.Justify = "PSCenter";
pi.Style = new VE_Font();
pi.Style.FontFamily = "Prestige Elite Tall";
pi.Style.FontSize = "10";
pi.Style.CPI = "12";
pi.Style.FontStyle = "Underline";
Fpsitms[8] = pi;
pi = new PSItem();
pi.Token = "PAGE {DOCCURPAGE} OF {DOCTOTPAGE}";
pi.Row = 130;
pi.Col = 244;
pi.Justify = "PSCenter";
pi.Style = new VE_Font();
pi.Style.FontFamily = "Prestige Elite Tall";
pi.Style.FontSize = "10";
pi.Style.CPI = "12";
pi.Style.FontStyle = "None";
Fpsitms[9] = pi;
ps.Items = Fpsitms;
pgs[numstyles - 1] = ps;
pgstyles.PgStyles = pgs; // save new pagelist
}
private void AddTUCEDOC(ref DocStyles dcstyles)
{
// we need to add one new docsyles
// expand the dcstyles.DcStyle array by one;
int numstyles = dcstyles.DcStyles.Length; // number of current docstyles
numstyles += 2; // adding one more docstyles
DocStyle[] dcs = new DocStyle[numstyles];
for (int i = 0; i < numstyles-2; i++)
{
DocStyle dc = new DocStyle();
dc = dcstyles.DcStyles[i];
dcs[i] = dc;
if (i+1 == numstyles - 2)
{
dc = new DocStyle();
dc = dcstyles.DcStyles[0]; // insert a new section by copying the first one
dcs[i+1] = dc;
dc = new DocStyle();
dc = dcstyles.DcStyles[0]; // insert a new section by copying the first one
dcs[i+2] = dc;
}
}
dcstyles.DcStyles = dcs;
//"Procedure Steps"
dcstyles.DcStyles[0].oldtonew = 1;
dcstyles.DcStyles[0].CancelSectTitle = true;
dcstyles.DcStyles[0].CBLoc = 2;
// Cover Page
dcstyles.DcStyles[1].PageLength = 620;
// Cover Page with ECC Stamp
dcstyles.DcStyles[2].PageLength = 620;
// Introduction & Appendix Pages
dcstyles.DcStyles[3].PageLength = 640;
dcstyles.DcStyles[3].PageWidth = 564;
// Cover Page with Small Stamp
dcstyles.DcStyles[4].PageLength = 620;
// Purpose and Entry - step editor
dcstyles.DcStyles[5].Name = "Purpose and Entry";
dcstyles.DcStyles[5].Index = 5;
dcstyles.DcStyles[5].pagestyle = 3;
dcstyles.DcStyles[5].oldtonew = 2;
dcstyles.DcStyles[5].CancelSectTitle = false;
dcstyles.DcStyles[5].TopMargin = 120;
dcstyles.DcStyles[5].PageLength = 640;
dcstyles.DcStyles[5].LeftMargin = 78;
dcstyles.DcStyles[5].EndFlag = 0;
dcstyles.DcStyles[5].EndString = null;
dcstyles.DcStyles[5].CBLoc = 2;
// Attachment (Step Editor)
dcstyles.DcStyles[6].Name = "Attachment (Step Editor)";
dcstyles.DcStyles[6].Index = 6;
dcstyles.DcStyles[6].pagestyle = 5;
dcstyles.DcStyles[6].oldtonew = 4;
dcstyles.DcStyles[6].CancelSectTitle = true;
dcstyles.DcStyles[6].TopMargin = 150;
dcstyles.DcStyles[6].PageLength = 564;
dcstyles.DcStyles[6].LeftMargin = 60;
dcstyles.DcStyles[6].EndFlag = 0;
dcstyles.DcStyles[6].EndString = null;
dcstyles.DcStyles[6].CBLoc = 2;
}
}
public partial class RtfToSvg
{
private void AddTUEC(XmlDocument myDoc)
{
XmlDocument xdNew = new XmlDocument();
xdNew.LoadXml("<svg xmlns=\"http://www.w3.org/2000/svg\"> <g id=\"C0\">" +
"<ellipse cx=\"6\" cy=\"-3.2\" rx=\"11.1\" ry=\"11.1\" fill=\"none\" stroke=\"black\" stroke-width=\"1.9\" />" +
"</g></svg>");
myDoc.DocumentElement.ReplaceChild(myDoc.ImportNode(xdNew.DocumentElement.ChildNodes[0], true), myDoc.DocumentElement.ChildNodes[12]);
xdNew.LoadXml("<svg xmlns=\"http://www.w3.org/2000/svg\"> <g id=\"C2\">" +
"<rect x=\"-16.15\" y=\"-7.05\" width=\"8.5\" height=\"8.5\" fill=\"none\" stroke=\"black\" stroke-width=\"0.85\" />" +
"</g></svg>");
myDoc.DocumentElement.ReplaceChild(myDoc.ImportNode(xdNew.DocumentElement.ChildNodes[0], true), myDoc.DocumentElement.ChildNodes[9]);
xdNew.LoadXml("<svg xmlns=\"http://www.w3.org/2000/svg\"> <g id=\"C4\">" +
"<rect x=\"-16.15\" y=\"-7.05\" width=\"8.5\" height=\"8.5\" fill=\"none\" stroke=\"black\" stroke-width=\"0.85\" />" +
"<rect x=\"245.15\" y=\"-7.05\" width=\"8.5\" height=\"8.5\" fill=\"none\" stroke=\"black\" stroke-width=\"0.85\" />" +
"</g></svg>");
myDoc.DocumentElement.ReplaceChild(myDoc.ImportNode(xdNew.DocumentElement.ChildNodes[0], true), myDoc.DocumentElement.ChildNodes[11]);
}
}
}
-28
View File
@@ -1,28 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
namespace fmtxml
{
public partial class FmtFileToXml
{
private void AddGENfmt(ref FormatData fmtdata) // Catawba
{
fmtdata.SectData.StepSectionData.StpSectLayData.ColT = -3;
}
}
public partial class FmtToXml
{
private void AddGENPage(ref PageStyles pgstyles)
{
}
}
public partial class RtfToSvg
{
private void AddGEN(XmlDocument myDoc)
{
}
}
}
-198
View File
@@ -1,198 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
namespace fmtxml
{
public partial class FmtFileToXml
{
private void AddMCGfmt(ref FormatData fmtdata) // McGuire
{
// Fix Logic for CAPSPIfLastLower
fmtdata.ROData.CapRoIfLastLower = "False";
fmtdata.ROData.CapSPIfLastLower = "True";
fmtdata.FontData.FontSize = "12";
//fmtdata.SectData.StepSectionData.StpSectLayData.Separator.SeparatorLocation = 2;
fmtdata.SectData.StepSectionData.StpSectLayData.ColT = -3;
// ColS="42" WidT="454" ColRTable="0,264,138" WidSTableEdit="432,221,120" WidSTablePrint="480,221,120"
fmtdata.SectData.StepSectionData.StpSectLayData.ColS = 42;
fmtdata.SectData.StepSectionData.StpSectLayData.WidT = 455;
fmtdata.SectData.StepSectionData.StpSectLayData.ColRTable = "0,264,138";
fmtdata.SectData.StepSectionData.StpSectLayData.WidSTableEdit = "432,221,120";
fmtdata.SectData.StepSectionData.StpSectLayData.WidSTablePrint = "480,221,120";
fmtdata.SectData.StepSectionData.AdjustRNOCautionNoteWidth = "True";
fmtdata.SectData.ReplaceWordsInROs = "False";
fmtdata.ProcData.TitleLength = 45;
// Base
fmtdata.StepData[0].StepLayoutData.STExtraSpace = "0";
// High
fmtdata.StepData[2].StepLayoutData.STExtraSpace = "12";
for (int i = 0; i < fmtdata.StepData.Length; i++)
{
if (fmtdata.StepData[i].Font != null && fmtdata.StepData[i].Font.FontFamily == "Arial")
fmtdata.StepData[i].Font.FontSize = "12";
if (fmtdata.StepData[i].TabData.Font.FontFamily == "Arial")
fmtdata.StepData[i].TabData.Font.FontSize = "12";
}
// caution separator
//fmtdata.StepData[6].StepLayoutData.STBoxindex = "1";
fmtdata.StepData[6].TabData.Bullet.Separate = "True";
fmtdata.StepData[6].TabData.Bullet.Font = new VE_Font();
fmtdata.StepData[6].TabData.Bullet.Font.FontFamily = "Arial";
fmtdata.StepData[6].TabData.Bullet.Font.FontSize = "12";
fmtdata.StepData[6].TabData.Bullet.Font.FontStyle = "none";
fmtdata.StepData[6].TabData.Bullet.Font.CPI = "12";
// note location/tab
//fmtdata.StepData[7].StepLayoutData.STBoxindex = "1";
fmtdata.StepData[7].TabData.Ident = "NOTE ";
fmtdata.StepData[7].TabData.IdentEdit = "NOTE ";
fmtdata.StepData[7].TabData.RNOIdent = "NOTE ";
fmtdata.StepData[7].TabData.Bullet.Separate = "True";
fmtdata.StepData[7].TabData.Bullet.Font = new VE_Font();
fmtdata.StepData[7].TabData.Bullet.Font.FontFamily = "Arial";
fmtdata.StepData[7].TabData.Bullet.Font.FontSize = "12";
fmtdata.StepData[7].TabData.Bullet.Font.FontStyle = "none";
fmtdata.StepData[7].TabData.Bullet.Font.CPI = "12";
// Bulleted High Level Step
fmtdata.StepData[9].TabData.Ident = "{bullet} ";
fmtdata.StepData[9].TabData.IdentEdit = "{bullet} ";
fmtdata.StepData[9].TabData.RNOIdent = "{bullet} ";
fmtdata.StepData[9].TabData.RNOIdentEdit = "{bullet} ";
// RNOType
fmtdata.StepData[40].Font.FontFamily = "Arial";
fmtdata.StepData[40].Font.FontSize = "12";
fmtdata.StepData[40].StepLayoutData.STExtraSpace = "0";
// note location (create a box to locate it)
//fmtdata.BoxData[1].Index = 1;
//fmtdata.BoxData[1].Start = 6;
//fmtdata.BoxData[1].End = 240;
//fmtdata.BoxData[1].TxtStart = 12;
//fmtdata.BoxData[1].TxtWidth = 450;
//fmtdata.BoxData[1].BXULC = " ";
//Disable extra Cautions and notes
// Caution 1
fmtdata.StepData[20].Inactive = "True";
// Caution 2
fmtdata.StepData[21].Inactive = "True";
// Caution 3
fmtdata.StepData[27].Inactive = "True";
// Caution 4
fmtdata.StepData[29].Inactive = "True";
// Note 1
fmtdata.StepData[22].Inactive = "True";
// Note 2
fmtdata.StepData[23].Inactive = "True";
// Note 3
fmtdata.StepData[26].Inactive = "True";
// Note 4
fmtdata.StepData[28].Inactive = "True";
// Note 5
fmtdata.StepData[32].Inactive = "True";
}
private void AddMCGfmtOVR(ref FormatData fmtdata) // McGuire
{
// Transitions
fmtdata.TransData.Cap1stCharTrans = "False";
fmtdata.TransData.TransTypeData[0].TransFormat = "{Proc Num} ({Proc Title}), Step {First Step}";
fmtdata.TransData.TransTypeData[0].TransMenu = "{Proc Num} ({Proc Title}), Step {First Step}";
fmtdata.TransData.TransTypeData[3].TransFormat = "{First Step} through {Last Step} of {?.Proc Num} ({?.Proc Title}), {?.Sect Num} ({?.Sect Title})";
fmtdata.TransData.TransTypeData[3].TransMenu = "{First Step} through {Last Step} of {Proc Num} ({Proc Title}), {Sect Num} ({Sect Title})";
fmtdata.TransData.TransTypeData[3].TransUI = "ProcMenu, SectMenuStep, StepFirst, StepLast";
fmtdata.TransData.TransTypeData[4].TransFormat = "{Sect Num} ({Sect Title}), Step {First Step}";
fmtdata.TransData.TransTypeData[4].TransMenu = "{Sect Num} ({Sect Title}), Step {First Step}";
fmtdata.TransData.TransTypeData[4].TransUI = "ProcCur, SectMenuAny, StepAllowNone, StepFirst";
fmtdata.TransData.TransTypeData[5].TransFormat = "{Proc Num} ({Proc Title}), {Sect Num} ({Sect Title}), Step {First Step}";
fmtdata.TransData.TransTypeData[5].TransMenu = "{Proc Num} ({Proc Title}), {Sect Num} ({Sect Title}), Step {First Step}";
fmtdata.TransData.TransTypeData[5].TransUI = "ProcMenu, SectMenuAny, StepAllowNone, StepFirst";
fmtdata.TransData.TransTypeData[6].TransUI = "ProcCur, SectMenuStep, StepFirst";
}
private void AddMCGDEVfmt(ref FormatData fmtdata)
{
fmtdata.SectData.ReplaceWordsInROs = "False";
}
}
public partial class FmtToXml
{
private void AddMCGPage(ref PageStyles pgstyles)
{
// proc steps
pgstyles.PgStyles[0].Items[2].Token = "PAGE NO.";
pgstyles.PgStyles[0].Items[5].Style.FontSize = "14";
pgstyles.PgStyles[0].Items[7].Token = "{PAGE} of {OF}";
pgstyles.PgStyles[0].Items[10].Token = "Rev. {REV}";
// proc steps - no header
pgstyles.PgStyles[1].Items[2].Token = "PAGE NO.";
pgstyles.PgStyles[1].Items[5].Style.FontSize = "14";
pgstyles.PgStyles[1].Items[7].Token = "{PAGE} of {OF}";
pgstyles.PgStyles[1].Items[10].Token = "Rev. {REV}";
// enclosures
pgstyles.PgStyles[2].Items[2].Token = "PAGE NO.";
pgstyles.PgStyles[2].Items[5].Style.FontSize = "14";
pgstyles.PgStyles[2].Items[7].Token = "{PAGE} of {OF}";
pgstyles.PgStyles[2].Items[9].Token = "Rev. {REV}";
// Attachments
pgstyles.PgStyles[4].Items[2].Token = "PAGE NO.";
pgstyles.PgStyles[4].Items[5].Style.FontSize = "14";
pgstyles.PgStyles[4].Items[7].Token = "{PAGE} of {OF}";
pgstyles.PgStyles[4].Items[9].Token = "Rev. {REV}";
// Status Tree
pgstyles.PgStyles[5].Items[2].Token = "PAGE NO.";
pgstyles.PgStyles[5].Items[5].Style.FontSize = "14";
pgstyles.PgStyles[5].Items[7].Token = "{PAGE} of {OF}";
pgstyles.PgStyles[5].Items[9].Token = "Rev. {REV}";
// Table of contents
pgstyles.PgStyles[6].Items[2].Token = "PAGE NO.";
pgstyles.PgStyles[6].Items[5].Style.FontSize = "14";
pgstyles.PgStyles[6].Items[6].Token = "{ROMANPAGE}";
pgstyles.PgStyles[6].Items[8].Token = "Rev. {REV}";
}
private void AddMCGDOC(ref DocStyles dcstyles)
{
SetMcGuireDocStyleFont(ref dcstyles);
dcstyles.DcStyles[0].CBMargin = 50;
//dcstyles.DcStyles[0].CBLoc = 3;
dcstyles.DcStyles[0].PageLength = 624;
dcstyles.DcStyles[1].CBMargin = 50;
//dcstyles.DcStyles[1].CBLoc = 3;
dcstyles.DcStyles[1].PageLength = 624;
dcstyles.DcStyles[2].CBMargin = 50;
//dcstyles.DcStyles[2].CBLoc = 3;
dcstyles.DcStyles[2].PageLength = 624;
}
private static void SetMcGuireDocStyleFont(ref DocStyles dcstyles)
{
int i = 0;
int ii = 0;
// Set font to Arial 12 pt
for (i = 0; i < dcstyles.DcStyles.Length; i++)
{
dcstyles.DcStyles[i].dstyle.FontFamily = "Arial";
dcstyles.DcStyles[i].dstyle.FontSize = "12";
dcstyles.DcStyles[i].ContStyle.FontFamily = "Arial";
dcstyles.DcStyles[i].ContStyle.FontSize = "12";
}
return;
}
}
public partial class RtfToSvg
{
private void AddMCG(XmlDocument myDoc)
{
}
}
}
-91
View File
@@ -1,91 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
namespace fmtxml
{
public partial class FmtFileToXml
{
private void AddMCGfmt(ref FormatData fmtdata) // McGuire
{
fmtdata.SectData.StepSectionData.StpSectLayData.Separator.SeparatorLocation = -2;
// caution separator
fmtdata.StepData[6].StepLayoutData.STBoxindex = "1";
fmtdata.StepData[6].TabData.Bullet.Separate = "True";
fmtdata.StepData[6].TabData.Bullet.Font = new VE_Font();
fmtdata.StepData[6].TabData.Bullet.Font.FontFamily = "Arial";
fmtdata.StepData[6].TabData.Bullet.Font.FontSize = "11";
fmtdata.StepData[6].TabData.Bullet.Font.FontStyle = "none";
fmtdata.StepData[6].TabData.Bullet.Font.CPI = "12";
// note location/tab
fmtdata.StepData[7].StepLayoutData.STBoxindex = "1";
fmtdata.StepData[7].TabData.Ident = "NOTE: ";
fmtdata.StepData[7].TabData.Bullet.Separate = "True";
fmtdata.StepData[7].TabData.Bullet.Font = new VE_Font();
fmtdata.StepData[7].TabData.Bullet.Font.FontFamily = "Arial";
fmtdata.StepData[7].TabData.Bullet.Font.FontSize = "11";
fmtdata.StepData[7].TabData.Bullet.Font.FontStyle = "none";
fmtdata.StepData[7].TabData.Bullet.Font.CPI = "12";
// RNOType
fmtdata.StepData[40].Font.FontFamily = "Arial";
fmtdata.StepData[40].Font.FontSize = "11";
// note location (create a box to locate it)
fmtdata.BoxData[1].Index = 1;
fmtdata.BoxData[1].Start = 6;
fmtdata.BoxData[1].End = 240;
fmtdata.BoxData[1].TxtStart = 12;
fmtdata.BoxData[1].TxtWidth = 450;
fmtdata.BoxData[1].BXULC = " ";
}
}
public partial class FmtToXml
{
private void AddMCGPage(ref PageStyles pgstyles)
{
// proc steps
pgstyles.PgStyles[0].Items[2].Token = "PAGE NO.";
pgstyles.PgStyles[0].Items[5].Style.FontSize = "14";
pgstyles.PgStyles[0].Items[7].Token = "{PAGE} of {OF}";
pgstyles.PgStyles[0].Items[10].Token = "Rev. {REV}";
// proc steps - no header
pgstyles.PgStyles[1].Items[2].Token = "PAGE NO.";
pgstyles.PgStyles[1].Items[5].Style.FontSize = "14";
pgstyles.PgStyles[1].Items[7].Token = "{PAGE} of {OF}";
pgstyles.PgStyles[1].Items[10].Token = "Rev. {REV}";
// enclosures
pgstyles.PgStyles[2].Items[2].Token = "PAGE NO.";
pgstyles.PgStyles[2].Items[5].Style.FontSize = "14";
pgstyles.PgStyles[2].Items[7].Token = "{PAGE} of {OF}";
pgstyles.PgStyles[2].Items[9].Token = "Rev. {REV}";
// Attachments
pgstyles.PgStyles[4].Items[2].Token = "PAGE NO.";
pgstyles.PgStyles[4].Items[5].Style.FontSize = "14";
pgstyles.PgStyles[4].Items[7].Token = "{PAGE} of {OF}";
pgstyles.PgStyles[4].Items[9].Token = "Rev. {REV}";
// Status Tree
pgstyles.PgStyles[5].Items[2].Token = "PAGE NO.";
pgstyles.PgStyles[5].Items[5].Style.FontSize = "14";
pgstyles.PgStyles[5].Items[7].Token = "{PAGE} of {OF}";
pgstyles.PgStyles[5].Items[9].Token = "Rev. {REV}";
// Table of contents
pgstyles.PgStyles[6].Items[2].Token = "PAGE NO.";
pgstyles.PgStyles[6].Items[5].Style.FontSize = "14";
pgstyles.PgStyles[6].Items[6].Token = "{ROMANPAGE}";
pgstyles.PgStyles[6].Items[8].Token = "Rev. {REV}";
}
private void AddMCGDOC(ref DocStyles dcstyles)
{
}
}
public partial class RtfToSvg
{
private void AddMCG(XmlDocument myDoc)
{
}
}
}
-206
View File
@@ -1,206 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
namespace fmtxml
{
public partial class FmtFileToXml
{
private void AddWEP2fmt(ref FormatData fmtdata)
{
fmtdata.SectData.StepSectionData.StpSectPrtData.DiffContActBox = "True";
fmtdata.SectData.StepSectionData.StpSectPrtData.ContActBoxOnSubSteps = "True";
fmtdata.TransData.Underline = "True";
fmtdata.StepData[2].TabData.Ident = "{Section Prefix}{numeric} ";
fmtdata.StepData[3].TabData.Ident = "{!C0}{numeric} ";
fmtdata.StepData[9].TabData.Ident = "{Section Prefix}{numeric} ";
//// EQuipment List
//fmtdata.StepData[11].StepLayoutData.EveryNLines = "1";
// EQuipment List With Blank
fmtdata.StepData[14].StepLayoutData.EveryNLines = "99";
//// Optional EQuipment List
//fmtdata.StepData[30].StepLayoutData.EveryNLines = "99";
//TitleWithTextRight
fmtdata.StepData[42].StepEditData.TypeMenu.MenuItem = "Title With Text Right";
//TitleWithTextBelow
fmtdata.StepData[43].StepEditData.TypeMenu.MenuItem = "Title With Text Below";
//ContAcSequential
fmtdata.StepData[44].StepEditData.TypeMenu.MenuItem = "Continuous Action AER";
//ContAcAnd
fmtdata.StepData[45].StepEditData.TypeMenu.MenuItem = "Continuous Action RNO";
//ContAcOr
fmtdata.StepData[46].StepEditData.TypeMenu.MenuItem = "Continuous Action AER & RNO";
fmtdata.TransData.TransTypeData[5].TransFormat = "{?.Sect Hdr}, Step {First Step}";
fmtdata.TransData.TransTypeData[5].TransMenu = "{Sect Num}, {Sect Title}, Step {First Step}";
fmtdata.TransData.TransTypeData[7].TransType = 4;
fmtdata.TransData.TransTypeData[7].TransFormat = "Attachment {Sect Num}{First Step}";
fmtdata.TransData.TransTypeData[7].TransMenu = "Attachment {Sect Num}{First Step} ( To a different section )";
fmtdata.TransData.TransTypeData[7].TransUI = "ProcCur, SectMenuAny, StepAllowNone, StepFirst";
fmtdata.TransData.TransTypeData[8].TransType = 0;
fmtdata.TransData.TransTypeData[8].TransFormat = "{Proc Num}, {Proc Title}, {Sect Num}, {Sect Title}, Step {First Step}";
fmtdata.TransData.TransTypeData[8].TransMenu = "{Proc Num}, {Proc Title}, {Sect Num}, {Sect Title}, Step {First Step}";
fmtdata.TransData.TransTypeData[8].TransUI = "ProcMenu, SectMenuAny, StepAllowNone, StepFirst";
}
private void AddWEP2Overridefmt(ref FormatData fmtdata)
{
// Boxes
fmtdata.BoxData[3].Start = 260;
fmtdata.BoxData[3].End = 504;
fmtdata.BoxData[3].TxtWidth = 210;
fmtdata.BoxData[3].Font.FontFamily = "Prestige Elite Tall";
fmtdata.BoxData[4].End = 504;
fmtdata.BoxData[4].TxtWidth = 216;
fmtdata.BoxData[4].Font.FontFamily = "Prestige Elite Tall";
fmtdata.BoxData[5].End = 504;
fmtdata.BoxData[5].TxtWidth = 198;
fmtdata.BoxData[5].Font.FontFamily = "Prestige Elite Tall";
fmtdata.BoxData[8].End = 260;
fmtdata.BoxData[8].TxtWidth = 198;
fmtdata.BoxData[8].Font.FontFamily = "Prestige Elite Tall";
fmtdata.BoxData[9].Start = 260;
fmtdata.BoxData[9].End = 504;
fmtdata.BoxData[9].TxtWidth = 210;
fmtdata.BoxData[9].Font.FontFamily = "Prestige Elite Tall";
}
private void AddWEPENBFmt(ref FormatData fmtdata)
{
fmtdata.ProcData.ChangeBarData.AbsoluteFixedChangeColumn = "True";
fmtdata.ProcData.ChangeBarData.FixedChangeColumn = 71;
fmtdata.ProcData.ChangeBarData.FixedAERChangeColumn = 0;
fmtdata.StepData[2].TabData.RNOIdent = @"\ul ERG STEP:\ulnone ";
fmtdata.StepData[3].TabData.RNOIdent = @"\ul ERG STEP:\ulnone ";
fmtdata.StepData[6].TabData.RNOIdent = @"\ul ERG CAUTION:\ulnone ";
fmtdata.StepData[7].TabData.RNOIdent = @"\ul ERG NOTE:\ulnone ";
fmtdata.StepData[18].TabData.RNOIdent = @"\ul ERG STEP:\ulnone ";
fmtdata.StepData[20].TabData.RNOIdent = @"\ul ERG CAUTION:\ulnone ";
fmtdata.StepData[21].TabData.RNOIdent = @"\ul ERG CAUTION:\ulnone ";
fmtdata.StepData[22].TabData.RNOIdent = @"\ul ERG NOTE:\ulnone ";
fmtdata.StepData[23].TabData.RNOIdent = @"\ul ERG NOTE:\ulnone ";
fmtdata.StepData[26].TabData.RNOIdent = @"\ul ERG NOTE:\ulnone ";
fmtdata.StepData[27].TabData.RNOIdent = @"\ul ERG CAUTION:\ulnone ";
}
private void AddWPB20fmt(ref FormatData fmtdata)
{
fmtdata.SectData.StepSectionData.StpSectLayData.ColS = 50;
fmtdata.SectData.StepSectionData.StpSectPrtData.LimitWidToPageWid = "True";
fmtdata.TransData.DoSectionTransitions = "True";
fmtdata.PrintData.ProcDescrList[0].ProcDescr1 = "{null}";
fmtdata.StepData[2].TabData.IdentEdit = "STEP {numeric} : ";
fmtdata.StepData[2].TabData.Ident = "STEP {numeric} : ";
fmtdata.StepData[2].TabData.RNOIdentEdit = "STEP {numeric} : ";
fmtdata.StepData[2].TabData.RNOIdent = "STEP {numeric} : ";
fmtdata.StepData[2].StepPrintData.PosAdjust = "36"; //HLSs
fmtdata.StepData[3].StepPrintData.PosAdjust = "36";
fmtdata.StepData[18].StepPrintData.PosAdjust = "36";
fmtdata.StepData[40].StepPrintData.PosAdjust = "36"; // (RNO inherits from HLS)
fmtdata.StepData[41].StepPrintData.PosAdjust = "36";
fmtdata.StepData[6].StepPrintData.PosAdjust = "50"; //Cautions
fmtdata.StepData[20].StepPrintData.PosAdjust = "50";
fmtdata.StepData[21].StepPrintData.PosAdjust = "50";
fmtdata.StepData[27].StepPrintData.PosAdjust = "50";
fmtdata.StepData[29].StepPrintData.PosAdjust = "50";
fmtdata.StepData[7].StepPrintData.PosAdjust = "67"; //Notes
fmtdata.StepData[22].StepPrintData.PosAdjust = "67";
fmtdata.StepData[23].StepPrintData.PosAdjust = "67";
fmtdata.StepData[26].StepPrintData.PosAdjust = "67";
fmtdata.StepData[28].StepPrintData.PosAdjust = "67";
fmtdata.StepData[32].StepPrintData.PosAdjust = "67";
fmtdata.StepData[9].StepPrintData.PosAdjust = "0";
fmtdata.StepData[24].StepPrintData.PosAdjust = "-50";
}
private void AddWPB22fmt(ref FormatData fmtdata)
{
fmtdata.SectData.StepSectionData.StpSectLayData.ColS = 50;
fmtdata.SectData.StepSectionData.StpSectPrtData.LimitWidToPageWid = "True";
fmtdata.TransData.DoSectionTransitions = "True";
fmtdata.PrintData.ProcDescrList[0].ProcDescr1 = "{null}";
fmtdata.StepData[2].TabData.IdentEdit = "STEP {numeric} : ";
fmtdata.StepData[2].TabData.Ident = "STEP {numeric} : ";
fmtdata.StepData[2].TabData.RNOIdentEdit = "STEP {numeric} : ";
fmtdata.StepData[2].TabData.RNOIdent = "STEP {numeric} : ";
//fmtdata.StepData[23].StepPrintData.PosAdjust = "46";
//fmtdata.StepData[24].StepPrintData.PosAdjust = "-50";
fmtdata.StepData[2].StepPrintData.PosAdjust = "36"; //HLSs
fmtdata.StepData[3].StepPrintData.PosAdjust = "36";
fmtdata.StepData[18].StepPrintData.PosAdjust = "36";
fmtdata.StepData[40].StepPrintData.PosAdjust = "36"; // (RNO inherits from HLS)
fmtdata.StepData[41].StepPrintData.PosAdjust = "36";
fmtdata.StepData[6].StepPrintData.PosAdjust = "50"; //Cautions
fmtdata.StepData[20].StepPrintData.PosAdjust = "50";
fmtdata.StepData[21].StepPrintData.PosAdjust = "50";
fmtdata.StepData[27].StepPrintData.PosAdjust = "50";
fmtdata.StepData[29].StepPrintData.PosAdjust = "50";
fmtdata.StepData[7].StepPrintData.PosAdjust = "67"; //Notes
fmtdata.StepData[22].StepPrintData.PosAdjust = "67";
fmtdata.StepData[23].StepPrintData.PosAdjust = "67";
fmtdata.StepData[26].StepPrintData.PosAdjust = "67";
fmtdata.StepData[28].StepPrintData.PosAdjust = "67";
fmtdata.StepData[32].StepPrintData.PosAdjust = "67";
fmtdata.StepData[9].StepPrintData.PosAdjust = "0";
fmtdata.StepData[24].StepPrintData.PosAdjust = "-50";
}
}
public partial class FmtToXml
{
private void AddWEP2DOC(ref DocStyles dcstyles)
{
dcstyles.DcStyles[1].PageLength = 654;
dcstyles.DcStyles[6].PageWidth = 564;
}
private void AddWEPENBPage(ref PageStyles pgstyles)
{
pgstyles.PgStyles[0].Items[12].Col = 520; // Step Descr:HLRNO location
pgstyles.PgStyles[0].Items[12].Justify = "PSRight";
pgstyles.PgStyles[1].Items[1].Col = 247; // Cover page token location adjustments
pgstyles.PgStyles[1].Items[2].Col = 238;
pgstyles.PgStyles[1].Items[3].Col = 238;
pgstyles.PgStyles[1].Items[4].Col = 266;
pgstyles.PgStyles[1].Items[5].Col = 288;
pgstyles.PgStyles[1].Items[6].Col = 266;
pgstyles.PgStyles[1].Items[7].Col = 288;
pgstyles.PgStyles[1].Items[8].Col = 266;
pgstyles.PgStyles[1].Items[9].Col = 288;
pgstyles.PgStyles[1].Items[10].Col = 266;
pgstyles.PgStyles[1].Items[11].Col = 288;
pgstyles.PgStyles[1].Items[12].Col = 266;
pgstyles.PgStyles[1].Items[13].Col = 288;
pgstyles.PgStyles[1].Items[14].Col = 266;
pgstyles.PgStyles[1].Items[15].Col = 288;
pgstyles.PgStyles[2].Items[1].Token = "{BOX3}";
}
private void AddWPB20DOC(ref DocStyles dcstyles)
{
dcstyles.DcStyles[0].ContTop = ". . . Step %3d Continued from Previous Page . . .";
dcstyles.DcStyles[0].ContBottom = ". . . Step %3d Continued on Next Page . . .";
}
private void AddWEPENBDOC(ref DocStyles dcstyles)
{
dcstyles.DcStyles[0].PageWidth = 580;
dcstyles.DcStyles[2].PageWidth = 584;
}
private void AddWEPENB_00DOC(ref DocStyles dcstyles)
{
dcstyles.DcStyles[0].PageWidth = 580;
}
}
public partial class RtfToSvg
{
private void AddWEP2(XmlDocument myDoc)
{
XmlDocument xdNew = new XmlDocument();
xdNew.LoadXml("<svg xmlns=\"http://www.w3.org/2000/svg\"> <g id=\"C0\">" +
"<ellipse cx=\"18\" cy=\"-3.2\" rx=\"11.1\" ry=\"11.1\" fill=\"none\" stroke=\"black\" stroke-width=\"1.9\" />" +
"</g></svg>");
myDoc.DocumentElement.ReplaceChild(myDoc.ImportNode(xdNew.DocumentElement.ChildNodes[0], true), myDoc.DocumentElement.ChildNodes[6]);
myDoc.DocumentElement.RemoveChild(myDoc.DocumentElement.ChildNodes[4]); // remove references to BMP files.
myDoc.DocumentElement.RemoveChild(myDoc.DocumentElement.ChildNodes[4]);
}
private void AddWEPENB(XmlDocument myDoc)
{
myDoc.DocumentElement.RemoveChild(myDoc.DocumentElement.ChildNodes[4]); // remove references to BMP files.
myDoc.DocumentElement.RemoveChild(myDoc.DocumentElement.ChildNodes[4]);
}
}
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
-286
View File
@@ -1,286 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
namespace fmtxml
{
public partial class FmtFileToXml
{
private void AddOHLPfmt(ref FormatData fmtdata) // Catawba
{
fmtdata.SectData.StepSectionData.StpSectLayData.ColT = -3;
Array.Resize<ReplaceStr>(ref fmtdata.SectData.ReplaceStrData, fmtdata.SectData.ReplaceStrData.Length + 64);
fmtdata.SectData.ReplaceStrData[15].Flag = "High, RNO, Caution, Note, Table, Substep, Attach, CaseInsens";
fmtdata.SectData.ReplaceStrData[15].ReplaceWord = "actuate";
fmtdata.SectData.ReplaceStrData[15].ReplaceWith = "ACTUATE";
fmtdata.SectData.ReplaceStrData[16].Flag = "High, RNO, Caution, Note, Table, Substep, Attach, CaseInsens";
fmtdata.SectData.ReplaceStrData[16].ReplaceWord = "adjust";
fmtdata.SectData.ReplaceStrData[16].ReplaceWith = "ADJUST";
fmtdata.SectData.ReplaceStrData[17].Flag = "High, RNO, Caution, Note, Table, Substep, Attach, CaseInsens";
fmtdata.SectData.ReplaceStrData[17].ReplaceWord = "align";
fmtdata.SectData.ReplaceStrData[17].ReplaceWith = "ALIGN";
fmtdata.SectData.ReplaceStrData[18].Flag = "High, RNO, Caution, Note, Table, Substep, Attach, CaseInsens";
fmtdata.SectData.ReplaceStrData[18].ReplaceWord = "allow";
fmtdata.SectData.ReplaceStrData[18].ReplaceWith = "ALLOW";
fmtdata.SectData.ReplaceStrData[19].Flag = "High, RNO, Caution, Note, Table, Substep, Attach, CaseInsens";
fmtdata.SectData.ReplaceStrData[19].ReplaceWord = "block";
fmtdata.SectData.ReplaceStrData[19].ReplaceWith = "BLOCK";
fmtdata.SectData.ReplaceStrData[20].Flag = "High, RNO, Caution, Note, Table, Substep, Attach, CaseInsens";
fmtdata.SectData.ReplaceStrData[20].ReplaceWord = "borate";
fmtdata.SectData.ReplaceStrData[20].ReplaceWith = "BORATE";
fmtdata.SectData.ReplaceStrData[21].Flag = "High, RNO, Caution, Note, Table, Substep, Attach, CaseInsens";
fmtdata.SectData.ReplaceStrData[21].ReplaceWord = "check";
fmtdata.SectData.ReplaceStrData[21].ReplaceWith = "CHECK";
fmtdata.SectData.ReplaceStrData[22].Flag = "High, RNO, Caution, Note, Table, Substep, Attach, CaseInsens";
fmtdata.SectData.ReplaceStrData[22].ReplaceWord = "close";
fmtdata.SectData.ReplaceStrData[22].ReplaceWith = "CLOSE";
fmtdata.SectData.ReplaceStrData[23].Flag = "High, RNO, Caution, Note, Table, Substep, Attach, CaseInsens";
fmtdata.SectData.ReplaceStrData[23].ReplaceWord = "complete";
fmtdata.SectData.ReplaceStrData[23].ReplaceWith = "COMPLETE";
fmtdata.SectData.ReplaceStrData[24].Flag = "High, RNO, Caution, Note, Table, Substep, Attach, CaseInsens";
fmtdata.SectData.ReplaceStrData[24].ReplaceWord = "control";
fmtdata.SectData.ReplaceStrData[24].ReplaceWith = "CONTROL";
fmtdata.SectData.ReplaceStrData[25].Flag = "High, RNO, Caution, Note, Table, Substep, Attach, CaseInsens";
fmtdata.SectData.ReplaceStrData[25].ReplaceWord = "consult";
fmtdata.SectData.ReplaceStrData[25].ReplaceWith = "CONSULT";
fmtdata.SectData.ReplaceStrData[26].Flag = "High, RNO, Caution, Note, Table, Substep, Attach, CaseInsens";
fmtdata.SectData.ReplaceStrData[26].ReplaceWord = "continue";
fmtdata.SectData.ReplaceStrData[26].ReplaceWith = "CONTINUE";
fmtdata.SectData.ReplaceStrData[27].Flag = "High, RNO, Caution, Note, Table, Substep, Attach, CaseInsens";
fmtdata.SectData.ReplaceStrData[27].ReplaceWord = "cooldown";
fmtdata.SectData.ReplaceStrData[27].ReplaceWith = "COOLDOWN";
fmtdata.SectData.ReplaceStrData[28].Flag = "High, RNO, Caution, Note, Table, Substep, Attach, CaseInsens";
fmtdata.SectData.ReplaceStrData[28].ReplaceWord = "decrease";
fmtdata.SectData.ReplaceStrData[28].ReplaceWith = "DECREASE";
fmtdata.SectData.ReplaceStrData[29].Flag = "High, RNO, Caution, Note, Table, Substep, Attach, CaseInsens";
fmtdata.SectData.ReplaceStrData[29].ReplaceWord = "deenergize";
fmtdata.SectData.ReplaceStrData[29].ReplaceWith = "DEENERGIZE";
fmtdata.SectData.ReplaceStrData[30].Flag = "High, RNO, Caution, Note, Table, Substep, Attach, CaseInsens";
fmtdata.SectData.ReplaceStrData[30].ReplaceWord = "depress";
fmtdata.SectData.ReplaceStrData[30].ReplaceWith = "DEPRESS";
fmtdata.SectData.ReplaceStrData[31].Flag = "High, RNO, Caution, Note, Table, Substep, Attach, CaseInsens";
fmtdata.SectData.ReplaceStrData[31].ReplaceWord = "depressurize";
fmtdata.SectData.ReplaceStrData[31].ReplaceWith = "DEPRESSURIZE";
fmtdata.SectData.ReplaceStrData[32].Flag = "High, RNO, Caution, Note, Table, Substep, Attach, CaseInsens";
fmtdata.SectData.ReplaceStrData[32].ReplaceWord = "determine";
fmtdata.SectData.ReplaceStrData[32].ReplaceWith = "DETERMINE";
fmtdata.SectData.ReplaceStrData[33].Flag = "High, RNO, Caution, Note, Table, Substep, Attach, CaseInsens";
fmtdata.SectData.ReplaceStrData[33].ReplaceWord = "dispatch";
fmtdata.SectData.ReplaceStrData[33].ReplaceWith = "DISPATCH";
fmtdata.SectData.ReplaceStrData[34].Flag = "High, RNO, Caution, Note, Table, Substep, Attach, CaseInsens";
fmtdata.SectData.ReplaceStrData[34].ReplaceWord = "dump";
fmtdata.SectData.ReplaceStrData[34].ReplaceWith = "DUMP";
fmtdata.SectData.ReplaceStrData[35].Flag = "High, RNO, Caution, Note, Table, Substep, Attach, CaseInsens";
fmtdata.SectData.ReplaceStrData[35].ReplaceWord = "energize";
fmtdata.SectData.ReplaceStrData[35].ReplaceWith = "ENERGIZE";
fmtdata.SectData.ReplaceStrData[36].Flag = "High, RNO, Caution, Note, Table, Substep, Attach, CaseInsens";
fmtdata.SectData.ReplaceStrData[36].ReplaceWord = "ensure";
fmtdata.SectData.ReplaceStrData[36].ReplaceWith = "ENSURE";
fmtdata.SectData.ReplaceStrData[37].Flag = "High, RNO, Caution, Note, Table, Substep, Attach, CaseInsens";
fmtdata.SectData.ReplaceStrData[37].ReplaceWord = "equalize";
fmtdata.SectData.ReplaceStrData[37].ReplaceWith = "EQUALIZE";
fmtdata.SectData.ReplaceStrData[38].Flag = "High, RNO, Caution, Note, Table, Substep, Attach, CaseInsens";
fmtdata.SectData.ReplaceStrData[38].ReplaceWord = "establish";
fmtdata.SectData.ReplaceStrData[38].ReplaceWith = "ESTABLISH";
fmtdata.SectData.ReplaceStrData[39].Flag = "High, RNO, Caution, Note, Table, Substep, Attach, CaseInsens";
fmtdata.SectData.ReplaceStrData[39].ReplaceWord = "evaluate";
fmtdata.SectData.ReplaceStrData[39].ReplaceWith = "EVALUATE";
fmtdata.SectData.ReplaceStrData[40].Flag = "High, RNO, Caution, Note, Table, Substep, Attach, CaseInsens";
fmtdata.SectData.ReplaceStrData[40].ReplaceWord = "identify";
fmtdata.SectData.ReplaceStrData[40].ReplaceWith = "IDENTIFY";
fmtdata.SectData.ReplaceStrData[41].Flag = "High, RNO, Caution, Note, Table, Substep, Attach, CaseInsens";
fmtdata.SectData.ReplaceStrData[41].ReplaceWord = "increase";
fmtdata.SectData.ReplaceStrData[41].ReplaceWith = "INCREASE";
fmtdata.SectData.ReplaceStrData[42].Flag = "High, RNO, Caution, Note, Table, Substep, Attach, CaseInsens";
fmtdata.SectData.ReplaceStrData[42].ReplaceWord = "initiate";
fmtdata.SectData.ReplaceStrData[42].ReplaceWith = "INITIATE";
fmtdata.SectData.ReplaceStrData[43].Flag = "High, RNO, Caution, Note, Table, Substep, Attach, CaseInsens";
fmtdata.SectData.ReplaceStrData[43].ReplaceWord = "insert";
fmtdata.SectData.ReplaceStrData[43].ReplaceWith = "INSERT";
fmtdata.SectData.ReplaceStrData[44].Flag = "High, RNO, Caution, Note, Table, Substep, Attach, CaseInsens";
fmtdata.SectData.ReplaceStrData[44].ReplaceWord = "isolate";
fmtdata.SectData.ReplaceStrData[44].ReplaceWith = "ISOLATE";
fmtdata.SectData.ReplaceStrData[45].Flag = "High, RNO, Caution, Note, Table, Substep, Attach, CaseInsens";
fmtdata.SectData.ReplaceStrData[45].ReplaceWord = "load";
fmtdata.SectData.ReplaceStrData[45].ReplaceWith = "LOAD";
fmtdata.SectData.ReplaceStrData[46].Flag = "High, RNO, Caution, Note, Table, Substep, Attach, CaseInsens";
fmtdata.SectData.ReplaceStrData[46].ReplaceWord = "lower";
fmtdata.SectData.ReplaceStrData[46].ReplaceWith = "LOWER";
fmtdata.SectData.ReplaceStrData[47].Flag = "High, RNO, Caution, Note, Table, Substep, Attach, CaseInsens";
fmtdata.SectData.ReplaceStrData[47].ReplaceWord = "maintain";
fmtdata.SectData.ReplaceStrData[47].ReplaceWith = "MAINTAIN";
fmtdata.SectData.ReplaceStrData[48].Flag = "High, RNO, Caution, Note, Table, Substep, Attach, CaseInsens";
fmtdata.SectData.ReplaceStrData[48].ReplaceWord = "minimize";
fmtdata.SectData.ReplaceStrData[48].ReplaceWith = "MINIMIZE";
fmtdata.SectData.ReplaceStrData[49].Flag = "High, RNO, Caution, Note, Table, Substep, Attach, CaseInsens";
fmtdata.SectData.ReplaceStrData[49].ReplaceWord = "monitor";
fmtdata.SectData.ReplaceStrData[49].ReplaceWith = "MONITOR";
fmtdata.SectData.ReplaceStrData[50].Flag = "High, RNO, Caution, Note, Table, Substep, Attach, CaseInsens";
fmtdata.SectData.ReplaceStrData[50].ReplaceWord = "notify";
fmtdata.SectData.ReplaceStrData[50].ReplaceWith = "NOTIFY";
fmtdata.SectData.ReplaceStrData[51].Flag = "High, RNO, Caution, Note, Table, Substep, Attach, CaseInsens";
fmtdata.SectData.ReplaceStrData[51].ReplaceWord = "observe";
fmtdata.SectData.ReplaceStrData[51].ReplaceWith = "OBSERVE";
fmtdata.SectData.ReplaceStrData[52].Flag = "High, RNO, Caution, Note, Table, Substep, Attach, CaseInsens";
fmtdata.SectData.ReplaceStrData[52].ReplaceWord = "open";
fmtdata.SectData.ReplaceStrData[52].ReplaceWith = "OPEN";
fmtdata.SectData.ReplaceStrData[53].Flag = "High, RNO, Caution, Note, Table, Substep, Attach, CaseInsens";
fmtdata.SectData.ReplaceStrData[53].ReplaceWord = "operate";
fmtdata.SectData.ReplaceStrData[53].ReplaceWith = "OPERATE";
fmtdata.SectData.ReplaceStrData[54].Flag = "High, RNO, Caution, Note, Table, Substep, Attach, CaseInsens";
fmtdata.SectData.ReplaceStrData[54].ReplaceWord = "perform";
fmtdata.SectData.ReplaceStrData[54].ReplaceWith = "PERFORM";
fmtdata.SectData.ReplaceStrData[55].Flag = "High, RNO, Caution, Note, Table, Substep, Attach, CaseInsens";
fmtdata.SectData.ReplaceStrData[55].ReplaceWord = "place";
fmtdata.SectData.ReplaceStrData[55].ReplaceWith = "PLACE";
fmtdata.SectData.ReplaceStrData[56].Flag = "High, RNO, Caution, Note, Table, Substep, Attach, CaseInsens";
fmtdata.SectData.ReplaceStrData[56].ReplaceWord = "prepare";
fmtdata.SectData.ReplaceStrData[56].ReplaceWith = "PREPARE";
fmtdata.SectData.ReplaceStrData[57].Flag = "High, RNO, Caution, Note, Table, Substep, Attach, CaseInsens";
fmtdata.SectData.ReplaceStrData[57].ReplaceWord = "raise";
fmtdata.SectData.ReplaceStrData[57].ReplaceWith = "RAISE";
fmtdata.SectData.ReplaceStrData[58].Flag = "High, RNO, Caution, Note, Table, Substep, Attach, CaseInsens";
fmtdata.SectData.ReplaceStrData[58].ReplaceWord = "record";
fmtdata.SectData.ReplaceStrData[58].ReplaceWith = "RECORD";
fmtdata.SectData.ReplaceStrData[59].Flag = "High, RNO, Caution, Note, Table, Substep, Attach, CaseInsens";
fmtdata.SectData.ReplaceStrData[59].ReplaceWord = "release";
fmtdata.SectData.ReplaceStrData[59].ReplaceWith = "RELEASE";
fmtdata.SectData.ReplaceStrData[60].Flag = "High, RNO, Caution, Note, Table, Substep, Attach, CaseInsens";
fmtdata.SectData.ReplaceStrData[60].ReplaceWord = "reset";
fmtdata.SectData.ReplaceStrData[60].ReplaceWith = "RESET";
fmtdata.SectData.ReplaceStrData[61].Flag = "High, RNO, Caution, Note, Table, Substep, Attach, CaseInsens";
fmtdata.SectData.ReplaceStrData[61].ReplaceWord = "restore";
fmtdata.SectData.ReplaceStrData[61].ReplaceWith = "RESTORE";
fmtdata.SectData.ReplaceStrData[62].Flag = "High, RNO, Caution, Note, Table, Substep, Attach, CaseInsens";
fmtdata.SectData.ReplaceStrData[62].ReplaceWord = "return";
fmtdata.SectData.ReplaceStrData[62].ReplaceWith = "RETURN";
fmtdata.SectData.ReplaceStrData[63].Flag = "High, RNO, Caution, Note, Table, Substep, Attach, CaseInsens";
fmtdata.SectData.ReplaceStrData[63].ReplaceWord = "runback";
fmtdata.SectData.ReplaceStrData[63].ReplaceWith = "RUNBACK";
fmtdata.SectData.ReplaceStrData[64].Flag = "High, RNO, Caution, Note, Table, Substep, Attach, CaseInsens";
fmtdata.SectData.ReplaceStrData[64].ReplaceWord = "select";
fmtdata.SectData.ReplaceStrData[64].ReplaceWith = "SELECT";
fmtdata.SectData.ReplaceStrData[65].Flag = "High, RNO, Caution, Note, Table, Substep, Attach, CaseInsens";
fmtdata.SectData.ReplaceStrData[65].ReplaceWord = "set";
fmtdata.SectData.ReplaceStrData[65].ReplaceWith = "SET";
fmtdata.SectData.ReplaceStrData[66].Flag = "High, RNO, Caution, Note, Table, Substep, Attach, CaseInsens";
fmtdata.SectData.ReplaceStrData[66].ReplaceWord = "shed";
fmtdata.SectData.ReplaceStrData[66].ReplaceWith = "SHED";
fmtdata.SectData.ReplaceStrData[67].Flag = "High, RNO, Caution, Note, Table, Substep, Attach, CaseInsens";
fmtdata.SectData.ReplaceStrData[67].ReplaceWord = "secure";
fmtdata.SectData.ReplaceStrData[67].ReplaceWith = "SECURE";
fmtdata.SectData.ReplaceStrData[68].Flag = "High, RNO, Caution, Note, Table, Substep, Attach, CaseInsens";
fmtdata.SectData.ReplaceStrData[68].ReplaceWord = "start";
fmtdata.SectData.ReplaceStrData[68].ReplaceWith = "START";
fmtdata.SectData.ReplaceStrData[69].Flag = "High, RNO, Caution, Note, Table, Substep, Attach, CaseInsens";
fmtdata.SectData.ReplaceStrData[69].ReplaceWord = "stop";
fmtdata.SectData.ReplaceStrData[69].ReplaceWith = "STOP";
fmtdata.SectData.ReplaceStrData[70].Flag = "High, RNO, Caution, Note, Table, Substep, Attach, CaseInsens";
fmtdata.SectData.ReplaceStrData[70].ReplaceWord = "throttle";
fmtdata.SectData.ReplaceStrData[70].ReplaceWith = "THROTTLE";
fmtdata.SectData.ReplaceStrData[71].Flag = "High, RNO, Caution, Note, Table, Substep, Attach, CaseInsens";
fmtdata.SectData.ReplaceStrData[71].ReplaceWord = "transfer";
fmtdata.SectData.ReplaceStrData[71].ReplaceWith = "TRANSFER";
fmtdata.SectData.ReplaceStrData[72].Flag = "High, RNO, Caution, Note, Table, Substep, Attach, CaseInsens";
fmtdata.SectData.ReplaceStrData[72].ReplaceWord = "trip";
fmtdata.SectData.ReplaceStrData[72].ReplaceWith = "TRIP";
fmtdata.SectData.ReplaceStrData[73].Flag = "High, RNO, Caution, Note, Table, Substep, Attach, CaseInsens";
fmtdata.SectData.ReplaceStrData[73].ReplaceWord = "try";
fmtdata.SectData.ReplaceStrData[73].ReplaceWith = "TRY";
fmtdata.SectData.ReplaceStrData[74].Flag = "High, RNO, Caution, Note, Table, Substep, Attach, CaseInsens";
fmtdata.SectData.ReplaceStrData[74].ReplaceWord = "turn on";
fmtdata.SectData.ReplaceStrData[74].ReplaceWith = "TURN ON";
fmtdata.SectData.ReplaceStrData[75].Flag = "High, RNO, Caution, Note, Table, Substep, Attach, CaseInsens";
fmtdata.SectData.ReplaceStrData[75].ReplaceWord = "turn off";
fmtdata.SectData.ReplaceStrData[75].ReplaceWith = "TURN OFF";
fmtdata.SectData.ReplaceStrData[76].Flag = "High, RNO, Caution, Note, Table, Substep, Attach, CaseInsens";
fmtdata.SectData.ReplaceStrData[76].ReplaceWord = "use";
fmtdata.SectData.ReplaceStrData[76].ReplaceWith = "USE";
fmtdata.SectData.ReplaceStrData[77].Flag = "High, RNO, Caution, Note, Table, Substep, Attach, CaseInsens";
fmtdata.SectData.ReplaceStrData[77].ReplaceWord = "vent";
fmtdata.SectData.ReplaceStrData[77].ReplaceWith = "VENT";
fmtdata.SectData.ReplaceStrData[78].Flag = "High, RNO, Caution, Note, Table, Substep, Attach, CaseInsens";
fmtdata.SectData.ReplaceStrData[78].ReplaceWord = "verify";
fmtdata.SectData.ReplaceStrData[78].ReplaceWith = "VERIFY";
}
}
public partial class FmtToXml
{
private void AddOHLPPage(ref PageStyles pgstyles)
{
}
}
public partial class RtfToSvg
{
private void AddOHLP(XmlDocument myDoc)
{
}
}
}
-422
View File
@@ -1,422 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
namespace fmtxml
{
public partial class FmtFileToXml
{
private void AddVCSDEVfmt(ref FormatData fmtdata)
{
}
private void AddSUMfmt(ref FormatData fmtdata)
{
fmtdata.ProcData.ChangeBarData.FixedChangeColumn = 91;
fmtdata.ProcData.TitleLength = 53;
fmtdata.ProcData.CheckOffData.RelXLocation = 5;
fmtdata.SectData.StepSectionData.StpSectLayData.WidSTableEdit = "460,204,126";
fmtdata.SectData.StepSectionData.StpSectLayData.WidSTablePrint = "460,204,126";
fmtdata.SectData.SectionNumber.Pos = 0;
fmtdata.SectData.SectionNumber.Just = "PSCenter";
fmtdata.SectData.SectionNumber.Font.FontFamily = "Letter Gothic Tall";
fmtdata.SectData.SectionNumber.Font.FontStyle = "None";
fmtdata.SectData.SectionNumber.Font.CPI = "12.5";
fmtdata.SectData.SectionHeader.Pos = 0;
fmtdata.SectData.SectionHeader.Just = "PSCenter";
fmtdata.SectData.SectionHeader.Font.FontFamily = "Letter Gothic Tall";
fmtdata.SectData.SectionHeader.Font.FontStyle = "Underline";
fmtdata.SectData.SectionHeader.Font.CPI = "12.5";
fmtdata.SectData.StepSectionData.StpSectLayData.SingleColumnRNOIndent = 30;
fmtdata.SectData.StepSectionData.StpSectLayData.DoSTExtraAtTop = "False";
fmtdata.SectData.StepSectionData.StpSectLayData.RNOWidthSameAsHighParent = true;
fmtdata.SectData.StepSectionData.StpSectLayData.ColRTable = "0,258,138";
fmtdata.SectData.StepSectionData.StpSectEditData.ColRScreen = "0,0,0";
fmtdata.StepData[2].StepLayoutData.STExtraSpace = "12";
fmtdata.StepData[3].TabData.RNOIdent = " {numeric}";
fmtdata.StepData[3].TabData.RNOExcludeMacros = true;
fmtdata.StepData[3].TabData.MacroTabAdjust = -6;
// Caution
fmtdata.StepData[6].TabData.Bullet.Separate = "True";
fmtdata.StepData[6].TabData.Bullet.Font = new VE_Font();
fmtdata.StepData[6].TabData.Bullet.Font.FontFamily = "Letter Gothic Tall";
fmtdata.StepData[6].TabData.Bullet.Font.FontSize = "10";
fmtdata.StepData[6].TabData.Bullet.Font.FontStyle = "none";
fmtdata.StepData[6].TabData.Bullet.Font.CPI = "12.5";
// Note
fmtdata.StepData[7].TabData.Bullet.Separate = "True";
fmtdata.StepData[7].TabData.Bullet.Font = new VE_Font();
fmtdata.StepData[7].TabData.Bullet.Font.FontFamily = "Letter Gothic Tall";
fmtdata.StepData[7].TabData.Bullet.Font.FontSize = "10";
fmtdata.StepData[7].TabData.Bullet.Font.FontStyle = "none";
fmtdata.StepData[7].TabData.Bullet.Font.CPI = "12.5";
// Table
fmtdata.StepData[8].StepLayoutData.STBoxindex = null;
// LossOfAC
fmtdata.StepData[18].StepEditData.TypeMenu.MenuItem = "Un-Numbered High Level Step";
fmtdata.StepData[18].TabData.IdentEdit = "";
fmtdata.StepData[18].TabData.Ident = "";
fmtdata.StepData[18].TabData.RNOIdentEdit = "";
fmtdata.StepData[18].TabData.RNOIdent = "";
fmtdata.StepData[18].TabData.Justify = "None";
// Caution 1
fmtdata.StepData[20].TabData.Bullet.Separate = "True";
fmtdata.StepData[20].TabData.Bullet.Font = new VE_Font();
fmtdata.StepData[20].TabData.Bullet.Font.FontFamily = "Letter Gothic Tall";
fmtdata.StepData[20].TabData.Bullet.Font.FontSize = "10";
fmtdata.StepData[20].TabData.Bullet.Font.FontStyle = "none";
fmtdata.StepData[20].TabData.Bullet.Font.CPI = "12.5";
// Caution 2
fmtdata.StepData[21].TabData.IsTransition = true;
fmtdata.StepData[21].TabData.Bullet.Separate = "True";
fmtdata.StepData[21].TabData.Bullet.Font = new VE_Font();
fmtdata.StepData[21].TabData.Bullet.Font.FontFamily = "Letter Gothic Tall";
fmtdata.StepData[21].TabData.Bullet.Font.FontSize = "10";
fmtdata.StepData[21].TabData.Bullet.Font.FontStyle = "none";
fmtdata.StepData[21].TabData.Bullet.Font.CPI = "12.5";
// Note 1
fmtdata.StepData[22].TabData.Bullet.Separate = "True";
fmtdata.StepData[22].TabData.Bullet.Font = new VE_Font();
fmtdata.StepData[22].TabData.Bullet.Font.FontFamily = "Letter Gothic Tall";
fmtdata.StepData[22].TabData.Bullet.Font.FontSize = "10";
fmtdata.StepData[22].TabData.Bullet.Font.FontStyle = "none";
fmtdata.StepData[22].TabData.Bullet.Font.CPI = "12.5";
// Note 2
fmtdata.StepData[23].TabData.IsTransition = true;
fmtdata.StepData[23].TabData.Bullet.Separate = "True";
fmtdata.StepData[23].TabData.Bullet.Font = new VE_Font();
fmtdata.StepData[23].TabData.Bullet.Font.FontFamily = "Letter Gothic Tall";
fmtdata.StepData[23].TabData.Bullet.Font.FontSize = "10";
fmtdata.StepData[23].TabData.Bullet.Font.FontStyle = "none";
fmtdata.StepData[23].TabData.Bullet.Font.CPI = "12.5";
// Note 3
fmtdata.StepData[26].TabData.Bullet.Separate = "True";
fmtdata.StepData[26].TabData.Bullet.Font = new VE_Font();
fmtdata.StepData[26].TabData.Bullet.Font.FontFamily = "Letter Gothic Tall";
fmtdata.StepData[26].TabData.Bullet.Font.FontSize = "10";
fmtdata.StepData[26].TabData.Bullet.Font.FontStyle = "none";
fmtdata.StepData[26].TabData.Bullet.Font.CPI = "12.5";
// Caution 3
fmtdata.StepData[27].TabData.Bullet.Separate = "True";
fmtdata.StepData[27].TabData.Bullet.Font = new VE_Font();
fmtdata.StepData[27].TabData.Bullet.Font.FontFamily = "Letter Gothic Tall";
fmtdata.StepData[27].TabData.Bullet.Font.FontSize = "10";
fmtdata.StepData[27].TabData.Bullet.Font.FontStyle = "none";
fmtdata.StepData[27].TabData.Bullet.Font.CPI = "12.5";
// Note 4
fmtdata.StepData[28].TabData.Bullet.Separate = "True";
fmtdata.StepData[28].TabData.Bullet.Font = new VE_Font();
fmtdata.StepData[28].TabData.Bullet.Font.FontFamily = "Letter Gothic Tall";
fmtdata.StepData[28].TabData.Bullet.Font.FontSize = "10";
fmtdata.StepData[28].TabData.Bullet.Font.FontStyle = "none";
fmtdata.StepData[28].TabData.Bullet.Font.CPI = "12.5";
// Caution 4
fmtdata.StepData[29].TabData.Bullet.Separate = "True";
fmtdata.StepData[29].TabData.Bullet.Font = new VE_Font();
fmtdata.StepData[29].TabData.Bullet.Font.FontFamily = "Letter Gothic Tall";
fmtdata.StepData[29].TabData.Bullet.Font.FontSize = "10";
fmtdata.StepData[29].TabData.Bullet.Font.FontStyle = "none";
fmtdata.StepData[29].TabData.Bullet.Font.CPI = "12.5";
// Note 5
fmtdata.StepData[32].TabData.Bullet.Separate = "True";
fmtdata.StepData[32].TabData.Bullet.Font = new VE_Font();
fmtdata.StepData[32].TabData.Bullet.Font.FontFamily = "Letter Gothic Tall";
fmtdata.StepData[32].TabData.Bullet.Font.FontSize = "10";
fmtdata.StepData[32].TabData.Bullet.Font.FontStyle = "none";
fmtdata.StepData[32].TabData.Bullet.Font.CPI = "12.5";
fmtdata.StepData[3].StepLayoutData.STExtraSpace = "-12345"; //this will put in a null
fmtdata.StepData[9].StepLayoutData.STExtraSpace = "-12345"; //this will put in a null
fmtdata.StepData[18].StepLayoutData.STExtraSpace = "-12345"; //this will put in a null
fmtdata.StepData[41].StepLayoutData.STExtraSpace = "-12345"; //this will put in a null
fmtdata.BoxData[1].TxtWidth = 420;
fmtdata.BoxData[2].TxtWidth = 420;
fmtdata.TransData.AdjustStepTransitionText = true;
fmtdata.TransData.BoldTransitionExceptHLS = true;
//fmtdata.TransData.TransTypeData[6].Index = 6;
//fmtdata.TransData.TransTypeData[6].TransType = 6;
//fmtdata.TransData.TransTypeData[6].TransFormat = "Step {First Step} of this procedure";
//fmtdata.TransData.TransTypeData[6].TransMenu = "Step {First Step} of this procedure";
//fmtdata.TransData.TransTypeData[6].TransUI = "ProcCur, SectMenuAny, StepFirst";
}
private void AddSUMOverridefmt(ref FormatData fmtdata)
{
fmtdata.StepData[2].StepLayoutData.STExtraSpace = "12";
fmtdata.StepData[40].StepLayoutData.STExtraSpace = "0";
// add lower cased versions to replacewords
Array.Resize<ReplaceStr>(ref fmtdata.SectData.ReplaceStrData, fmtdata.SectData.ReplaceStrData.Length + 20);
fmtdata.SectData.ReplaceStrData[42].Flag = "High, RNO, Caution, Note, Table, Substep, Attach, CaseInsensFirst";
fmtdata.SectData.ReplaceStrData[42].ReplaceWord = "any";
fmtdata.SectData.ReplaceStrData[42].ReplaceWith=@"\ul any\ulnone ";
fmtdata.SectData.ReplaceStrData[43].Flag="High, RNO, Caution, Note, Table, Substep, Attach, CaseInsensFirst";
fmtdata.SectData.ReplaceStrData[43].ReplaceWord="each";
fmtdata.SectData.ReplaceStrData[43].ReplaceWith=@"\ul each\ulnone ";
fmtdata.SectData.ReplaceStrData[44].Flag = "High, RNO, Caution, Note, Table, Substep, Attach, CaseInsensFirst";
fmtdata.SectData.ReplaceStrData[44].ReplaceWord="all";
fmtdata.SectData.ReplaceStrData[44].ReplaceWith=@"\ul all\ulnone ";
fmtdata.SectData.ReplaceStrData[45].Flag="High, RNO, Caution, Note, Table, Substep, Attach, CaseInsensFirst";
fmtdata.SectData.ReplaceStrData[45].ReplaceWord="either";
fmtdata.SectData.ReplaceStrData[45].ReplaceWith=@"\ul either\ulnone ";
fmtdata.SectData.ReplaceStrData[46].Flag="High, RNO, Caution, Note, Table, Substep, Attach, Setpoint, CaseInsensFirst";
fmtdata.SectData.ReplaceStrData[46].ReplaceWord="eleven";
fmtdata.SectData.ReplaceStrData[46].ReplaceWith=@"\ul eleven\ulnone ";
fmtdata.SectData.ReplaceStrData[47].Flag="High, RNO, Caution, Note, Table, Substep, Attach, CaseInsensFirst";
fmtdata.SectData.ReplaceStrData[47]. ReplaceWord="no";
fmtdata.SectData.ReplaceStrData[47].ReplaceWith=@"\ul no\ulnone ";
fmtdata.SectData.ReplaceStrData[48].Flag="High, RNO, Caution, Note, Table, Substep, Attach, CaseInsensFirst";
fmtdata.SectData.ReplaceStrData[48].ReplaceWord="both";
fmtdata.SectData.ReplaceStrData[48].ReplaceWith=@"\ul both\ulnone ";
fmtdata.SectData.ReplaceStrData[49].Flag="High, RNO, Caution, Note, Table, Substep, Attach, Setpoint, CaseInsensFirst";
fmtdata.SectData.ReplaceStrData[49].ReplaceWord="one";
fmtdata.SectData.ReplaceStrData[49].ReplaceWith=@"\ul one\ulnone ";
fmtdata.SectData.ReplaceStrData[50].Flag="High, RNO, Caution, Note, Table, Substep, Attach, CaseInsensFirst";
fmtdata.SectData.ReplaceStrData[50].ReplaceWord="neither";
fmtdata.SectData.ReplaceStrData[50].ReplaceWith=@"\ul neither\ulnone ";
fmtdata.SectData.ReplaceStrData[51].Flag="High, RNO, Caution, Note, Table, Substep, Attach, Setpoint, CaseInsensFirst";
fmtdata.SectData.ReplaceStrData[51].ReplaceWord="three";
fmtdata.SectData.ReplaceStrData[51].ReplaceWith=@"\ul three\ulnone ";
fmtdata.SectData.ReplaceStrData[52].Flag="High, RNO, Caution, Note, Table, Substep, Attach, Setpoint, CaseInsensFirst";
fmtdata.SectData.ReplaceStrData[52].ReplaceWord="two";
fmtdata.SectData.ReplaceStrData[52].ReplaceWith=@"\ul two\ulnone ";
fmtdata.SectData.ReplaceStrData[53].Flag="High, RNO, Caution, Note, Table, Substep, Attach, Setpoint, CaseInsensFirst";
fmtdata.SectData.ReplaceStrData[53].ReplaceWord="four";
fmtdata.SectData.ReplaceStrData[53].ReplaceWith=@"\ul four\ulnone ";
fmtdata.SectData.ReplaceStrData[55].Flag="High, RNO, Caution, Note, Table, Substep, Attach, Setpoint, CaseInsensFirst";
fmtdata.SectData.ReplaceStrData[55].ReplaceWord="five";
fmtdata.SectData.ReplaceStrData[55].ReplaceWith=@"\ul five\ulnone ";
fmtdata.SectData.ReplaceStrData[56].Flag="High, RNO, Caution, Note, Table, Substep, Attach, Setpoint, CaseInsensFirst";
fmtdata.SectData.ReplaceStrData[56].ReplaceWord="six";
fmtdata.SectData.ReplaceStrData[56].ReplaceWith=@"\ul six\ulnone ";
fmtdata.SectData.ReplaceStrData[57].Flag="High, RNO, Caution, Note, Table, Substep, Attach, Setpoint, CaseInsensFirst";
fmtdata.SectData.ReplaceStrData[57].ReplaceWord="seven";
fmtdata.SectData.ReplaceStrData[57].ReplaceWith=@"\ul seven\ulnone ";
fmtdata.SectData.ReplaceStrData[58].Flag="High, RNO, Caution, Note, Table, Substep, Attach, Setpoint, CaseInsensFirst";
fmtdata.SectData.ReplaceStrData[58].ReplaceWord="eight";
fmtdata.SectData.ReplaceStrData[58].ReplaceWith=@"\ul eight\ulnone ";
fmtdata.SectData.ReplaceStrData[59].Flag="High, RNO, Caution, Note, Table, Substep, Attach, Setpoint, CaseInsensFirst";
fmtdata.SectData.ReplaceStrData[59].ReplaceWord="nine";
fmtdata.SectData.ReplaceStrData[59].ReplaceWith=@"\ul nine\ulnone ";
fmtdata.SectData.ReplaceStrData[60].Flag="High, RNO, Caution, Note, Table, Substep, Attach, Setpoint, CaseInsensFirst";
fmtdata.SectData.ReplaceStrData[60].ReplaceWord="ten";
fmtdata.SectData.ReplaceStrData[60].ReplaceWith=@"\ul ten\ulnone ";
fmtdata.SectData.ReplaceStrData[61].Flag="High, RNO, Caution, Note, Table, Substep, Attach, Setpoint, CaseInsensFirst";
fmtdata.SectData.ReplaceStrData[61].ReplaceWord="zero";
fmtdata.SectData.ReplaceStrData[61].ReplaceWith=@"\ul zero\ulnone ";
fmtdata.SectData.ReplaceStrData[62].Flag="High, RNO, Caution, Note, Table, Substep, Attach, CaseInsensFirst";
fmtdata.SectData.ReplaceStrData[62].ReplaceWord="none";
fmtdata.SectData.ReplaceStrData[62].ReplaceWith=@"\ul none\ulnone ";
}
}
public partial class FmtToXml
{
private void AddVCSDEVfmt(ref PageStyles pgstyles)
{
}
private void AddSUMfmt(ref PageStyles pgstyles)
{
pgstyles.PgStyles[4].Items[1].Style.FontSize = "14";
pgstyles.PgStyles[4].Items[2].Style.FontSize = "14";
Array.Resize<PageStyle>(ref pgstyles.PgStyles, pgstyles.PgStyles.Length + 1);
pgstyles.PgStyles[12].Name = "Purpose/Symptom";
pgstyles.PgStyles[12].Index = 12;
if (pgstyles.PgStyles[12].Items == null)
Array.Resize<PSItem>(ref pgstyles.PgStyles[12].Items, 7);
pgstyles.PgStyles[12].Items[0].Col = 3F;
pgstyles.PgStyles[12].Items[0].Justify = "PSCenter";
pgstyles.PgStyles[12].Items[0].Row = 12F;
pgstyles.PgStyles[12].Items[0].Style = new VE_Font();
pgstyles.PgStyles[12].Items[0].Style.CPI = "12";
pgstyles.PgStyles[12].Items[0].Style.FontFamily = "Prestige Elite Tall";
pgstyles.PgStyles[12].Items[0].Style.FontSize = "10";
pgstyles.PgStyles[12].Items[0].Style.FontStyle = "None";
pgstyles.PgStyles[12].Items[0].Token = "{DRAFTPAGE}{REFERENCEPAGE}{MASTERPAGE}{SAMPLEPAGE}";
pgstyles.PgStyles[12].Items[1].Col = 426.24F;
pgstyles.PgStyles[12].Items[1].Justify = "PSLeft";
pgstyles.PgStyles[12].Items[1].Row = 12F;
pgstyles.PgStyles[12].Items[1].Style = new VE_Font();
pgstyles.PgStyles[12].Items[1].Style.CPI = "12.5";
pgstyles.PgStyles[12].Items[1].Style.FontFamily = "Letter Gothic Tall";
pgstyles.PgStyles[12].Items[1].Style.FontSize = "10";
pgstyles.PgStyles[12].Items[1].Style.FontStyle = "None";
pgstyles.PgStyles[12].Items[1].Token = "{EOPNUM}";
pgstyles.PgStyles[12].Items[2].Col = 426.24F;
pgstyles.PgStyles[12].Items[2].Justify = "PSLeft";
pgstyles.PgStyles[12].Items[2].Row = 24F;
pgstyles.PgStyles[12].Items[2].Style = new VE_Font();
pgstyles.PgStyles[12].Items[2].Style.CPI = "12.5";
pgstyles.PgStyles[12].Items[2].Style.FontFamily = "Letter Gothic Tall";
pgstyles.PgStyles[12].Items[2].Style.FontSize = "10";
pgstyles.PgStyles[12].Items[2].Style.FontStyle = "None";
pgstyles.PgStyles[12].Items[2].Token = "REVISION {REV}";
pgstyles.PgStyles[12].Items[3].Col = 426.24F;
pgstyles.PgStyles[12].Items[3].Justify = "PSLeft";
pgstyles.PgStyles[12].Items[3].Row = 36F;
pgstyles.PgStyles[12].Items[3].Style = new VE_Font();
pgstyles.PgStyles[12].Items[3].Style.CPI = "12.5";
pgstyles.PgStyles[12].Items[3].Style.FontFamily = "Letter Gothic Tall";
pgstyles.PgStyles[12].Items[3].Style.FontSize = "10";
pgstyles.PgStyles[12].Items[3].Style.FontStyle = "None";
pgstyles.PgStyles[12].Items[3].Token = "{PS-DRAFT}";
pgstyles.PgStyles[12].Items[4].Col = 250.56F;
pgstyles.PgStyles[12].Items[4].Justify = "PSCenter";
pgstyles.PgStyles[12].Items[4].Row = 48F;
pgstyles.PgStyles[12].Items[4].Style = new VE_Font();
pgstyles.PgStyles[12].Items[4].Style.CPI = "12.5";
pgstyles.PgStyles[12].Items[4].Style.FontFamily = "Letter Gothic Tall";
pgstyles.PgStyles[12].Items[4].Style.FontSize = "10";
pgstyles.PgStyles[12].Items[4].Style.FontStyle = "None";
pgstyles.PgStyles[12].Items[4].Token = "{PROCTITLE}";
pgstyles.PgStyles[12].Items[5].Col = 0;//-23.04F;
pgstyles.PgStyles[12].Items[5].Justify = "PSLeft";
pgstyles.PgStyles[12].Items[5].Row = 60F;
pgstyles.PgStyles[12].Items[5].Style = new VE_Font();
pgstyles.PgStyles[12].Items[5].Style.CPI = "12.5";
pgstyles.PgStyles[12].Items[5].Style.FontFamily = "Letter Gothic Tall";
pgstyles.PgStyles[12].Items[5].Style.FontSize = "10";
pgstyles.PgStyles[12].Items[5].Style.FontStyle = "None";
pgstyles.PgStyles[12].Items[5].Token = "{BOX3}";
pgstyles.PgStyles[12].Items[6].Col = 250.56F;
pgstyles.PgStyles[12].Items[6].Justify = "PSCenter";
pgstyles.PgStyles[12].Items[6].Row = 756F;
pgstyles.PgStyles[12].Items[6].Style = new VE_Font();
pgstyles.PgStyles[12].Items[6].Style.CPI = "12.5";
pgstyles.PgStyles[12].Items[6].Style.FontFamily = "Letter Gothic Tall";
pgstyles.PgStyles[12].Items[6].Style.FontSize = "10";
pgstyles.PgStyles[12].Items[6].Style.FontStyle = "None";
pgstyles.PgStyles[12].Items[6].Token = "PAGE {PAGE} OF {OF}";
}
private void AddVCSDEVDOC(ref DocStyles dcstyles)
{
/*
<Item Token="{SECTIONLEVELNUMBER}" Row="36" Col="426.24" Justify="PSLeft">
<Font Family="Letter Gothic Tall" Size="10" Style="None" CPI="12.5" />
</Item>
*/
}
private void AddSUMDOC(ref DocStyles dcstyles)
{
dcstyles.DcStyles[0].CenterLineX = 261.9F;
dcstyles.DcStyles[0].CenterLineYTop = 652.2F;
//dcstyles.DcStyles[0].CenterLineYBottom = 49.2F;
dcstyles.DcStyles[0].CenterLineYBottom = 40.2F;
//dcstyles.DcStyles[0].EndString = " - - - - - - - - - - - - - - - - \n - - - - - - - - - - - - - - | End of %-8s | - - - - - - - - - - - - \n - - - - - - - - - - - - - - - -";
dcstyles.DcStyles[0].EndString = " - - - - - - - - - - - - - - - - \n - - - - - - - - - - - - - - | End of %-12s | - - - - - - - - - - - - \n - - - - - - - - - - - - - - - -";
dcstyles.DcStyles[1].CenterLineX = 261.9F;
dcstyles.DcStyles[1].CenterLineYTop = 678.2F;
//dcstyles.DcStyles[1].CenterLineYBottom = 49.2F;
dcstyles.DcStyles[1].CenterLineYBottom = 40.2F;
//dcstyles.DcStyles[1].EndString = " - - - - - - - - - - - - - - - - \n - - - - - - - - - - - - - - | End of %-8s | - - - - - - - - - - - - \n - - - - - - - - - - - - - - - -";
dcstyles.DcStyles[1].EndString = " - - - - - - - - - - - - - - - - \n - - - - - - - - - - - - - - | End of %-12s | - - - - - - - - - - - - \n - - - - - - - - - - - - - - - -";
dcstyles.DcStyles[2].CenterLineX = 261.9F;
dcstyles.DcStyles[2].CenterLineYTop = 678.2F;
//dcstyles.DcStyles[2].CenterLineYBottom = 49.2F;
dcstyles.DcStyles[2].CenterLineYBottom = 40.2F;
dcstyles.DcStyles[2].FooterLen = 0;
dcstyles.DcStyles[3].PageWidth = 612.96F;
dcstyles.DcStyles[4].PageWidth = 612.96F;
dcstyles.DcStyles[5].PageWidth = 612.96F;
dcstyles.DcStyles[7].LandscapePageList = true;
// foldout (Step Editor)
dcstyles.DcStyles[11].TopMargin = 103;
//adding new single column docstyle for purpose and symptoms and
//single column procedure steps section and
// single column step editor attachment section
Array.Resize<DocStyle>(ref dcstyles.DcStyles, dcstyles.DcStyles.Length + 3);
//jcb single column docstyle for purpose and symptoms
dcstyles.DcStyles[12].Name = "Purpose/Symptom";
dcstyles.DcStyles[12].Index = 12;
dcstyles.DcStyles[12].pagestyle = 12;
dcstyles.DcStyles[12].CancelSectTitle = false;
dcstyles.DcStyles[12].FooterLen = 12F;
dcstyles.DcStyles[12].IsStepSection = true;
dcstyles.DcStyles[12].LeftMargin = 51.84F;
dcstyles.DcStyles[12].numberingsequence = 1;
dcstyles.DcStyles[12].PageLength = 636;
dcstyles.DcStyles[12].PageWidth = 572.2F; //547.2F;
dcstyles.DcStyles[12].ShowSectionTitles = true;
dcstyles.DcStyles[12].SpecialStepsFoldout = false;
dcstyles.DcStyles[12].TopMargin = 108F;
dcstyles.DcStyles[12].UseCheckOffs = false;
dcstyles.DcStyles[12].dstyle = new VE_Font();
dcstyles.DcStyles[12].dstyle.FontFamily = "Letter Gothic Tall";
dcstyles.DcStyles[12].dstyle.FontSize = "10";
dcstyles.DcStyles[12].dstyle.FontStyle = "None";
dcstyles.DcStyles[12].dstyle.CPI = "12.5";
//jsj single column Procedure Steps section
dcstyles.DcStyles[13].Name = "Single Column Procedure Steps";
dcstyles.DcStyles[13].Index = 13;
dcstyles.DcStyles[13].pagestyle = 12;
dcstyles.DcStyles[13].CancelSectTitle = false;
dcstyles.DcStyles[13].FooterLen = 12F;
dcstyles.DcStyles[13].IsStepSection = true;
dcstyles.DcStyles[13].LeftMargin = 51.84F;
dcstyles.DcStyles[13].numberingsequence = 1;
dcstyles.DcStyles[13].PageLength = 636;
dcstyles.DcStyles[13].PageWidth = 547.2F;
dcstyles.DcStyles[13].SpecialStepsFoldout = false;
dcstyles.DcStyles[13].TopMargin = 108F;
dcstyles.DcStyles[13].UseCheckOffs = false;
dcstyles.DcStyles[13].dstyle = new VE_Font();
dcstyles.DcStyles[13].dstyle.FontFamily = "Letter Gothic Tall";
dcstyles.DcStyles[13].dstyle.FontSize = "10";
dcstyles.DcStyles[13].dstyle.FontStyle = "None";
dcstyles.DcStyles[13].dstyle.CPI = "12.5";
//jsj Attachment Steps- one Column
dcstyles.DcStyles[14].Name = "Attachment Steps- One Column";
dcstyles.DcStyles[14].Index = 14;
dcstyles.DcStyles[14].pagestyle = 5;
dcstyles.DcStyles[14].CancelSectTitle = false;
dcstyles.DcStyles[14].FooterLen = 12F;
dcstyles.DcStyles[14].IsStepSection = true;
dcstyles.DcStyles[14].LeftMargin = 51.84F;
dcstyles.DcStyles[14].numberingsequence = 1;
dcstyles.DcStyles[14].PageLength = 636;
dcstyles.DcStyles[14].PageWidth = 547.2F;
dcstyles.DcStyles[14].SpecialStepsFoldout = false;
dcstyles.DcStyles[14].TopMargin = 108F;
dcstyles.DcStyles[14].UseCheckOffs = false;
dcstyles.DcStyles[14].dstyle = new VE_Font();
dcstyles.DcStyles[14].dstyle.FontFamily = "Letter Gothic Tall";
dcstyles.DcStyles[14].dstyle.FontSize = "10";
dcstyles.DcStyles[14].dstyle.FontStyle = "None";
dcstyles.DcStyles[14].dstyle.CPI = "12.5";
}
}
public partial class RtfToSvg
{
private void AddSUM(XmlDocument myDoc)
{
XmlDocument xdNew = new XmlDocument();
// B2
xdNew.LoadXml("<svg xmlns=\"http://www.w3.org/2000/svg\"> <g id=\"B2\">" +
"<rect x=\"0\" y=\"4.25\" width=\"519.3\" height=\"677.45\" fill=\"none\" stroke=\"black\" stroke-width=\"0.95\" />" +
"<line x1=\"0\" y1=\"29.75\" x2=\"519.3\" y2=\"29.75\" stroke=\"black\" stroke-width=\"0.95\" />" +
"<text x=\"56.65\" y=\"21.25\" font-family=\"Letter Gothic Tall\" font-size=\"10\">ACTION/EXPECTED{sp}RESPONSE</text>" +
"<line x1=\"261.9\" y1=\"4.25\" x2=\"261.9\" y2=\"44.2\" stroke=\"black\" stroke-width=\"0.95\" />" +
"<text x=\"339.85\" y=\"21.25\" font-family=\"Letter Gothic Tall\" font-size=\"10\">ALTERNATIVE{sp}ACTION</text>" +
"</g></svg>");
myDoc.DocumentElement.ReplaceChild(myDoc.ImportNode(xdNew.DocumentElement.ChildNodes[0], true), myDoc.DocumentElement.ChildNodes[2]);
//B3
xdNew.LoadXml("<svg xmlns=\"http://www.w3.org/2000/svg\"> <g id=\"B3\">" +
"<rect x=\"0\" y=\"4.25\" width=\"519.3\" height=\"677.45\" fill=\"none\" stroke=\"black\" stroke-width=\"0.95\" />" +
"</g></svg>");
myDoc.DocumentElement.ReplaceChild(myDoc.ImportNode(xdNew.DocumentElement.ChildNodes[0], true), myDoc.DocumentElement.ChildNodes[3]);
}
}
}
-290
View File
@@ -1,290 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
namespace fmtxml
{
public partial class FmtFileToXml
{
private void AddWCN1Fmt(ref FormatData fmtdata)
{
// Set a section title length
fmtdata.SectData.SectionTitleLength = 71;
fmtdata.ROData.UpRoAftrDash = "False";
fmtdata.ROData.UpRoImmAftrDashSpace = "True";
// replace words
fmtdata.SectData.ReplaceStrData[0].ReplaceWith = @"\b \ul IF\ulnone \b0 ";
fmtdata.SectData.ReplaceStrData[2].ReplaceWith = @"{\par}\b \ul THEN\ulnone \b0 ";
fmtdata.SectData.ReplaceStrData[3].ReplaceWith = @"\b \ul WHEN\ulnone \b0 ";
fmtdata.SectData.ReplaceStrData[4].ReplaceWith = @"{\par}\b \ul AND\ulnone \b0 ";
fmtdata.SectData.ReplaceStrData[5].ReplaceWith = @"{\par}\b \ul OR\ulnone \b0 ";
// transdata
fmtdata.TransData.TransTypeData[4].TransFormat = @"{Sect Num}{First Step}";
// psi definition
fmtdata.ProcData.Psi = new PSI();
fmtdata.ProcData.Psi.x = 200;
fmtdata.ProcData.Psi.y = 129;
fmtdata.ProcData.Psi.Caption = "Wolf Creek Procedure Information";
fmtdata.ProcData.Psi.ButtonsOnBottom = "NO";
fmtdata.ProcData.Psi.font = "ARIAL";
fmtdata.ProcData.Psi.Labels = new PsiLabel[5];
fmtdata.ProcData.Psi.Labels[0].text = "Responsible Manager's Title:";
fmtdata.ProcData.Psi.Labels[0].Justify = "LEFT";
fmtdata.ProcData.Psi.Labels[0].x = 12;
fmtdata.ProcData.Psi.Labels[0].y = 11;
fmtdata.ProcData.Psi.Labels[0].width = 100;
fmtdata.ProcData.Psi.Labels[0].height = 8;
fmtdata.ProcData.Psi.Labels[1].text = "Use Category (Continuous/Reference):";
fmtdata.ProcData.Psi.Labels[1].Justify = "LEFT";
fmtdata.ProcData.Psi.Labels[1].x = 12;
fmtdata.ProcData.Psi.Labels[1].y = 36;
fmtdata.ProcData.Psi.Labels[1].width = 100;
fmtdata.ProcData.Psi.Labels[1].height = 8;
fmtdata.ProcData.Psi.Labels[2].text = "Administrative Controls Procedure (Yes/No):";
fmtdata.ProcData.Psi.Labels[2].Justify = "LEFT";
fmtdata.ProcData.Psi.Labels[2].x = 12;
fmtdata.ProcData.Psi.Labels[2].y = 62;
fmtdata.ProcData.Psi.Labels[2].width = 148;
fmtdata.ProcData.Psi.Labels[2].height = 8;
fmtdata.ProcData.Psi.Labels[3].text = "Management Oversight Evolution (Yes/No):";
fmtdata.ProcData.Psi.Labels[3].Justify = "LEFT";
fmtdata.ProcData.Psi.Labels[3].x = 12;
fmtdata.ProcData.Psi.Labels[3].y = 80;
fmtdata.ProcData.Psi.Labels[3].width = 144;
fmtdata.ProcData.Psi.Labels[3].height = 8;
fmtdata.ProcData.Psi.Labels[4].text = "Program Number:";
fmtdata.ProcData.Psi.Labels[4].Justify = "LEFT";
fmtdata.ProcData.Psi.Labels[4].x = 12;
fmtdata.ProcData.Psi.Labels[4].y = 97;
fmtdata.ProcData.Psi.Labels[4].width = 60;
fmtdata.ProcData.Psi.Labels[4].height = 8;
fmtdata.ProcData.Psi.Fields = new PsiField[5];
fmtdata.ProcData.Psi.Fields[0].name = "CLASSIFICATION";
fmtdata.ProcData.Psi.Fields[0].type = "TEXT";
fmtdata.ProcData.Psi.Fields[0].text = "";
fmtdata.ProcData.Psi.Fields[0].Length = 51;
fmtdata.ProcData.Psi.Fields[0].x = 12;
fmtdata.ProcData.Psi.Fields[0].y = 20;
fmtdata.ProcData.Psi.Fields[0].width = 180;
fmtdata.ProcData.Psi.Fields[0].height = 12;
fmtdata.ProcData.Psi.Fields[1].name = "USECATEGORY";
fmtdata.ProcData.Psi.Fields[1].type = "TEXT";
fmtdata.ProcData.Psi.Fields[1].text = "";
fmtdata.ProcData.Psi.Fields[1].Length = 21;
fmtdata.ProcData.Psi.Fields[1].x = 12;
fmtdata.ProcData.Psi.Fields[1].y = 44;
fmtdata.ProcData.Psi.Fields[1].width = 145;
fmtdata.ProcData.Psi.Fields[1].height = 12;
fmtdata.ProcData.Psi.Fields[2].name = "CLASSABBR";
fmtdata.ProcData.Psi.Fields[2].type = "TEXT";
fmtdata.ProcData.Psi.Fields[2].text = "";
fmtdata.ProcData.Psi.Fields[2].Length = 4;
fmtdata.ProcData.Psi.Fields[2].x = 160;
fmtdata.ProcData.Psi.Fields[2].y = 61;
fmtdata.ProcData.Psi.Fields[2].width = 28;
fmtdata.ProcData.Psi.Fields[2].height = 12;
fmtdata.ProcData.Psi.Fields[3].name = "MNGOSEVOL";
fmtdata.ProcData.Psi.Fields[3].type = "TEXT";
fmtdata.ProcData.Psi.Fields[3].text = "";
fmtdata.ProcData.Psi.Fields[3].Length = 4;
fmtdata.ProcData.Psi.Fields[3].x = 160;
fmtdata.ProcData.Psi.Fields[3].y = 80;
fmtdata.ProcData.Psi.Fields[3].width = 28;
fmtdata.ProcData.Psi.Fields[3].height = 12;
fmtdata.ProcData.Psi.Fields[4].name = "PROGNUMBER";
fmtdata.ProcData.Psi.Fields[4].type = "TEXT";
fmtdata.ProcData.Psi.Fields[4].text = "";
fmtdata.ProcData.Psi.Fields[4].Length = 4;
fmtdata.ProcData.Psi.Fields[4].x = 76;
fmtdata.ProcData.Psi.Fields[4].y = 96;
fmtdata.ProcData.Psi.Fields[4].width = 28;
fmtdata.ProcData.Psi.Fields[4].height = 12;
}
private void AddWCN2Fmt(ref FormatData fmtdata)
{
// the WCN2 tab for continuous HLS type had only 1 space after the period ('.'). The other
// tabs had two spaces. This tab type also uses the C0 macro to draw the lines above/below
// the number. Because it only had 1 space, the tab and lines were not matching the
// 16bit output. A space is added here to make the continuous HLS type match the number
// of spaces as other HLS tabs, and to make the printed output match that of 16bit.
fmtdata.StepData[9].TabData.Ident = fmtdata.StepData[9].TabData.Ident + " ";
fmtdata.StepData[9].TabData.IdentEdit = fmtdata.StepData[9].TabData.IdentEdit + " ";
fmtdata.StepData[9].TabData.RNOIdent = fmtdata.StepData[9].TabData.RNOIdent + " ";
fmtdata.StepData[9].TabData.RNOIdentEdit = fmtdata.StepData[9].TabData.RNOIdentEdit + " ";
fmtdata.ROData.UpRoAftrDash = "False";
fmtdata.ROData.UpRoImmAftrDashSpace = "True";
}
private void AddWCNCKLFmt(ref FormatData fmtdata)
{
fmtdata.BoxData[3].End = 518;
fmtdata.BoxData[4].End = 518;
fmtdata.StepData[30].StepLayoutData.AlignWithParentTab = "True";
fmtdata.StepData[2].StepPrintData.Justify = "Center";
fmtdata.StepData[9].StepPrintData.Justify = "Center";
fmtdata.StepData[2].StepPrintData.HLSLength = "66";
fmtdata.StepData[9].StepPrintData.HLSLength = "66";
fmtdata.ROData.UpRoAftrDash = "False";
fmtdata.ROData.UpRoImmAftrDashSpace = "True";
}
private void AddWCNBCKFmt(ref FormatData fmtdata)
{
fmtdata.SectData.StepSectionData.StpSectLayData.WidSTablePrint = "485,216,144";
fmtdata.StepData[20].ColOverride = "86.4";
fmtdata.StepData[20].PageBreakOnStep = "False";
fmtdata.ROData.UpRoAftrDash = "False";
fmtdata.ROData.UpRoImmAftrDashSpace = "True";
fmtdata.StepData[2].TabData.RNOIdent = @"\ul WOG ERG STEP:\ulnone ";
fmtdata.StepData[3].TabData.RNOIdent = @"\ul WOG ERG STEP:\ulnone ";
fmtdata.StepData[6].TabData.RNOIdent = @"\ul WOG ERG STEP:\ulnone ";
fmtdata.StepData[7].TabData.RNOIdent = @"\ul WOG ERG STEP:\ulnone ";
fmtdata.StepData[9].TabData.RNOIdent = @"\ul WOG ERG STEP:\ulnone ";
fmtdata.StepData[18].TabData.RNOIdent = @"\ul WOG ERG STEP:\ulnone ";
fmtdata.StepData[22].TabData.RNOIdent = @"\ul WOG ERG STEP:\ulnone ";
fmtdata.StepData[23].TabData.RNOIdent = @"\ul WOG ERG STEP:\ulnone ";
fmtdata.StepData[26].TabData.RNOIdent = @"\ul WOG ERG STEP:\ulnone ";
}
private void AddWCNOFBFmt(ref FormatData fmtdata)
{
fmtdata.SectData.StepSectionData.StpSectLayData.WidSTablePrint = "495,216,144";
fmtdata.StepData[20].PageBreakOnStep = "False";
fmtdata.StepData[43].ColOverride = "86.4";
fmtdata.ROData.UpRoAftrDash = "False";
fmtdata.ROData.UpRoImmAftrDashSpace = "True";
// tabbing for hls types:
fmtdata.StepData[2].TabData.IdentEdit = @"STEP: {Section Prefix}{numeric}";
fmtdata.StepData[2].TabData.Ident = @"STEP: {Section Prefix}{numeric} ";
fmtdata.StepData[2].TabData.IdentAltPrint = @"STEP: {Section Prefix}{numeric}\STEP: {Section Prefix}{numeric}";
fmtdata.StepData[2].TabData.RNOIdentEdit = "STEP {Section Prefix}: ";
fmtdata.StepData[2].TabData.RNOIdent = "STEP: {Section Prefix} ";
fmtdata.StepData[2].TabData.IdentWid = "100";
fmtdata.StepData[3].TabData.IdentEdit = @"STEP: {Section Prefix}{numeric}";
fmtdata.StepData[3].TabData.Ident = @"STEP: {Section Prefix}{numeric} ";
fmtdata.StepData[3].TabData.IdentAltPrint = @"STEP: {Section Prefix}{numeric}\STEP: {Section Prefix}{numeric}";
fmtdata.StepData[3].TabData.RNOIdentEdit = "STEP {Section Prefix}: ";
fmtdata.StepData[3].TabData.RNOIdent = "STEP: {Section Prefix} ";
fmtdata.StepData[3].TabData.IdentWid = "100";
fmtdata.StepData[9].TabData.IdentEdit = @"STEP: {Section Prefix}{numeric}";
fmtdata.StepData[9].TabData.Ident = @"STEP: {Section Prefix}{numeric} ";
fmtdata.StepData[9].TabData.IdentAltPrint = @"STEP: {Section Prefix}{numeric}\STEP: {Section Prefix}{numeric}";
fmtdata.StepData[9].TabData.RNOIdentEdit = "STEP {Section Prefix}: ";
fmtdata.StepData[9].TabData.RNOIdent = "STEP: {Section Prefix} ";
fmtdata.StepData[9].TabData.IdentWid = "100";
fmtdata.StepData[18].TabData.IdentEdit = @"STEP: {Section Prefix}{numeric}";
fmtdata.StepData[18].TabData.Ident = @"STEP: {Section Prefix}{numeric} ";
fmtdata.StepData[18].TabData.IdentAltPrint = @"STEP: {Section Prefix}{numeric}\STEP: {Section Prefix}{numeric}";
fmtdata.StepData[18].TabData.RNOIdentEdit = "STEP {Section Prefix}: ";
fmtdata.StepData[18].TabData.RNOIdent = "STEP: {Section Prefix} ";
fmtdata.StepData[18].TabData.IdentWid = "100";
// tabbing for cautions/notes
// cautions:
fmtdata.StepData[6].TabData.Ident = @"STEP: {Section Prefix}{LNK Step Num}-CAUTION {LNK C/N Num} ";
fmtdata.StepData[6].TabData.IdentAltPrint = @"STEP: {Section Prefix}{LNK Step Num}-CAUTION {LNK C/N Num} /STEP: {Section Prefix}{LNK Step Num}-CAUTION {LNK C/N Num} ";
fmtdata.StepData[6].TabData.RNOIdent = @"STEP: {Section Prefix}{LNK Step Num}-CAUTION {LNK C/N Num} ";
// notes:
fmtdata.StepData[7].TabData.Ident = @"STEP: {Section Prefix}{LNK Step Num}-NOTE {LNK C/N Num} ";
fmtdata.StepData[7].TabData.IdentAltPrint = @"STEP: {Section Prefix}{LNK Step Num}-NOTE {LNK C/N Num} \STEP: {Section Prefix}{LNK Step Num}-NOTE {LNK C/N Num} ";
fmtdata.StepData[7].TabData.RNOIdent = @"STEP: {Section Prefix}{LNK Step Num}-NOTE {LNK C/N Num} ";
fmtdata.StepData[22].TabData.Ident = @"STEP: {Section Prefix}{LNK Step Num}-NOTE {LNK C/N Num} ";
fmtdata.StepData[22].TabData.IdentAltPrint = @"STEP: {Section Prefix}{LNK Step Num}-NOTE {LNK C/N Num} \STEP: {Section Prefix}{LNK Step Num}-NOTE {LNK C/N Num} ";
fmtdata.StepData[22].TabData.RNOIdent = @"STEP: {Section Prefix}{LNK Step Num}-NOTE {LNK C/N Num} ";
fmtdata.StepData[23].TabData.Ident = @"STEP: {Section Prefix}{LNK Step Num}-NOTE {LNK C/N Num} ";
fmtdata.StepData[23].TabData.IdentAltPrint = @"STEP: {Section Prefix}{LNK Step Num}-NOTE {LNK C/N Num} \STEP: {Section Prefix}{LNK Step Num}-NOTE {LNK C/N Num} ";
fmtdata.StepData[23].TabData.RNOIdent = @"STEP: {Section Prefix}{LNK Step Num}-NOTE {LNK C/N Num} ";
fmtdata.StepData[26].TabData.Ident = @"STEP: {Section Prefix}{LNK Step Num}-NOTE {LNK C/N Num} ";
fmtdata.StepData[26].TabData.IdentAltPrint = @"STEP: {Section Prefix}{LNK Step Num}-NOTE {LNK C/N Num} \STEP: {Section Prefix}{LNK Step Num}-NOTE {LNK C/N Num} ";
fmtdata.StepData[26].TabData.RNOIdent = @"STEP: {Section Prefix}{LNK Step Num}-NOTE {LNK C/N Num} ";
}
}
public partial class FmtToXml
{
private void AddWCN1Page(ref PageStyles pgstyles)
{
// Attachments
pgstyles.PgStyles[1].Items[8].Row = 88;
pgstyles.PgStyles[1].Items[9].Row = 100;
// Attachments (Norton Editor)
pgstyles.PgStyles[4].Name = "Attachments (MSWord Section)";
pgstyles.PgStyles[4].Items[8].Row = 83;
pgstyles.PgStyles[4].Items[9].Row = 94;
pgstyles.PgStyles[4].Items[10].Row = 112;
// Figures
pgstyles.PgStyles[5].Items[9].Row = 101;
// Landscape Attachments (Norton Editor)
pgstyles.PgStyles[6].Name = "Landscape Attachments (MSWord Section)";
pgstyles.PgStyles[6].Items[8].Row = 83;
pgstyles.PgStyles[6].Items[9].Row = 94;
pgstyles.PgStyles[6].Items[10].Row = 112;
}
private void AddWCNBCKPage(ref PageStyles pgstyles)
{
pgstyles.PgStyles[0].Items[9].Col = 518;
}
private void AddWCNBCKDoc(ref DocStyles dcstyles)
{
dcstyles.DcStyles[0].ContTop = "";
dcstyles.DcStyles[0].ContTopHLS = 0;
dcstyles.DcStyles[2].PageWidth = 592;
dcstyles.DcStyles[3].PageWidth = 592;
dcstyles.DcStyles[4].PageWidth = 592;
}
private void AddWCN2Doc(ref DocStyles dcstyles)
{
dcstyles.DcStyles[1].PageLength = 660;
}
public void AddWCN1Doc(ref DocStyles dcstyles)
{
// Procedure Steps
dcstyles.DcStyles[0].FooterLen = 0; // was set to 12
// Attachments
dcstyles.DcStyles[1].PageLength = 606;
// remove the 'DontCountInTabOfCont' flag on the cover page so that page counts in the
// auto table of contents will be correct.
dcstyles.DcStyles[3].DocStructStyle.DocStyle = dcstyles.DcStyles[3].DocStructStyle.DocStyle.Replace(", DontCountInTabOfCont", "");
// Records
dcstyles.DcStyles[7].FooterLen = 0;
dcstyles.DcStyles[7].PageLength = 672; // same length as Procedure Steps section to fix End message placement
}
}
public partial class RtfToSvg
{
private void AddWCN2(XmlDocument myDoc)
{
XmlDocument xd = new XmlDocument();
// include the svg level so that the xmlns can be set to be the same as the generated document.
xd.LoadXml("<svg xmlns=\"http://www.w3.org/2000/svg\"><g id=\"B9\">" +
"<rect x=\"4\" y=\"-3\" width=\"352.5\" height=\"120\" fill=\"none\" stroke=\"black\" stroke-width=\"1.2\" />\r\n" +
"<line x1=\"4\" y1=\"21\" x2=\"355.5\" y2=\"21\" stroke-width=\"1.2\" />\r\n" +
"<line x1=\"4\" y1=\"45\" x2=\"355.5\" y2=\"45\" stroke-width=\"1.2\" />\r\n" +
"<line x1=\"4\" y1=\"69\" x2=\"355.5\" y2=\"69\" stroke-width=\"1.2\" />\r\n" +
"<line x1=\"4\" y1=\"93\" x2=\"355.5\" y2=\"93\" stroke-width=\"1.2\" />\r\n" +
"<line x1=\"263\" y1=\"-3\" x2=\"263\" y2=\"118\" stroke-width=\"1.2\" />\r\n" +
"</g></svg>");
myDoc.DocumentElement.AppendChild(myDoc.ImportNode(xd.DocumentElement.ChildNodes[0], true));
}
}
}
@@ -1,78 +0,0 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{830C64FF-60EF-4771-8073-D25BF2F2E3AE}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>PrettyPrint</RootNamespace>
<AssemblyName>PrettyPrint</AssemblyName>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="frmPrettyPrint.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmPrettyPrint.Designer.cs">
<DependentUpon>frmPrettyPrint.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="frmPrettyPrint.resx">
<SubType>Designer</SubType>
<DependentUpon>frmPrettyPrint.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
-20
View File
@@ -1,20 +0,0 @@
using System;
using System.Collections.Generic;
using System.Windows.Forms;
namespace PrettyPrint
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new frmPrettyPrint());
}
}
}
@@ -1,33 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("PrettyPrint")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("PrettyPrint")]
[assembly: AssemblyCopyright("Copyright © 2011")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("fa8c01a2-0c39-405f-b733-1b38af0c590c")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
@@ -1,71 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.4216
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace PrettyPrint.Properties
{
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("PrettyPrint.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}
@@ -1,117 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
-30
View File
@@ -1,30 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.4216
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace PrettyPrint.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "8.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}
@@ -1,7 +0,0 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>
-208
View File
@@ -1,208 +0,0 @@
namespace PrettyPrint
{
partial class frmPrettyPrint
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.tbInputFileName = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
this.tsslStatus = new System.Windows.Forms.ToolStripStatusLabel();
this.tspbStatus = new System.Windows.Forms.ToolStripProgressBar();
this.btnBrowse = new System.Windows.Forms.Button();
this.ofd = new System.Windows.Forms.OpenFileDialog();
this.sfd = new System.Windows.Forms.SaveFileDialog();
this.fbd = new System.Windows.Forms.FolderBrowserDialog();
this.btnPretty = new System.Windows.Forms.Button();
this.label2 = new System.Windows.Forms.Label();
this.tbOutputFileName = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.tbFolder = new System.Windows.Forms.TextBox();
this.btnFolderBrowse = new System.Windows.Forms.Button();
this.btnFolderPretty = new System.Windows.Forms.Button();
this.statusStrip1.SuspendLayout();
this.SuspendLayout();
//
// tbInputFileName
//
this.tbInputFileName.Location = new System.Drawing.Point(76, 29);
this.tbInputFileName.Name = "tbInputFileName";
this.tbInputFileName.Size = new System.Drawing.Size(434, 20);
this.tbInputFileName.TabIndex = 0;
this.tbInputFileName.Text = "C:\\Development\\fmtall\\AEP_00all.xml";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(12, 31);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(50, 13);
this.label1.TabIndex = 1;
this.label1.Text = "Input File";
//
// statusStrip1
//
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.tspbStatus,
this.tsslStatus});
this.statusStrip1.Location = new System.Drawing.Point(0, 282);
this.statusStrip1.Name = "statusStrip1";
this.statusStrip1.Size = new System.Drawing.Size(657, 22);
this.statusStrip1.TabIndex = 2;
this.statusStrip1.Text = "statusStrip1";
//
// tsslStatus
//
this.tsslStatus.Name = "tsslStatus";
this.tsslStatus.Size = new System.Drawing.Size(39, 17);
this.tsslStatus.Text = "Ready";
//
// tspbStatus
//
this.tspbStatus.Name = "tspbStatus";
this.tspbStatus.Size = new System.Drawing.Size(100, 16);
this.tspbStatus.Visible = false;
//
// btnBrowse
//
this.btnBrowse.Location = new System.Drawing.Point(516, 27);
this.btnBrowse.Name = "btnBrowse";
this.btnBrowse.Size = new System.Drawing.Size(59, 23);
this.btnBrowse.TabIndex = 3;
this.btnBrowse.Text = "Browse...";
this.btnBrowse.UseVisualStyleBackColor = true;
//
// btnPretty
//
this.btnPretty.Location = new System.Drawing.Point(516, 53);
this.btnPretty.Name = "btnPretty";
this.btnPretty.Size = new System.Drawing.Size(59, 23);
this.btnPretty.TabIndex = 4;
this.btnPretty.Text = "Pretty";
this.btnPretty.UseVisualStyleBackColor = true;
this.btnPretty.Click += new System.EventHandler(this.btnPretty_Click);
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(12, 57);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(58, 13);
this.label2.TabIndex = 6;
this.label2.Text = "Output File";
//
// tbOutputFileName
//
this.tbOutputFileName.Location = new System.Drawing.Point(76, 55);
this.tbOutputFileName.Name = "tbOutputFileName";
this.tbOutputFileName.Size = new System.Drawing.Size(434, 20);
this.tbOutputFileName.TabIndex = 5;
this.tbOutputFileName.Text = "C:\\Development\\fmtall\\AEP_00all_out.xml";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(12, 169);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(36, 13);
this.label3.TabIndex = 8;
this.label3.Text = "Folder";
//
// tbFolder
//
this.tbFolder.Location = new System.Drawing.Point(76, 167);
this.tbFolder.Name = "tbFolder";
this.tbFolder.Size = new System.Drawing.Size(434, 20);
this.tbFolder.TabIndex = 7;
this.tbFolder.Text = "C:\\Development\\fmtall";
//
// btnFolderBrowse
//
this.btnFolderBrowse.Location = new System.Drawing.Point(516, 165);
this.btnFolderBrowse.Name = "btnFolderBrowse";
this.btnFolderBrowse.Size = new System.Drawing.Size(59, 23);
this.btnFolderBrowse.TabIndex = 9;
this.btnFolderBrowse.Text = "Browse...";
this.btnFolderBrowse.UseVisualStyleBackColor = true;
this.btnFolderBrowse.Click += new System.EventHandler(this.btnFolderBrowse_Click);
//
// btnFolderPretty
//
this.btnFolderPretty.Location = new System.Drawing.Point(581, 164);
this.btnFolderPretty.Name = "btnFolderPretty";
this.btnFolderPretty.Size = new System.Drawing.Size(59, 23);
this.btnFolderPretty.TabIndex = 10;
this.btnFolderPretty.Text = "Pretty";
this.btnFolderPretty.UseVisualStyleBackColor = true;
this.btnFolderPretty.Click += new System.EventHandler(this.btnFolderPretty_Click);
//
// frmPrettyPrint
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(657, 304);
this.Controls.Add(this.btnFolderPretty);
this.Controls.Add(this.btnFolderBrowse);
this.Controls.Add(this.label3);
this.Controls.Add(this.tbFolder);
this.Controls.Add(this.label2);
this.Controls.Add(this.tbOutputFileName);
this.Controls.Add(this.btnPretty);
this.Controls.Add(this.btnBrowse);
this.Controls.Add(this.statusStrip1);
this.Controls.Add(this.label1);
this.Controls.Add(this.tbInputFileName);
this.Name = "frmPrettyPrint";
this.Text = "PrettyPrint";
this.statusStrip1.ResumeLayout(false);
this.statusStrip1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TextBox tbInputFileName;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.StatusStrip statusStrip1;
private System.Windows.Forms.ToolStripStatusLabel tsslStatus;
private System.Windows.Forms.ToolStripProgressBar tspbStatus;
private System.Windows.Forms.Button btnBrowse;
private System.Windows.Forms.OpenFileDialog ofd;
private System.Windows.Forms.SaveFileDialog sfd;
private System.Windows.Forms.FolderBrowserDialog fbd;
private System.Windows.Forms.Button btnPretty;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox tbOutputFileName;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox tbFolder;
private System.Windows.Forms.Button btnFolderBrowse;
private System.Windows.Forms.Button btnFolderPretty;
}
}
@@ -1,96 +0,0 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Xml;
using System.IO;
namespace PrettyPrint
{
public partial class frmPrettyPrint : Form
{
public string MyStatus
{
get { return tsslStatus.Text; }
set { tsslStatus.Text = value; Application.DoEvents(); }
}
public frmPrettyPrint()
{
InitializeComponent();
}
private void btnPretty_Click(object sender, EventArgs e)
{
FileInfo fi = new FileInfo(tbOutputFileName.Text);
using(FileStream fs = fi.Create())
{
using (StreamWriter sw = new StreamWriter(fs))
{
XmlDocument doc = new XmlDocument();
//get your document
doc.Load(tbInputFileName.Text);
//create reader and writer
XmlNodeReader xmlReader = new XmlNodeReader(doc);
XmlTextWriter xmlWriter = new XmlTextWriter(sw);
//set formatting options
xmlWriter.Formatting = Formatting.Indented;
xmlWriter.Indentation = 1;
xmlWriter.IndentChar = '\t';
//write the document formatted
xmlWriter.WriteNode(xmlReader, true);
xmlWriter.Close();
xmlReader.Close();
sw.Close();
}
fs.Close();
}
}
private void btnFolderBrowse_Click(object sender, EventArgs e)
{
fbd.SelectedPath = tbFolder.Text;
if (fbd.ShowDialog() == DialogResult.OK)
tbFolder.Text = fbd.SelectedPath;
}
private void btnFolderPretty_Click(object sender, EventArgs e)
{
DirectoryInfo di = new DirectoryInfo(tbFolder.Text);
FileInfo [] files = di.GetFiles("*.xml");
tspbStatus.Maximum = files.Length;
tspbStatus.Visible = true;
tspbStatus.Value = 0;
foreach(FileInfo fi in files)
{
tspbStatus.Value ++;
MyStatus = string.Format("Processing {0}", fi.Name);
FixXML(fi);
}
tspbStatus.Visible = false;
MyStatus = "Ready";
}
private void FixXML(FileInfo fi)
{
DateTime lastModified = fi.LastWriteTime;
XmlDocument doc = new XmlDocument();
//get your document
doc.Load(fi.FullName);
using (FileStream fs = fi.Create())
{
//create reader and writer
XmlNodeReader xmlReader = new XmlNodeReader(doc);
XmlTextWriter xmlWriter = new XmlTextWriter(fs, Encoding.Unicode);
//set formatting options
xmlWriter.Formatting = Formatting.Indented;
xmlWriter.Indentation = 1;
xmlWriter.IndentChar = '\t';
//write the document formatted
xmlWriter.WriteNode(xmlReader, true);
xmlWriter.Close();
xmlReader.Close();
fs.Close();
}
fi.LastWriteTime = lastModified;
}
}
}
@@ -1,132 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="ofd.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>133, 17</value>
</metadata>
<metadata name="sfd.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>273, 17</value>
</metadata>
<metadata name="fbd.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>409, 17</value>
</metadata>
</root>
-387
View File
@@ -1,387 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Text.RegularExpressions;
using System.Drawing;
using System.Xml;
namespace fmtxml
{
public partial class RtfToSvg
{
public RtfToSvg(string rtfFileName)
{
RtfFileName = rtfFileName;
_FormatFolder = RtfFile.Directory;
}
private static DirectoryInfo _FormatFolder;
public RtfToSvg(FileInfo rtfFile)
{
RtfFile = rtfFile;
_FormatFolder = RtfFile.Directory;
}
private bool? _IsGenMac;
public bool IsGenMac
{
get
{
if (_IsGenMac == null)
Convert();
return (bool)_IsGenMac;
}
set { _IsGenMac = value; }
}
private string _RtfFileName;
public string RtfFileName
{
get { return _RtfFileName; }
set
{
_RtfFileName = value;
_RtfFile = new FileInfo(_RtfFileName);
}
}
private FileInfo _RtfFile;
public FileInfo RtfFile
{
get { return _RtfFile; }
set
{
_RtfFile = value;
_RtfFileName = _RtfFile.FullName;
}
}
private string _Svg;
public string Svg
{
get
{
if (_Svg == null)
Convert();
return _Svg;
}
}
private string Convert()
{
string buff = LoadFile(RtfFile);// Load Text
_Svg = CreateSvg(RtfFile, buff);// Convert to SVG
return _Svg;
}
/// <summary>
/// Load the file into a string by bytes
/// </summary>
/// <param name="file"></param>
/// <returns></returns>
private static string LoadFile(FileInfo file)
{
byte[] bytes = new byte[file.Length];
using (FileStream fs = file.OpenRead())
{
fs.Read(bytes, 0, (int)file.Length);
fs.Close();
}
StringBuilder sb = new StringBuilder();
foreach (byte byt in bytes)
sb.Append((char)byt);
return sb.ToString();
}
private const string _TripleBang = "\xAD\xAD\xAD\xA8\xA8";
Regex regLines = new Regex(@"([^\r\n]*)?\r?\n", RegexOptions.Singleline);
// If processing any of the RGE (except RGEDEV) C0 macros, adjust the x location of the ellipse, so that
// 32bit printing matches 16bit. This flag shows that we're in a format that needs this adjustment.
private static bool _InRge = false;
private static bool _DoingRgeC0 = false;
private string CreateSvg(FileInfo file, string buff)
{
IsGenMac = (buff.Substring(0, 5) == _TripleBang);
if(!IsGenMac)
return null;
_InRge = (file.Name.ToUpper().Contains("RGE") && !file.Name.ToUpper().Contains("RGEDEV"));
StringBuilder sb = new StringBuilder();
MatchCollection lines = regLines.Matches(buff);
bool svg = false;
bool group = false;
bool hasC0 = false;
foreach (Match line in lines)
{
string text = line.Groups[1].Value;
if (text == _TripleBang)
if (!svg)
svg = AddSvgPrefix(file, sb, svg);
else
AddSvgSuffix(sb, hasC0);
else if (text.StartsWith("\xAD\xAD"))
{
hasC0 |= AddGroupStart(sb, ref group, text).ToLower() == "c0";
_DoingRgeC0 = (hasC0 && _InRge);
}
else if (text == "END")
{
group = AddGroupEnd(sb, group);
_DoingRgeC0 = false;
}
else if (text != "")
ProcessCommand(sb, text, file);
}
return sb.ToString();
}
private static void AddSvgSuffix(StringBuilder sb, bool hasC0)
{
if (!hasC0)
{
AddC0(sb);
}
sb.Append(string.Format("</svg>\r\n"));
}
private static bool AddGroupEnd(StringBuilder sb, bool group)
{
if (group) sb.Append(" </g>\r\n");
group = false;
_Xoff = 0;
_Yoff = 0;
return group;
}
private static string AddGroupStart(StringBuilder sb, ref bool group, string text)
{
AddGroupEnd(sb, group);
group = true;
string grpID = text.Substring(2).ToUpper();
sb.Append(string.Format(" <g id=\"{0}\">\r\n", grpID));
return grpID;
}
private static void AddC0(StringBuilder sb)
{
// note that cx = 1 has been tested with NSP.
sb.Append(" <g id=\"C0\">\r\n");
sb.Append(" <ellipse cx=\"1\" cy=\"-3.2\" rx=\"11.1\" ry=\"11.1\" fill=\"none\" stroke=\"black\" stroke-width=\"1.9\" />\r\n");
sb.Append(" </g>\r\n");
}
private static bool AddSvgPrefix(FileInfo file, StringBuilder sb, bool svg)
{
sb.Append("<?xml version=\"1.0\" encoding=\"utf-16\"?>\r\n");
sb.Append("<!--Proprietary Information - Copyright 2012 - Volian Enterprises, Inc. All rights reserved.-->\r\n");
sb.Append("<svg xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns=\"http://www.w3.org/2000/svg\" width=\"8in\" height=\"10in\" viewBox=\"0 0 576 720\">\r\n");
sb.Append(string.Format(" <desc>{0}</desc>\r\n", file.Name.ToLower().Replace(".rtf", "")));
svg = true;
return svg;
}
private static Regex regCommand = new Regex(@"^[A-Z][^ \r\n]*", RegexOptions.Multiline);
private static void ProcessCommand(StringBuilder sb, string text, FileInfo file)
{
Match commandMatch = regCommand.Match(text);
ECommand command = (ECommand)Enum.Parse(typeof(ECommand), commandMatch.Value);
Converters[(int)command](sb, text);
}
private enum ECommand : int
{
LINE,
BOX,
ELLIPSE,
TEXT,
BITMAP,
GDIADJ,
RTFADJ,
ABSOLUTE
}
private delegate void Converter(StringBuilder sb, string text);
private static Converter[] _Converters;
private static Converter[] Converters
{
get
{
if (_Converters == null)
SetupConverters();
return RtfToSvg._Converters;
}
set { _Converters = value; }
}
private static void SetupConverters()
{
Converters = new Converter[Enum.GetNames(typeof(ECommand)).Length];
Converters[(int)ECommand.LINE] = new Converter(AddLine);
Converters[(int)ECommand.BOX] = new Converter(AddRect);
Converters[(int)ECommand.ELLIPSE] = new Converter(AddEllipse);
Converters[(int)ECommand.TEXT] = new Converter(AddText);
Converters[(int)ECommand.BITMAP] = new Converter(AddImage);
Converters[(int)ECommand.GDIADJ] = new Converter(AddGdiAdj);
Converters[(int)ECommand.RTFADJ] = new Converter(AddRtfAdj);
Converters[(int)ECommand.ABSOLUTE] = new Converter(AddAbsolute);
}
private static Regex regGdiAdj = new Regex(@"GDIADJ ([-0-9]*) ([-0-9]*)$", RegexOptions.Multiline);
private static void AddGdiAdj(StringBuilder sb, string text)
{
Match gdiadjMatch = regGdiAdj.Match(text);
_Xoff = int.Parse(gdiadjMatch.Groups[1].Value);
_Yoff = int.Parse(gdiadjMatch.Groups[2].Value);
}
private static void AddAbsolute(StringBuilder sb, string text)
{
sb.Append(" <desc>ABSOLUTE</desc>");
}
private static void AddRtfAdj(StringBuilder sb, string text)
{
// Not needed
}
private static Regex regBitmap = new Regex(@"BITMAP ([-0-9]*) ([-0-9]*) (.*)$", RegexOptions.Multiline);
private static void AddImage(StringBuilder sb, string text)
{
Match bitmapMatch = regBitmap.Match(text);
//string bmFileName = FixXmlText(bitmapMatch.Groups[3].Value);
string bmFileName = FixFileName(bitmapMatch.Groups[3].Value);
Bitmap bmp = new Bitmap(bmFileName);
string bmWidth = bmp.Width.ToString() + "px";
string bmHeight = bmp.Height.ToString() + "px";
//Console.WriteLine("'{0}'", bmFileName);
sb.Append(string.Format(" <image x=\"{0}\" y=\"{1}\" width=\"{2}\" height=\"{3}\" xlink:href=\"{4}\"/>\r\n",
TwipsToPointsX(bitmapMatch.Groups[1].Value),
TwipsToPointsY(bitmapMatch.Groups[2].Value),
bmWidth,
bmHeight,
bmFileName));
}
private static Regex regText = new Regex(@"TEXT ([-0-9]*) ([-0-9]*) ([-0-9]*) ([-0-9]*) ([-0-9]*) ""([^""]*)""", RegexOptions.Multiline);
private static void AddText(StringBuilder sb, string text)
{
Match textMatch = regText.Match(text);
sb.Append(string.Format(" <text x=\"{0}\" y=\"{1}\" font-family=\"{3}\" font-size=\"{2}\" {4}>{5}</text>\r\n",
TwipsToPointsX(textMatch.Groups[1].Value),
TwipsToPointsY(textMatch.Groups[2].Value),
FontSizeToPoints(textMatch.Groups[3].Value),
FontToFamily(textMatch.Groups[4].Value),
FontStyle(textMatch.Groups[5].Value),
FixXmlText(textMatch.Groups[6].Value)));
}
private static Regex regEllipse = new Regex(@"ELLIPSE ([-0-9]*) ([-0-9]*) ([-0-9]*) ([-0-9]*) ([-0-9]*)", RegexOptions.Multiline);
private static void AddEllipse(StringBuilder sb, string text)
{
Match ellipseMatch = regEllipse.Match(text);
// code in the new veproms that draws the ellipse must use the 'y' location differently. So
// add in the radius to the 'y' to get the correct value.
float yadj = TwipsToPointsEllipse(ellipseMatch.Groups[4].Value);
sb.Append(string.Format(" <ellipse cx=\"{0}\" cy=\"{1}\" rx=\"{2}\" ry=\"{3}\" fill=\"none\" stroke=\"black\" stroke-width=\"{4}\" />\r\n",
_DoingRgeC0?6.5:TwipsToPointsX(ellipseMatch.Groups[1].Value),
yadj + TwipsToPointsY(ellipseMatch.Groups[2].Value),
TwipsToPointsEllipse(ellipseMatch.Groups[3].Value),
TwipsToPointsEllipse(ellipseMatch.Groups[4].Value),
TwipsToPoints(ellipseMatch.Groups[5].Value)));
}
private static Regex regBox = new Regex(@"BOX ([-0-9]*) ([-0-9]*) ([-0-9]*) ([-0-9]*) ([-0-9]*)", RegexOptions.Multiline);
private static void AddRect(StringBuilder sb, string text)
{
Match boxMatch = regBox.Match(text);
sb.Append(string.Format(" <rect x=\"{0}\" y=\"{1}\" width=\"{2}\" height=\"{3}\" fill=\"none\" stroke=\"black\" stroke-width=\"{4}\" />\r\n",
TwipsToPointsX(boxMatch.Groups[1].Value),
TwipsToPointsY(boxMatch.Groups[2].Value),
TwipsToPoints(boxMatch.Groups[3].Value),
TwipsToPoints(boxMatch.Groups[4].Value),
TwipsToPoints(boxMatch.Groups[5].Value)));
}
private static int _Xoff = 0;
private static int _Yoff = 0;
private static Regex regLine = new Regex(@"LINE ([-0-9]*) ([-0-9]*) ([-0-9]*) ([-0-9]*) ([-0-9]*)", RegexOptions.Multiline);
private static void AddLine(StringBuilder sb, string text)
{
Match lineMatch = regLine.Match(text);
sb.Append(string.Format(" <line x1=\"{0}\" y1=\"{1}\" x2=\"{2}\" y2=\"{3}\" stroke=\"black\" stroke-width=\"{4}\" />\r\n",
TwipsToPointsX(lineMatch.Groups[1].Value),
TwipsToPointsY(lineMatch.Groups[2].Value),
TwipsToPoints(lineMatch.Groups[3].Value) + TwipsToPointsX(lineMatch.Groups[1].Value),
TwipsToPoints(lineMatch.Groups[4].Value) + TwipsToPointsY(lineMatch.Groups[2].Value),
TwipsToPoints(lineMatch.Groups[5].Value)));
}
private static string FontStyle(string style)
{
StringBuilder sb = new StringBuilder();
int iStyle = int.Parse(style);
if ((iStyle & 1) == 1)
sb.Append("font-weight=\"bold\" ");
if ((iStyle & 2) == 2)
sb.Append("text-decoration=\"underline\" ");
if ((iStyle & 4) == 4)
sb.Append("font-style=\"italic\" ");
return sb.ToString();
}
private static string FixFileName(string fileName)
{
return Regex.Replace(fileName, @"^.*FORMAT\\", _FormatFolder.FullName + @"\");
}
private static string FixXmlText(string str)
{
str = str.Replace("&", "&amp;");
str = str.Replace("'", "&apos;");
str = str.Replace("\"", "&quot;");
str = str.Replace("<", "&lt;");
str = str.Replace(">", "&gt;");
str = str.Replace("\x0B", "&#11;");
str = str.Replace(" ", "{sp}");
str = str.Replace("\xAE",@"\u8594?"); // Turkey Point uses a Right Arrow from VESYMB
return str;
}
private static string[] FontChoice =
{
"Times New Roman",
"VESymb XXXXXX",
"VolianDraw XXXXXX",
"Prestige Elite Tall",
"Courier New",
"Arial",
"Letter Gothic",
"Times New Roman",
"Letter Gothic Tall",
"Letter Gothic Tall",
"Gothic Ultra",
"VolianScript"
};
private static float TwipsToPoints(string twips)
{
return float.Parse(twips) / 20;
}
private static float TwipsToPointsEllipse(string twips)
{
// divide the ellipse by 40. This is the 20 to convert from twips to points
// and an addition divide by 2 since the definition in 16bit is diameter &
// in 32 is radius.
return float.Parse(twips) / 40;
}
private static float TwipsToPointsX(string twips)
{
return (_Xoff + float.Parse(twips)) / 20;
}
private static float TwipsToPointsY(string twips)
{
return (_Yoff + float.Parse(twips)) / 20;
}
private static float FontSizeToPoints(string fontSize)
{
return float.Parse(fontSize) / 2;
}
private static string FontToFamily(string fontID)
{
if (int.Parse(fontID) >= FontChoice.Length)
return "Font-" + fontID;
return FontChoice[int.Parse(fontID)];
}
public void Save(string svgFileName)
{
FileInfo outFile = new FileInfo(svgFileName);
if (outFile.Exists) outFile.Delete();
XmlDocument xDoc = new XmlDocument();
try
{
//if (svgFileName.Contains("nsppe"))
// Console.WriteLine("stop");
xDoc.LoadXml(Svg);
AppendPlantSpecific(svgFileName, xDoc);
xDoc.Save(outFile.FullName);
}
catch (Exception ex)
{
Console.WriteLine("Error generating {0}", svgFileName);
Console.WriteLine("ex = {0}", ex);
}
}
}
}
-62
View File
@@ -1,62 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.4016
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace fmtxml {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "8.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("c:\\development\\")]
public string ResultsFolder {
get {
return ((string)(this["ResultsFolder"]));
}
set {
this["ResultsFolder"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("c:\\16bit\\ve-proms\\format")]
public string FormatFolder {
get {
return ((string)(this["FormatFolder"]));
}
set {
this["FormatFolder"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("C:\\16bit\\promsnt\\genmac")]
public string GenmacFolder {
get {
return ((string)(this["GenmacFolder"]));
}
set {
this["GenmacFolder"] = value;
}
}
}
}
-15
View File
@@ -1,15 +0,0 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="fmtxml" GeneratedClassName="Settings1">
<Profiles />
<Settings>
<Setting Name="ResultsFolder" Type="System.String" Scope="User">
<Value Profile="(Default)">c:\development\</Value>
</Setting>
<Setting Name="FormatFolder" Type="System.String" Scope="User">
<Value Profile="(Default)">c:\16bit\ve-proms\format</Value>
</Setting>
<Setting Name="GenmacFolder" Type="System.String" Scope="User">
<Value Profile="(Default)">C:\16bit\promsnt\genmac</Value>
</Setting>
</Settings>
</SettingsFile>
-16
View File
@@ -1,16 +0,0 @@
<Step Name='Table'>
<Menu Action='Contingency' Available='true' Item='With Border'/>
</Step>
<Step Name='AERTable'>
<Menu Action='Normal/Standard' Available='true' MenuItem='AER Table with Border'/>
<Menu Action='Contingency' Available='false'/>
</Step>
<Step Name='Caution'>
<Menu Action='Normal/Standard' Available='true' Item='Standard Caution'>
<Alternate Type='Note'/>
<Alternate Type='High-Level Step'/>
</Menu>
</Step>
<Step Name='RNO'>
<Menu Action='Contingency' Available='false' Reason='Contingency steps cannot change type'/>
</Step>
Binary file not shown.
-191
View File
@@ -1,191 +0,0 @@
using System;
using System.Text;
using System.Xml;
using System.Drawing;
using System.Windows.Forms;
//using C1.C1Pdf;
namespace fmtxml
{
/// <summary>
/// Summary description for XmlToPdf.
/// </summary>
public class SvgToPdf
{
private float ConvertToPoints=72f;
private XmlDocument xmlDoc;
private string FileName;
private string FilePath;
//private C1.C1Pdf.C1PdfDocument _c1pdf;
private string [] FontChoice =
{"Times New Roman",
"VESymb XXXXXX",
"VolianDraw XXXXXX",
"Prestige Elite Tall",
"Courier New",
"Arial",
"Letter Gothic",
"Times New Roman",
"Letter Gothic Tall",
"Letter Gothic Tall",
"Gothic Ultra",
"VolianScript"
};
private float LeftMargin; //todo: define in page info
private float VerticalOffset; //todo: define in page info
private bool Portrait; //todo: define in page info
public SvgToPdf(string path, string fname)
{
LeftMargin=0.5f * ConvertToPoints; // KBR: TODO
VerticalOffset=0.5f * ConvertToPoints; // KBR: TODO
Portrait = true; // KBR: TODO
FileName = fname;
FilePath = path;
xmlDoc = new XmlDocument();
XmlTextReader reader = new XmlTextReader(FilePath+"\\"+FileName);
xmlDoc.Load(reader);
reader.Close();
try
{
GeneratePDFForFile();
}
catch (Exception e)
{
MessageBox.Show("Error processing: " + fname, e.Message);
}
}
private void GeneratePDFForFile()
{
//_c1pdf = new C1.C1Pdf.C1PdfDocument();
//string rootname = FileName.Substring(0,FileName.Length-4);
//// create a pdf file with a page for each macro (i.e. macro element in xml tree),
//// put it into the pdf file.
//XmlNode topnode = xmlDoc.LastChild;
//XmlNodeList ndlist = topnode.SelectNodes("/g");
//for (int i=0;i<topnode.ChildNodes.Count;i++)
//{
// XmlNode nd = topnode.ChildNodes[i];
// if (nd.Name!="desc")
// {
// SvgConvertToPdf(nd);
// _c1pdf.NewPage();
// }
//}
//string outname = "E:\\proms.net\\genmac.xml\\testpdf\\" + rootname + ".pdf";
//_c1pdf.Save(outname);
}
private string AddRTFBUI(string origStr, string bold, string underline, string italics)
{
if (bold==""&&underline==""&&italics=="")return origStr;
StringBuilder sb = new StringBuilder();
if (bold == "bold")sb.Append("{\\b");
if (underline == "underline")sb.Append("{\\u");
if (italics == "italics") sb.Append("{\\i");
sb.Append(" ");
sb.Append(origStr);
if (bold == "bold")sb.Append("}");
if (underline == "underline")sb.Append("}");
if (italics == "italics") sb.Append("}");
return sb.ToString();
}
private void SvgConvertToPdf(XmlNode nd)
{
for (int i=0; i<nd.ChildNodes.Count; i++)
{
XmlElement cmdele = (XmlElement) nd.ChildNodes[i];
string cmdline = cmdele.InnerXml;
string cmd = cmdele.Name.ToLower();
float fstx, fsty, fex, fey = 0;
float flw = 0;
// temporary for testing of negative placement (x/y) values...
XmlElement tstele = (XmlElement) nd;
if (tstele.GetAttribute("id")=="CNUM")
{
LeftMargin = 100.0f;
VerticalOffset = 100f;
}
Pen pn = null;
switch (cmd)
{
case "rect":
fstx = (float) System.Convert.ToDouble(cmdele.GetAttribute("x"));
fsty = (float) System.Convert.ToDouble(cmdele.GetAttribute("y"));
fex = (float) System.Convert.ToDouble(cmdele.GetAttribute("width"));
fey = (float) System.Convert.ToDouble(cmdele.GetAttribute("height"));
flw = (float) System.Convert.ToDouble(cmdele.GetAttribute("stroke-width"));
pn = new Pen(Brushes.Black,flw);
//KBR: TODO - storing page stuff such as portland, vertical offset, tab, etc.
RectangleF rc = new RectangleF(LeftMargin+fstx,VerticalOffset+fsty,fex,fey);
//_c1pdf.DrawRectangle(pn,rc);
break;
case "line": // command is LINE startx, starty, endx, endy, lnwidth
fstx = (float) System.Convert.ToDouble(cmdele.GetAttribute("x1"));
fsty = (float) System.Convert.ToDouble(cmdele.GetAttribute("y1"));
fex = (float) System.Convert.ToDouble(cmdele.GetAttribute("x2"));
fey = (float) System.Convert.ToDouble(cmdele.GetAttribute("y2"));
float flw1 = (float) System.Convert.ToDouble(cmdele.GetAttribute("stroke-width"));
//KBR: TODO - storing page stuff such as portland, vertical offset, tab, etc.
// startx = portland ? (vof + cy + adjy) : (cx + tab + adjx);
// starty = portland ? (tab - (cx + adjx)) : (cy + vof + adjy);
pn = new Pen(Brushes.Black,flw1);
//KBR: TODO - move ablsolute?
// if (MoveAbsolute)
// {tab = 0;vof = 0;}
//_c1pdf.DrawLine(pn, LeftMargin+fstx, VerticalOffset+fsty, LeftMargin+fex, VerticalOffset+fey);
break;
case "text":
fstx = (float) System.Convert.ToDouble(cmdele.GetAttribute("x"));
fsty = (float) System.Convert.ToDouble(cmdele.GetAttribute("y"));
int FontSize = System.Convert.ToInt32(cmdele.GetAttribute("font-size"));
string bold = cmdele.GetAttribute("font-weight");
string underline = cmdele.GetAttribute("text-decoration");
string italics = cmdele.GetAttribute("font-style");
Font myfont = new Font(cmdele.GetAttribute("font-family"),FontSize);
rc = new Rectangle();
//rc.Size = _c1pdf.MeasureStringRtf(cmdele.InnerText,myfont,500); // kbr todo: 500?
rc.X = LeftMargin+fstx;
rc.Y = VerticalOffset+fsty-FontSize;
// add bold, underline & italics for entire object.
string rtfout = AddRTFBUI(cmdele.InnerText,bold,underline,italics);
//_c1pdf.DrawStringRtf(rtfout,myfont,Brushes.Black,rc);
break;
case "gdiadj":
break;
case "ellipse":
fstx = (float) System.Convert.ToDouble(cmdele.GetAttribute("cx"));
fsty = (float) System.Convert.ToDouble(cmdele.GetAttribute("cy"));
fex = (float) System.Convert.ToDouble(cmdele.GetAttribute("rx"));
fey = (float) System.Convert.ToDouble(cmdele.GetAttribute("ry"));
flw = (float) System.Convert.ToDouble(cmdele.GetAttribute("stroke-width"));
pn = new Pen(Brushes.Black,flw);
//_c1pdf.DrawEllipse(pn,LeftMargin+fstx, VerticalOffset+fsty, fex, fey);
break;
case "image":
fstx = (float) System.Convert.ToDouble(cmdele.GetAttribute("x"));
fsty = (float) System.Convert.ToDouble(cmdele.GetAttribute("y"));
int scale=1;
if (cmdele.HasAttribute("scale")) scale = System.Convert.ToInt32(cmdele.GetAttribute("scale"));
string fname = cmdele.GetAttribute("xlink:href");
Bitmap bm = new Bitmap(fname);
Image img = Image.FromFile(fname);
rc = new RectangleF();
rc.Height = (((img.Height*scale)*4.8f)/1440f)*72f;
rc.Width = (((img.Width*scale)*4.8f)/1440f)*72f;
rc.X = LeftMargin+fstx;
rc.Y = VerticalOffset+fsty;
//_c1pdf.DrawImage(img, rc, ContentAlignment.MiddleCenter, ImageSizeModeEnum.Scale);
break;
case "absolute":
break;
default:
break;
}
}
}
}
}
-293
View File
@@ -1,293 +0,0 @@
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml" omit-xml-declaration="yes" indent="yes"/>
<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="DocStyles">
<DocStyles>
<xsl:apply-templates/>
</DocStyles>
</xsl:template>
<xsl:template match="DcStyles">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="DocStyle">
<DocStyle>
<xsl:apply-templates select="Name"/>
<xsl:apply-templates select="Index"/>
<xsl:apply-templates select="numberingsequence"/>
<xsl:apply-templates select="IndexOtherThanFirstPage"/>
<xsl:apply-templates select="IsStepSection"/>
<xsl:apply-templates select="UseCheckOffs"/>
<xsl:apply-templates select ="UseColSByLevel"/>
<xsl:apply-templates select="oldtonew"/>
<xsl:apply-templates select="CancelSectTitle"/>
<xsl:apply-templates select="SpecialStepsFoldout"/>
<xsl:apply-templates select="UndSpecialStepsFoldout"/>
<xsl:apply-templates select="ExtraLineHeader"/>
<xsl:apply-templates select="AlignHLSTabWithSect"/>
<xsl:apply-templates select="ComponentList"/>
<xsl:apply-templates select="pagestyle"/>
<xsl:apply-templates select="dstyle|DocStructStyle|TopMargin|ContStyle|EndStyle|FinalMsg|CenterLineX|CenterLineYTop|CenterLineYBottom|LandscapePageList|ShowSectionTitles"/>
</DocStyle>
</xsl:template>
<xsl:template match="numberingsequence">
<xsl:attribute name="NumberingSequence"><xsl:value-of select="."/></xsl:attribute>
</xsl:template>
<xsl:template match="IndexOtherThanFirstPage">
<xsl:if test=".!=0">
<xsl:attribute name="IndexOtherThanFirstPage">
<xsl:value-of select="."/>
</xsl:attribute>
</xsl:if>
</xsl:template>
<xsl:template match="CenterLineX">
<xsl:if test=".!=0">
<xsl:attribute name="CenterLineX">
<xsl:value-of select="."/>
</xsl:attribute>
</xsl:if>
</xsl:template>
<xsl:template match="CenterLineYTop">
<xsl:if test=".!=0">
<xsl:attribute name="CenterLineYTop">
<xsl:value-of select="."/>
</xsl:attribute>
</xsl:if>
</xsl:template>
<xsl:template match="CenterLineYBottom">
<xsl:if test=".!=0">
<xsl:attribute name="CenterLineYBottom">
<xsl:value-of select="."/>
</xsl:attribute>
</xsl:if>
</xsl:template>
<xsl:template match="LandscapePageList">
<xsl:if test=".!='false'">
<xsl:attribute name="LandscapePageList">
<xsl:value-of select="."/>
</xsl:attribute>
</xsl:if>
</xsl:template>
<xsl:template match="ShowSectionTitles">
<xsl:if test=".!='false'">
<xsl:attribute name="ShowSectionTitles">
<xsl:value-of select="."/>
</xsl:attribute>
</xsl:if>
</xsl:template>
<xsl:template match="IsStepSection">
<xsl:attribute name="IsStepSection"><xsl:value-of select="."/>
</xsl:attribute>
</xsl:template>
<xsl:template match="UseCheckOffs">
<xsl:attribute name="UseCheckOffs">
<xsl:value-of select="."/>
</xsl:attribute>
</xsl:template>
<xsl:template match="UseColSByLevel">
<xsl:attribute name="UseColSByLevel">
<xsl:value-of select="."/>
</xsl:attribute>
</xsl:template>
<xsl:template match="oldtonew">
<xsl:attribute name="OldToNew"><xsl:value-of select="."/></xsl:attribute>
</xsl:template>
<xsl:template match="CancelSectTitle">
<xsl:attribute name="CancelSectTitle">
<xsl:value-of select="."/>
</xsl:attribute>
</xsl:template>
<xsl:template match="SpecialStepsFoldout">
<xsl:attribute name="SpecialStepsFoldout">
<xsl:value-of select="."/>
</xsl:attribute>
</xsl:template>
<xsl:template match="UndSpecialStepsFoldout">
<xsl:attribute name="UndSpecialStepsFoldout">
<xsl:value-of select="."/>
</xsl:attribute>
</xsl:template>
<xsl:template match="ExtraLineHeader">
<xsl:attribute name="ExtraLineHeader">
<xsl:value-of select="."/>
</xsl:attribute>
</xsl:template>
<xsl:template match="AlignHLSTabWithSect">
<xsl:attribute name="AlignHLSTabWithSect">
<xsl:value-of select="."/>
</xsl:attribute>
</xsl:template>
<xsl:template match="ComponentList">
<xsl:if test=".!='false'">
<xsl:attribute name="ComponentList">
<xsl:value-of select="."/>
</xsl:attribute>
</xsl:if>
</xsl:template>
<xsl:template match="dstyle">
<xsl:if test="string-length(./FontFamily)+string-length(./FontSize)+string-length(./FontStyle)>0">
<Font>
<xsl:if test="FontFamily">
<xsl:attribute name="Family">
<xsl:value-of select="FontFamily"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="FontSize">
<xsl:attribute name="Size">
<xsl:value-of select="FontSize"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="FontStyle">
<xsl:attribute name="Style">
<xsl:value-of select="FontStyle"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="CPI">
<xsl:attribute name="CPI">
<xsl:value-of select="CPI"/>
</xsl:attribute>
</xsl:if>
</Font>
</xsl:if>
</xsl:template>
<xsl:template match="TopMargin">
<Layout>
<xsl:attribute name="TopMargin"><xsl:value-of select="."/></xsl:attribute>
<xsl:attribute name="FooterLength"><xsl:value-of select="..//FooterLen"/></xsl:attribute>
<xsl:attribute name="PageLength"><xsl:value-of select="..//PageLength"/></xsl:attribute>
<xsl:attribute name="PageWidth"><xsl:value-of select="..//PageWidth"/></xsl:attribute>
<xsl:attribute name="LeftMargin"><xsl:value-of select="..//LeftMargin"/></xsl:attribute>
<xsl:apply-templates/>
</Layout>
</xsl:template>
<xsl:template match="ContStyle">
<xsl:if test="string-length(..//ContTop)+string-length(..//ContBottom)>0">
<Continue>
<xsl:if test="string-length(./FontFamily)+string-length(./FontSize)+string-length(./FontStyle)>0">
<Font>
<xsl:if test="FontFamily">
<xsl:attribute name="Family">
<xsl:value-of select="FontFamily"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="FontSize">
<xsl:attribute name="Size">
<xsl:value-of select="FontSize"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="FontStyle">
<xsl:attribute name="Style">
<xsl:value-of select="FontStyle"/>
</xsl:attribute>
</xsl:if>
</Font>
</xsl:if>
<Top>
<xsl:if test="..//ContTop != 'empty'">
<xsl:attribute name="Message">
<xsl:value-of select="../ContTop"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="..//ContTopHLS != 'empty'">
<xsl:attribute name="HLS">
<xsl:value-of select="..//ContTopHLS"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="..//CTMargin != 'empty'">
<xsl:attribute name="Margin">
<xsl:value-of select="..//CTMargin"/>
</xsl:attribute>
</xsl:if>
</Top>
<Bottom>
<xsl:if test="..//ContBottom != 'empty'">
<xsl:attribute name="Message">
<xsl:value-of select="../ContBottom"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="..//CBMargin != 'empty'">
<xsl:attribute name="Margin">
<xsl:value-of select="..//CBMargin"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="..//CBMarginR != 0">
<xsl:attribute name="MarginR">
<xsl:value-of select="..//CBMarginR"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="..//CBLoc != 'empty'">
<xsl:attribute name="Location">
<xsl:value-of select="..//CBLoc"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="..//CBNoOverrideSpace != 'false'">
<xsl:attribute name="NoOverrideSpace">
<xsl:value-of select="..//CBNoOverrideSpace"/>
</xsl:attribute>
</xsl:if>
</Bottom>
</Continue>
</xsl:if>
</xsl:template>
<xsl:template match="EndStyle">
<xsl:if test="../EndString != 'empty'">
<End>
<xsl:if test="../EndFlag != 'empty'">
<xsl:attribute name="Flag">
<xsl:value-of select="../EndFlag"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="../EndMargin != 'empty'">
<xsl:attribute name="Margin">
<xsl:value-of select="../EndMargin"/>
</xsl:attribute>
</xsl:if>
<xsl:attribute name="Message">
<xsl:value-of select="../EndString"/>
</xsl:attribute>
<xsl:if test="string-length(./FontFamily)+string-length(./FontSize)+string-length(./FontStyle)>0">
<Font>
<xsl:if test="FontFamily">
<xsl:attribute name="Family">
<xsl:value-of select="FontFamily"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="FontSize">
<xsl:attribute name="Size">
<xsl:value-of select="FontSize"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="FontStyle">
<xsl:attribute name="Style">
<xsl:value-of select="FontStyle"/>
</xsl:attribute>
</xsl:if>
</Font>
</xsl:if>
</End>
</xsl:if>
</xsl:template>
<xsl:template match="FinalMsg">
<Final>
<xsl:attribute name="Message"><xsl:value-of select="."/></xsl:attribute>
</Final>
</xsl:template>
<xsl:template match="DocStructStyle">
<StructureStyle>
<xsl:attribute name="Where"><xsl:value-of select="DocStyleUse"/></xsl:attribute>
<xsl:if test="DocStyle != 'None'"><xsl:attribute name="Style"><xsl:value-of select="DocStyle"/></xsl:attribute></xsl:if>
</StructureStyle>
</xsl:template>
<xsl:template match="Name">
<xsl:attribute name="Name"><xsl:value-of select="."/></xsl:attribute>
</xsl:template>
<xsl:template match="Index">
<xsl:attribute name="Index"><xsl:value-of select="."/></xsl:attribute>
</xsl:template>
<xsl:template match="pagestyle">
<xsl:attribute name="PageStyle"><xsl:value-of select="."/></xsl:attribute>
</xsl:template>
<xsl:template match="text()"/>
</xsl:stylesheet>
Binary file not shown.
-62
View File
@@ -1,62 +0,0 @@
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml" omit-xml-declaration="yes" indent="yes"/>
<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="PageStyles">
<PageStyles>
<xsl:attribute name="Name"><xsl:value-of select="./Name"/></xsl:attribute>
<xsl:apply-templates/>
</PageStyles>
</xsl:template>
<xsl:template match="PgStyles">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="PageStyle">
<PageStyle>
<xsl:attribute name="Name"><xsl:value-of select="./Name"/></xsl:attribute>
<xsl:attribute name="Index"><xsl:value-of select="./Index"/></xsl:attribute>
<xsl:apply-templates/>
</PageStyle>
</xsl:template>
<xsl:template match="Items">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="PSItem">
<Item>
<xsl:attribute name="Token"><xsl:value-of select="./Token"/></xsl:attribute>
<xsl:attribute name="Row"><xsl:value-of select="./Row"/></xsl:attribute>
<xsl:attribute name="Col"><xsl:value-of select="./Col"/></xsl:attribute>
<xsl:attribute name="Justify"><xsl:value-of select="./Justify"/></xsl:attribute>
<xsl:apply-templates/>
</Item>
</xsl:template>
<xsl:template match="Style">
<xsl:if test="string-length(./FontFamily)+string-length(./FontSize)+string-length(./FontStyle)>0">
<Font>
<xsl:if test="string-length(./FontFamily)">
<xsl:attribute name="Family">
<xsl:value-of select="./FontFamily"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="string-length(./FontSize)">
<xsl:attribute name="Size">
<xsl:value-of select="./FontSize"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="string-length(./FontStyle)">
<xsl:attribute name="Style">
<xsl:value-of select="./FontStyle"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="string-length(./CPI)">
<xsl:attribute name="CPI">
<xsl:value-of select="./CPI"/>
</xsl:attribute>
</xsl:if>
</Font>
</xsl:if>
</xsl:template>
<xsl:template match="text()"/>
</xsl:stylesheet>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

File diff suppressed because it is too large Load Diff
-20
View File
@@ -1,20 +0,0 @@
using System;
using System.Collections.Generic;
using System.Windows.Forms;
namespace XSL_Transform
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new frmMain());
}
}
}
@@ -1,33 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("XSL Transform")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Volian Enterprises, Inc.")]
[assembly: AssemblyProduct("XSL Transform")]
[assembly: AssemblyCopyright("Copyright © Volian Enterprises, Inc. 2006")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("7e95cb06-46be-49c6-81e1-92302d9017e4")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
@@ -1,71 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.42
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace XSL_Transform.Properties
{
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("XSL_Transform.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}
@@ -1,117 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
@@ -1,30 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.42
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace XSL_Transform.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "8.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}
@@ -1,7 +0,0 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>
Binary file not shown.
File diff suppressed because it is too large Load Diff
@@ -1,82 +0,0 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{74593BA8-2F88-4FF2-89A6-9FBD358231D7}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>XSL_Transform</RootNamespace>
<AssemblyName>XSL Transform</AssemblyName>
<ApplicationIcon>ARW05RT.ICO</ApplicationIcon>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="frmMain.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmMain.Designer.cs">
<DependentUpon>frmMain.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="frmMain.resx">
<SubType>Designer</SubType>
<DependentUpon>frmMain.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<Content Include="ARW05RT.ICO" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
@@ -1,20 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XSL Transform", "XSL Transform.csproj", "{74593BA8-2F88-4FF2-89A6-9FBD358231D7}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{74593BA8-2F88-4FF2-89A6-9FBD358231D7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{74593BA8-2F88-4FF2-89A6-9FBD358231D7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{74593BA8-2F88-4FF2-89A6-9FBD358231D7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{74593BA8-2F88-4FF2-89A6-9FBD358231D7}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
-591
View File
@@ -1,591 +0,0 @@
namespace XSL_Transform
{
partial class frmMain
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.Windows.Forms.TabPage tpSX;
System.Windows.Forms.TabPage tpRS;
System.Windows.Forms.TabPage tpSR;
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmMain));
this.tbSX = new System.Windows.Forms.TextBox();
this.wbRS = new System.Windows.Forms.WebBrowser();
this.tbSR = new System.Windows.Forms.TextBox();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.tcSource = new System.Windows.Forms.TabControl();
this.tpSS = new System.Windows.Forms.TabPage();
this.tbSS = new System.Windows.Forms.TextBox();
this.tcResults = new System.Windows.Forms.TabControl();
this.tpRX = new System.Windows.Forms.TabPage();
this.wbRX = new System.Windows.Forms.WebBrowser();
this.tpRR = new System.Windows.Forms.TabPage();
this.wbRR = new System.Windows.Forms.WebBrowser();
this.tpXslHelp = new System.Windows.Forms.TabPage();
this.wbXSLHelp = new System.Windows.Forms.WebBrowser();
this.tpXPathHelp = new System.Windows.Forms.TabPage();
this.wbXPathHelp = new System.Windows.Forms.WebBrowser();
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
this.xMLToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.miOpenXML = new System.Windows.Forms.ToolStripMenuItem();
this.miSaveXML = new System.Windows.Forms.ToolStripMenuItem();
this.miSaveAsXML = new System.Windows.Forms.ToolStripMenuItem();
this.xSLToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.miOpenXSL = new System.Windows.Forms.ToolStripMenuItem();
this.miSaveXSL = new System.Windows.Forms.ToolStripMenuItem();
this.miSaveAsXSL = new System.Windows.Forms.ToolStripMenuItem();
this.resultToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.miTransform = new System.Windows.Forms.ToolStripMenuItem();
this.miQuery = new System.Windows.Forms.ToolStripMenuItem();
this.miSaveAsResults = new System.Windows.Forms.ToolStripMenuItem();
this.miQuit = new System.Windows.Forms.ToolStripMenuItem();
this.searchToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.specialToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ofdxml = new System.Windows.Forms.OpenFileDialog();
this.sfdxml = new System.Windows.Forms.SaveFileDialog();
this.ofdxsl = new System.Windows.Forms.OpenFileDialog();
this.sfdxsl = new System.Windows.Forms.SaveFileDialog();
this.sfdResults = new System.Windows.Forms.SaveFileDialog();
this.ofdResults = new System.Windows.Forms.OpenFileDialog();
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
this.RowLbl = new System.Windows.Forms.ToolStripStatusLabel();
this.ColLbl = new System.Windows.Forms.ToolStripStatusLabel();
this.miRefreshXML = new System.Windows.Forms.ToolStripMenuItem();
this.miRefreshXSL = new System.Windows.Forms.ToolStripMenuItem();
tpSX = new System.Windows.Forms.TabPage();
tpRS = new System.Windows.Forms.TabPage();
tpSR = new System.Windows.Forms.TabPage();
tpSX.SuspendLayout();
tpRS.SuspendLayout();
tpSR.SuspendLayout();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
this.tcSource.SuspendLayout();
this.tpSS.SuspendLayout();
this.tcResults.SuspendLayout();
this.tpRX.SuspendLayout();
this.tpRR.SuspendLayout();
this.tpXslHelp.SuspendLayout();
this.tpXPathHelp.SuspendLayout();
this.menuStrip1.SuspendLayout();
this.statusStrip1.SuspendLayout();
this.SuspendLayout();
//
// tpSX
//
tpSX.Controls.Add(this.tbSX);
tpSX.Location = new System.Drawing.Point(4, 22);
tpSX.Name = "tpSX";
tpSX.Padding = new System.Windows.Forms.Padding(3);
tpSX.Size = new System.Drawing.Size(426, 463);
tpSX.TabIndex = 0;
tpSX.Text = "XML";
tpSX.UseVisualStyleBackColor = true;
//
// tbSX
//
this.tbSX.Dock = System.Windows.Forms.DockStyle.Fill;
this.tbSX.Location = new System.Drawing.Point(3, 3);
this.tbSX.Multiline = true;
this.tbSX.Name = "tbSX";
this.tbSX.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
this.tbSX.Size = new System.Drawing.Size(420, 457);
this.tbSX.TabIndex = 0;
this.tbSX.MouseUp += new System.Windows.Forms.MouseEventHandler(this.tbSX_MouseUp);
this.tbSX.TextChanged += new System.EventHandler(this.tbTextChanged);
//
// tpRS
//
tpRS.Controls.Add(this.wbRS);
tpRS.Location = new System.Drawing.Point(4, 22);
tpRS.Name = "tpRS";
tpRS.Padding = new System.Windows.Forms.Padding(3);
tpRS.Size = new System.Drawing.Size(419, 463);
tpRS.TabIndex = 1;
tpRS.Text = "XSL";
tpRS.UseVisualStyleBackColor = true;
//
// wbRS
//
this.wbRS.Dock = System.Windows.Forms.DockStyle.Fill;
this.wbRS.Location = new System.Drawing.Point(3, 3);
this.wbRS.MinimumSize = new System.Drawing.Size(20, 20);
this.wbRS.Name = "wbRS";
this.wbRS.Size = new System.Drawing.Size(413, 457);
this.wbRS.TabIndex = 1;
//
// tpSR
//
tpSR.Controls.Add(this.tbSR);
tpSR.Location = new System.Drawing.Point(4, 22);
tpSR.Name = "tpSR";
tpSR.Size = new System.Drawing.Size(426, 463);
tpSR.TabIndex = 2;
tpSR.Text = "Results";
tpSR.UseVisualStyleBackColor = true;
//
// tbSR
//
this.tbSR.Dock = System.Windows.Forms.DockStyle.Fill;
this.tbSR.Location = new System.Drawing.Point(0, 0);
this.tbSR.Multiline = true;
this.tbSR.Name = "tbSR";
this.tbSR.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
this.tbSR.Size = new System.Drawing.Size(426, 463);
this.tbSR.TabIndex = 1;
this.tbSR.TextChanged += new System.EventHandler(this.tbTextChanged);
//
// splitContainer1
//
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer1.Location = new System.Drawing.Point(0, 24);
this.splitContainer1.Name = "splitContainer1";
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.tcSource);
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.tcResults);
this.splitContainer1.Size = new System.Drawing.Size(865, 489);
this.splitContainer1.SplitterDistance = 434;
this.splitContainer1.TabIndex = 0;
//
// tcSource
//
this.tcSource.Controls.Add(tpSX);
this.tcSource.Controls.Add(this.tpSS);
this.tcSource.Controls.Add(tpSR);
this.tcSource.Dock = System.Windows.Forms.DockStyle.Fill;
this.tcSource.Location = new System.Drawing.Point(0, 0);
this.tcSource.Name = "tcSource";
this.tcSource.SelectedIndex = 0;
this.tcSource.Size = new System.Drawing.Size(434, 489);
this.tcSource.TabIndex = 0;
//
// tpSS
//
this.tpSS.Controls.Add(this.tbSS);
this.tpSS.Location = new System.Drawing.Point(4, 22);
this.tpSS.Name = "tpSS";
this.tpSS.Padding = new System.Windows.Forms.Padding(3);
this.tpSS.Size = new System.Drawing.Size(426, 463);
this.tpSS.TabIndex = 1;
this.tpSS.Text = "XSL";
this.tpSS.UseVisualStyleBackColor = true;
//
// tbSS
//
this.tbSS.Dock = System.Windows.Forms.DockStyle.Fill;
this.tbSS.Location = new System.Drawing.Point(3, 3);
this.tbSS.Multiline = true;
this.tbSS.Name = "tbSS";
this.tbSS.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
this.tbSS.Size = new System.Drawing.Size(420, 457);
this.tbSS.TabIndex = 1;
this.tbSS.TextChanged += new System.EventHandler(this.tbTextChanged);
//
// tcResults
//
this.tcResults.Controls.Add(this.tpRX);
this.tcResults.Controls.Add(tpRS);
this.tcResults.Controls.Add(this.tpRR);
this.tcResults.Controls.Add(this.tpXslHelp);
this.tcResults.Controls.Add(this.tpXPathHelp);
this.tcResults.Dock = System.Windows.Forms.DockStyle.Fill;
this.tcResults.Location = new System.Drawing.Point(0, 0);
this.tcResults.Name = "tcResults";
this.tcResults.SelectedIndex = 0;
this.tcResults.Size = new System.Drawing.Size(427, 489);
this.tcResults.TabIndex = 1;
this.tcResults.SelectedIndexChanged += new System.EventHandler(this.tcResults_SelectedIndexChanged);
//
// tpRX
//
this.tpRX.Controls.Add(this.wbRX);
this.tpRX.Location = new System.Drawing.Point(4, 22);
this.tpRX.Name = "tpRX";
this.tpRX.Padding = new System.Windows.Forms.Padding(3);
this.tpRX.Size = new System.Drawing.Size(419, 463);
this.tpRX.TabIndex = 0;
this.tpRX.Text = "XML";
this.tpRX.UseVisualStyleBackColor = true;
//
// wbRX
//
this.wbRX.Dock = System.Windows.Forms.DockStyle.Fill;
this.wbRX.Location = new System.Drawing.Point(3, 3);
this.wbRX.MinimumSize = new System.Drawing.Size(20, 20);
this.wbRX.Name = "wbRX";
this.wbRX.Size = new System.Drawing.Size(413, 457);
this.wbRX.TabIndex = 0;
//
// tpRR
//
this.tpRR.Controls.Add(this.wbRR);
this.tpRR.Location = new System.Drawing.Point(4, 22);
this.tpRR.Name = "tpRR";
this.tpRR.Size = new System.Drawing.Size(419, 463);
this.tpRR.TabIndex = 2;
this.tpRR.Text = "Results";
this.tpRR.UseVisualStyleBackColor = true;
//
// wbRR
//
this.wbRR.Dock = System.Windows.Forms.DockStyle.Fill;
this.wbRR.Location = new System.Drawing.Point(0, 0);
this.wbRR.MinimumSize = new System.Drawing.Size(20, 20);
this.wbRR.Name = "wbRR";
this.wbRR.Size = new System.Drawing.Size(419, 463);
this.wbRR.TabIndex = 1;
//
// tpXslHelp
//
this.tpXslHelp.Controls.Add(this.wbXSLHelp);
this.tpXslHelp.Location = new System.Drawing.Point(4, 22);
this.tpXslHelp.Name = "tpXslHelp";
this.tpXslHelp.Size = new System.Drawing.Size(419, 463);
this.tpXslHelp.TabIndex = 3;
this.tpXslHelp.Text = "XSL Help";
this.tpXslHelp.UseVisualStyleBackColor = true;
//
// wbXSLHelp
//
this.wbXSLHelp.Dock = System.Windows.Forms.DockStyle.Fill;
this.wbXSLHelp.Location = new System.Drawing.Point(0, 0);
this.wbXSLHelp.MinimumSize = new System.Drawing.Size(20, 20);
this.wbXSLHelp.Name = "wbXSLHelp";
this.wbXSLHelp.Size = new System.Drawing.Size(419, 463);
this.wbXSLHelp.TabIndex = 3;
//
// tpXPathHelp
//
this.tpXPathHelp.Controls.Add(this.wbXPathHelp);
this.tpXPathHelp.Location = new System.Drawing.Point(4, 22);
this.tpXPathHelp.Name = "tpXPathHelp";
this.tpXPathHelp.Size = new System.Drawing.Size(419, 463);
this.tpXPathHelp.TabIndex = 4;
this.tpXPathHelp.Text = "XPath Help";
this.tpXPathHelp.UseVisualStyleBackColor = true;
//
// wbXPathHelp
//
this.wbXPathHelp.Dock = System.Windows.Forms.DockStyle.Fill;
this.wbXPathHelp.Location = new System.Drawing.Point(0, 0);
this.wbXPathHelp.MinimumSize = new System.Drawing.Size(20, 20);
this.wbXPathHelp.Name = "wbXPathHelp";
this.wbXPathHelp.Size = new System.Drawing.Size(419, 463);
this.wbXPathHelp.TabIndex = 2;
//
// menuStrip1
//
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.xMLToolStripMenuItem,
this.xSLToolStripMenuItem,
this.resultToolStripMenuItem,
this.miQuit,
this.searchToolStripMenuItem});
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
this.menuStrip1.Name = "menuStrip1";
this.menuStrip1.Size = new System.Drawing.Size(865, 24);
this.menuStrip1.TabIndex = 1;
this.menuStrip1.Text = "menuStrip1";
//
// xMLToolStripMenuItem
//
this.xMLToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.miOpenXML,
this.miSaveXML,
this.miSaveAsXML,
this.miRefreshXML});
this.xMLToolStripMenuItem.Name = "xMLToolStripMenuItem";
this.xMLToolStripMenuItem.Size = new System.Drawing.Size(38, 20);
this.xMLToolStripMenuItem.Text = "XML";
//
// miOpenXML
//
this.miOpenXML.Name = "miOpenXML";
this.miOpenXML.Size = new System.Drawing.Size(152, 22);
this.miOpenXML.Tag = "0";
this.miOpenXML.Text = "Open";
this.miOpenXML.Click += new System.EventHandler(this.miOpen_Click);
//
// miSaveXML
//
this.miSaveXML.Name = "miSaveXML";
this.miSaveXML.Size = new System.Drawing.Size(152, 22);
this.miSaveXML.Tag = "0";
this.miSaveXML.Text = "Save";
this.miSaveXML.Click += new System.EventHandler(this.miSave_Click);
//
// miSaveAsXML
//
this.miSaveAsXML.Name = "miSaveAsXML";
this.miSaveAsXML.Size = new System.Drawing.Size(152, 22);
this.miSaveAsXML.Tag = "0";
this.miSaveAsXML.Text = "Save As";
this.miSaveAsXML.Click += new System.EventHandler(this.miSaveAs_Click);
//
// xSLToolStripMenuItem
//
this.xSLToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.miOpenXSL,
this.miSaveXSL,
this.miSaveAsXSL,
this.miRefreshXSL});
this.xSLToolStripMenuItem.Name = "xSLToolStripMenuItem";
this.xSLToolStripMenuItem.Size = new System.Drawing.Size(36, 20);
this.xSLToolStripMenuItem.Text = "XSL";
//
// miOpenXSL
//
this.miOpenXSL.Name = "miOpenXSL";
this.miOpenXSL.Size = new System.Drawing.Size(152, 22);
this.miOpenXSL.Tag = "1";
this.miOpenXSL.Text = "Open";
this.miOpenXSL.Click += new System.EventHandler(this.miOpen_Click);
//
// miSaveXSL
//
this.miSaveXSL.Name = "miSaveXSL";
this.miSaveXSL.Size = new System.Drawing.Size(152, 22);
this.miSaveXSL.Tag = "1";
this.miSaveXSL.Text = "Save";
this.miSaveXSL.Click += new System.EventHandler(this.miSave_Click);
//
// miSaveAsXSL
//
this.miSaveAsXSL.Name = "miSaveAsXSL";
this.miSaveAsXSL.Size = new System.Drawing.Size(152, 22);
this.miSaveAsXSL.Tag = "1";
this.miSaveAsXSL.Text = "Save As";
this.miSaveAsXSL.Click += new System.EventHandler(this.miSaveAs_Click);
//
// resultToolStripMenuItem
//
this.resultToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.miTransform,
this.miQuery,
this.miSaveAsResults});
this.resultToolStripMenuItem.Name = "resultToolStripMenuItem";
this.resultToolStripMenuItem.Size = new System.Drawing.Size(49, 20);
this.resultToolStripMenuItem.Text = "Result";
//
// miTransform
//
this.miTransform.Name = "miTransform";
this.miTransform.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.T)));
this.miTransform.Size = new System.Drawing.Size(172, 22);
this.miTransform.Text = "Transform";
this.miTransform.Click += new System.EventHandler(this.miTransform_Click);
//
// miQuery
//
this.miQuery.Name = "miQuery";
this.miQuery.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Q)));
this.miQuery.Size = new System.Drawing.Size(172, 22);
this.miQuery.Text = "Query";
this.miQuery.Click += new System.EventHandler(this.miQuery_Click);
//
// miSaveAsResults
//
this.miSaveAsResults.Name = "miSaveAsResults";
this.miSaveAsResults.Size = new System.Drawing.Size(172, 22);
this.miSaveAsResults.Tag = "2";
this.miSaveAsResults.Text = "Save";
this.miSaveAsResults.Click += new System.EventHandler(this.miSaveAs_Click);
//
// miQuit
//
this.miQuit.Name = "miQuit";
this.miQuit.Size = new System.Drawing.Size(39, 20);
this.miQuit.Text = "&Quit";
this.miQuit.Click += new System.EventHandler(this.miQuit_Click);
//
// searchToolStripMenuItem
//
this.searchToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.specialToolStripMenuItem});
this.searchToolStripMenuItem.Name = "searchToolStripMenuItem";
this.searchToolStripMenuItem.Size = new System.Drawing.Size(52, 20);
this.searchToolStripMenuItem.Text = "Search";
//
// specialToolStripMenuItem
//
this.specialToolStripMenuItem.Name = "specialToolStripMenuItem";
this.specialToolStripMenuItem.Size = new System.Drawing.Size(174, 22);
this.specialToolStripMenuItem.Text = "Special Characters";
this.specialToolStripMenuItem.Click += new System.EventHandler(this.specialToolStripMenuItem_Click);
//
// ofdxml
//
this.ofdxml.FileOk += new System.ComponentModel.CancelEventHandler(this.OpenFileOk);
//
// sfdxml
//
this.sfdxml.FileOk += new System.ComponentModel.CancelEventHandler(this.SaveFileOk);
//
// ofdxsl
//
this.ofdxsl.FileOk += new System.ComponentModel.CancelEventHandler(this.OpenFileOk);
//
// sfdxsl
//
this.sfdxsl.FileOk += new System.ComponentModel.CancelEventHandler(this.SaveFileOk);
//
// sfdResults
//
this.sfdResults.FileOk += new System.ComponentModel.CancelEventHandler(this.SaveFileOk);
//
// ofdResults
//
this.ofdResults.FileOk += new System.ComponentModel.CancelEventHandler(this.OpenFileOk);
//
// statusStrip1
//
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.RowLbl,
this.ColLbl});
this.statusStrip1.Location = new System.Drawing.Point(0, 513);
this.statusStrip1.Name = "statusStrip1";
this.statusStrip1.Size = new System.Drawing.Size(865, 22);
this.statusStrip1.TabIndex = 2;
this.statusStrip1.Text = "statusStrip1";
//
// RowLbl
//
this.RowLbl.Name = "RowLbl";
this.RowLbl.Size = new System.Drawing.Size(41, 17);
this.RowLbl.Text = "Row: 0";
//
// ColLbl
//
this.ColLbl.Name = "ColLbl";
this.ColLbl.Size = new System.Drawing.Size(55, 17);
this.ColLbl.Text = "Column: 0";
//
// miRefreshXML
//
this.miRefreshXML.Name = "miRefreshXML";
this.miRefreshXML.Size = new System.Drawing.Size(152, 22);
this.miRefreshXML.Tag = "0";
this.miRefreshXML.Text = "Refresh";
this.miRefreshXML.Click += new System.EventHandler(this.miRefresh_Click);
//
// miRefreshXSL
//
this.miRefreshXSL.Name = "miRefreshXSL";
this.miRefreshXSL.Size = new System.Drawing.Size(152, 22);
this.miRefreshXSL.Tag = "1";
this.miRefreshXSL.Text = "Refresh";
this.miRefreshXSL.Click += new System.EventHandler(this.miRefresh_Click);
//
// frmMain
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(865, 535);
this.Controls.Add(this.splitContainer1);
this.Controls.Add(this.menuStrip1);
this.Controls.Add(this.statusStrip1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "frmMain";
this.Text = "XML Query and Transform Tool";
tpSX.ResumeLayout(false);
tpSX.PerformLayout();
tpRS.ResumeLayout(false);
tpSR.ResumeLayout(false);
tpSR.PerformLayout();
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel2.ResumeLayout(false);
this.splitContainer1.ResumeLayout(false);
this.tcSource.ResumeLayout(false);
this.tpSS.ResumeLayout(false);
this.tpSS.PerformLayout();
this.tcResults.ResumeLayout(false);
this.tpRX.ResumeLayout(false);
this.tpRR.ResumeLayout(false);
this.tpXslHelp.ResumeLayout(false);
this.tpXPathHelp.ResumeLayout(false);
this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout();
this.statusStrip1.ResumeLayout(false);
this.statusStrip1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.SplitContainer splitContainer1;
private System.Windows.Forms.TabControl tcSource;
private System.Windows.Forms.TabPage tpSS;
private System.Windows.Forms.TabControl tcResults;
private System.Windows.Forms.TabPage tpRX;
private System.Windows.Forms.MenuStrip menuStrip1;
private System.Windows.Forms.ToolStripMenuItem xMLToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem miOpenXML;
private System.Windows.Forms.ToolStripMenuItem miSaveXML;
private System.Windows.Forms.ToolStripMenuItem miSaveAsXML;
private System.Windows.Forms.ToolStripMenuItem xSLToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem miOpenXSL;
private System.Windows.Forms.ToolStripMenuItem miSaveXSL;
private System.Windows.Forms.ToolStripMenuItem miSaveAsXSL;
private System.Windows.Forms.ToolStripMenuItem resultToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem miTransform;
private System.Windows.Forms.ToolStripMenuItem miQuery;
private System.Windows.Forms.ToolStripMenuItem miSaveAsResults;
private System.Windows.Forms.ToolStripMenuItem miQuit;
private System.Windows.Forms.OpenFileDialog ofdxml;
private System.Windows.Forms.SaveFileDialog sfdxml;
private System.Windows.Forms.OpenFileDialog ofdxsl;
private System.Windows.Forms.SaveFileDialog sfdxsl;
private System.Windows.Forms.SaveFileDialog sfdResults;
private System.Windows.Forms.TabPage tpRR;
private System.Windows.Forms.TextBox tbSX;
private System.Windows.Forms.TextBox tbSS;
private System.Windows.Forms.TextBox tbSR;
private System.Windows.Forms.WebBrowser wbRX;
private System.Windows.Forms.WebBrowser wbRS;
private System.Windows.Forms.WebBrowser wbRR;
private System.Windows.Forms.OpenFileDialog ofdResults;
private System.Windows.Forms.TabPage tpXslHelp;
private System.Windows.Forms.TabPage tpXPathHelp;
private System.Windows.Forms.WebBrowser wbXSLHelp;
private System.Windows.Forms.WebBrowser wbXPathHelp;
private System.Windows.Forms.StatusStrip statusStrip1;
private System.Windows.Forms.ToolStripStatusLabel RowLbl;
private System.Windows.Forms.ToolStripStatusLabel ColLbl;
private System.Windows.Forms.ToolStripMenuItem searchToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem specialToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem miRefreshXML;
private System.Windows.Forms.ToolStripMenuItem miRefreshXSL;
}
}
-289
View File
@@ -1,289 +0,0 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Xml.Xsl;
using System.Xml;
using System.IO;
using System.Text.RegularExpressions;
namespace XSL_Transform
{
public partial class frmMain : Form
{
private bool[] _Dirty = new bool[] { false, false, false };
private string[] _Name = new string[] { "XML", "XSL", "Results" };
private SaveFileDialog[] _Sfd;
private OpenFileDialog[] _Ofd;
private TextBox[] _Tb;
private WebBrowser[] _Wb;
private Dictionary<OpenFileDialog, Tabs> _OpenDict = new Dictionary<OpenFileDialog, Tabs>();
private Dictionary<SaveFileDialog, Tabs> _SaveDict = new Dictionary<SaveFileDialog, Tabs>();
private Dictionary<TextBox, Tabs> _TextBoxDict = new Dictionary<TextBox, Tabs>();
enum Tabs : int
{
XML=0,XSL=1,Results=2
}
public frmMain()
{
InitializeComponent();
_Sfd = new SaveFileDialog[] { sfdxml, sfdxsl, sfdResults };
_Ofd = new OpenFileDialog[] { ofdxml, ofdxsl, ofdResults };
_Tb = new TextBox[] { tbSX, tbSS, tbSR };
_Wb = new WebBrowser[] { wbRX, wbRS, wbRR };
foreach (Tabs tab in Enum.GetValues(typeof(Tabs)))
{
_SaveDict.Add(_Sfd[(int)tab], tab);
_OpenDict.Add(_Ofd[(int)tab], tab);
_TextBoxDict.Add(_Tb[(int)tab], tab);
}
}
void SaveFileOk(object sender, CancelEventArgs e)
{
SaveIt(_SaveDict[(SaveFileDialog)sender]);
}
private void SaveIt(Tabs tab)
{
_Ofd[(int)tab].FileName = _Sfd[(int)tab].FileName;
StreamWriter sw = File.CreateText(_Sfd[(int)tab].FileName);
sw.Write(_Tb[(int)tab].Text);
sw.Close();
_Dirty[(int)tab] = false;
}
void OpenFileOk(object sender, CancelEventArgs e)
{
OpenIt(_OpenDict[(OpenFileDialog) sender]);
}
private void ShowTab(Tabs tabs)
{
if (tcResults.SelectedIndex == (int)tabs)
ShowActiveTab();
else
tcResults.SelectedIndex = (int)tabs;// Activate the Approproate Browser
}
private void OpenIt(Tabs tab)
{
_Sfd[(int)tab].FileName = _Ofd[(int)tab].FileName;
LoadTB(_Tb[(int)tab],_Ofd[(int)tab].FileName);
_Dirty[(int)tab] = false;
tcSource.SelectedIndex = (int)tab;// Activate the Appropriate Tab
ShowTab(tab);
}
private bool SaveChanges(Tabs tab)
{
if (!_Dirty[(int)tab]) return true;
DialogResult dr = MessageBox.Show("Save changes to " + _Name[(int)tab] + " file?", "Save Changes",
MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
if (dr == DialogResult.Cancel) return false;
if (dr == DialogResult.Yes) SaveIt(tab);
return true;
}
private void LoadTB(TextBox tb, string fileName)
{
FileInfo f = new FileInfo(fileName);
StreamReader sr = f.OpenText();
tb.Text = sr.ReadToEnd();
sr.Close();
}
private void miQuit_Click(object sender, EventArgs e)
{
if (SaveChanges()) this.Close();
}
private bool SaveChanges()
{
foreach (Tabs tab in Enum.GetValues(typeof(Tabs)))
if (!SaveChanges(tab)) return false;
return true;
}
private Tabs TabValue(ToolStripDropDownItem mi)
{
return (Tabs)int.Parse(mi.Tag.ToString());
}
private void miOpen_Click(object sender, EventArgs e)
{
Tabs tab = TabValue((ToolStripDropDownItem)sender);
if (SaveChanges(tab))
_Ofd[(int)tab].ShowDialog();
}
private void miRefresh_Click(object sender, EventArgs e)
{
Tabs tab = TabValue((ToolStripDropDownItem)sender);
OpenIt(tab);
}
private void miSaveAs_Click(object sender, EventArgs e)
{
Tabs tab = TabValue((ToolStripDropDownItem)sender);
_Sfd[(int)tab].ShowDialog();
}
private void miSave_Click(object sender, EventArgs e)
{
Tabs tab = TabValue((ToolStripDropDownItem)sender);
if (_Sfd[(int)tab].FileName == string.Empty)
_Sfd[(int)tab].ShowDialog();
else
SaveIt(tab);
}
private string FormatException(Exception ex)
{
return string.Format("{0} - {1}", ex.GetType().Name, ex.Message);
}
private void ShowException(Exception ex)
{
ShowException(ex, null);
}
private void ShowException(Exception ex,string sResults)
{
if (sResults != null)
{
LoadTB(tbSR, sResults);
}
StringBuilder sb = new StringBuilder(FormatException(ex));
sb.Append("\r\n");
for (; ex.InnerException != null; ex = ex.InnerException)
{
sb.Append(FormatException(ex.InnerException));
sb.Append("\r\n");
}
tbSR.SelectionStart = 0;
tbSR.SelectedText=sb.ToString();
}
private void miQuery_Click(object sender, EventArgs e)
{
try
{
XmlDocument xd = new XmlDocument();
xd.LoadXml(tbSX.Text);
XmlNodeList nl = xd.SelectNodes(tbSS.Text);
if (nl.Count > 0)
{
StringBuilder sb= new StringBuilder("<Results>");
foreach (XmlNode nd in nl)
sb.Append(string.Format("\r\n <Result Type='{0}'>{1}</Result>",nd.GetType().Name,nd.OuterXml));
sb.Append("\r\n</Results>");
tbSR.Text = sb.ToString();
}
else
tbSR.Text = "No nodes found matching criteria";
}
catch (Exception ex)
{
ShowException(ex);
}
ShowTab(Tabs.Results);
}
private void miTransform_Click(object sender, EventArgs e)
{
string sXSL = Save(tbSS, "tmpS");
string sXML = Save(tbSX, "tmpX");
string sResults = Application.StartupPath + "\\" + "tmpR.XML";
try
{
XslCompiledTransform xsl = new XslCompiledTransform();
xsl.Load(sXSL);
xsl.Transform(sXML, sResults); // Perform Transform
LoadTB(tbSR, sResults);
}
catch (Exception ex)
{
ShowException(ex,sResults);
}
ShowTab(Tabs.Results);
}
private void ShowActiveTab()
{
Tabs tab = (Tabs)tcResults.SelectedIndex;
_Wb[(int)tab].Navigate(Save(_Tb[(int)tab], _Name[(int)tab]));
}
private void tcResults_SelectedIndexChanged(object sender, EventArgs e)
{
switch (tcResults.SelectedIndex)
{
case 3:
if (wbXSLHelp.Url == null)
wbXSLHelp.Navigate("http://www.w3schools.com/xsl/default.asp");
break;
case 4:
if (wbXPathHelp.Url == null)
wbXPathHelp.Navigate("http://www.w3schools.com/xpath/");
break;
default:
ShowActiveTab();
break;
}
}
private string Extension(string txt)
{
if (txt.Substring(0, 5) == "<html") return ".html";
try
{
XmlDocument xd = new XmlDocument();
xd.LoadXml(txt);
if (xd.OuterXml == string.Empty) return ".txt";
else return ".xml";
}
catch (Exception)
{
return ".txt";
}
}
private string Save(TextBox tb, string path)
{
if (tb.Text == string.Empty) return "about:blank";
string sPath = Application.StartupPath + "\\" + path + Extension(tb.Text) ;
StreamWriter sw = File.CreateText(sPath);
sw.Write(tb.Text);
sw.Close();
return sPath;
}
private void tbTextChanged(object sender, EventArgs e)
{
_Dirty[(int)_TextBoxDict[(TextBox)sender]] = true;
}
private void tbSX_MouseUp(object sender, MouseEventArgs e)
{
RefreshLabels(tbSX.Text, tbSX.SelectionStart);
}
private void RefreshLabels(string s, int location)
{
int row = 0;
int col = 0;
int ii = 0;
while (ii < location)
{
if (s[ii] == '\r')
{
row++;
col = 0;
}
if (s[ii] != '\n') col++;
ii++;
}
RowLbl.Text = string.Format("Row: {0}", row);
ColLbl.Text = string.Format("Col: {0}", col);
}
private void specialToolStripMenuItem_Click(object sender, EventArgs e)
{
SortedList<int, int> sl = new SortedList<int, int>();
foreach (Match match in Regex.Matches(tbSX.Text,"&#x([0-9]*);"))
{
int num = int.Parse(match.Value.Substring(3).TrimEnd(";".ToCharArray()));
if(num != 9 && num != 10 && num != 13){
if (sl.ContainsKey(num)) sl[num] = sl[num] + 1;
else sl[num] = 1;
}
}
// When all done show the results in a list.
tbSR.Text = "Special Characters";
foreach (int key in sl.Keys)
{
tbSR.Text += string.Format("\r\n{0} Ctrl-{1} - {2}", key, Convert.ToChar('A' - 1 + key), sl[key]);
}
ShowTab(Tabs.Results);
}
}
}
-176
View File
@@ -1,176 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="tpSX.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="tpRS.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="tpSR.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="ofdxml.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>126, 17</value>
</metadata>
<metadata name="sfdxml.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>256, 17</value>
</metadata>
<metadata name="ofdxsl.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>340, 17</value>
</metadata>
<metadata name="sfdxsl.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>470, 17</value>
</metadata>
<metadata name="sfdResults.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>598, 17</value>
</metadata>
<metadata name="ofdResults.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>700, 17</value>
</metadata>
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>803, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAIAICAQAAAAAADoAgAAJgAAABAQEAAAAAAAKAEAAA4DAAAoAAAAIAAAAEAAAAABAAQAAAAAAIAC
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAgAAAAICAAIAAAACAAIAAgIAAAICAgADAwMAAAAD/AAD/
AAAA//8A/wAAAP8A/wD//wAA////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////
//////////////////////////P////4/////D////wP///+A////gD///8AP4AAAA8AAAADAAAAAAAA
AAOAAAAP//8AP//+AP///gP///wP///8P///+P////P/////////////////////////////////////
//8oAAAAEAAAACAAAAABAAQAAAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAgAAAAICAAIAA
AACAAIAAgIAAAICAgADAwMAAAAD/AAD/AAAA//8A/wAAAP8A/wD//wAA////AAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAP//
AAD//wAA/P8AAP4/AAD+DwAAgAMAAAAAAACAAQAA/gcAAP4fAAD8fwAA/f8AAP//AAD//wAA//8AAA==
</value>
</data>
</root>
-188
View File
@@ -1,188 +0,0 @@
using System;
using System.Xml;
using System.Drawing;
using System.Windows.Forms;
//using C1.C1Pdf;
namespace fmtxml
{
/// <summary>
/// Summary description for XmlToPdf.
/// </summary>
public class XmlToPdf
{
private float ConvertToPoints=72f;
private XmlDocument xmlDoc;
private string FileName;
private string FilePath;
//private C1.C1Pdf.C1PdfDocument _c1pdf;
private string [] FontChoice =
{"Times New Roman",
"VESymb XXXXXX",
"VolianDraw XXXXXX",
"Prestige Elite Tall",
"Courier New",
"Arial",
"Letter Gothic",
"Times New Roman",
"Letter Gothic Tall",
"Letter Gothic Tall",
"Gothic Ultra",
"VolianScript"
};
private float LeftMargin; //todo: define in page info
private float VerticalOffset; //todo: define in page info
private bool Portrait; //todo: define in page info
public XmlToPdf(string path, string fname)
{
LeftMargin=0.5f * ConvertToPoints; // KBR: TODO
VerticalOffset=0.5f * ConvertToPoints; // KBR: TODO
Portrait = true; // KBR: TODO
FileName = fname;
FilePath = path;
xmlDoc = new XmlDocument();
XmlTextReader reader = new XmlTextReader(FilePath+"\\"+FileName);
xmlDoc.Load(reader);
reader.Close();
try
{
GeneratePDFForFile();
}
catch (Exception e)
{
MessageBox.Show("Error processing: " + fname, e.Message);
}
}
private void GeneratePDFForFile()
{
//_c1pdf = new C1.C1Pdf.C1PdfDocument();
//string rootname = FileName.Substring(0,FileName.Length-4);
//// create a pdf file & for each macro (i.e. macro element in xml tree),
//// put it into the pdf file.
//XmlElement top = (XmlElement) xmlDoc.SelectSingleNode(rootname + "_GENMAC");
//XmlNodeList xmlNds = top.SelectNodes("MACRO");
//foreach (XmlNode nd in xmlNds)
//{
// XmlNode name = nd.SelectSingleNode("NAME");
// XmlElement elm = (XmlElement) name;
// XmlNode definition = nd.SelectSingleNode("DEFINITION");
// MacroGeneratePDF(definition);
// _c1pdf.NewPage();
//}
//string outname = "E:\\ve-proms.net\\genmac.xml\\testpdf\\" + rootname + ".pdf";
//_c1pdf.Save(outname);
}
private void MacroGeneratePDF(XmlNode definition)
{
XmlElement elm = (XmlElement) definition;
string def = elm.InnerText;
int lindx = 0;
int indx = def.IndexOf(";");
while (indx>-1)
{
string command = def.Substring(lindx,indx-lindx).Trim();
DoPDF(command);
lindx = indx+1;
indx = def.IndexOf(";",lindx);
}
}
private void DoPDF(string cmdline)
{
string cmd = cmdline.Substring(0,cmdline.IndexOf(" "));
int stx, sty, ex, ey = 0;
float fstx, fsty, fex, fey = 0;
int lw=0;
string restOfIt=null;
string [] parts;
Pen pn = null;
switch (cmd)
{
case "BOX":
restOfIt = cmdline.Substring(4,cmdline.Length-4);
parts = restOfIt.Split(" ".ToCharArray(),5);
fstx = (float) System.Convert.ToDouble(parts[0]);
fsty = (float) System.Convert.ToDouble(parts[1]);
fex = (float) System.Convert.ToDouble(parts[2]);
fey = (float) System.Convert.ToDouble(parts[3]);
float flw = (float) System.Convert.ToDouble(parts[4]);
pn = new Pen(Brushes.Black,flw);
//KBR: TODO - storing page stuff such as portland, vertical offset, tab, etc.
RectangleF rc = new RectangleF(LeftMargin+fstx,VerticalOffset+fsty,fex,fey);
//_c1pdf.DrawRectangle(pn,rc);
break;
case "LINE": // command is LINE startx, starty, endx, endy, lnwidth
restOfIt = cmdline.Substring(5,cmdline.Length-5);
parts = restOfIt.Split(" ".ToCharArray(),5);
fstx = (float) System.Convert.ToDouble(parts[0]);
fsty = (float) System.Convert.ToDouble(parts[1]);
fex = (float) System.Convert.ToDouble(parts[2]);
fey = (float) System.Convert.ToDouble(parts[3]);
float flw1 = (float) System.Convert.ToDouble(parts[4]);
//KBR: TODO - storing page stuff such as portland, vertical offset, tab, etc.
// startx = portland ? (vof + cy + adjy) : (cx + tab + adjx);
// starty = portland ? (tab - (cx + adjx)) : (cy + vof + adjy);
pn = new Pen(Brushes.Black,flw1);
//KBR: TODO - move ablsolute?
// if (MoveAbsolute)
// {tab = 0;vof = 0;}
//_c1pdf.DrawLine(pn, LeftMargin+fstx, VerticalOffset+fsty, LeftMargin+fstx+fex, VerticalOffset+fsty+fey);
break;
case "TEXT":
int quote = cmdline.IndexOf("\"");
string txt = cmdline.Substring(quote+1,cmdline.LastIndexOf("\"")-quote-1);
restOfIt = cmdline.Substring(5,quote-6);
parts = restOfIt.Split(" ".ToCharArray(),5);
fstx = (float) System.Convert.ToDouble(parts[0]);
fsty = (float) System.Convert.ToDouble(parts[1]);
int FontSize = System.Convert.ToInt32(parts[2]);
FontSize = FontSize/2;
int FontFamily = System.Convert.ToInt32(parts[3]);
int bui = System.Convert.ToInt32(parts[4]); //kbr todo: use bui
Font myfont = new Font(this.FontChoice[FontFamily],FontSize);
rc = new Rectangle();
//rc.Size = _c1pdf.MeasureStringRtf(txt,myfont,500); // kbr todo: 500?
rc.X = LeftMargin+fstx;
rc.Y = VerticalOffset+fsty-FontSize; //-(rc.Size.Height/2);
//_c1pdf.DrawStringRtf(txt,myfont,Brushes.Black,rc);
break;
case "GDIADJ":
break;
case "ELLIPSE":
restOfIt = cmdline.Substring(8,cmdline.Length-8);
parts = restOfIt.Split(" ".ToCharArray(),5);
stx = System.Convert.ToInt32(parts[0]);
sty = System.Convert.ToInt32(parts[1]);
ex = System.Convert.ToInt32(parts[2]);
ey = System.Convert.ToInt32(parts[3]);
lw = System.Convert.ToInt32(parts[4]);
//_c1pdf.DrawEllipse(pn,LeftMargin+stx, VerticalOffset+sty, LeftMargin+ex, VerticalOffset+ey);
break;
case "BITMAP":
restOfIt = cmdline.Substring(8,cmdline.Length-7);
parts = restOfIt.Split(" ".ToCharArray(),3);
fstx = (float) System.Convert.ToDouble(parts[0]);
fsty = (float) System.Convert.ToDouble(parts[1]);
string fname = parts[2];
Image img = Image.FromFile(fname);
rc = new RectangleF();
rc.Height = img.Height;
rc.Width = img.Width;
rc.X = LeftMargin+fstx;
rc.Y = VerticalOffset+fsty-(rc.Size.Height/2);
//_c1pdf.DrawImage(img, rc, ContentAlignment.MiddleCenter, ImageSizeModeEnum.Scale);
break;
case "ABSOLUTE":
break;
default:
break;
}
}
}
}
-21
View File
@@ -1,21 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="fmtxml.Settings1" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<userSettings>
<fmtxml.Settings1>
<setting name="ResultsFolder" serializeAs="String">
<value>c:\development\</value>
</setting>
<setting name="FormatFolder" serializeAs="String">
<value>c:\16bit\ve-proms\format</value>
</setting>
<setting name="GenmacFolder" serializeAs="String">
<value>C:\16bit\promsnt\genmac</value>
</setting>
</fmtxml.Settings1>
</userSettings>
</configuration>
-3
View File
@@ -1,3 +0,0 @@
copy c:\development\proms\fmtxml\wst1all.xml c:\development\fmtall\
copy c:\development\proms\fmtxml\wst2all.xml c:\development\fmtall\
pause
-138
View File
@@ -1,138 +0,0 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{66A20362-1B7E-4F9D-BABA-86E29EA60994}</ProjectGuid>
<OutputType>WinExe</OutputType>
<NoStandardLibraries>false</NoStandardLibraries>
<AssemblyName>fmtxml</AssemblyName>
<RootNamespace>fmtxml</RootNamespace>
<SccProjectName>"%24/PROMS/fmtxml", URDAAAAA</SccProjectName>
<SccLocalPath>.</SccLocalPath>
<SccAuxPath>
</SccAuxPath>
<SccProvider>MSSCCI:Microsoft Visual SourceSafe</SccProvider>
<RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>.\bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>.\bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Reference Include="c1.c1pdf, Version=1.1.20052.40, Culture=neutral, PublicKeyToken=bc8d9c59cf1b601f" />
<Reference Include="C1.Common, Version=1.0.20031.116, Culture=neutral, PublicKeyToken=e272bb32d11b1948" />
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Content Include="App.ico" />
<Content Include="ComPeakFlex.svg" />
<Content Include="ComPeakFlexall.xml" />
<Content Include="fnpnmp.svg" />
<Content Include="FNPNMPall.xml" />
<Content Include="hlpfsg.svg" />
<Content Include="HLPFSGall.xml" />
<Content Include="removeempty.xsl" />
<Content Include="removeFmtUseCO.xsl">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="TranslateDoc.XSL">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="TranslateFMT.XSL">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="TranslatePAG.XSL">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="wst1.svg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="WST1all.xml">
</Content>
<Content Include="wst2.svg">
</Content>
<Content Include="WST2all.xml">
</Content>
<Content Include="wstalr.svg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="WSTALRall.xml">
</Content>
<Content Include="wstbck.svg" />
<Content Include="WSTBCKall.xml" />
<Content Include="wstckl.svg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="WSTCKLall.xml">
</Content>
<Content Include="wstDCS.svg" />
<Content Include="WSTDCSall.xml" />
<Content Include="_UpgradeReport_Files\UpgradeReport.css" />
<Content Include="_UpgradeReport_Files\UpgradeReport.xslt" />
<Content Include="_UpgradeReport_Files\UpgradeReport_Minus.gif" />
<Content Include="_UpgradeReport_Files\UpgradeReport_Plus.gif" />
</ItemGroup>
<ItemGroup>
<Compile Include="AppendPlantSpecific.cs" />
<Compile Include="AssemblyInfo.cs" />
<Compile Include="PlantSpecific_Calvert.cs" />
<Compile Include="PlantSpecific_PointBeach.cs" />
<Compile Include="PlantSpecific_ByrBwd.cs" />
<Compile Include="PlantSpecific_Gen.cs" />
<Compile Include="PlantSpecific_Catawba.cs" />
<Compile Include="EntireFormat.cs" />
<Compile Include="FmtFileToXml.cs" />
<Compile Include="FmtToXml.cs" />
<Compile Include="Form1.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="GenToXml.cs" />
<Compile Include="GenXmlToSvg.cs" />
<Compile Include="PlantSpecific_ComanchePeak.cs" />
<Compile Include="PlantSpecific_McGuire.cs" />
<Compile Include="PlantSpecific_PrairieIsland.cs" />
<Compile Include="PlantSpecific_Robinson.cs" />
<Compile Include="PlantSpecific_SouthTexas.cs" />
<Compile Include="PlantSpecific_Summer.cs" />
<Compile Include="PlantSpecific_WolfCreak.cs" />
<Compile Include="PSI.cs" />
<Compile Include="RtfToSvg.cs" />
<Compile Include="Settings.Designer.cs" />
<Compile Include="SvgToPdf.cs" />
<Compile Include="XmlToPdf.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Volian.Utils.Library\CvtFont\CvtFont.csproj">
<Project>{652EB5F6-18DD-4F22-9C0B-62EB46613C4D}</Project>
<Name>CvtFont</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
<ProjectExtensions>
<VisualStudio AllowExistingFolder="true" />
</ProjectExtensions>
<PropertyGroup>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
</Project>
-55
View File
@@ -1,55 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "fmtxml", "fmtxml.csproj", "{66A20362-1B7E-4F9D-BABA-86E29EA60994}"
ProjectSection(WebsiteProperties) = preProject
Debug.AspNetCompiler.Debug = "True"
Release.AspNetCompiler.Debug = "False"
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CvtFont", "..\Volian.Utils.Library\CvtFont\CvtFont.csproj", "{652EB5F6-18DD-4F22-9C0B-62EB46613C4D}"
ProjectSection(WebsiteProperties) = preProject
Debug.AspNetCompiler.Debug = "True"
Release.AspNetCompiler.Debug = "False"
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XSL Transform", "XSL Transform\XSL Transform.csproj", "{74593BA8-2F88-4FF2-89A6-9FBD358231D7}"
ProjectSection(WebsiteProperties) = preProject
Debug.AspNetCompiler.Debug = "True"
Release.AspNetCompiler.Debug = "False"
EndProjectSection
EndProject
Global
GlobalSection(SourceCodeControl) = preSolution
SccNumberOfProjects = 2
SccProjectUniqueName0 = ..\\Volian.Utils.Library\\CvtFont\\CvtFont.csproj
SccProjectName0 = \u0022$/PROMS/Volian.Utils.Library/CvtFont\u0022,\u0020TRDAAAAA
SccLocalPath0 = ..\\Volian.Utils.Library\\CvtFont
SccProvider0 = MSSCCI:Microsoft\u0020Visual\u0020SourceSafe
SccProjectUniqueName1 = fmtxml.csproj
SccProjectName1 = \u0022$/PROMS/fmtxml\u0022,\u0020URDAAAAA
SccLocalPath1 = .
SccProvider1 = MSSCCI:Microsoft\u0020Visual\u0020SourceSafe
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{66A20362-1B7E-4F9D-BABA-86E29EA60994}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{66A20362-1B7E-4F9D-BABA-86E29EA60994}.Debug|Any CPU.Build.0 = Debug|Any CPU
{66A20362-1B7E-4F9D-BABA-86E29EA60994}.Release|Any CPU.ActiveCfg = Release|Any CPU
{66A20362-1B7E-4F9D-BABA-86E29EA60994}.Release|Any CPU.Build.0 = Release|Any CPU
{652EB5F6-18DD-4F22-9C0B-62EB46613C4D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{652EB5F6-18DD-4F22-9C0B-62EB46613C4D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{652EB5F6-18DD-4F22-9C0B-62EB46613C4D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{652EB5F6-18DD-4F22-9C0B-62EB46613C4D}.Release|Any CPU.Build.0 = Release|Any CPU
{74593BA8-2F88-4FF2-89A6-9FBD358231D7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{74593BA8-2F88-4FF2-89A6-9FBD358231D7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{74593BA8-2F88-4FF2-89A6-9FBD358231D7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{74593BA8-2F88-4FF2-89A6-9FBD358231D7}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
Binary file not shown.
Binary file not shown.
-215
View File
@@ -1,215 +0,0 @@
----------------------------------------
Find 'usemeta' (false by default) - format flag on section
C:\Development\fmtall\BGEALNall.xml(12):
C:\Development\fmtall\BGEEOPall.xml(18):
C:\Development\fmtall\BGEOIall.xml(32):
C:\Development\fmtall\BGESTPall.xml(30):
C:\Development\fmtall\CAL1all.xml':
C:\Development\fmtall\CATall.xml':
C:\Development\fmtall\CATBOXall.xml(17):
C:\Development\fmtall\FNPall.xml(28):
C:\Development\fmtall\GPCAall.xml(17):
C:\Development\fmtall\MCGBOXall.xml(21):
C:\Development\fmtall\RGEBCK_00all.xml(10):
C:\Development\fmtall\WCN1all.xml(25):
C:\Development\fmtall\wst1all.xml(36):
----------------------------------------
'showsectiontitles' (false by default) format flag on sectionlayout
C:\Development\fmtall\BGEALNall.xml(32):
C:\Development\fmtall\BGEEOPall.xml(26):
C:\Development\fmtall\BGEOIall.xml(40):
C:\Development\fmtall\BGESTPall.xml(38):
C:\Development\fmtall\CAL1all.xml(39):
C:\Development\fmtall\CATall.xml(25):
C:\Development\fmtall\CATBOXall.xml(25):
C:\Development\fmtall\FNPall.xml(36):
C:\Development\fmtall\GPCAall.xml(25):
C:\Development\fmtall\IP3_08all.xml(19): (and other subformats)
C:\Development\fmtall\MCGall.xml(29):
C:\Development\fmtall\MCGBOXall.xml(29):
C:\Development\fmtall\NSPARPall.xml(62):
C:\Development\fmtall\NSPFCall.xml(29):
C:\Development\fmtall\NSPIFG2all.xml(27):
C:\Development\fmtall\NSPIFGall.xml(27):
C:\Development\fmtall\NSPPEall.xml(32):
C:\Development\fmtall\RGEBCK_00all.xml(16):
C:\Development\fmtall\TPall.xml(34):
C:\Development\fmtall\WCN1all.xml(39):
C:\Development\fmtall\WCN2all.xml(38):
C:\Development\fmtall\WEP2all.xml(35):
C:\Development\fmtall\WEPSAM2all.xml(25):
C:\Development\fmtall\WEPSAMGall.xml(25):
C:\Development\fmtall\WPSall.xml(31):
C:\Development\fmtall\WPSARPall.xml(59):
C:\Development\fmtall\WPSBCK_00all.xml(61):
C:\Development\fmtall\WPSDOMall.xml(40):
C:\Development\fmtall\WPSOPall.xml(56):
C:\Development\fmtall\wst1all.xml(44):
C:\Development\fmtall\wst2all.xml(28):
C:\Development\fmtall\wstalrall.xml(28):
----------------------------------------
Find 'cancelsection title (true by default) defined on docstyle
C:\Development\fmtall\AEPall.xml(371):
C:\Development\fmtall\AEPAPPRall.xml(227):
C:\Development\fmtall\AEPCHIDall.xml(385):
C:\Development\fmtall\AEPCHID_00all.xml(206):
C:\Development\fmtall\AEPDEVall.xml(234):
C:\Development\fmtall\AEP_00all.xml(206): and other subformats
C:\Development\fmtall\BASEall.xml(505):
C:\Development\fmtall\BGEALNall.xml(371):
C:\Development\fmtall\BGEEOPall.xml(519):
C:\Development\fmtall\BGEEOP_00all.xml(164):
C:\Development\fmtall\BGEOI_00all.xml(314):
C:\Development\fmtall\BGESTPall.xml(590):
C:\Development\fmtall\BGEVLall.xml(328):
C:\Development\fmtall\CAL1all.xml(473):
C:\Development\fmtall\CAL2all.xml(403):
C:\Development\fmtall\CAL2_00all.xml(266):
C:\Development\fmtall\CALBCKall.xml(287):
C:\Development\fmtall\CALOTOall.xml(392):
C:\Development\fmtall\CATADEVall.xml(211):
C:\Development\fmtall\CATall.xml(313):
C:\Development\fmtall\CATBOXall.xml(313):
C:\Development\fmtall\CATDEVall.xml(181):
C:\Development\fmtall\CATEBCKall.xml(237):
C:\Development\fmtall\CPBCK2all.xml(286):
C:\Development\fmtall\CPBCKall.xml(366):
C:\Development\fmtall\CPBCK_00all.xml(188): & other sub
C:\Development\fmtall\CPLAall.xml(258):
C:\Development\fmtall\CPLall.xml(340):
C:\Development\fmtall\CPLRDEVall.xml(173):
C:\Development\fmtall\CPLS2all.xml(333):
C:\Development\fmtall\CPLSall.xml(331):
C:\Development\fmtall\CPLSDEVall.xml(202):
C:\Development\fmtall\CPLSSDDall.xml(319):
C:\Development\fmtall\CPLSSUMall.xml(193):
C:\Development\fmtall\CPL_00all.xml(253): & other sub
C:\Development\fmtall\CWEall.xml(387):
C:\Development\fmtall\CWEDEVall.xml(161):
C:\Development\fmtall\CWERall.xml(371):
C:\Development\fmtall\CWER_00all.xml(199): & other sub
C:\Development\fmtall\EBCKall.xml(231):
C:\Development\fmtall\ELFDEVall.xml(221):
C:\Development\fmtall\ENall.xml(242):
C:\Development\fmtall\ESFDEVall.xml(211):
C:\Development\fmtall\EXCLNall.xml(390):
C:\Development\fmtall\EXCLN_00all.xml(206): & other sub
C:\Development\fmtall\EXEBCKall.xml(270):
C:\Development\fmtall\EXEBCK_00all.xml(163):
C:\Development\fmtall\EXEDEVall.xml(221):
C:\Development\fmtall\FNPall.xml(359):
C:\Development\fmtall\FNPCASall.xml(110):
C:\Development\fmtall\FNPDEVall.xml(303):
C:\Development\fmtall\FNPDEVall.xml(337):
C:\Development\fmtall\FNPEBKall.xml(244):
C:\Development\fmtall\FNP_00all.xml(152): & other sub
C:\Development\fmtall\FPLall.xml(328):
C:\Development\fmtall\FPLBCKall.xml(297):
C:\Development\fmtall\GENall.xml(377):
C:\Development\fmtall\GENDEVall.xml(161):
C:\Development\fmtall\GENPLANall.xml(175):
C:\Development\fmtall\GPCAall.xml(307):
C:\Development\fmtall\GPCall.xml(301):
C:\Development\fmtall\GPCA_00all.xml(179):
C:\Development\fmtall\HLPall.xml(537):
C:\Development\fmtall\HLPDEVall.xml(255):
C:\Development\fmtall\IP2all.xml(254):
C:\Development\fmtall\IP2BCKall.xml(290):
C:\Development\fmtall\IP2DEVall.xml(171):
C:\Development\fmtall\IP2_00all.xml(169): and sub
C:\Development\fmtall\IP3all.xml(192):
C:\Development\fmtall\IP3DEVall.xml(171):
C:\Development\fmtall\IP3DEV_00all.xml(235):
C:\Development\fmtall\IP3_00all.xml(264): & sub
C:\Development\fmtall\MAINGall.xml(154):
C:\Development\fmtall\MCGall.xml(346):
C:\Development\fmtall\MCGBOXall.xml(346):
C:\Development\fmtall\MCGDEVall.xml(181):
C:\Development\fmtall\MCGEBCKall.xml(234):
C:\Development\fmtall\NSPABall.xml(358):
C:\Development\fmtall\NSPAB_00all.xml(206): & sub
C:\Development\fmtall\NSPall.xml(318):
C:\Development\fmtall\NSPARPall.xml(394):
C:\Development\fmtall\NSPARP_00all.xml(271):
C:\Development\fmtall\NSPBCKall.xml(198):
C:\Development\fmtall\NSPDEVall.xml(178):
C:\Development\fmtall\NSPEDEVall.xml(229):
C:\Development\fmtall\NSPFCall.xml(262):
C:\Development\fmtall\NSPIFG2all.xml(289):
C:\Development\fmtall\NSPIFGall.xml(289):
C:\Development\fmtall\NSPIFG_00all.xml(188):
C:\Development\fmtall\NSPPEall.xml(265):
C:\Development\fmtall\NSPSAMall.xml(291):
C:\Development\fmtall\NSPWGall.xml(143):
C:\Development\fmtall\NSP_00all.xml(144):
C:\Development\fmtall\OHLPall.xml(313):
C:\Development\fmtall\OHLPall.xml(360):
C:\Development\fmtall\RGEall.xml(257):
C:\Development\fmtall\RGEBCKall.xml(253):
C:\Development\fmtall\RGEBCK_00all.xml(196):
C:\Development\fmtall\RGEDEVall.xml(177):
C:\Development\fmtall\RGESAM1all.xml(242):
C:\Development\fmtall\RGESAM2all.xml(211):
C:\Development\fmtall\RGESMPEall.xml(176):
C:\Development\fmtall\ROBall.xml(382):
C:\Development\fmtall\ROB_00all.xml(270): & other sub
C:\Development\fmtall\SETDEVall.xml(168):
C:\Development\fmtall\SHEall.xml(413):
C:\Development\fmtall\SHEDEVall.xml(208):
C:\Development\fmtall\SHERVSUall.xml(206):
C:\Development\fmtall\SHESSDall.xml(261):
C:\Development\fmtall\SHESSD_00all.xml(111):
C:\Development\fmtall\TPall.xml(445):
C:\Development\fmtall\TPBCK2all.xml(286):
C:\Development\fmtall\TPBCKall.xml(367):
C:\Development\fmtall\TPBCK_00all.xml(188): & sub
C:\Development\fmtall\TP_00all.xml(173):
C:\Development\fmtall\TUECABNall.xml(351):
C:\Development\fmtall\TUECall.xml(311):
C:\Development\fmtall\TUECDEVall.xml(179):
C:\Development\fmtall\VLNCASall.xml(120):
C:\Development\fmtall\WCN1all.xml(473):
C:\Development\fmtall\WCN1all.xml(504):
C:\Development\fmtall\WCN2all.xml(409):
C:\Development\fmtall\WCNBCKall.xml(309):
C:\Development\fmtall\WCNCKLall.xml(316):
C:\Development\fmtall\WCNCLBall.xml(230):
C:\Development\fmtall\WCNDEVall.xml(198):
C:\Development\fmtall\WCNOFBall.xml(301):
C:\Development\fmtall\WEP2all.xml(529):
C:\Development\fmtall\WEPBCKall.xml(432):
C:\Development\fmtall\WEPENBall.xml(369):
C:\Development\fmtall\WEPENB_00all.xml(181): & other
C:\Development\fmtall\WEPSAM2all.xml(518):
C:\Development\fmtall\WEPSAMGall.xml(375):
C:\Development\fmtall\WPBAall.xml(232):
C:\Development\fmtall\WPBall.xml(237):
C:\Development\fmtall\WPB_20all.xml(340): & sub
C:\Development\fmtall\WPSall.xml(392):
C:\Development\fmtall\WPSARPall.xml(365):
C:\Development\fmtall\WPSARP_00all.xml(244):
C:\Development\fmtall\WPSBCKall.xml(360):
C:\Development\fmtall\WPSBCK_00all.xml(268):
C:\Development\fmtall\WPSDEVall.xml(181):
C:\Development\fmtall\WPSDOMall.xml(321):
C:\Development\fmtall\WPSDOM_00all.xml(421): & sub
C:\Development\fmtall\WPSOPall.xml(450): & sub
C:\Development\fmtall\WPSSAMGall.xml(331):
C:\Development\fmtall\WPS_00all.xml(159): & sub
C:\Development\fmtall\wst1all.xml(604):
C:\Development\fmtall\wst2all.xml(511):
C:\Development\fmtall\wstalrall.xml(415):
C:\Development\fmtall\wstcklall.xml(322):
C:\Development\fmtall\backup\WCN2all.xml(407):
Find 'tietabtolevel' (looks like this just determines a different tabstyle, xoffset & width for tabs/text,
used for metasections, uses section number as part of tab)
C:\Development\fmtall\CAL1all.xml(39):
C:\Development\fmtall\RGEBCK_00all.xml(16):
C:\Development\fmtall\WCN1all.xml(39):
C:\Development\fmtall\wst1all.xml(44):
-18
View File
@@ -1,18 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" encoding="utf-8" omit-xml-declaration="yes" indent="yes" />
<xsl:strip-space elements="*" />
<xsl:template match="*">
<xsl:if test="count(@*) &gt; 0 or count(node()) &gt; 0">
<xsl:copy>
<xsl:apply-templates select="@* | node()" />
</xsl:copy>
</xsl:if>
</xsl:template>
<xsl:template match="@UseCheckOffsIn"/> <!--remove UseCheckOffsIn attribute, moved to docstyle -->
<xsl:template match="@* | text() | processing-instruction()">
<xsl:copy />
</xsl:template>
</xsl:stylesheet>
-17
View File
@@ -1,17 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" encoding="utf-8" omit-xml-declaration="yes" indent="yes" />
<xsl:strip-space elements="*" />
<xsl:template match="*">
<xsl:if test="count(@*) &gt; 0 or count(node()) &gt; 0">
<xsl:copy>
<xsl:apply-templates select="@* | node()" />
</xsl:copy>
</xsl:if>
</xsl:template>
<xsl:template match="@* | text() | processing-instruction()">
<xsl:copy />
</xsl:template>
</xsl:stylesheet>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.