This commit is contained in:
parent
59cfbbea6c
commit
ea8ada7cd9
@ -1,122 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
|
||||
namespace Sync
|
||||
{
|
||||
class FileCompare
|
||||
{
|
||||
private FileInfo _Developement;
|
||||
private FileInfo _SourceSafe;
|
||||
private bool _ToProcess = false;
|
||||
public bool ToProcess
|
||||
{
|
||||
get { return _ToProcess; }
|
||||
set { _ToProcess = value; }
|
||||
}
|
||||
public string FileName
|
||||
{
|
||||
get { return _Developement.FullName; }
|
||||
}
|
||||
public Nullable<DateTime> DevModified
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_Developement.Exists)
|
||||
return _Developement.LastWriteTime;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
public Nullable<DateTime> SSModified
|
||||
{
|
||||
get
|
||||
{
|
||||
if(_SourceSafe.Exists)
|
||||
return _SourceSafe.LastWriteTime;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
private bool _Different;
|
||||
public bool Different
|
||||
{
|
||||
get { return _Different; }
|
||||
}
|
||||
public string SSFileName
|
||||
{
|
||||
get { return _SourceSafe.FullName; }
|
||||
}
|
||||
public FileCompare(FileInfo development, FileInfo sourceSafe)
|
||||
{
|
||||
_Developement = development;
|
||||
_SourceSafe = sourceSafe;
|
||||
_Different = DifferentContents(development, sourceSafe);
|
||||
_ToProcess = _Different;
|
||||
}
|
||||
public static bool DifferentContents(FileInfo development, FileInfo sourceSafe)
|
||||
{
|
||||
string strDev =ReadFile(development);
|
||||
string strSS = ReadFile(sourceSafe);
|
||||
return strDev != strSS;
|
||||
}
|
||||
private static string ReadFile(FileInfo fi)
|
||||
{
|
||||
if (fi.Exists == false) return "";
|
||||
TextReader tr = fi.OpenText();
|
||||
string retval = tr.ReadToEnd();
|
||||
tr.Close();
|
||||
return retval;
|
||||
}
|
||||
public void MoveToDevelopment()
|
||||
{
|
||||
//if (_Developement.Attributes & FileAttributes.ReadOnly == FileAttributes.ReadOnly)
|
||||
if (_Developement.Exists) _Developement.Attributes &= (_Developement.Attributes ^ FileAttributes.ReadOnly);
|
||||
BuildFolder(_Developement.Directory);
|
||||
if(_SourceSafe.Exists)_SourceSafe.CopyTo(_Developement.FullName , true);
|
||||
}
|
||||
public void MoveDevToMailBox(string devFolder, string mailboxFolder)
|
||||
{
|
||||
if (ToProcess)
|
||||
{
|
||||
FileInfo fi1 = new FileInfo(_Developement.FullName.Replace(devFolder, mailboxFolder));
|
||||
BuildFolder(fi1.Directory);
|
||||
if(_Developement.Exists)_Developement.CopyTo(fi1.FullName,true);
|
||||
}
|
||||
}
|
||||
public void MoveMailBoxToDev(string devFolder, string mailboxFolder)
|
||||
{
|
||||
if (ToProcess)
|
||||
{
|
||||
FileInfo fi1 = new FileInfo(_Developement.FullName.Replace(devFolder, mailboxFolder));
|
||||
BuildFolder(_Developement.Directory);
|
||||
fi1.CopyTo(_Developement.FullName, true);
|
||||
}
|
||||
}
|
||||
public void MoveSSToMailBox(string SSFolder, string mailboxFolder)
|
||||
{
|
||||
if (ToProcess)
|
||||
{
|
||||
FileInfo fi1 = new FileInfo(_SourceSafe.FullName.Replace(SSFolder, mailboxFolder));
|
||||
BuildFolder(fi1.Directory);
|
||||
if(_SourceSafe.Exists) _SourceSafe.CopyTo(fi1.FullName, true);
|
||||
}
|
||||
}
|
||||
public void MoveMailBoxToSS(string SSFolder, string mailboxFolder)
|
||||
{
|
||||
if (ToProcess)
|
||||
{
|
||||
FileInfo fi1 = new FileInfo(_SourceSafe.FullName.Replace(SSFolder, mailboxFolder));
|
||||
BuildFolder(fi1.Directory);
|
||||
if(fi1.Exists)fi1.CopyTo(_SourceSafe.FullName, true);
|
||||
}
|
||||
}
|
||||
private static void BuildFolder(DirectoryInfo directoryInfo)
|
||||
{
|
||||
if (!directoryInfo.Exists)
|
||||
{
|
||||
BuildFolder(directoryInfo.Parent);
|
||||
directoryInfo.Create();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,430 +0,0 @@
|
||||
namespace Sync
|
||||
{
|
||||
partial class frmSync
|
||||
{
|
||||
/// <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.components = new System.ComponentModel.Container();
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmSync));
|
||||
this.panel1 = new System.Windows.Forms.Panel();
|
||||
this.btnBrwsSSMail = new System.Windows.Forms.Button();
|
||||
this.tbSSMailBox = new System.Windows.Forms.TextBox();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.btnBrwsMail = new System.Windows.Forms.Button();
|
||||
this.tbMailBox = new System.Windows.Forms.TextBox();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.btnBrwsSS = new System.Windows.Forms.Button();
|
||||
this.tbSourceSafe = new System.Windows.Forms.TextBox();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.btnBrwsDev = new System.Windows.Forms.Button();
|
||||
this.tbDevelopment = new System.Windows.Forms.TextBox();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.fbd = new System.Windows.Forms.FolderBrowserDialog();
|
||||
this.dgv = new System.Windows.Forms.DataGridView();
|
||||
this.cms = new System.Windows.Forms.ContextMenuStrip(this.components);
|
||||
this.compareToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.restoreToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
|
||||
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
|
||||
this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.mailboxToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.clearToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.buildToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.findToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.checkedOutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.differentToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.contentDifferentToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.sourceSafeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.restoreUnchangedToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.restoreSelectedToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.restoreAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.panel1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.dgv)).BeginInit();
|
||||
this.cms.SuspendLayout();
|
||||
this.menuStrip1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// panel1
|
||||
//
|
||||
this.panel1.Controls.Add(this.btnBrwsSSMail);
|
||||
this.panel1.Controls.Add(this.tbSSMailBox);
|
||||
this.panel1.Controls.Add(this.label4);
|
||||
this.panel1.Controls.Add(this.btnBrwsMail);
|
||||
this.panel1.Controls.Add(this.tbMailBox);
|
||||
this.panel1.Controls.Add(this.label3);
|
||||
this.panel1.Controls.Add(this.btnBrwsSS);
|
||||
this.panel1.Controls.Add(this.tbSourceSafe);
|
||||
this.panel1.Controls.Add(this.label2);
|
||||
this.panel1.Controls.Add(this.btnBrwsDev);
|
||||
this.panel1.Controls.Add(this.tbDevelopment);
|
||||
this.panel1.Controls.Add(this.label1);
|
||||
this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.panel1.Location = new System.Drawing.Point(0, 24);
|
||||
this.panel1.Name = "panel1";
|
||||
this.panel1.Size = new System.Drawing.Size(759, 117);
|
||||
this.panel1.TabIndex = 1;
|
||||
//
|
||||
// btnBrwsSSMail
|
||||
//
|
||||
this.btnBrwsSSMail.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.btnBrwsSSMail.Location = new System.Drawing.Point(672, 86);
|
||||
this.btnBrwsSSMail.Name = "btnBrwsSSMail";
|
||||
this.btnBrwsSSMail.Size = new System.Drawing.Size(75, 23);
|
||||
this.btnBrwsSSMail.TabIndex = 14;
|
||||
this.btnBrwsSSMail.Text = "Browse...";
|
||||
this.btnBrwsSSMail.UseVisualStyleBackColor = true;
|
||||
this.btnBrwsSSMail.Click += new System.EventHandler(this.btnBrowse_Click);
|
||||
//
|
||||
// tbSSMailBox
|
||||
//
|
||||
this.tbSSMailBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.tbSSMailBox.Location = new System.Drawing.Point(120, 88);
|
||||
this.tbSSMailBox.Name = "tbSSMailBox";
|
||||
this.tbSSMailBox.Size = new System.Drawing.Size(546, 20);
|
||||
this.tbSSMailBox.TabIndex = 13;
|
||||
this.tbSSMailBox.Text = "E:\\Mailbox\\SourceSafe\\Proms";
|
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.Location = new System.Drawing.Point(12, 91);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(92, 13);
|
||||
this.label4.TabIndex = 12;
|
||||
this.label4.Text = "SS Mailbox Folder";
|
||||
//
|
||||
// btnBrwsMail
|
||||
//
|
||||
this.btnBrwsMail.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.btnBrwsMail.Location = new System.Drawing.Point(672, 60);
|
||||
this.btnBrwsMail.Name = "btnBrwsMail";
|
||||
this.btnBrwsMail.Size = new System.Drawing.Size(75, 23);
|
||||
this.btnBrwsMail.TabIndex = 8;
|
||||
this.btnBrwsMail.Text = "Browse...";
|
||||
this.btnBrwsMail.UseVisualStyleBackColor = true;
|
||||
this.btnBrwsMail.Click += new System.EventHandler(this.btnBrowse_Click);
|
||||
//
|
||||
// tbMailBox
|
||||
//
|
||||
this.tbMailBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.tbMailBox.Location = new System.Drawing.Point(120, 62);
|
||||
this.tbMailBox.Name = "tbMailBox";
|
||||
this.tbMailBox.Size = new System.Drawing.Size(546, 20);
|
||||
this.tbMailBox.TabIndex = 7;
|
||||
this.tbMailBox.Text = "E:\\Mailbox\\Proms";
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(12, 65);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(75, 13);
|
||||
this.label3.TabIndex = 6;
|
||||
this.label3.Text = "Mailbox Folder";
|
||||
//
|
||||
// btnBrwsSS
|
||||
//
|
||||
this.btnBrwsSS.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.btnBrwsSS.Location = new System.Drawing.Point(672, 34);
|
||||
this.btnBrwsSS.Name = "btnBrwsSS";
|
||||
this.btnBrwsSS.Size = new System.Drawing.Size(75, 23);
|
||||
this.btnBrwsSS.TabIndex = 5;
|
||||
this.btnBrwsSS.Text = "Browse...";
|
||||
this.btnBrwsSS.UseVisualStyleBackColor = true;
|
||||
this.btnBrwsSS.Click += new System.EventHandler(this.btnBrowse_Click);
|
||||
//
|
||||
// tbSourceSafe
|
||||
//
|
||||
this.tbSourceSafe.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.tbSourceSafe.Location = new System.Drawing.Point(120, 36);
|
||||
this.tbSourceSafe.Name = "tbSourceSafe";
|
||||
this.tbSourceSafe.Size = new System.Drawing.Size(546, 20);
|
||||
this.tbSourceSafe.TabIndex = 4;
|
||||
this.tbSourceSafe.Text = "E:\\SourceSafe\\Proms";
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(12, 39);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(98, 13);
|
||||
this.label2.TabIndex = 3;
|
||||
this.label2.Text = "Source Safe Folder";
|
||||
//
|
||||
// btnBrwsDev
|
||||
//
|
||||
this.btnBrwsDev.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.btnBrwsDev.Location = new System.Drawing.Point(672, 8);
|
||||
this.btnBrwsDev.Name = "btnBrwsDev";
|
||||
this.btnBrwsDev.Size = new System.Drawing.Size(75, 23);
|
||||
this.btnBrwsDev.TabIndex = 2;
|
||||
this.btnBrwsDev.Text = "Browse...";
|
||||
this.btnBrwsDev.UseVisualStyleBackColor = true;
|
||||
this.btnBrwsDev.Click += new System.EventHandler(this.btnBrowse_Click);
|
||||
//
|
||||
// tbDevelopment
|
||||
//
|
||||
this.tbDevelopment.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.tbDevelopment.Location = new System.Drawing.Point(120, 10);
|
||||
this.tbDevelopment.Name = "tbDevelopment";
|
||||
this.tbDevelopment.Size = new System.Drawing.Size(546, 20);
|
||||
this.tbDevelopment.TabIndex = 1;
|
||||
this.tbDevelopment.Text = "E:\\Proms";
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(12, 13);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(102, 13);
|
||||
this.label1.TabIndex = 0;
|
||||
this.label1.Text = "Development Folder";
|
||||
//
|
||||
// dgv
|
||||
//
|
||||
this.dgv.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
this.dgv.ContextMenuStrip = this.cms;
|
||||
this.dgv.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.dgv.Location = new System.Drawing.Point(0, 141);
|
||||
this.dgv.Name = "dgv";
|
||||
this.dgv.Size = new System.Drawing.Size(759, 283);
|
||||
this.dgv.TabIndex = 2;
|
||||
this.dgv.ColumnWidthChanged += new System.Windows.Forms.DataGridViewColumnEventHandler(this.dgv_ColumnWidthChanged);
|
||||
//
|
||||
// cms
|
||||
//
|
||||
this.cms.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.compareToolStripMenuItem,
|
||||
this.restoreToolStripMenuItem});
|
||||
this.cms.Name = "cms";
|
||||
this.cms.Size = new System.Drawing.Size(124, 48);
|
||||
//
|
||||
// compareToolStripMenuItem
|
||||
//
|
||||
this.compareToolStripMenuItem.Name = "compareToolStripMenuItem";
|
||||
this.compareToolStripMenuItem.Size = new System.Drawing.Size(123, 22);
|
||||
this.compareToolStripMenuItem.Text = "Compare";
|
||||
this.compareToolStripMenuItem.Click += new System.EventHandler(this.compareToolStripMenuItem_Click);
|
||||
//
|
||||
// restoreToolStripMenuItem
|
||||
//
|
||||
this.restoreToolStripMenuItem.Name = "restoreToolStripMenuItem";
|
||||
this.restoreToolStripMenuItem.Size = new System.Drawing.Size(123, 22);
|
||||
this.restoreToolStripMenuItem.Text = "Restore";
|
||||
this.restoreToolStripMenuItem.Click += new System.EventHandler(this.restoreToolStripMenuItem_Click);
|
||||
//
|
||||
// statusStrip1
|
||||
//
|
||||
this.statusStrip1.Location = new System.Drawing.Point(0, 424);
|
||||
this.statusStrip1.Name = "statusStrip1";
|
||||
this.statusStrip1.Size = new System.Drawing.Size(759, 22);
|
||||
this.statusStrip1.TabIndex = 3;
|
||||
this.statusStrip1.Text = "statusStrip1";
|
||||
//
|
||||
// menuStrip1
|
||||
//
|
||||
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.fileToolStripMenuItem,
|
||||
this.mailboxToolStripMenuItem,
|
||||
this.findToolStripMenuItem,
|
||||
this.sourceSafeToolStripMenuItem});
|
||||
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
|
||||
this.menuStrip1.Name = "menuStrip1";
|
||||
this.menuStrip1.Size = new System.Drawing.Size(759, 24);
|
||||
this.menuStrip1.TabIndex = 4;
|
||||
this.menuStrip1.Text = "menuStrip1";
|
||||
//
|
||||
// fileToolStripMenuItem
|
||||
//
|
||||
this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.exitToolStripMenuItem});
|
||||
this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
|
||||
this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20);
|
||||
this.fileToolStripMenuItem.Text = "&File";
|
||||
//
|
||||
// exitToolStripMenuItem
|
||||
//
|
||||
this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
|
||||
this.exitToolStripMenuItem.Size = new System.Drawing.Size(92, 22);
|
||||
this.exitToolStripMenuItem.Text = "E&xit";
|
||||
this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click);
|
||||
//
|
||||
// mailboxToolStripMenuItem
|
||||
//
|
||||
this.mailboxToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.clearToolStripMenuItem,
|
||||
this.buildToolStripMenuItem});
|
||||
this.mailboxToolStripMenuItem.Name = "mailboxToolStripMenuItem";
|
||||
this.mailboxToolStripMenuItem.Size = new System.Drawing.Size(61, 20);
|
||||
this.mailboxToolStripMenuItem.Text = "Mailbox";
|
||||
//
|
||||
// clearToolStripMenuItem
|
||||
//
|
||||
this.clearToolStripMenuItem.Name = "clearToolStripMenuItem";
|
||||
this.clearToolStripMenuItem.Size = new System.Drawing.Size(101, 22);
|
||||
this.clearToolStripMenuItem.Text = "Clear";
|
||||
this.clearToolStripMenuItem.Click += new System.EventHandler(this.clearToolStripMenuItem_Click);
|
||||
//
|
||||
// buildToolStripMenuItem
|
||||
//
|
||||
this.buildToolStripMenuItem.Name = "buildToolStripMenuItem";
|
||||
this.buildToolStripMenuItem.Size = new System.Drawing.Size(101, 22);
|
||||
this.buildToolStripMenuItem.Text = "Build";
|
||||
this.buildToolStripMenuItem.Click += new System.EventHandler(this.buildToolStripMenuItem_Click);
|
||||
//
|
||||
// findToolStripMenuItem
|
||||
//
|
||||
this.findToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.checkedOutToolStripMenuItem,
|
||||
this.differentToolStripMenuItem,
|
||||
this.contentDifferentToolStripMenuItem});
|
||||
this.findToolStripMenuItem.Name = "findToolStripMenuItem";
|
||||
this.findToolStripMenuItem.Size = new System.Drawing.Size(42, 20);
|
||||
this.findToolStripMenuItem.Text = "Find";
|
||||
//
|
||||
// checkedOutToolStripMenuItem
|
||||
//
|
||||
this.checkedOutToolStripMenuItem.Name = "checkedOutToolStripMenuItem";
|
||||
this.checkedOutToolStripMenuItem.Size = new System.Drawing.Size(166, 22);
|
||||
this.checkedOutToolStripMenuItem.Text = "Checked-Out";
|
||||
this.checkedOutToolStripMenuItem.Click += new System.EventHandler(this.checkedOutToolStripMenuItem_Click);
|
||||
//
|
||||
// differentToolStripMenuItem
|
||||
//
|
||||
this.differentToolStripMenuItem.Name = "differentToolStripMenuItem";
|
||||
this.differentToolStripMenuItem.Size = new System.Drawing.Size(166, 22);
|
||||
this.differentToolStripMenuItem.Text = "Different";
|
||||
this.differentToolStripMenuItem.Click += new System.EventHandler(this.differentToolStripMenuItem_Click);
|
||||
//
|
||||
// contentDifferentToolStripMenuItem
|
||||
//
|
||||
this.contentDifferentToolStripMenuItem.Name = "contentDifferentToolStripMenuItem";
|
||||
this.contentDifferentToolStripMenuItem.Size = new System.Drawing.Size(166, 22);
|
||||
this.contentDifferentToolStripMenuItem.Text = "Content Different";
|
||||
this.contentDifferentToolStripMenuItem.Click += new System.EventHandler(this.contentDifferentToolStripMenuItem_Click);
|
||||
//
|
||||
// sourceSafeToolStripMenuItem
|
||||
//
|
||||
this.sourceSafeToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.restoreUnchangedToolStripMenuItem,
|
||||
this.restoreSelectedToolStripMenuItem,
|
||||
this.restoreAllToolStripMenuItem});
|
||||
this.sourceSafeToolStripMenuItem.Name = "sourceSafeToolStripMenuItem";
|
||||
this.sourceSafeToolStripMenuItem.Size = new System.Drawing.Size(80, 20);
|
||||
this.sourceSafeToolStripMenuItem.Text = "Source Safe";
|
||||
//
|
||||
// restoreUnchangedToolStripMenuItem
|
||||
//
|
||||
this.restoreUnchangedToolStripMenuItem.Name = "restoreUnchangedToolStripMenuItem";
|
||||
this.restoreUnchangedToolStripMenuItem.Size = new System.Drawing.Size(228, 22);
|
||||
this.restoreUnchangedToolStripMenuItem.Text = "Restore Unchanged";
|
||||
this.restoreUnchangedToolStripMenuItem.Click += new System.EventHandler(this.restoreUnchangedToolStripMenuItem_Click);
|
||||
//
|
||||
// restoreSelectedToolStripMenuItem
|
||||
//
|
||||
this.restoreSelectedToolStripMenuItem.Name = "restoreSelectedToolStripMenuItem";
|
||||
this.restoreSelectedToolStripMenuItem.Size = new System.Drawing.Size(228, 22);
|
||||
this.restoreSelectedToolStripMenuItem.Text = "Restore Selected (To Process)";
|
||||
this.restoreSelectedToolStripMenuItem.Click += new System.EventHandler(this.restoreSelectedToolStripMenuItem_Click);
|
||||
//
|
||||
// restoreAllToolStripMenuItem
|
||||
//
|
||||
this.restoreAllToolStripMenuItem.Name = "restoreAllToolStripMenuItem";
|
||||
this.restoreAllToolStripMenuItem.Size = new System.Drawing.Size(228, 22);
|
||||
this.restoreAllToolStripMenuItem.Text = "Restore All";
|
||||
this.restoreAllToolStripMenuItem.Click += new System.EventHandler(this.restoreAllToolStripMenuItem_Click);
|
||||
//
|
||||
// frmSync
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(759, 446);
|
||||
this.Controls.Add(this.dgv);
|
||||
this.Controls.Add(this.panel1);
|
||||
this.Controls.Add(this.statusStrip1);
|
||||
this.Controls.Add(this.menuStrip1);
|
||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||
this.MainMenuStrip = this.menuStrip1;
|
||||
this.Name = "frmSync";
|
||||
this.Text = "Volian Sync";
|
||||
this.Load += new System.EventHandler(this.frmSync_Load);
|
||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.frmSync_FormClosing);
|
||||
this.LocationChanged += new System.EventHandler(this.frmSync_LocationChanged);
|
||||
this.panel1.ResumeLayout(false);
|
||||
this.panel1.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.dgv)).EndInit();
|
||||
this.cms.ResumeLayout(false);
|
||||
this.menuStrip1.ResumeLayout(false);
|
||||
this.menuStrip1.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Panel panel1;
|
||||
private System.Windows.Forms.Button btnBrwsDev;
|
||||
private System.Windows.Forms.TextBox tbDevelopment;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Button btnBrwsMail;
|
||||
private System.Windows.Forms.TextBox tbMailBox;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.Button btnBrwsSS;
|
||||
private System.Windows.Forms.TextBox tbSourceSafe;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.FolderBrowserDialog fbd;
|
||||
private System.Windows.Forms.DataGridView dgv;
|
||||
private System.Windows.Forms.Button btnBrwsSSMail;
|
||||
private System.Windows.Forms.TextBox tbSSMailBox;
|
||||
private System.Windows.Forms.Label label4;
|
||||
private System.Windows.Forms.StatusStrip statusStrip1;
|
||||
private System.Windows.Forms.MenuStrip menuStrip1;
|
||||
private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem mailboxToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem clearToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem buildToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem findToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem checkedOutToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem differentToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem sourceSafeToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem restoreUnchangedToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem restoreSelectedToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem restoreAllToolStripMenuItem;
|
||||
private System.Windows.Forms.ContextMenuStrip cms;
|
||||
private System.Windows.Forms.ToolStripMenuItem compareToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem restoreToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem contentDifferentToolStripMenuItem;
|
||||
}
|
||||
}
|
||||
|
@ -1,377 +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.IO;
|
||||
using System.Xml;
|
||||
|
||||
|
||||
namespace Sync
|
||||
{
|
||||
public partial class frmSync : Form
|
||||
{
|
||||
private List<FileCompare> _CheckedOut;
|
||||
private bool IsLoading = false;
|
||||
public frmSync()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
private void LoadSettings()
|
||||
{
|
||||
if (Properties.Settings.Default["Location"] != null)
|
||||
Location = Properties.Settings.Default.Location;
|
||||
if (Properties.Settings.Default["Size"] != null)
|
||||
Size = Properties.Settings.Default.Size;
|
||||
if (Properties.Settings.Default.DevelopmentFolder != "")
|
||||
tbDevelopment.Text = Properties.Settings.Default.DevelopmentFolder;
|
||||
if (Properties.Settings.Default.SourceSafeFolder != "")
|
||||
tbSourceSafe.Text = Properties.Settings.Default.SourceSafeFolder;
|
||||
if(Properties.Settings.Default.MailBoxDevelopmentFolder != "")
|
||||
tbMailBox.Text = Properties.Settings.Default.MailBoxDevelopmentFolder;
|
||||
if (Properties.Settings.Default.MailBoxSourceSafeFolder != "")
|
||||
tbSSMailBox.Text = Properties.Settings.Default.MailBoxSourceSafeFolder;
|
||||
}
|
||||
private void frmSync_Load(object sender, EventArgs e)
|
||||
{
|
||||
LoadSettings();
|
||||
Setup();
|
||||
}
|
||||
private void Setup()
|
||||
{
|
||||
// Setup Browse Buttons
|
||||
btnBrwsDev.Tag = this.tbDevelopment;
|
||||
btnBrwsSS.Tag = this.tbSourceSafe;
|
||||
btnBrwsMail.Tag = this.tbMailBox;
|
||||
btnBrwsSSMail.Tag = this.tbSSMailBox;
|
||||
}
|
||||
private void btnBrowse_Click(object sender, EventArgs e)
|
||||
{
|
||||
TextBox tb = (TextBox)((Button)sender).Tag;
|
||||
fbd.SelectedPath = tb.Text;
|
||||
if (fbd.ShowDialog() == DialogResult.OK)
|
||||
tb.Text = fbd.SelectedPath;
|
||||
}
|
||||
private void ClearResults()
|
||||
{
|
||||
_CheckedOut = new List<FileCompare>();
|
||||
}
|
||||
private void FindCheckedOut(DirectoryInfo di)
|
||||
{
|
||||
FindCheckedOut(di.GetFiles());
|
||||
FindCheckedOut(di.GetDirectories());
|
||||
}
|
||||
private void FindCheckedOut(DirectoryInfo[] directoryInfoList)
|
||||
{
|
||||
foreach (DirectoryInfo di in directoryInfoList)
|
||||
FindCheckedOut(di);
|
||||
}
|
||||
private void FindCheckedOut(FileInfo[] fileInfoList)
|
||||
{
|
||||
foreach (FileInfo fi in fileInfoList)
|
||||
FindCheckedOut(fi);
|
||||
}
|
||||
private void FindCheckedOut(FileInfo fi)
|
||||
{
|
||||
if (fi.Name.ToLower().EndsWith("scc")) return;
|
||||
if (fi.Name.ToLower().EndsWith("sln")) return;
|
||||
if (fi.Name.ToLower().EndsWith("csproj"))
|
||||
{
|
||||
// Find files that have been added to the new Project
|
||||
List<string> compileList = GetCompileList(fi.FullName);
|
||||
FileInfo fi1csproj = new FileInfo(fi.FullName.Replace(tbSourceSafe.Text, tbDevelopment.Text));
|
||||
List<string> compileList1 = GetCompileList(fi1csproj.FullName);
|
||||
CompareLists(compileList, compileList1, fi, fi1csproj);
|
||||
return;
|
||||
}
|
||||
if (fi.Name.ToLower().EndsWith("licx")) return;
|
||||
FileInfo fi1 = new FileInfo(fi.FullName.Replace(tbSourceSafe.Text, tbDevelopment.Text));
|
||||
if ((fi1.Attributes & FileAttributes.ReadOnly) != FileAttributes.ReadOnly)
|
||||
AddToResults(fi, fi1);
|
||||
}
|
||||
|
||||
private void CompareLists(List<string> compileList, List<string> compileList1, FileInfo fi, FileInfo fi1)
|
||||
{
|
||||
// If anything is in compileList1 and not in CompileList add it to the results
|
||||
foreach (string filename in compileList1)
|
||||
if (!compileList.Contains(filename))
|
||||
AddToResults(fi, fi1, filename);
|
||||
}
|
||||
private void AddToResults(FileInfo fi, FileInfo fi1, string filename)
|
||||
{
|
||||
FileInfo newfi = new FileInfo(fi.DirectoryName + "/" + filename);
|
||||
FileInfo newfi1 = new FileInfo(fi1.DirectoryName + "/" + filename);
|
||||
if(!newfi.Exists)AddToResults(newfi, newfi1); // Only add if the file does not exist
|
||||
}
|
||||
private List<string> GetCompileList(string fileName)
|
||||
{
|
||||
List<string> retval = new List<string>();
|
||||
XmlDocument doc = new XmlDocument();
|
||||
doc.Load(fileName);
|
||||
XmlNamespaceManager nsmgr = new XmlNamespaceManager(doc.NameTable);
|
||||
foreach (XmlAttribute attrib in doc.DocumentElement.Attributes)
|
||||
if (attrib.Name == "xmlns")
|
||||
nsmgr.AddNamespace("ns", attrib.Value);
|
||||
XmlNodeList xl = doc.DocumentElement.SelectNodes(@"//ns:Compile/@Include",nsmgr);
|
||||
foreach (XmlAttribute xa in xl)
|
||||
retval.Add(xa.Value);
|
||||
return retval;
|
||||
}
|
||||
private void AddToResults(FileInfo fiSS,FileInfo fiDev)
|
||||
{
|
||||
FileCompare fc = new FileCompare(fiDev, fiSS);
|
||||
if(!_OnlyContentDifferent || (fc.Different && (fc.DevModified != null)))
|
||||
_CheckedOut.Add(fc);
|
||||
//if (tbResults.Text == "") tbResults.Text = "Found:";
|
||||
//tbResults.Text += "\r\n" + fiDev.FullName + " - " + ((fiDev.Attributes & FileAttributes.ReadOnly) != FileAttributes.ReadOnly ? "" : "ReadOnly");
|
||||
}
|
||||
private void ClearMailBox()
|
||||
{
|
||||
DeleteFolder(new DirectoryInfo(tbMailBox.Text));
|
||||
DeleteFolder(new DirectoryInfo(tbSSMailBox.Text));
|
||||
}
|
||||
private void DeleteFolder(DirectoryInfo directoryInfo)
|
||||
{
|
||||
if (directoryInfo.Exists)
|
||||
{
|
||||
AdjustAttributes(directoryInfo);
|
||||
directoryInfo.Delete(true);
|
||||
}
|
||||
}
|
||||
private void AdjustAttributes(DirectoryInfo directoryInfo)
|
||||
{
|
||||
foreach (DirectoryInfo di in directoryInfo.GetDirectories())
|
||||
AdjustAttributes(di);
|
||||
foreach (FileInfo fi in directoryInfo.GetFiles())
|
||||
AdjustAttribute(fi);
|
||||
}
|
||||
private void AdjustAttribute(FileInfo fi)
|
||||
{
|
||||
if ((fi.Attributes & FileAttributes.ReadOnly) == FileAttributes.ReadOnly)
|
||||
fi.Attributes = fi.Attributes ^ FileAttributes.ReadOnly;
|
||||
}
|
||||
private void frmSync_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
Properties.Settings.Default.Location = Location;
|
||||
Properties.Settings.Default.Size = Size;
|
||||
Properties.Settings.Default.DevelopmentFolder = tbDevelopment.Text;
|
||||
Properties.Settings.Default.SourceSafeFolder = tbSourceSafe.Text;
|
||||
Properties.Settings.Default.MailBoxDevelopmentFolder = tbMailBox.Text;
|
||||
Properties.Settings.Default.MailBoxSourceSafeFolder = tbSSMailBox.Text;
|
||||
Properties.Settings.Default.Save();
|
||||
}
|
||||
private void exitToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
private void clearToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
ClearMailBox();
|
||||
}
|
||||
private void buildToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
dgv.EndEdit();
|
||||
ClearMailBox();
|
||||
if (_CheckedOut == null)
|
||||
checkedOutToolStripMenuItem_Click(sender, e);
|
||||
foreach (FileCompare fc in _CheckedOut)
|
||||
{
|
||||
if (fc.ToProcess)
|
||||
{
|
||||
fc.MoveDevToMailBox(tbDevelopment.Text, tbMailBox.Text);
|
||||
fc.MoveSSToMailBox(tbSourceSafe.Text, tbSSMailBox.Text);
|
||||
}
|
||||
}
|
||||
}
|
||||
private void checkedOutToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
ClearResults();
|
||||
// Walk though Source Safe and check to see if the files in the Development folder are read-only
|
||||
FindCheckedOut(new DirectoryInfo(tbSourceSafe.Text));
|
||||
dgv.DataSource = _CheckedOut;
|
||||
SetColumnWidth();
|
||||
}
|
||||
private void syncAllToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
dgv.EndEdit();
|
||||
foreach (FileCompare fc in _CheckedOut)
|
||||
{
|
||||
fc.MoveToDevelopment();
|
||||
}
|
||||
}
|
||||
private void restoreUnchangedToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
dgv.EndEdit();
|
||||
foreach (FileCompare fc in _CheckedOut)
|
||||
{
|
||||
if(!fc.Different || fc.DevModified == null)
|
||||
fc.MoveToDevelopment();
|
||||
}
|
||||
}
|
||||
private void restoreSelectedToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
dgv.EndEdit();
|
||||
foreach (FileCompare fc in _CheckedOut)
|
||||
{
|
||||
if (fc.ToProcess) fc.MoveToDevelopment();
|
||||
}
|
||||
}
|
||||
private void restoreAllToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
dgv.EndEdit();
|
||||
foreach (FileCompare fc in _CheckedOut)
|
||||
{
|
||||
fc.MoveToDevelopment();
|
||||
}
|
||||
}
|
||||
private List<FileCompare> SelectedList
|
||||
{
|
||||
get
|
||||
{
|
||||
dgv.EndEdit();
|
||||
List<FileCompare> fcList = new List<FileCompare>();
|
||||
foreach (DataGridViewCell dgc in dgv.SelectedCells)
|
||||
{
|
||||
FileCompare fc = dgv.Rows[dgc.RowIndex].DataBoundItem as FileCompare;
|
||||
if (fc != null && fcList.Contains(fc) == false)
|
||||
fcList.Add(fc);
|
||||
}
|
||||
return fcList;
|
||||
}
|
||||
}
|
||||
private void compareToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
// This should launch UltraCompare with the two files
|
||||
// Which Item am I on
|
||||
List<FileCompare> fcList = SelectedList;
|
||||
foreach (FileCompare fc in fcList)
|
||||
{
|
||||
Console.WriteLine("Compare {0} and {1}", fc.FileName, fc.SSFileName);
|
||||
string cmd = string.Format("\"C:\\Program Files\\IDM Computer Solutions\\UltraCompare\\UC.exe\" -t \"{0}\" \"{1}\"", fc.FileName, fc.SSFileName);
|
||||
System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo(@"C:\Program Files\IDM Computer Solutions\UltraCompare\UC.exe",
|
||||
string.Format(@" -t ""{0}"" ""{1}""", fc.FileName, fc.SSFileName));
|
||||
System.Diagnostics.Process prc = System.Diagnostics.Process.Start(psi);
|
||||
}
|
||||
}
|
||||
private void restoreToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
List<FileCompare> fcList = SelectedList;
|
||||
foreach (FileCompare fc in fcList)
|
||||
{
|
||||
fc.MoveToDevelopment();
|
||||
}
|
||||
}
|
||||
private void differentToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
ClearResults();
|
||||
// Walk though Source Safe and check to see if the files in the Development folder are read-only
|
||||
FindDifferent(new DirectoryInfo(tbSourceSafe.Text));
|
||||
dgv.DataSource = _CheckedOut;
|
||||
SetColumnWidth();
|
||||
}
|
||||
private void SetColumnWidth()
|
||||
{
|
||||
IsLoading = true;
|
||||
if (Properties.Settings.Default["Widths"] == null)
|
||||
{
|
||||
dgv.Columns[0].Width = 60;
|
||||
dgv.Columns[1].Visible = false;
|
||||
dgv.Columns[2].Width = 125;
|
||||
dgv.Columns[3].Width = 125;
|
||||
dgv.Columns[4].Width = 50;
|
||||
dgv.Columns[5].Width = 500;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < Properties.Settings.Default.Widths.Count; i++)
|
||||
{
|
||||
string sWidth = Properties.Settings.Default.Widths[i];
|
||||
if (sWidth == "Invisible")
|
||||
dgv.Columns[i].Visible = false;
|
||||
else
|
||||
dgv.Columns[i].Width = int.Parse(sWidth);
|
||||
}
|
||||
}
|
||||
dgv.Columns[1].Visible = false;
|
||||
IsLoading = false;
|
||||
}
|
||||
private void FindDifferent(DirectoryInfo di)
|
||||
{
|
||||
FindDifferent(di.GetFiles());
|
||||
FindDifferent(di.GetDirectories());
|
||||
}
|
||||
private void FindDifferent(DirectoryInfo[] directoryInfoList)
|
||||
{
|
||||
foreach (DirectoryInfo di in directoryInfoList)
|
||||
FindDifferent(di);
|
||||
}
|
||||
private void FindDifferent(FileInfo[] fileInfoList)
|
||||
{
|
||||
foreach (FileInfo fi in fileInfoList)
|
||||
FindDifferent(fi);
|
||||
}
|
||||
private void FindDifferent(FileInfo fi)
|
||||
{
|
||||
if (fi.Name.ToLower().EndsWith("scc")) return;
|
||||
if (fi.Name.ToLower().EndsWith("sln")) return;
|
||||
if (fi.Name.ToLower().EndsWith("csproj"))
|
||||
{
|
||||
// Find files that have been added to the new Project
|
||||
List<string> compileList = GetCompileList(fi.FullName);
|
||||
FileInfo fi1csproj = new FileInfo(fi.FullName.Replace(tbSourceSafe.Text, tbDevelopment.Text));
|
||||
List<string> compileList1 = GetCompileList(fi1csproj.FullName);
|
||||
CompareLists(compileList, compileList1, fi, fi1csproj);
|
||||
return;
|
||||
}
|
||||
if (fi.Name.ToLower().EndsWith("licx")) return;
|
||||
FileInfo fiD = new FileInfo(fi.FullName.Replace(tbSourceSafe.Text, tbDevelopment.Text));
|
||||
FileInfo fiS = fi;
|
||||
// Only check Read-Only flag, other attributes are unimportant
|
||||
if (fiS.LastWriteTimeUtc != fiD.LastWriteTimeUtc || (fiS.Attributes & FileAttributes.ReadOnly ) != (fiD.Attributes & FileAttributes.ReadOnly ))
|
||||
AddToResults(fi, fiD);
|
||||
}
|
||||
private void dgv_ColumnWidthChanged(object sender, DataGridViewColumnEventArgs e)
|
||||
{
|
||||
if (!IsLoading)
|
||||
{
|
||||
System.Collections.Specialized.StringCollection widths = new System.Collections.Specialized.StringCollection();
|
||||
foreach (DataGridViewColumn col in dgv.Columns)
|
||||
widths.Add(col.Visible ? col.Width.ToString() : "Invisible");
|
||||
Properties.Settings.Default.Widths = widths;
|
||||
Properties.Settings.Default.Save();
|
||||
}
|
||||
}
|
||||
private bool _OnlyContentDifferent = false;
|
||||
private void contentDifferentToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
ClearResults();
|
||||
_OnlyContentDifferent = true;
|
||||
// Walk though Source Safe and check to see if the files in the Development folder are read-only
|
||||
FindDifferent(new DirectoryInfo(tbSourceSafe.Text));
|
||||
_OnlyContentDifferent = false;
|
||||
dgv.DataSource = _CheckedOut;
|
||||
SetColumnWidth();
|
||||
}
|
||||
private void frmSync_LocationChanged(object sender, EventArgs e)
|
||||
{
|
||||
Rectangle rec = Screen.GetWorkingArea(this);
|
||||
int newLeft = Left;
|
||||
int newTop = Top;
|
||||
if (Math.Abs(Left - rec.X) < 10) newLeft = rec.X;
|
||||
if (Math.Abs(Top - rec.Y) < 10) newTop = rec.Y;
|
||||
if (Math.Abs(rec.X + rec.Width - Right) < 10) newLeft = rec.X + rec.Width - Width;
|
||||
if (Math.Abs(rec.Y + rec.Height - Bottom) < 10) newTop = rec.Y + rec.Height - Height;
|
||||
if (newTop != Top || newLeft != Left)
|
||||
Location = new Point(newLeft, newTop);
|
||||
}
|
||||
private void restoreReadOnlyToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
foreach (FileCompare fc in _CheckedOut)
|
||||
{
|
||||
if (fc.ReadOnly) fc.MoveToDevelopment();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
609
PROMS/VEPROMS/PrintMSWord/frmAnalyze.Designer.cs
generated
Normal file
609
PROMS/VEPROMS/PrintMSWord/frmAnalyze.Designer.cs
generated
Normal file
@ -0,0 +1,609 @@
|
||||
namespace PrintMSWord
|
||||
{
|
||||
partial class frmAnalyze
|
||||
{
|
||||
/// <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.splitContainer1 = new System.Windows.Forms.SplitContainer();
|
||||
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
|
||||
this.lbDocVersion = new System.Windows.Forms.ListBox();
|
||||
this.lbProcedure = new System.Windows.Forms.ListBox();
|
||||
this.lbSections = new System.Windows.Forms.ListBox();
|
||||
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
|
||||
this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.proceduresToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.countToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.walkStepsToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.listSectionsToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.buldXMLToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.wordSectionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.countToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.walkStepsToolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.listSectionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.convertToPDFToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.countROsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.convertToPDFwithROsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.determineLengthToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.promsPrinterToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.oneSectionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.walkStepsToolStripMenuItem3 = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.pDFToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.listROsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.findROsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.determineLengthToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.promsPrinterToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.cleanupToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.closeAcrobatToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.removePDFsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.pDFMethodToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toPDFToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toPDF2003BGToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toPDF2003FGToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toPDF2007ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.rODataToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.getAllPlotsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.getAllFortranNumbersToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.getAllImagesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.typesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
|
||||
this.tsslStatus = new System.Windows.Forms.ToolStripStatusLabel();
|
||||
this.tbAdjust = new System.Windows.Forms.TextBox();
|
||||
this.tbAdjustX = new System.Windows.Forms.TextBox();
|
||||
this.tbAdjustY = new System.Windows.Forms.TextBox();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.splitContainer1.Panel1.SuspendLayout();
|
||||
this.splitContainer1.Panel2.SuspendLayout();
|
||||
this.splitContainer1.SuspendLayout();
|
||||
this.splitContainer2.Panel1.SuspendLayout();
|
||||
this.splitContainer2.Panel2.SuspendLayout();
|
||||
this.splitContainer2.SuspendLayout();
|
||||
this.menuStrip1.SuspendLayout();
|
||||
this.statusStrip1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// 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.splitContainer2);
|
||||
//
|
||||
// splitContainer1.Panel2
|
||||
//
|
||||
this.splitContainer1.Panel2.Controls.Add(this.lbSections);
|
||||
this.splitContainer1.Size = new System.Drawing.Size(690, 373);
|
||||
this.splitContainer1.SplitterDistance = 230;
|
||||
this.splitContainer1.TabIndex = 0;
|
||||
//
|
||||
// splitContainer2
|
||||
//
|
||||
this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.splitContainer2.Location = new System.Drawing.Point(0, 0);
|
||||
this.splitContainer2.Name = "splitContainer2";
|
||||
this.splitContainer2.Orientation = System.Windows.Forms.Orientation.Horizontal;
|
||||
//
|
||||
// splitContainer2.Panel1
|
||||
//
|
||||
this.splitContainer2.Panel1.Controls.Add(this.lbDocVersion);
|
||||
//
|
||||
// splitContainer2.Panel2
|
||||
//
|
||||
this.splitContainer2.Panel2.Controls.Add(this.lbProcedure);
|
||||
this.splitContainer2.Size = new System.Drawing.Size(230, 373);
|
||||
this.splitContainer2.SplitterDistance = 83;
|
||||
this.splitContainer2.TabIndex = 0;
|
||||
//
|
||||
// lbDocVersion
|
||||
//
|
||||
this.lbDocVersion.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.lbDocVersion.FormattingEnabled = true;
|
||||
this.lbDocVersion.Location = new System.Drawing.Point(0, 0);
|
||||
this.lbDocVersion.Name = "lbDocVersion";
|
||||
this.lbDocVersion.Size = new System.Drawing.Size(230, 82);
|
||||
this.lbDocVersion.TabIndex = 0;
|
||||
this.lbDocVersion.SelectedValueChanged += new System.EventHandler(this.lbDocVersion_SelectedValueChanged);
|
||||
//
|
||||
// lbProcedure
|
||||
//
|
||||
this.lbProcedure.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.lbProcedure.FormattingEnabled = true;
|
||||
this.lbProcedure.Location = new System.Drawing.Point(0, 0);
|
||||
this.lbProcedure.Name = "lbProcedure";
|
||||
this.lbProcedure.Size = new System.Drawing.Size(230, 277);
|
||||
this.lbProcedure.TabIndex = 0;
|
||||
this.lbProcedure.SelectedValueChanged += new System.EventHandler(this.lbProcedure_SelectedValueChanged);
|
||||
//
|
||||
// lbSections
|
||||
//
|
||||
this.lbSections.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.lbSections.FormattingEnabled = true;
|
||||
this.lbSections.Location = new System.Drawing.Point(0, 0);
|
||||
this.lbSections.Name = "lbSections";
|
||||
this.lbSections.Size = new System.Drawing.Size(456, 368);
|
||||
this.lbSections.TabIndex = 0;
|
||||
this.lbSections.DoubleClick += new System.EventHandler(this.lbSections_DoubleClick);
|
||||
//
|
||||
// menuStrip1
|
||||
//
|
||||
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.fileToolStripMenuItem,
|
||||
this.proceduresToolStripMenuItem1,
|
||||
this.wordSectionsToolStripMenuItem,
|
||||
this.oneSectionToolStripMenuItem,
|
||||
this.cleanupToolStripMenuItem,
|
||||
this.pDFMethodToolStripMenuItem,
|
||||
this.rODataToolStripMenuItem});
|
||||
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
|
||||
this.menuStrip1.Name = "menuStrip1";
|
||||
this.menuStrip1.Size = new System.Drawing.Size(690, 24);
|
||||
this.menuStrip1.TabIndex = 1;
|
||||
this.menuStrip1.Text = "menuStrip1";
|
||||
//
|
||||
// fileToolStripMenuItem
|
||||
//
|
||||
this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.exitToolStripMenuItem});
|
||||
this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
|
||||
this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20);
|
||||
this.fileToolStripMenuItem.Text = "&File";
|
||||
//
|
||||
// exitToolStripMenuItem
|
||||
//
|
||||
this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
|
||||
this.exitToolStripMenuItem.Size = new System.Drawing.Size(92, 22);
|
||||
this.exitToolStripMenuItem.Text = "E&xit";
|
||||
this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click);
|
||||
//
|
||||
// proceduresToolStripMenuItem1
|
||||
//
|
||||
this.proceduresToolStripMenuItem1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.countToolStripMenuItem1,
|
||||
this.walkStepsToolStripMenuItem1,
|
||||
this.listSectionsToolStripMenuItem1,
|
||||
this.buldXMLToolStripMenuItem});
|
||||
this.proceduresToolStripMenuItem1.Name = "proceduresToolStripMenuItem1";
|
||||
this.proceduresToolStripMenuItem1.Size = new System.Drawing.Size(78, 20);
|
||||
this.proceduresToolStripMenuItem1.Text = "Procedures";
|
||||
//
|
||||
// countToolStripMenuItem1
|
||||
//
|
||||
this.countToolStripMenuItem1.Name = "countToolStripMenuItem1";
|
||||
this.countToolStripMenuItem1.Size = new System.Drawing.Size(139, 22);
|
||||
this.countToolStripMenuItem1.Text = "Count";
|
||||
this.countToolStripMenuItem1.Click += new System.EventHandler(this.countToolStripMenuItem1_Click);
|
||||
//
|
||||
// walkStepsToolStripMenuItem1
|
||||
//
|
||||
this.walkStepsToolStripMenuItem1.Name = "walkStepsToolStripMenuItem1";
|
||||
this.walkStepsToolStripMenuItem1.Size = new System.Drawing.Size(139, 22);
|
||||
this.walkStepsToolStripMenuItem1.Text = "Walk Steps";
|
||||
this.walkStepsToolStripMenuItem1.Click += new System.EventHandler(this.walkStepsToolStripMenuItem1_Click);
|
||||
//
|
||||
// listSectionsToolStripMenuItem1
|
||||
//
|
||||
this.listSectionsToolStripMenuItem1.Name = "listSectionsToolStripMenuItem1";
|
||||
this.listSectionsToolStripMenuItem1.Size = new System.Drawing.Size(139, 22);
|
||||
this.listSectionsToolStripMenuItem1.Text = "List Sections";
|
||||
this.listSectionsToolStripMenuItem1.Click += new System.EventHandler(this.listSectionsToolStripMenuItem1_Click);
|
||||
//
|
||||
// buldXMLToolStripMenuItem
|
||||
//
|
||||
this.buldXMLToolStripMenuItem.Name = "buldXMLToolStripMenuItem";
|
||||
this.buldXMLToolStripMenuItem.Size = new System.Drawing.Size(139, 22);
|
||||
this.buldXMLToolStripMenuItem.Text = "BuldXML";
|
||||
this.buldXMLToolStripMenuItem.Click += new System.EventHandler(this.buldXMLToolStripMenuItem_Click);
|
||||
//
|
||||
// wordSectionsToolStripMenuItem
|
||||
//
|
||||
this.wordSectionsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.countToolStripMenuItem,
|
||||
this.walkStepsToolStripMenuItem2,
|
||||
this.listSectionsToolStripMenuItem,
|
||||
this.convertToPDFToolStripMenuItem,
|
||||
this.countROsToolStripMenuItem,
|
||||
this.convertToPDFwithROsToolStripMenuItem,
|
||||
this.determineLengthToolStripMenuItem,
|
||||
this.promsPrinterToolStripMenuItem});
|
||||
this.wordSectionsToolStripMenuItem.Name = "wordSectionsToolStripMenuItem";
|
||||
this.wordSectionsToolStripMenuItem.Size = new System.Drawing.Size(63, 20);
|
||||
this.wordSectionsToolStripMenuItem.Text = "Sections";
|
||||
//
|
||||
// countToolStripMenuItem
|
||||
//
|
||||
this.countToolStripMenuItem.Name = "countToolStripMenuItem";
|
||||
this.countToolStripMenuItem.Size = new System.Drawing.Size(195, 22);
|
||||
this.countToolStripMenuItem.Text = "Count";
|
||||
this.countToolStripMenuItem.Click += new System.EventHandler(this.countToolStripMenuItem_Click);
|
||||
//
|
||||
// walkStepsToolStripMenuItem2
|
||||
//
|
||||
this.walkStepsToolStripMenuItem2.Name = "walkStepsToolStripMenuItem2";
|
||||
this.walkStepsToolStripMenuItem2.Size = new System.Drawing.Size(195, 22);
|
||||
this.walkStepsToolStripMenuItem2.Text = "Walk Steps";
|
||||
this.walkStepsToolStripMenuItem2.Click += new System.EventHandler(this.walkStepsToolStripMenuItem2_Click);
|
||||
//
|
||||
// listSectionsToolStripMenuItem
|
||||
//
|
||||
this.listSectionsToolStripMenuItem.Name = "listSectionsToolStripMenuItem";
|
||||
this.listSectionsToolStripMenuItem.Size = new System.Drawing.Size(195, 22);
|
||||
this.listSectionsToolStripMenuItem.Text = "List Sections";
|
||||
this.listSectionsToolStripMenuItem.Click += new System.EventHandler(this.listSectionsToolStripMenuItem_Click);
|
||||
//
|
||||
// convertToPDFToolStripMenuItem
|
||||
//
|
||||
this.convertToPDFToolStripMenuItem.Name = "convertToPDFToolStripMenuItem";
|
||||
this.convertToPDFToolStripMenuItem.Size = new System.Drawing.Size(195, 22);
|
||||
this.convertToPDFToolStripMenuItem.Text = "ConvertToPDF";
|
||||
this.convertToPDFToolStripMenuItem.Click += new System.EventHandler(this.convertToPDFToolStripMenuItem_Click);
|
||||
//
|
||||
// countROsToolStripMenuItem
|
||||
//
|
||||
this.countROsToolStripMenuItem.Name = "countROsToolStripMenuItem";
|
||||
this.countROsToolStripMenuItem.Size = new System.Drawing.Size(195, 22);
|
||||
this.countROsToolStripMenuItem.Text = "Count ROs";
|
||||
this.countROsToolStripMenuItem.Click += new System.EventHandler(this.countROsToolStripMenuItem_Click);
|
||||
//
|
||||
// convertToPDFwithROsToolStripMenuItem
|
||||
//
|
||||
this.convertToPDFwithROsToolStripMenuItem.Name = "convertToPDFwithROsToolStripMenuItem";
|
||||
this.convertToPDFwithROsToolStripMenuItem.Size = new System.Drawing.Size(195, 22);
|
||||
this.convertToPDFwithROsToolStripMenuItem.Text = "ConvertToPDFwithROs";
|
||||
this.convertToPDFwithROsToolStripMenuItem.Click += new System.EventHandler(this.convertToPDFwithROsToolStripMenuItem_Click);
|
||||
//
|
||||
// determineLengthToolStripMenuItem
|
||||
//
|
||||
this.determineLengthToolStripMenuItem.Name = "determineLengthToolStripMenuItem";
|
||||
this.determineLengthToolStripMenuItem.Size = new System.Drawing.Size(195, 22);
|
||||
this.determineLengthToolStripMenuItem.Text = "DetermineLength";
|
||||
this.determineLengthToolStripMenuItem.Click += new System.EventHandler(this.determineLengthToolStripMenuItem_Click);
|
||||
//
|
||||
// promsPrinterToolStripMenuItem
|
||||
//
|
||||
this.promsPrinterToolStripMenuItem.Name = "promsPrinterToolStripMenuItem";
|
||||
this.promsPrinterToolStripMenuItem.Size = new System.Drawing.Size(195, 22);
|
||||
this.promsPrinterToolStripMenuItem.Text = "PromsPrinter";
|
||||
this.promsPrinterToolStripMenuItem.Click += new System.EventHandler(this.promsPrinterToolStripMenuItem_Click);
|
||||
//
|
||||
// oneSectionToolStripMenuItem
|
||||
//
|
||||
this.oneSectionToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.walkStepsToolStripMenuItem3,
|
||||
this.pDFToolStripMenuItem,
|
||||
this.listROsToolStripMenuItem,
|
||||
this.findROsToolStripMenuItem,
|
||||
this.determineLengthToolStripMenuItem1,
|
||||
this.promsPrinterToolStripMenuItem1});
|
||||
this.oneSectionToolStripMenuItem.Name = "oneSectionToolStripMenuItem";
|
||||
this.oneSectionToolStripMenuItem.Size = new System.Drawing.Size(58, 20);
|
||||
this.oneSectionToolStripMenuItem.Text = "Section";
|
||||
//
|
||||
// walkStepsToolStripMenuItem3
|
||||
//
|
||||
this.walkStepsToolStripMenuItem3.Name = "walkStepsToolStripMenuItem3";
|
||||
this.walkStepsToolStripMenuItem3.Size = new System.Drawing.Size(166, 22);
|
||||
this.walkStepsToolStripMenuItem3.Text = "Walk Steps";
|
||||
this.walkStepsToolStripMenuItem3.Click += new System.EventHandler(this.walkStepsToolStripMenuItem3_Click);
|
||||
//
|
||||
// pDFToolStripMenuItem
|
||||
//
|
||||
this.pDFToolStripMenuItem.Name = "pDFToolStripMenuItem";
|
||||
this.pDFToolStripMenuItem.Size = new System.Drawing.Size(166, 22);
|
||||
this.pDFToolStripMenuItem.Text = "PDF";
|
||||
this.pDFToolStripMenuItem.Click += new System.EventHandler(this.pDFToolStripMenuItem_Click);
|
||||
//
|
||||
// listROsToolStripMenuItem
|
||||
//
|
||||
this.listROsToolStripMenuItem.Name = "listROsToolStripMenuItem";
|
||||
this.listROsToolStripMenuItem.Size = new System.Drawing.Size(166, 22);
|
||||
this.listROsToolStripMenuItem.Text = "List ROs";
|
||||
this.listROsToolStripMenuItem.Click += new System.EventHandler(this.listROsToolStripMenuItem_Click);
|
||||
//
|
||||
// findROsToolStripMenuItem
|
||||
//
|
||||
this.findROsToolStripMenuItem.Name = "findROsToolStripMenuItem";
|
||||
this.findROsToolStripMenuItem.Size = new System.Drawing.Size(166, 22);
|
||||
this.findROsToolStripMenuItem.Text = "Find ROs";
|
||||
this.findROsToolStripMenuItem.Click += new System.EventHandler(this.findROsToolStripMenuItem_Click);
|
||||
//
|
||||
// determineLengthToolStripMenuItem1
|
||||
//
|
||||
this.determineLengthToolStripMenuItem1.Name = "determineLengthToolStripMenuItem1";
|
||||
this.determineLengthToolStripMenuItem1.Size = new System.Drawing.Size(166, 22);
|
||||
this.determineLengthToolStripMenuItem1.Text = "DetermineLength";
|
||||
this.determineLengthToolStripMenuItem1.Click += new System.EventHandler(this.determineLengthToolStripMenuItem1_Click);
|
||||
//
|
||||
// promsPrinterToolStripMenuItem1
|
||||
//
|
||||
this.promsPrinterToolStripMenuItem1.Name = "promsPrinterToolStripMenuItem1";
|
||||
this.promsPrinterToolStripMenuItem1.Size = new System.Drawing.Size(166, 22);
|
||||
this.promsPrinterToolStripMenuItem1.Text = "PromsPrinter";
|
||||
this.promsPrinterToolStripMenuItem1.Click += new System.EventHandler(this.promsPrinterToolStripMenuItem1_Click);
|
||||
//
|
||||
// cleanupToolStripMenuItem
|
||||
//
|
||||
this.cleanupToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.closeAcrobatToolStripMenuItem,
|
||||
this.removePDFsToolStripMenuItem});
|
||||
this.cleanupToolStripMenuItem.Name = "cleanupToolStripMenuItem";
|
||||
this.cleanupToolStripMenuItem.Size = new System.Drawing.Size(68, 20);
|
||||
this.cleanupToolStripMenuItem.Text = "Clean-up";
|
||||
//
|
||||
// closeAcrobatToolStripMenuItem
|
||||
//
|
||||
this.closeAcrobatToolStripMenuItem.Name = "closeAcrobatToolStripMenuItem";
|
||||
this.closeAcrobatToolStripMenuItem.Size = new System.Drawing.Size(148, 22);
|
||||
this.closeAcrobatToolStripMenuItem.Text = "Close Acrobat";
|
||||
this.closeAcrobatToolStripMenuItem.Click += new System.EventHandler(this.closeAcrobatToolStripMenuItem_Click);
|
||||
//
|
||||
// removePDFsToolStripMenuItem
|
||||
//
|
||||
this.removePDFsToolStripMenuItem.Name = "removePDFsToolStripMenuItem";
|
||||
this.removePDFsToolStripMenuItem.Size = new System.Drawing.Size(148, 22);
|
||||
this.removePDFsToolStripMenuItem.Text = "Remove PDFs";
|
||||
this.removePDFsToolStripMenuItem.Click += new System.EventHandler(this.removePDFsToolStripMenuItem_Click);
|
||||
//
|
||||
// pDFMethodToolStripMenuItem
|
||||
//
|
||||
this.pDFMethodToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.toPDFToolStripMenuItem,
|
||||
this.toPDF2003BGToolStripMenuItem,
|
||||
this.toPDF2003FGToolStripMenuItem,
|
||||
this.toPDF2007ToolStripMenuItem});
|
||||
this.pDFMethodToolStripMenuItem.Name = "pDFMethodToolStripMenuItem";
|
||||
this.pDFMethodToolStripMenuItem.Size = new System.Drawing.Size(85, 20);
|
||||
this.pDFMethodToolStripMenuItem.Text = "PDF Method";
|
||||
//
|
||||
// toPDFToolStripMenuItem
|
||||
//
|
||||
this.toPDFToolStripMenuItem.Checked = true;
|
||||
this.toPDFToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.toPDFToolStripMenuItem.Name = "toPDFToolStripMenuItem";
|
||||
this.toPDFToolStripMenuItem.Size = new System.Drawing.Size(148, 22);
|
||||
this.toPDFToolStripMenuItem.Text = "ToPDF";
|
||||
this.toPDFToolStripMenuItem.Click += new System.EventHandler(this.toPDFMethodToggle_Click);
|
||||
//
|
||||
// toPDF2003BGToolStripMenuItem
|
||||
//
|
||||
this.toPDF2003BGToolStripMenuItem.Name = "toPDF2003BGToolStripMenuItem";
|
||||
this.toPDF2003BGToolStripMenuItem.Size = new System.Drawing.Size(148, 22);
|
||||
this.toPDF2003BGToolStripMenuItem.Text = "ToPDF2003BG";
|
||||
this.toPDF2003BGToolStripMenuItem.Click += new System.EventHandler(this.toPDFMethodToggle_Click);
|
||||
//
|
||||
// toPDF2003FGToolStripMenuItem
|
||||
//
|
||||
this.toPDF2003FGToolStripMenuItem.Name = "toPDF2003FGToolStripMenuItem";
|
||||
this.toPDF2003FGToolStripMenuItem.Size = new System.Drawing.Size(148, 22);
|
||||
this.toPDF2003FGToolStripMenuItem.Text = "ToPDF2003FG";
|
||||
this.toPDF2003FGToolStripMenuItem.Click += new System.EventHandler(this.toPDFMethodToggle_Click);
|
||||
//
|
||||
// toPDF2007ToolStripMenuItem
|
||||
//
|
||||
this.toPDF2007ToolStripMenuItem.Name = "toPDF2007ToolStripMenuItem";
|
||||
this.toPDF2007ToolStripMenuItem.Size = new System.Drawing.Size(148, 22);
|
||||
this.toPDF2007ToolStripMenuItem.Text = "ToPDF2007";
|
||||
this.toPDF2007ToolStripMenuItem.Click += new System.EventHandler(this.toPDFMethodToggle_Click);
|
||||
//
|
||||
// rODataToolStripMenuItem
|
||||
//
|
||||
this.rODataToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.getAllPlotsToolStripMenuItem,
|
||||
this.getAllFortranNumbersToolStripMenuItem,
|
||||
this.getAllImagesToolStripMenuItem,
|
||||
this.typesToolStripMenuItem});
|
||||
this.rODataToolStripMenuItem.Name = "rODataToolStripMenuItem";
|
||||
this.rODataToolStripMenuItem.Size = new System.Drawing.Size(59, 20);
|
||||
this.rODataToolStripMenuItem.Text = "ROData";
|
||||
//
|
||||
// getAllPlotsToolStripMenuItem
|
||||
//
|
||||
this.getAllPlotsToolStripMenuItem.Name = "getAllPlotsToolStripMenuItem";
|
||||
this.getAllPlotsToolStripMenuItem.Size = new System.Drawing.Size(193, 22);
|
||||
this.getAllPlotsToolStripMenuItem.Text = "GetAllPlots";
|
||||
this.getAllPlotsToolStripMenuItem.Click += new System.EventHandler(this.getAllPlotsToolStripMenuItem_Click);
|
||||
//
|
||||
// getAllFortranNumbersToolStripMenuItem
|
||||
//
|
||||
this.getAllFortranNumbersToolStripMenuItem.Name = "getAllFortranNumbersToolStripMenuItem";
|
||||
this.getAllFortranNumbersToolStripMenuItem.Size = new System.Drawing.Size(193, 22);
|
||||
this.getAllFortranNumbersToolStripMenuItem.Text = "GetAllFortranNumbers";
|
||||
this.getAllFortranNumbersToolStripMenuItem.Click += new System.EventHandler(this.getAllFortranNumbersToolStripMenuItem_Click);
|
||||
//
|
||||
// getAllImagesToolStripMenuItem
|
||||
//
|
||||
this.getAllImagesToolStripMenuItem.Name = "getAllImagesToolStripMenuItem";
|
||||
this.getAllImagesToolStripMenuItem.Size = new System.Drawing.Size(193, 22);
|
||||
this.getAllImagesToolStripMenuItem.Text = "GetAllImages";
|
||||
this.getAllImagesToolStripMenuItem.Click += new System.EventHandler(this.getAllImagesToolStripMenuItem_Click);
|
||||
//
|
||||
// typesToolStripMenuItem
|
||||
//
|
||||
this.typesToolStripMenuItem.Name = "typesToolStripMenuItem";
|
||||
this.typesToolStripMenuItem.Size = new System.Drawing.Size(193, 22);
|
||||
this.typesToolStripMenuItem.Text = "Types";
|
||||
this.typesToolStripMenuItem.Click += new System.EventHandler(this.typesToolStripMenuItem_Click);
|
||||
//
|
||||
// statusStrip1
|
||||
//
|
||||
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.tsslStatus});
|
||||
this.statusStrip1.Location = new System.Drawing.Point(0, 397);
|
||||
this.statusStrip1.Name = "statusStrip1";
|
||||
this.statusStrip1.Size = new System.Drawing.Size(690, 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";
|
||||
//
|
||||
// tbAdjust
|
||||
//
|
||||
this.tbAdjust.Location = new System.Drawing.Point(659, 0);
|
||||
this.tbAdjust.Name = "tbAdjust";
|
||||
this.tbAdjust.Size = new System.Drawing.Size(29, 20);
|
||||
this.tbAdjust.TabIndex = 3;
|
||||
this.tbAdjust.Text = ".89";
|
||||
//
|
||||
// tbAdjustX
|
||||
//
|
||||
this.tbAdjustX.Location = new System.Drawing.Point(538, 0);
|
||||
this.tbAdjustX.Name = "tbAdjustX";
|
||||
this.tbAdjustX.Size = new System.Drawing.Size(32, 20);
|
||||
this.tbAdjustX.TabIndex = 4;
|
||||
this.tbAdjustX.Text = "-29.3";
|
||||
//
|
||||
// tbAdjustY
|
||||
//
|
||||
this.tbAdjustY.Location = new System.Drawing.Point(596, 0);
|
||||
this.tbAdjustY.Name = "tbAdjustY";
|
||||
this.tbAdjustY.Size = new System.Drawing.Size(37, 20);
|
||||
this.tbAdjustY.TabIndex = 5;
|
||||
this.tbAdjustY.Text = "9.1";
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(520, 3);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(12, 13);
|
||||
this.label1.TabIndex = 6;
|
||||
this.label1.Text = "x";
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(578, 3);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(12, 13);
|
||||
this.label2.TabIndex = 7;
|
||||
this.label2.Text = "y";
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(639, 3);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(21, 13);
|
||||
this.label3.TabIndex = 8;
|
||||
this.label3.Text = "adj";
|
||||
//
|
||||
// frmAnalyze
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(690, 419);
|
||||
this.Controls.Add(this.label3);
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Controls.Add(this.tbAdjustY);
|
||||
this.Controls.Add(this.tbAdjustX);
|
||||
this.Controls.Add(this.tbAdjust);
|
||||
this.Controls.Add(this.splitContainer1);
|
||||
this.Controls.Add(this.menuStrip1);
|
||||
this.Controls.Add(this.statusStrip1);
|
||||
this.Name = "frmAnalyze";
|
||||
this.Text = "PROMS-2010 Print MS Word";
|
||||
this.Load += new System.EventHandler(this.frmPrintMsWord_Load);
|
||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.frmPrintMsWord_FormClosing);
|
||||
this.splitContainer1.Panel1.ResumeLayout(false);
|
||||
this.splitContainer1.Panel2.ResumeLayout(false);
|
||||
this.splitContainer1.ResumeLayout(false);
|
||||
this.splitContainer2.Panel1.ResumeLayout(false);
|
||||
this.splitContainer2.Panel2.ResumeLayout(false);
|
||||
this.splitContainer2.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.SplitContainer splitContainer2;
|
||||
private System.Windows.Forms.ListBox lbDocVersion;
|
||||
private System.Windows.Forms.ListBox lbProcedure;
|
||||
private System.Windows.Forms.MenuStrip menuStrip1;
|
||||
private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem;
|
||||
private System.Windows.Forms.StatusStrip statusStrip1;
|
||||
private System.Windows.Forms.ToolStripStatusLabel tsslStatus;
|
||||
private System.Windows.Forms.ListBox lbSections;
|
||||
private System.Windows.Forms.ToolStripMenuItem wordSectionsToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem countToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem countROsToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem listSectionsToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem convertToPDFToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem oneSectionToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem pDFToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem listROsToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem findROsToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem convertToPDFwithROsToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem cleanupToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem closeAcrobatToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem removePDFsToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem pDFMethodToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem toPDFToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem toPDF2003BGToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem toPDF2003FGToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem toPDF2007ToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem rODataToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem getAllPlotsToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem getAllFortranNumbersToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem getAllImagesToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem determineLengthToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem determineLengthToolStripMenuItem1;
|
||||
private System.Windows.Forms.TextBox tbAdjust;
|
||||
private System.Windows.Forms.TextBox tbAdjustX;
|
||||
private System.Windows.Forms.TextBox tbAdjustY;
|
||||
private System.Windows.Forms.ToolStripMenuItem promsPrinterToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem promsPrinterToolStripMenuItem1;
|
||||
private System.Windows.Forms.ToolStripMenuItem typesToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem proceduresToolStripMenuItem1;
|
||||
private System.Windows.Forms.ToolStripMenuItem walkStepsToolStripMenuItem1;
|
||||
private System.Windows.Forms.ToolStripMenuItem walkStepsToolStripMenuItem2;
|
||||
private System.Windows.Forms.ToolStripMenuItem walkStepsToolStripMenuItem3;
|
||||
private System.Windows.Forms.ToolStripMenuItem countToolStripMenuItem1;
|
||||
private System.Windows.Forms.ToolStripMenuItem listSectionsToolStripMenuItem1;
|
||||
private System.Windows.Forms.ToolStripMenuItem buldXMLToolStripMenuItem;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Label label3;
|
||||
}
|
||||
}
|
||||
|
868
PROMS/VEPROMS/PrintMSWord/frmAnalyze.cs
Normal file
868
PROMS/VEPROMS/PrintMSWord/frmAnalyze.cs
Normal file
@ -0,0 +1,868 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using System.IO;
|
||||
using VEPROMS.CSLA.Library;
|
||||
using System.Text.RegularExpressions;
|
||||
using LBWordLibrary;
|
||||
using Volian.Controls.Library;
|
||||
using Volian.Svg.Library;
|
||||
|
||||
namespace PrintMSWord
|
||||
{
|
||||
public partial class frmAnalyze : Form
|
||||
{
|
||||
public string MyStatus
|
||||
{
|
||||
get { return tsslStatus.Text; }
|
||||
set { tsslStatus.Text = value; Application.DoEvents(); }
|
||||
}
|
||||
private PDFMethod _MyPDFMethod = PDFMethod.ToPDF;
|
||||
internal PDFMethod MyPDFMethod
|
||||
{
|
||||
get { return _MyPDFMethod; }
|
||||
set
|
||||
{
|
||||
_MyPDFMethod = value;
|
||||
// Adjust Checked Status
|
||||
toPDFToolStripMenuItem.Checked = _MyPDFMethod == PDFMethod.ToPDF;
|
||||
toPDF2003BGToolStripMenuItem.Checked = _MyPDFMethod == PDFMethod.ToPDF2003BG;
|
||||
toPDF2003FGToolStripMenuItem.Checked = _MyPDFMethod == PDFMethod.ToPDF2003FG;
|
||||
toPDF2007ToolStripMenuItem.Checked = _MyPDFMethod == PDFMethod.toPDF2007;
|
||||
}
|
||||
}
|
||||
public frmAnalyze()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
private LBApplicationClass _MyApp = null;
|
||||
public LBApplicationClass MyApp
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_MyApp == null)
|
||||
_MyApp = new LBApplicationClass();
|
||||
return _MyApp;
|
||||
}
|
||||
}
|
||||
private frmInfo _MyInfo = null;
|
||||
public frmInfo MyInfo
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_MyInfo == null)
|
||||
{
|
||||
_MyInfo = new frmInfo(this);
|
||||
_MyInfo.FormClosed += new FormClosedEventHandler(_MyInfo_FormClosed);
|
||||
}
|
||||
return _MyInfo;
|
||||
}
|
||||
}
|
||||
private void _MyInfo_FormClosed(object sender, FormClosedEventArgs e)
|
||||
{
|
||||
_MyInfo = null;
|
||||
}
|
||||
public void AddInfo(string info, params object [] objs)
|
||||
{
|
||||
MyInfo.AddInfo(string.Format(info,objs));
|
||||
}
|
||||
public void AddInfo(string info)
|
||||
{
|
||||
MyInfo.AddInfo(info);
|
||||
}
|
||||
public void ClearInfo()
|
||||
{
|
||||
MyInfo.Clear();
|
||||
}
|
||||
void exitToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
private System.Diagnostics.Process [] WordProcesses
|
||||
{
|
||||
get
|
||||
{
|
||||
return System.Diagnostics.Process.GetProcessesByName("WINWORD");
|
||||
}
|
||||
}
|
||||
private void frmPrintMsWord_Load(object sender, EventArgs e)
|
||||
{
|
||||
CleanupMSWordProcesses();
|
||||
lbDocVersion.DataSource = DocVersionInfoList.Get();
|
||||
toPDFToolStripMenuItem.Tag = PDFMethod.ToPDF;
|
||||
toPDF2003BGToolStripMenuItem.Tag = PDFMethod.ToPDF2003BG;
|
||||
toPDF2003FGToolStripMenuItem.Tag = PDFMethod.ToPDF2003FG;
|
||||
toPDF2007ToolStripMenuItem.Tag = PDFMethod.toPDF2007;
|
||||
FileInfo xmlFile = new FileInfo("Proms2010Print.xml");
|
||||
if(xmlFile.Exists)
|
||||
_MyProms2010Print = SvgSerializer<Proms2010Print>.ReadFile(xmlFile.FullName);
|
||||
}
|
||||
private void CleanupMSWordProcesses()
|
||||
{
|
||||
System.Diagnostics.Process[] wordProcesses = WordProcesses;
|
||||
if (wordProcesses.Length > 0)
|
||||
{
|
||||
AddInfo("{0} copies of MS Word are running", wordProcesses.Length);
|
||||
if (MessageBox.Show("MS Word is Running and must be stopped", "MS Word is Running", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
|
||||
{
|
||||
TerminateProcesses(wordProcesses);
|
||||
ClearInfo();
|
||||
}
|
||||
}
|
||||
}
|
||||
private void TerminateProcesses(System.Diagnostics.Process[] wordProcesses)
|
||||
{
|
||||
foreach (System.Diagnostics.Process proc in wordProcesses)
|
||||
proc.Kill();
|
||||
}
|
||||
private void lbDocVersion_SelectedValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
lbProcedure.DataSource = MyDocVersion.Procedures;
|
||||
}
|
||||
private void lbProcedure_SelectedValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
lbSections.DataSource = MyProcedure.Sections;
|
||||
countToolStripMenuItem.Enabled = listSectionsToolStripMenuItem.Enabled = convertToPDFToolStripMenuItem.Enabled =
|
||||
countROsToolStripMenuItem.Enabled = convertToPDFwithROsToolStripMenuItem.Enabled = MyProcedure.Sections != null;
|
||||
}
|
||||
private void countToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
ShowSectionCounts(MyProcedure);
|
||||
}
|
||||
private void ShowSectionCounts(ProcedureInfo procInfo)
|
||||
{
|
||||
int total = 0;
|
||||
int totalLibraryDocs = 0;
|
||||
// for each section in the active procedure
|
||||
foreach (SectionInfo sect in procInfo.Sections)
|
||||
{
|
||||
// check to see if it contains a Word Document
|
||||
if (sect.MyContent.ContentEntryCount > 0)
|
||||
{
|
||||
total++;
|
||||
if (sect.MyContent.MyEntry.MyDocument.LibTitle != "")
|
||||
totalLibraryDocs++;
|
||||
}
|
||||
}
|
||||
AddInfo("Procedure {0} contains {1} MS Word Sections, and {2} Library Documents.", MyProcedure.DisplayNumber, total, totalLibraryDocs);
|
||||
}
|
||||
private void listSectionsToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
ListSections(MyProcedure);
|
||||
}
|
||||
|
||||
private void ListSections(ProcedureInfo procInfo)
|
||||
{
|
||||
int total = 0;
|
||||
// for each section in the active procedure
|
||||
AddInfo("Procedure {0}:", procInfo.DisplayNumber);
|
||||
foreach (SectionInfo sect in procInfo.Sections)
|
||||
{
|
||||
// check to see if it contains a Word Document
|
||||
if (sect.MyContent.ContentEntryCount > 0)
|
||||
{
|
||||
total++;
|
||||
AddInfo("\t section {0} - {1}", sect.DisplayNumber, sect.DisplayText);
|
||||
}
|
||||
}
|
||||
AddInfo("Procedure {0} contains {1} MS Word Sections.", procInfo.DisplayNumber, total);
|
||||
}
|
||||
|
||||
private void convertToPDFToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
// for each section in the active procedure
|
||||
AddInfo("Procedure {0}:", MyProcedure.DisplayNumber);
|
||||
int i = 0;
|
||||
foreach (SectionInfo sect in MyProcedure.Sections)
|
||||
{
|
||||
// check to see if it contains a Word Document
|
||||
if (sect.MyContent.ContentEntryCount > 0)
|
||||
{
|
||||
AddInfo("\t section {0} - {1}", sect.DisplayNumber, sect.DisplayText);
|
||||
using (DSOFile myFile = new DSOFile(sect.MyContent.MyEntry.MyDocument))
|
||||
{
|
||||
MyApp.Documents.Open(myFile.FullName);
|
||||
string fileName = string.Format("{0:00} ", ++i) + (sect.DisplayNumber == "" ? sect.DisplayText : sect.DisplayNumber);
|
||||
CreatePDF(fileName,true);
|
||||
MyApp.ActiveDocument.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
private string CreatePDF(string fileName, bool openPdf)
|
||||
{
|
||||
string pdfFileName = null;
|
||||
switch (MyPDFMethod)
|
||||
{
|
||||
case PDFMethod.ToPDF:
|
||||
pdfFileName = MyApp.CreatePDF(@"C:\Temp\" + fileName + ".pdf", openPdf);
|
||||
break;
|
||||
case PDFMethod.ToPDF2003BG:
|
||||
pdfFileName = MyApp.CreatePDF2003BG(@"C:\Temp\" + fileName + ".pdf", openPdf);
|
||||
break;
|
||||
case PDFMethod.ToPDF2003FG:
|
||||
pdfFileName = MyApp.CreatePDF2003FG(@"C:\Temp\" + fileName + ".pdf", openPdf);
|
||||
break;
|
||||
case PDFMethod.toPDF2007:
|
||||
pdfFileName = MyApp.CreatePDF2007(@"C:\Temp\" + fileName + ".pdf", openPdf);
|
||||
break;
|
||||
}
|
||||
_PDFFiles.Add(pdfFileName);
|
||||
return pdfFileName;
|
||||
}
|
||||
private void countROsToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
// for each section in the active procedure
|
||||
AddInfo("Procedure {0}:", MyProcedure.DisplayNumber);
|
||||
int i = 0;
|
||||
foreach (SectionInfo sect in MyProcedure.Sections)
|
||||
{
|
||||
// check to see if it contains a Word Document
|
||||
if (sect.MyContent.ContentEntryCount > 0)
|
||||
{
|
||||
AddInfo("\t section {0} - {1} - {2} ROs", sect.DisplayNumber, sect.DisplayText, ROCount(sect) );
|
||||
}
|
||||
}
|
||||
}
|
||||
private int ROCount(SectionInfo sect)
|
||||
{
|
||||
string searchText = sect.MyContent.MyEntry.MyDocument.DocAscii;
|
||||
MatchCollection matches = Regex.Matches(searchText, @"\<[^>]*\>");
|
||||
return matches.Count;
|
||||
}
|
||||
private void pDFToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
using (DSOFile myFile = new DSOFile(MySection.MyContent.MyEntry.MyDocument))
|
||||
{
|
||||
MyApp.Documents.Open(myFile.FullName);
|
||||
string fileName = MySection.DisplayNumber == "" ? MySection.DisplayText : MySection.DisplayNumber;
|
||||
CreatePDF(fileName,true);
|
||||
MyApp.ActiveDocument.Close();
|
||||
}
|
||||
}
|
||||
private void listROsToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
ListROs(MySection);
|
||||
}
|
||||
private void ListROs(SectionInfo sect)
|
||||
{
|
||||
string searchText = sect.MyContent.MyEntry.MyDocument.DocAscii;
|
||||
ProcedureInfo proc = sect.ActiveParent as ProcedureInfo;
|
||||
MatchCollection matches = Regex.Matches(searchText, @"\<[^>]*\>");
|
||||
AddInfo("{0}:{1} contains {2} ROs", proc.DisplayNumber, (sect.DisplayNumber == "" ? sect.DisplayText : sect.DisplayNumber), matches.Count);
|
||||
foreach (Match match in matches)
|
||||
AddInfo("RO - '{0}'", match.Value);
|
||||
}
|
||||
private void findROsToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
ToPDFReplaceROs(MySection, true);
|
||||
}
|
||||
private string ToPDFReplaceROs(SectionInfo sect, bool openPdf)
|
||||
{
|
||||
int docStyleIndex = ((int)sect.MyContent.Type) % 10000;
|
||||
DocStyle myDocStyle = sect.ActiveFormat.PlantFormat.DocStyles.DocStyleList[docStyleIndex];
|
||||
PageStyle myPageStyle = myDocStyle.pagestyle;
|
||||
ProcedureInfo proc = sect.ActiveParent as ProcedureInfo;
|
||||
DocVersionInfo dvi = proc.ActiveParent as DocVersionInfo;
|
||||
ROFstInfo rofst = dvi.DocVersionAssociations[0].MyROFst;
|
||||
ROFSTLookup lookup = rofst.ROFSTLookup;
|
||||
string igPrefix = dvi.DocVersionConfig.RODefaults_graphicsprefix;
|
||||
string spPrefix = dvi.DocVersionConfig.RODefaults_setpointprefix;
|
||||
// string AccPageID = string.Format("<{0}-{1}>", accPrefix, roch.appid);
|
||||
|
||||
//AddInfo("{0}:{1}", proc.DisplayNumber, (sect.DisplayNumber == "" ? sect.DisplayText : sect.DisplayNumber));
|
||||
using (DSOFile myFile = new DSOFile(sect.MyContent.MyEntry.MyDocument))
|
||||
{
|
||||
LBDocumentClass myDoc = MyApp.Documents.Open(myFile.FullName);
|
||||
float newTop = (float)myDocStyle.Layout.TopRow;
|
||||
float newLeft = (float)myDocStyle.Layout.LeftMargin;
|
||||
float newLength = (float)myDocStyle.Layout.PageLength;
|
||||
float newWidth = (float)myDocStyle.Layout.PageWidth;
|
||||
float oldTop = myDoc.PageSetup.TopMargin;
|
||||
float oldLeft = myDoc.PageSetup.LeftMargin;
|
||||
float oldBottom = myDoc.PageSetup.BottomMargin;
|
||||
float oldRight = myDoc.PageSetup.RightMargin;
|
||||
float oldHeight = myDoc.PageSetup.PageHeight;
|
||||
float oldWidth = myDoc.PageSetup.PageWidth;
|
||||
float newRight = oldWidth - (newWidth + newLeft);
|
||||
if (newRight < 0) newRight = 0;
|
||||
float newBottom = oldBottom - newTop;
|
||||
//Console.WriteLine("{0},{1},{2},{3},{4},{5},{6},{7},{8},{9}", newTop, newLeft, newLength, newWidth, oldTop, oldLeft, oldBottom, oldRight,oldHeight,oldWidth);
|
||||
myDoc.PageSetup.BottomMargin = 0;// 11 * 72 - (newTop + newLength);
|
||||
myDoc.PageSetup.RightMargin = newRight;
|
||||
myDoc.PageSetup.LeftMargin = newLeft;
|
||||
myDoc.PageSetup.TopMargin = newTop;
|
||||
LBSelection sel = FindRO();
|
||||
while (sel != null)
|
||||
{
|
||||
string val = lookup.GetROValueByAccPagID(sel.Text, spPrefix, igPrefix);
|
||||
int? type = lookup.GetROTypeByAccPagID(sel.Text, spPrefix, igPrefix);
|
||||
if ((int)type == 8) // Image
|
||||
{
|
||||
//Console.WriteLine("Image: {0} - {1}", sect.MyContent.Number, sect.MyContent.Text);
|
||||
bool imageROTokenReplaced = false;
|
||||
string [] vals = val.Split("\n".ToCharArray());
|
||||
ROImageInfo roImage = ROImageInfo.GetByROFstID_FileName(rofst.ROFstID, vals[0]);
|
||||
if (roImage != null)
|
||||
{
|
||||
ROImageFile roImageFile = new ROImageFile(roImage);
|
||||
float width = 72 * Int32.Parse(vals[3], System.Globalization.NumberStyles.AllowHexSpecifier) / 12.0F;
|
||||
int lines = Int32.Parse(vals[2], System.Globalization.NumberStyles.AllowHexSpecifier);
|
||||
float height = 72 * lines / 6.0F;
|
||||
//sel.MoveEnd(LBWdUnits.wdLine, lines);// The number of lines depends on the third parameter
|
||||
//sel.EndKey(LBWdUnits.wdLine, true);
|
||||
//sel.MoveEnd(LBWdUnits.wdCharacter, -1);
|
||||
//Console.WriteLine("Lines = {0}", lines);
|
||||
sel.Text = "";
|
||||
// TODO: Need to create a temporary file for printing.
|
||||
// TODO: Need a way to eliminate the temporary file when done printing.
|
||||
// LBInlineShape shape = sel.InlineShapes.AddPicture(@"C:\Plant\HLP\VEHLP\ro\No1Seal.bmp");
|
||||
float x = (float)sel.get_Information(LBWdInformation.wdHorizontalPositionRelativeToPage);
|
||||
float y = (float)sel.get_Information(LBWdInformation.wdVerticalPositionRelativeToPage);
|
||||
//LBInlineShape shape = sel.InlineShapes.AddPicture(pngFile);
|
||||
LBRange myRange = sel.Paragraphs.First.Range;
|
||||
float yTop = (float)myRange.get_Information(LBWdInformation.wdVerticalPositionRelativeToPage);
|
||||
LBShape shape = myDoc.Shapes.AddPicture(roImageFile.MyFile.FullName, x, y - yTop, sel.Range);
|
||||
// LBInlineShape shape = sel.InlineShapes.AddPicture(roImageFile.MyFile.FullName);
|
||||
//Console.WriteLine("{0} Shape Width {1} Height {2}", val.Replace("\n", "','"), shape.Width, shape.Height);
|
||||
shape.Width = width;
|
||||
shape.Height = height;
|
||||
//Console.WriteLine("{0} Shape Width {1} Height {2}", val.Replace("\n", "','"), shape.Width, shape.Height);
|
||||
imageROTokenReplaced = true;
|
||||
}
|
||||
if(!imageROTokenReplaced)
|
||||
sel.Text = string.Format("Bad Image Link (Missing Image File:{0})",vals[0]);
|
||||
}
|
||||
else if ((int)type == 4) // X-Y Plot
|
||||
{
|
||||
val = val.Replace("`", "\xB0");
|
||||
//AddInfo("\tRO Found {0} = '{1}'", sel.Text, val);
|
||||
sel.Text = "";
|
||||
//float width = 72 * Int32.Parse(vals[3], System.Globalization.NumberStyles.AllowHexSpecifier) / 12.0F;
|
||||
//float height = 72 * lines / 6.0F;
|
||||
string pngFile = @"C:\Temp\XYPlot1.png";
|
||||
RectangleF plotRect = CreatePlot(pngFile, val, 600F);
|
||||
//LBShape shape = myDoc.Shapes.AddPicture(@"C:\Temp\XYPlot.png", 0, 0, sel.Range);
|
||||
float x = (float) sel.get_Information(LBWdInformation.wdHorizontalPositionRelativeToPage);
|
||||
float y = (float) sel.get_Information(LBWdInformation.wdVerticalPositionRelativeToPage);
|
||||
//LBInlineShape shape = sel.InlineShapes.AddPicture(pngFile);
|
||||
LBRange myRange = sel.Paragraphs.First.Range;
|
||||
float yTop = (float)myRange.get_Information(LBWdInformation.wdVerticalPositionRelativeToPage);
|
||||
float xAdjust = float.Parse(tbAdjustX.Text);
|
||||
float yAdjust = float.Parse(tbAdjustY.Text);
|
||||
LBShape shape = myDoc.Shapes.AddPicture(pngFile, x + xAdjust + plotRect.X, yAdjust + y - yTop + plotRect.Y, sel.Range);
|
||||
//Console.WriteLine(",{0},{1},{2},{3}", x, y - yTop, xAdjust,yAdjust);
|
||||
shape.LockAspectRatio = LBMsoTriState.msoTrue;
|
||||
//shape.Width = .89F * shape.Width;
|
||||
//shape.Width = float.Parse(tbAdjust.Text) * shape.Width;
|
||||
shape.Width = plotRect.Width;
|
||||
//shape.Height = .89F * shape.Height;
|
||||
sel.WholeStory();
|
||||
sel.Range.Font.Color = LBWdColor.wdColorRed;
|
||||
//Console.WriteLine("{0} Shape Width {1} Height {2}", val.Replace("\n", "','"), shape.Width, shape.Height);
|
||||
//shape.Width = width;
|
||||
//shape.Height = height;
|
||||
//Console.WriteLine("{0} Shape Width {1} Height {2}", val.Replace("\n", "','"), shape.Width, shape.Height);
|
||||
//imageROTokenReplaced = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
val = val.Replace("`", "\xB0");
|
||||
AddInfo("\tRO Found {0} = '{1}'", sel.Text, val);
|
||||
InsertROValue(sel, val, sect.ActiveFormat.PlantFormat.FormatData.ROData.UpRoIfPrevUpper);
|
||||
}
|
||||
sel = FindRO();
|
||||
}
|
||||
sel = MyApp.Selection;
|
||||
sel.WholeStory();
|
||||
sel.Range.Font.Color = LBWdColor.wdColorRed;
|
||||
sel.ParagraphFormat.LineSpacingRule = LBWdLineSpacing.wdLineSpaceExactly;
|
||||
sel.ParagraphFormat.LineSpacing = 12;
|
||||
//Console.WriteLine("{0},{1}", sel.ParagraphFormat.LineSpacing, sel.ParagraphFormat.LineSpacingRule);
|
||||
string fileName = sect.DisplayNumber == "" ? sect.DisplayText : sect.DisplayNumber;
|
||||
//MyApp.Visible = true;
|
||||
//MessageBox.Show("Ready to make PDF");
|
||||
//MyApp.Visible = false;
|
||||
fileName=CreatePDF(fileName, openPdf);
|
||||
//MyApp.Visible = true;
|
||||
MyApp.ActiveDocument.Close();
|
||||
MyApp.Quit();
|
||||
_MyApp = null;
|
||||
return fileName;
|
||||
}
|
||||
}
|
||||
private RectangleF CreatePlot(string pngFile, string xyPlot, float resolution)
|
||||
{
|
||||
RectangleF retval = new RectangleF(0, 0, 0, 0);
|
||||
Graphics grfx = this.CreateGraphics();
|
||||
string emfFile = pngFile.Replace(".png", ".emf");
|
||||
Metafile mf = new Metafile(emfFile, grfx.GetHdc());
|
||||
grfx.Dispose();
|
||||
grfx = Graphics.FromImage(mf);
|
||||
float dpi = grfx.DpiX;
|
||||
//grfx.ScaleTransform(resolution / grfx.DpiX, (resolution +1F) / grfx.DpiY);
|
||||
grfx.ScaleTransform(resolution / grfx.DpiX, resolution / grfx.DpiY);
|
||||
grfx.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor;
|
||||
grfx.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
|
||||
grfx.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias;
|
||||
grfx.Clear(Color.Transparent);
|
||||
XYPlots.XYPlot.BlackColor = Color.Red;
|
||||
XYPlots.XYPlot myPlot = new XYPlots.XYPlot(xyPlot);
|
||||
myPlot.SetMargins(0, 0, 0, 0);
|
||||
myPlot.Process(new VG.VGOut_Graphics(grfx));
|
||||
grfx.Dispose();
|
||||
GraphicsUnit gu = new GraphicsUnit();
|
||||
retval = mf.GetBounds(ref gu);
|
||||
retval.Width *= dpi / resolution;
|
||||
retval.Height *= dpi / resolution;
|
||||
retval.X *= dpi / resolution;
|
||||
retval.Y *= dpi / resolution;
|
||||
//retval.X = myPlot.Width-retval.Width;
|
||||
AddInfo("{0},{1},{2},{3},{4},{5}", myPlot.Width, myPlot.Height, retval.Width, retval.Height,retval.X,retval.Y);
|
||||
//Console.Write("{0},{1},{2},{3}", myPlot.Width, myPlot.Height, retval.Width, retval.Height);
|
||||
mf.Save(pngFile, ImageFormat.Png);
|
||||
//Console.WriteLine("'pngfile','{0}'", pngFile);
|
||||
mf.Dispose();
|
||||
FileInfo myFile = new System.IO.FileInfo(emfFile);
|
||||
myFile.Delete();
|
||||
return retval;
|
||||
}
|
||||
private static void InsertROValue(LBSelection sel, string roValue, bool upRoIfPrevUpper)
|
||||
{
|
||||
if (roValue == null)
|
||||
{
|
||||
sel.Text = "RO Not Found";
|
||||
sel.Font.Color = LBWdColor.wdColorRed;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (upRoIfPrevUpper && sel.LastWasUpper) roValue = roValue.ToUpper();
|
||||
// Convert fortran formatted numbers to scientific notation.
|
||||
|
||||
string tmp = DisplayRO.ConvertFortranFormatToScienctificNotation(roValue);
|
||||
// Look for superscript or subscript and insert the appropriate commands
|
||||
Match roMatch = Regex.Match(tmp, @"(.*?)\\(super|sub) (.*?)\\nosupersub ");
|
||||
if (roMatch.Groups.Count == 4)// Superscript or subscript found
|
||||
{
|
||||
sel.Font.Color = LBWdColor.wdColorRed;
|
||||
while (roMatch.Groups.Count == 4)
|
||||
{
|
||||
sel.TypeText(roMatch.Groups[1].Value); // output the text preceeding the super or sub command
|
||||
sel.Font.Position = roMatch.Groups[2].Value=="super" ? 2 : -2; // Shift the vertical position for super or sub
|
||||
sel.TypeText(roMatch.Groups[3].Value); // output the superscript or subscript
|
||||
sel.Font.Position = 0; // restore the vertical position
|
||||
tmp = tmp.Substring(roMatch.Length); // remove the processed text
|
||||
roMatch = Regex.Match(tmp, @"(.*?)\\(super|sub) (.*?)\\nosupersub "); // check to see if the text contain another super or sub
|
||||
}
|
||||
if(tmp != "")// Add any remaining text
|
||||
sel.TypeText(tmp);
|
||||
sel.Font.Color = LBWdColor.wdColorAutomatic;
|
||||
}
|
||||
else // if no superscripts or subscripts just output the text
|
||||
{
|
||||
sel.Text = roValue;
|
||||
sel.Font.Color = LBWdColor.wdColorRed;
|
||||
}
|
||||
}
|
||||
}
|
||||
private LBSelection FindRO()
|
||||
{
|
||||
LBSelection sel = MyApp.Selection;
|
||||
LBFind find = sel.Find;
|
||||
find.ClearFormatting();
|
||||
find.Text = "[<](?@)-(?@)[>]";
|
||||
//find.Wrap = LBWdFindWrap.wdFindStop;
|
||||
find.Wrap = LBWdFindWrap.wdFindContinue;
|
||||
find.MatchCase = false;
|
||||
find.MatchWholeWord = false;
|
||||
find.MatchWildcards = true;
|
||||
find.MatchSoundsLike = false;
|
||||
find.MatchAllWordForms = false;
|
||||
if (find.Execute()) return sel;
|
||||
return null;
|
||||
}
|
||||
private void frmPrintMsWord_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
if (MyApp != null)
|
||||
_MyApp.Quit();
|
||||
//Console.WriteLine("Closing --- {0}", e.CloseReason);
|
||||
LBApplicationClass.ClosePDFs();
|
||||
RemovePDFFiles();
|
||||
}
|
||||
private void convertToPDFwithROsToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
// for each section in the active procedure
|
||||
AddInfo("Procedure {0}:", MyProcedure.DisplayNumber);
|
||||
int i = 0;
|
||||
if (MyProcedure.Sections == null)
|
||||
{
|
||||
AddInfo(" No Sections", MyProcedure.DisplayNumber);
|
||||
MessageBox.Show("No Sections");
|
||||
return;
|
||||
}
|
||||
foreach (SectionInfo sect in MyProcedure.Sections)
|
||||
{
|
||||
// check to see if it contains a Word Document
|
||||
if (sect.MyContent.ContentEntryCount > 0)
|
||||
{
|
||||
ToPDFReplaceROs(sect,true);
|
||||
AddInfo("\t section {0} - {1} - {2} ROs", sect.DisplayNumber, sect.DisplayText, ROCount(sect));
|
||||
}
|
||||
}
|
||||
}
|
||||
private void closeAcrobatToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
LBApplicationClass.ClosePDFs();
|
||||
}
|
||||
List<string> _PDFFiles = new List<string>();
|
||||
private void removePDFsToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
RemovePDFFiles();
|
||||
}
|
||||
|
||||
private void RemovePDFFiles()
|
||||
{
|
||||
Application.DoEvents();
|
||||
while (_PDFFiles.Count > 0)
|
||||
{
|
||||
string fileName = _PDFFiles[0];
|
||||
//Console.WriteLine("Start==={0:s.ffff}==========={1}", DateTime.Now, fileName);
|
||||
System.IO.FileInfo fi = new System.IO.FileInfo(fileName);
|
||||
try
|
||||
{
|
||||
fi.Delete();
|
||||
_PDFFiles.Remove(fileName);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
AddInfo("Error==={0:s.ffff}==========>{1} - {2}", DateTime.Now, ex.GetType().Name, ex.Message);
|
||||
Application.DoEvents();
|
||||
}
|
||||
}
|
||||
}
|
||||
private void toPDFMethodToggle_Click(object sender, EventArgs e)
|
||||
{
|
||||
ToolStripMenuItem mi = sender as ToolStripMenuItem;
|
||||
MyPDFMethod = (PDFMethod)mi.Tag;
|
||||
}
|
||||
private void rOTypesToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
}
|
||||
private void FindROTypes(ProcedureInfo proc, Dictionary<int, int> roTypes, ROFSTLookup lookup, string igPrefix, string spPrefix)
|
||||
{
|
||||
foreach (SectionInfo sect in proc.Sections)
|
||||
{
|
||||
if (sect.MyContent.ContentEntryCount == 1)
|
||||
{
|
||||
MyStatus = string.Format("{0}:{1}", proc.DisplayNumber, sect.DisplayNumber == "" ? sect.DisplayText : sect.DisplayNumber);
|
||||
FindROTypes(proc, sect, roTypes, lookup, igPrefix, spPrefix);
|
||||
}
|
||||
}
|
||||
}
|
||||
private void FindROTypes(ProcedureInfo proc, SectionInfo sect, Dictionary<int, int> roTypes, ROFSTLookup lookup, string igPrefix, string spPrefix)
|
||||
{
|
||||
string searchText = sect.MyContent.MyEntry.MyDocument.DocAscii;
|
||||
MatchCollection matches = Regex.Matches(searchText, @"\<[^>]*\>");
|
||||
foreach (Match match in matches)
|
||||
{
|
||||
int? roType = lookup.GetROTypeByAccPagID(match.Value.Replace(" ",""), spPrefix, igPrefix);
|
||||
if (roType != null)
|
||||
{
|
||||
if (roTypes.ContainsKey((int)roType))
|
||||
{
|
||||
roTypes[(int)roType]++;
|
||||
if (roType == 8)
|
||||
{
|
||||
AddInfo("{0}:{1}", proc.DisplayNumber, sect.DisplayNumber == "" ? sect.DisplayText : sect.DisplayNumber);
|
||||
AddInfo("{0} Type '{1}' '{2}'\r\n", match.Value.Replace(" ", ""), roType,
|
||||
lookup.GetROValueByAccPagID(match.Value.Replace(" ", ""), spPrefix, igPrefix).Replace("\n","','"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
roTypes.Add((int)roType, 1);
|
||||
AddInfo("{0}:{1}", proc.DisplayNumber, sect.DisplayNumber == "" ? sect.DisplayText : sect.DisplayNumber);
|
||||
AddInfo("{0} Type {1} \r\nValue '{2}'\r\n", match.Value.Replace(" ", ""), roType, lookup.GetROValueByAccPagID(match.Value.Replace(" ", ""), spPrefix, igPrefix));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
AddInfo("{0}:{1} - {2}", proc.DisplayNumber, sect.DisplayNumber == "" ? sect.DisplayText : sect.DisplayNumber, match.Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
private void getAllPlotsToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (MyDocVersion.DocVersionAssociationCount <= 0)
|
||||
{
|
||||
MessageBox.Show("No RO data associations!", "No RO data", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||
return;
|
||||
}
|
||||
ROFstInfo rofst = MyDocVersion.DocVersionAssociations[0].MyROFst;
|
||||
ROFSTLookup lookup = rofst.ROFSTLookup;
|
||||
List<ROFSTLookup.rochild> plots = lookup.GetRoChildrenByType(4);
|
||||
foreach (ROFSTLookup.rochild plot in plots)
|
||||
AddInfo("plots.Add(\"{0}\",\"{1}\");", plot.appid, ToCode(plot.value ?? "No Plot"));
|
||||
}
|
||||
private string ToCode(string text)
|
||||
{
|
||||
|
||||
string retval = text.Replace("\"","\\\"");
|
||||
retval = retval.Replace("\r\n", "\\r\\n\" +\r\n\t\"");
|
||||
return retval;
|
||||
}
|
||||
private void getAllFortranNumbersToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (MyDocVersion.DocVersionAssociationCount <= 0)
|
||||
{
|
||||
MessageBox.Show("No RO data associations!", "No RO data", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||
return;
|
||||
}
|
||||
ROFstInfo rofst = MyDocVersion.DocVersionAssociations[0].MyROFst;
|
||||
ROFSTLookup lookup = rofst.ROFSTLookup;
|
||||
List<ROFSTLookup.rochild> roValues = lookup.GetRoChildrenByType(1);
|
||||
foreach (ROFSTLookup.rochild roValue in roValues)
|
||||
if(Regex.IsMatch(roValue.value,".*[0-9.]E[-+0-9].*"))
|
||||
AddInfo("_Numbers.Add(new FortranNumber(\"{0}\"));", roValue.value);
|
||||
}
|
||||
private void getAllImagesToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (MyDocVersion.DocVersionAssociationCount <= 0)
|
||||
{
|
||||
MessageBox.Show("No RO data associations!", "No RO data", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||
return;
|
||||
}
|
||||
ROFstInfo rofst = MyDocVersion.DocVersionAssociations[0].MyROFst;
|
||||
ROFSTLookup lookup = rofst.ROFSTLookup;
|
||||
List<ROFSTLookup.rochild> plots = lookup.GetRoChildrenByType(8);
|
||||
foreach (ROFSTLookup.rochild plot in plots)
|
||||
AddInfo("plots.Add(\"{0}\",\"{1}\");", plot.roid, plot.appid);
|
||||
|
||||
}
|
||||
private void determineLengthToolStripMenuItem1_Click(object sender, EventArgs e)
|
||||
{
|
||||
AddInfo("Length of {0} = {1}", MySection.MyContent.Number ?? MySection.MyContent.Text, DetermineLength(MySection));
|
||||
MyApp.Quit();
|
||||
_MyApp = null;
|
||||
}
|
||||
private float DetermineLength(SectionInfo sect)
|
||||
{
|
||||
float retval=0;
|
||||
using (DSOFile myFile = new DSOFile(sect.MyContent.MyEntry.MyDocument))
|
||||
{
|
||||
LBDocumentClass myDoc = MyApp.Documents.Open(myFile.FullName);
|
||||
retval = myDoc.Length;
|
||||
myDoc.Close();
|
||||
}
|
||||
//MyApp.Quit();
|
||||
//_MyApp = null;
|
||||
return retval;
|
||||
}
|
||||
private void determineLengthToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
AddInfo("{0}:", MyProcedure.DisplayNumber);
|
||||
int i = 0;
|
||||
if (MyProcedure.Sections == null)
|
||||
{
|
||||
AddInfo(" No Sections", MyProcedure.DisplayNumber);
|
||||
return;
|
||||
}
|
||||
foreach (SectionInfo sect in MyProcedure.Sections)
|
||||
{
|
||||
// check to see if it contains a Word Document
|
||||
if (sect.MyContent.ContentEntryCount > 0)
|
||||
{
|
||||
AddInfo("\t{0:00.00} pages - {1} - {2} ", DetermineLength(sect), sect.DisplayNumber, sect.DisplayText);
|
||||
}
|
||||
}
|
||||
MyApp.Quit();
|
||||
_MyApp = null;
|
||||
}
|
||||
private void WalkItems(ItemInfo itemInfo)
|
||||
{
|
||||
MyInfo.MyStatus = string.Format("Processing {0}", ShortPath(itemInfo));
|
||||
WalkSteps(itemInfo);
|
||||
MyInfo.MyStatus = string.Format("Ready - Output copied to clipboard");
|
||||
}
|
||||
private int testID = 442;
|
||||
private void WalkSteps(ItemInfo itemInfo)
|
||||
{
|
||||
if(itemInfo.ItemID == testID)
|
||||
AddInfo("Found TestID");
|
||||
WalkSteps(itemInfo.Cautions);
|
||||
WalkSteps(itemInfo.Notes);
|
||||
MyInfo.AddInfoPartial("{0},'{1}','{2}','{3}'", itemInfo.ItemID, ShortPath(itemInfo), ShortPath(itemInfo.SearchNext), ShortPath(itemInfo.SearchPrev));
|
||||
WalkSteps(itemInfo.RNOs);
|
||||
WalkSteps(itemInfo.Tables);
|
||||
WalkSteps(itemInfo.Procedures);
|
||||
WalkSteps(itemInfo.Sections);
|
||||
WalkSteps(itemInfo.Steps);
|
||||
}
|
||||
private string ShortPath(ItemInfo itemInfo)
|
||||
{
|
||||
if (itemInfo == null)
|
||||
return "";
|
||||
if (itemInfo.IsProcedure)
|
||||
return itemInfo.DisplayNumber;
|
||||
if (itemInfo.IsSection)
|
||||
return itemInfo.DisplayNumber != "" ? itemInfo.DisplayNumber : itemInfo.DisplayText;
|
||||
return itemInfo.Path.Substring(itemInfo.ActiveSection.Path.Length);
|
||||
}
|
||||
private void WalkSteps(ItemInfoList itemInfoList)
|
||||
{
|
||||
if(itemInfoList != null)
|
||||
foreach (ItemInfo itemInfo in itemInfoList)
|
||||
WalkSteps(itemInfo);
|
||||
}
|
||||
private void lbSections_DoubleClick(object sender, EventArgs e)
|
||||
{
|
||||
promsPrinterToolStripMenuItem1_Click(sender, e);
|
||||
}
|
||||
private void AddPageTemplate(string msWordPdf, SectionInfo sect)
|
||||
{
|
||||
// Create Page Template based upon PageList items and genmac
|
||||
int docStyleIndex = ((int)sect.MyContent.Type) % 10000;
|
||||
DocStyle myDocStyle = sect.ActiveFormat.PlantFormat.DocStyles.DocStyleList[docStyleIndex];
|
||||
PageStyle myPageStyle = myDocStyle.pagestyle;
|
||||
foreach (PageItem pageItem in myPageStyle.PageItems)
|
||||
{
|
||||
AddInfo("{0},{1},'{2}','{3}','{4}'", pageItem.Row, pageItem.Col, pageItem.Font, pageItem.Justify, pageItem.Token);
|
||||
}
|
||||
AddInfo("GenMac\r\n{0}",sect.ActiveFormat.GenMac);
|
||||
}
|
||||
|
||||
private void promsPrinterToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
Proms2010Procedure prProc = _MyProms2010Print.GetProcedure(MyProcedure);
|
||||
PromsPrinter pp = new PromsPrinter(MyProcedure,prProc.Rev,prProc.RevDate,"DRAFT");
|
||||
pp.Print(@"C:\TEMP\32Bit",_MyProms2010Print, null,this);
|
||||
}
|
||||
|
||||
private void promsPrinterToolStripMenuItem1_Click(object sender, EventArgs e)
|
||||
{
|
||||
Proms2010Procedure prProc = _MyProms2010Print.GetProcedure(MySection.MyProcedure);
|
||||
string wordFile = null;
|
||||
if(MySection.MyContent.ContentEntryCount == 1)
|
||||
wordFile = ToPDFReplaceROs(MySection, false);
|
||||
PromsPrinter pp = new PromsPrinter(MySection, prProc.Rev, prProc.RevDate,"DRAFT");
|
||||
pp.Print(@"C:\TEMP\32Bit",_MyProms2010Print, wordFile,this);
|
||||
}
|
||||
Proms2010Print _MyProms2010Print;
|
||||
private void buldXMLToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
// Walk through contents of the 16Bit Folder and create Proms2010 Structure
|
||||
Proms2010Print _MyProms2010Print = new Proms2010Print();
|
||||
_MyProms2010Print.PROMS16_Folder = @"C:\TEMP\16Bit";
|
||||
_MyProms2010Print.Procedures = new Proms2010Procedures();
|
||||
DirectoryInfo myDirectory = new DirectoryInfo(_MyProms2010Print.PROMS16_Folder);
|
||||
foreach (FileInfo myFile in myDirectory.GetFiles("*.pdf"))
|
||||
{
|
||||
ProcedureInfo myProc = GetProcedure(myFile.Name.Replace(".pdf",""));
|
||||
if (myProc != null)
|
||||
{
|
||||
Proms2010Procedure proc = new Proms2010Procedure(myProc);
|
||||
proc.PageCount = VolianPdf.PageCount(myFile.FullName);
|
||||
_MyProms2010Print.Procedures.Add(proc);
|
||||
}
|
||||
}
|
||||
// Output xml to frmInfo
|
||||
ClearInfo();
|
||||
SvgSerializer<Proms2010Print>.WriteFile(_MyProms2010Print, "Proms2010Print.xml");
|
||||
AddInfo(SvgSerializer<Proms2010Print>.StringSerialize(_MyProms2010Print));
|
||||
}
|
||||
private ProcedureInfo GetProcedure(string procNumber)
|
||||
{
|
||||
// Loop through the list looking for a matching number
|
||||
foreach (ProcedureInfo proc in MyDocVersion.Procedures)
|
||||
if (proc.DisplayNumber == procNumber)
|
||||
return proc;
|
||||
return null;
|
||||
}
|
||||
|
||||
private void typesToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
// Initialize Dictionary
|
||||
Dictionary<int, int> roTypes = new Dictionary<int, int>();
|
||||
// Spin Through Procedures for selected DocVersion
|
||||
if (MyDocVersion.DocVersionAssociationCount == 0)
|
||||
{
|
||||
MessageBox.Show("No associated ROFST");
|
||||
return;
|
||||
}
|
||||
ROFstInfo rofst = MyDocVersion.DocVersionAssociations[0].MyROFst;
|
||||
ROFSTLookup lookup = rofst.ROFSTLookup;
|
||||
string igPrefix = MyDocVersion.DocVersionConfig.RODefaults_graphicsprefix;
|
||||
string spPrefix = MyDocVersion.DocVersionConfig.RODefaults_setpointprefix;
|
||||
foreach (ProcedureInfo proc in MyDocVersion.Procedures)
|
||||
FindROTypes(proc, roTypes, lookup, igPrefix, spPrefix);
|
||||
// Output Dictionary Results
|
||||
foreach (int roType in roTypes.Keys)
|
||||
AddInfo("Type {0}, Count {1}", roType, roTypes[roType]);
|
||||
}
|
||||
|
||||
private void walkStepsToolStripMenuItem1_Click(object sender, EventArgs e)
|
||||
{
|
||||
MyInfo.MyStatus = string.Format("Processing");
|
||||
if (MyDocVersion != null)
|
||||
{
|
||||
MyInfo.Clear();
|
||||
foreach (ProcedureInfo procInfo in MyDocVersion.Procedures)
|
||||
ProcedureWalkSteps(procInfo);
|
||||
MyInfo.CopyOutput();
|
||||
MyInfo.MyStatus = string.Format("Ready - Output copied to clipboard");
|
||||
}
|
||||
|
||||
}
|
||||
private void walkStepsToolStripMenuItem2_Click(object sender, EventArgs e)
|
||||
{
|
||||
ProcedureWalkSteps(MyProcedure);
|
||||
MyInfo.CopyOutput();
|
||||
MyInfo.MyStatus = string.Format("Ready - Output copied to clipboard");
|
||||
}
|
||||
private void walkStepsToolStripMenuItem3_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (MySection != null) WalkItems(MySection);
|
||||
}
|
||||
private void ProcedureWalkSteps(ProcedureInfo procInfo)
|
||||
{
|
||||
MyInfo.MyStatus = string.Format("Processing {0}", procInfo.MyContent.Number);
|
||||
if (procInfo != null) WalkItems(procInfo);
|
||||
}
|
||||
public DocVersionInfo MyDocVersion
|
||||
{
|
||||
get { return lbDocVersion.SelectedValue as DocVersionInfo; }
|
||||
}
|
||||
public ProcedureInfo MyProcedure
|
||||
{
|
||||
get { return lbProcedure.SelectedValue as ProcedureInfo; }
|
||||
}
|
||||
public SectionInfo MySection
|
||||
{
|
||||
get { return lbSections.SelectedValue as SectionInfo; }
|
||||
}
|
||||
|
||||
private void countToolStripMenuItem1_Click(object sender, EventArgs e)
|
||||
{
|
||||
foreach (ProcedureInfo procInfo in MyDocVersion.Procedures)
|
||||
ShowSectionCounts(procInfo);
|
||||
}
|
||||
|
||||
private void listSectionsToolStripMenuItem1_Click(object sender, EventArgs e)
|
||||
{
|
||||
foreach (ProcedureInfo procInfo in MyDocVersion.Procedures)
|
||||
ListSections(procInfo);
|
||||
}
|
||||
}
|
||||
enum PDFMethod
|
||||
{
|
||||
ToPDF,
|
||||
ToPDF2003BG,
|
||||
ToPDF2003FG,
|
||||
toPDF2007
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user