Commit for development environment setup

This commit is contained in:
2023-06-19 16:12:33 -04:00
parent be72063a3c
commit bbce2ad0a6
2209 changed files with 1171775 additions and 625 deletions

View File

@@ -0,0 +1,549 @@
/*********************************************************************************************
* Copyright 2004 - Volian Enterprises, Inc. All rights reserved.
* Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
* ------------------------------------------------------------------------------
* $Workfile: ARProperties.cs $ $Revision: 2 $
* $Author: Jsj $ $Date: 8/20/04 4:45p $
*
* $History: ARProperties.cs $
*
* ***************** Version 2 *****************
* User: Jsj Date: 8/20/04 Time: 4:45p
* Updated in $/LibSource/VEObject
* fixed cancel of archive selected procedures
*
* ***************** Version 1 *****************
* User: Kathy Date: 7/27/04 Time: 8:52a
* Created in $/LibSource/VEObject
*********************************************************************************************/
using System;
using System.IO;
using System.Drawing;
using System.Collections;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Windows.Forms;
using System.Text;
using System.Data;
using VDB_Set;
using Utils;
namespace VEObject
{
/// <summary>
/// NOTE: cmbType (the combo box that contains the document types) must match
/// the order of document types given in the ArchiveTypeOptions for this dialog
/// to work correctly
/// </summary>
public class ARProperties : System.Windows.Forms.Form
{
private System.Windows.Forms.PropertyGrid myPropertyGrid;
private System.Windows.Forms.ComboBox cmbType;
private System.Windows.Forms.Label lblType;
private System.Windows.Forms.Button btnOK;
private System.Windows.Forms.Button btnCancel;
private System.Windows.Forms.Button btnApply;
private VEO_Base _ParentObj;
private VEO_Base _CurObj;
private bool isnew;
private bool glbCancel;
private bool zipInCurProcSet;
private bool hasInvalidEntry;
private string strCurZipPath;
private string strZipFileName;
private string strFilesToArchive;
private string strZipFileExcludeList;
private string strProcSetDir;
private ZipFuncs ZipFile;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
public ARProperties(Object parent, Object curobj)
{
//
// Required for Windows Form Designer support
//
_ParentObj = (VEO_Base) parent;
_CurObj = (VEO_Base) curobj;
VEO_Archive tmpArc = (VEO_Archive)curobj;
if (tmpArc.isnew == true)
isnew=true;
else
isnew=false;
InitializeComponent();
this.myPropertyGrid.SelectedObject=curobj;
strCurZipPath = _ParentObj._Location;
strProcSetDir = _ParentObj._Location;
// If new, combo box should have 'Full'
this.cmbType.Visible=false;
this.btnApply.Enabled=false;
glbCancel = false;
zipInCurProcSet = true;
if (isnew == true)
{
this.btnApply.Visible = false;
SetupNewFileName();
ZipFile = new ZipFuncs();
// Since this a new Zip File, don't assign ZipFile with the path/name,
// Title, or Comment. These values can be changed prior to the
// actual creation of the Zip file.
}
else
{
VEO_Archive arc = (VEO_Archive)curobj;
ZipFile = new ZipFuncs(arc._Location);
GetCommentInformation();
this.cmbType.SelectedIndex = (int) arc._ArchiveType;
}
}
private void SetupNewFileName()
{
int i=0;
StringBuilder newname = new StringBuilder();
VEO_Archive arc = (VEO_Archive) _CurObj;
// The old VE-PROMS logic would create SOURCE.ZIP for
// the first archive, then ARCH_xxx.ZIP for the rest.
// Now we will just create ARCH_xxx.ZIP
while(i==0 || arc.Exists(strCurZipPath + "\\" + newname.ToString()))
{
newname.Remove(0,newname.Length);
newname.Append("ARCH_");
newname.Append(i.ToString("d3"));
newname.Append(".ZIP");
i++;
}
strZipFileName = newname.ToString();
_CurObj._Location = strCurZipPath + "\\" + strZipFileName;
_CurObj._Title = "New Archive " + newname.ToString();
this.myPropertyGrid.SelectedObject=_CurObj;
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(ARProperties));
this.myPropertyGrid = new System.Windows.Forms.PropertyGrid();
this.cmbType = new System.Windows.Forms.ComboBox();
this.lblType = new System.Windows.Forms.Label();
this.btnOK = new System.Windows.Forms.Button();
this.btnCancel = new System.Windows.Forms.Button();
this.btnApply = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// myPropertyGrid
//
this.myPropertyGrid.CommandsVisibleIfAvailable = true;
this.myPropertyGrid.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.myPropertyGrid.HelpVisible = false;
this.myPropertyGrid.LargeButtons = false;
this.myPropertyGrid.LineColor = System.Drawing.SystemColors.ScrollBar;
this.myPropertyGrid.Location = new System.Drawing.Point(0, 48);
this.myPropertyGrid.Name = "myPropertyGrid";
this.myPropertyGrid.Size = new System.Drawing.Size(736, 112);
this.myPropertyGrid.TabIndex = 2;
this.myPropertyGrid.Text = "Properties";
this.myPropertyGrid.ToolbarVisible = false;
this.myPropertyGrid.ViewBackColor = System.Drawing.SystemColors.Window;
this.myPropertyGrid.ViewForeColor = System.Drawing.SystemColors.WindowText;
this.myPropertyGrid.PropertyValueChanged += new System.Windows.Forms.PropertyValueChangedEventHandler(this.myPropertyGrid_PropertyValueChanged);
//
// cmbType
//
this.cmbType.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.cmbType.Items.AddRange(new object[] {
"Full",
"Partial"});
this.cmbType.Location = new System.Drawing.Point(104, 0);
this.cmbType.Name = "cmbType";
this.cmbType.Size = new System.Drawing.Size(208, 24);
this.cmbType.TabIndex = 3;
this.cmbType.SelectedIndexChanged += new System.EventHandler(this.cmbType_SelectedIndexChanged);
//
// lblType
//
this.lblType.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.lblType.Location = new System.Drawing.Point(0, 0);
this.lblType.Name = "lblType";
this.lblType.Size = new System.Drawing.Size(96, 24);
this.lblType.TabIndex = 4;
this.lblType.Text = "Archive Type:";
this.lblType.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// btnOK
//
this.btnOK.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.btnOK.Location = new System.Drawing.Point(432, 200);
this.btnOK.Name = "btnOK";
this.btnOK.Size = new System.Drawing.Size(64, 24);
this.btnOK.TabIndex = 8;
this.btnOK.Text = "OK";
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
//
// btnCancel
//
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnCancel.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.btnCancel.Location = new System.Drawing.Point(512, 200);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(64, 24);
this.btnCancel.TabIndex = 9;
this.btnCancel.Text = "Cancel";
this.btnCancel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
//
// btnApply
//
this.btnApply.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.btnApply.Location = new System.Drawing.Point(592, 200);
this.btnApply.Name = "btnApply";
this.btnApply.Size = new System.Drawing.Size(56, 24);
this.btnApply.TabIndex = 10;
this.btnApply.Text = "Apply";
this.btnApply.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.btnApply.Click += new System.EventHandler(this.btnApply_Click);
//
// ARProperties
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.CausesValidation = false;
this.ClientSize = new System.Drawing.Size(736, 246);
this.Controls.Add(this.btnApply);
this.Controls.Add(this.btnCancel);
this.Controls.Add(this.btnOK);
this.Controls.Add(this.lblType);
this.Controls.Add(this.cmbType);
this.Controls.Add(this.myPropertyGrid);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "ARProperties";
this.Text = "Archive Properties";
this.ResumeLayout(false);
}
#endregion
private void cmbType_SelectedIndexChanged(object sender, System.EventArgs e)
{
}
// save was clicked, use the objects save methods.
private void btnOK_Click(object sender, System.EventArgs e)
{
btnApply_Click(sender,e);
if (hasInvalidEntry)
{
DialogResult = DialogResult.None;
return; // keep the dialog open
}
if (!glbCancel)
DialogResult=DialogResult.OK;
else
DialogResult=DialogResult.Cancel;
this.Close();
}
// Apply changes
private void btnApply_Click(object sender, System.EventArgs e)
{
bool success = true;
if (!ValidatePropertyEntries()) // check the entry fields
{
return; // has invalid data in a property field
}
if (isnew)
{
if(_ParentObj==null)
{
DialogResult=DialogResult.Cancel;
return;
}
// generate new zip file
success = GenerateArchiveFile();
if (success)
{
// save the property values
success=_CurObj.Write();
}
}
else // update existing ZipFile's Comment Field
{
success=_CurObj.Write();
if (success)
success = AddCommentInformation();
}
// if not successful with the archive, set the cancel
// flag so that a false tree item does not appear.
// Note that when archiving outside of the current directory,
// (for example to a floppy disk), success is set to false to
// prevent a false tree item.
glbCancel = !success;
btnApply.Enabled=false;
}
private bool SelectProcsToArchive()
{
StringCollection SelectedFilesToArchive;
bool isfirst = true;
bool rtnval = false;
ProcedureSelectionList ProcList = new ProcedureSelectionList();
vdb_Set vdbSet=new vdb_Set(strProcSetDir + "\\SET.DBF");
// Loop thru the procset (process like a dataset)
DataTable tbl = vdbSet.DB_Data.Tables[0];
foreach (DataRow row in tbl.Rows)
{
// skip the first one (it's always a "blank" record)
if (isfirst)
isfirst = false;
else
{
ProcList.Add(row);
}
}
if (ProcList.ShowDialog() == DialogResult.OK)
{
StringBuilder tmpstr = new StringBuilder();
string strZipPath = "\"" + strProcSetDir + "\\";
// get list of procedures to archive
// Note that there is no file extension in this list of dBase files
SelectedFilesToArchive = ProcList.GetListOfSelectedProcs_Files();
for(int j=0; j<SelectedFilesToArchive.Count; j++)
{
string tstr = SelectedFilesToArchive[j];
tmpstr.Append(strZipPath);
tmpstr.Append(tstr);
tmpstr.Append(".*\" ");
}
// add needed supporing files
tmpstr.Append(strZipPath);
tmpstr.Append("SET*.*\" ");
tmpstr.Append(strZipPath);
tmpstr.Append("PROC.INI\" ");
tmpstr.Append(strZipPath);
tmpstr.Append("CURSET.DAT\" ");
tmpstr.Append(strZipPath);
tmpstr.Append("USA*.*\" ");
tmpstr.Append(strZipPath);
tmpstr.Append("TRAN*.*\" ");
tmpstr.Append(strZipPath);
tmpstr.Append("XT*.*\" ");
tmpstr.Append(strZipPath);
tmpstr.Append("DOC_*.LIB\" ");
tmpstr.Append(strZipPath);
tmpstr.Append("RO.FST\" ");
tmpstr.Append(strZipPath);
tmpstr.Append("TITLE\" ");
tmpstr.Append(strZipPath);
tmpstr.Append("*.LNK\" ");
tmpstr.Append(strZipPath);
tmpstr.Append("RTFFILES\\*.*\" ");
tmpstr.Append(strZipPath);
tmpstr.Append("TEMPS\\*.*\"");
strFilesToArchive = tmpstr.ToString();
if (SelectedFilesToArchive.Count > 0)
rtnval = true;
}
return rtnval;
}
// This function generates a new zip file
private bool GenerateArchiveFile()
{
bool rtnval = true;
StringBuilder cmntTxt = new StringBuilder();
VEO_Archive arc = (VEO_Archive) _CurObj;
this.glbCancel = false;
if (arc._ArchiveType == VEO_Base.ArchiveTypeOptions.Partial)
{
// get list of selected procedures to archive
rtnval = SelectProcsToArchive();
}
else
{
// Archive entire procedure directory
strFilesToArchive = "\"" + strProcSetDir + "\\*.*\"";
}
if (rtnval)
{
strZipFileExcludeList = "\"" + strProcSetDir + "\\Approved\\*.*\" \"" + strProcSetDir + "\\Temps\\*.*\" *.zip process.dat ?process.dat *.lck";
// Setup DynaZip
ZipFile.strZipPathAndFile = arc.Location;
ZipFile.strZipFileExcludeList = strZipFileExcludeList;
ZipFile.strFilesToArchive = strFilesToArchive;
ZipFile.strArcTitle = arc.Description;
ZipFile.strComment = arc.Comment;
ZipFile.ArchiveType = (int)arc._ArchiveType;
this.Enabled = false;
rtnval = ZipFile.CreateNewZipFile();
this.Enabled = true;
}
return rtnval;
}
private bool AddCommentInformation()
{
VEO_Archive arc = (VEO_Archive) _CurObj;
// add comment
ZipFile.strArcTitle = arc.Description;
ZipFile.ArchiveType = (int)arc._ArchiveType;
ZipFile.strComment = arc.Comment;
return ZipFile.AddZipCommentInformation();
}
private void GetCommentInformation()
{
this.glbCancel = false;
VEO_Archive arc = (VEO_Archive) _CurObj;
if (ZipFile.strArcTitle == null)
arc.Description = arc._Title;
else
arc.Description = ZipFile.strArcTitle;
arc.Comment = ZipFile.strComment;
if (ZipFile.ArchiveType == (int)VEO_Base.ArchiveTypeOptions.Full)
arc.ArchiveType = VEO_Base.ArchiveTypeOptions.Full;
else
arc.ArchiveType = VEO_Base.ArchiveTypeOptions.Partial;
arc.Write();
return;
}
private void myPropertyGrid_PropertyValueChanged(object s, System.Windows.Forms.PropertyValueChangedEventArgs e)
{
btnApply.Enabled = true;
}
private void btnCancel_Click(object sender, System.EventArgs e)
{
this.glbCancel = true;
}
/*
* Check the property fields for invalid entries
* If an invalid entry is found, display a message and
* return to the property dialog
*/
private bool ValidatePropertyEntries()
{
VEO_Archive arc = (VEO_Archive) _CurObj;
hasInvalidEntry = false;
// Check the zip file path and filename
if (!IsAValidZipFileLocation())
{
hasInvalidEntry = true;
return false; // data in fields are not valid
}
if (zipInCurProcSet && (arc.Description == null || arc.Description.Equals("")))
{
// put in a default title
arc.Description = "Archive: " + strZipFileName;
}
return (true); // data in fields are valid
}
/*
* Check the zip file name and path.
* Display message box to notify user of invalid entry.
* Assign local strArchive variables accordingly.
*/
private bool IsAValidZipFileLocation()
{
string strArchiveLocation;
string strCurDirSave;
VEO_Archive arc = (VEO_Archive) _CurObj;
strArchiveLocation = arc._Location;
// Check for a cleared out location field
if (arc._Location == null || arc._Location.Equals(""))
{
MessageBox.Show("Need to Enter the Archive Location and File Name","Archive Error");
return false;
}
string strTmp = strArchiveLocation.ToUpper();
// Check for a zip extension
if (!strTmp.EndsWith(".ZIP"))
{
MessageBox.Show("Need to enter the Archive File Name","Archive Error");
return false;
}
// make sure the current working directory is the current procedure set
strCurDirSave = Directory.GetCurrentDirectory();
Directory.SetCurrentDirectory(strProcSetDir);
// Get the full path based on the user entry
strArchiveLocation = Path.GetFullPath(strArchiveLocation);
if (!strArchiveLocation.Equals(arc._Location))
{
if (strArchiveLocation == null || strArchiveLocation.Equals(""))
{
MessageBox.Show("Invalid Archive File Name or File Path","Archive Error");
// reset the current working directory
Directory.SetCurrentDirectory(strCurDirSave);
return false;
}
arc._Location = strArchiveLocation;
}
// parse out the file name
strZipFileName = Path.GetFileName(strArchiveLocation);
// parse out the path
strCurZipPath = strArchiveLocation.Substring(0,strArchiveLocation.LastIndexOf(strZipFileName)-1);
// If the zip file path is not the same as the current working directory
// then flag the fact we are creating a zip file outside the procedure directory.
zipInCurProcSet = Directory.Equals(Directory.GetCurrentDirectory(),strCurZipPath);
// reset the current working directory
Directory.SetCurrentDirectory(strCurDirSave);
return true;
}
}
}

View File

@@ -0,0 +1,201 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 1.3
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">1.3</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1">this is my long string</data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
[base64 mime encoded serialized .NET Framework object]
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
[base64 mime encoded string representing a byte array form of the .NET Framework object]
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used forserialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>1.3</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="myPropertyGrid.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="myPropertyGrid.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="myPropertyGrid.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="cmbType.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="cmbType.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="cmbType.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="lblType.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="lblType.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="lblType.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="btnOK.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="btnOK.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="btnOK.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="btnCancel.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="btnCancel.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="btnCancel.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="btnApply.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="btnApply.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="btnApply.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="$this.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="$this.Name">
<value>ARProperties</value>
</data>
<data name="$this.Language" type="System.Globalization.CultureInfo, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>(Default)</value>
</data>
<data name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="$this.Localizable" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="$this.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>8, 8</value>
</data>
<data name="$this.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="$this.TrayHeight" type="System.Int32, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>80</value>
</data>
<data name="$this.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="$this.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAICAQAAAAAADoAgAAFgAAACgAAAAgAAAAQAAAAAEABAAAAAAAgAIAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAADAAADAAAAAwMAAwAAAAMAAwADAwAAAwMDAAICAgAAAAP8AAP8AAAD//wD/AAAA/wD/AP//
AAD///8AiIiIiIiIiIiIiIiIiIiIiPF3F3F3F3F3F3d3d3d3d3jxdxdxdxdxdxd3d3d3d3d49xdxdxdx
dxdxd3d3d3d3ePcXcXcXcXcXcXd3d3d3d3jxcXcXcXcXcXcXd3d3d3d48XF3F3F3F3F3F3d3d3d3ePdx
F3F3F3F3F3F3d3d3d3j3cRdxdxdxdxdxd3d3d3d49xdxdxdxdxdxdxd3d3d3ePcXcXcXcXcXcXcXd3d3
d3jxdxcXcXcXcXcXcXd3d3d48XcXF3F3F3F3F3F3d3d3ePdxdxF3F3F3F3F3F3d3d3j3cXcRdxdxdxdx
dxd3d3d49xdxdxdxdxdxdxdxd3d3ePcXcXcXcXcXcXcXcXd3d3jxdxdxcXcXcXcXcXcXd3d48XcXcXF3
F3F3F3F3F3d3ePdxdxd3F3F3F3F3F3F3d3j3cXcXdxdxdxdxdxdxd3d49xdxd3dxdxdxdxdxdxd3ePcX
cXd3cXcXcXcXcXcXd3jxdxd3d3cXcXcXcXcXcXd48XcXd3d3F3F3F3F3F3F3ePdxd3d3d3F3F3F3F3F3
F3j3cXd3d3dxdxdxdxdxdxd49xd3d3d3dxdxdxdxdxdxePcXd3d3d3cXcXcXcXcXcXjxd3d3d3d3cXcX
cXcXcXcY8Xd3d3d3d3F3F3F3F3F3GP////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==
</value>
</data>
</root>

View File

@@ -0,0 +1,293 @@
/*********************************************************************************************
* Copyright 2005 - Volian Enterprises, Inc. All rights reserved.
* Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
* ------------------------------------------------------------------------------
* $Workfile: AppConflict.cs $ $Revision: 4 $
* $Author: Kathy $ $Date: 8/16/05 2:55p $
*
* $History: AppConflict.cs $
*
* ***************** Version 4 *****************
* User: Kathy Date: 8/16/05 Time: 2:55p
* Updated in $/LibSource/VEObject
* B2005-030: error if missing ndx
*
* ***************** Version 3 *****************
* User: Jsj Date: 6/02/05 Time: 11:32a
* Updated in $/LibSource/VEObject
* fix for approving with conditional ROs
*
* ***************** Version 2 *****************
* User: Kathy Date: 3/22/05 Time: 10:01a
* Updated in $/LibSource/VEObject
* Add procnum to transition message
*
* ***************** Version 1 *****************
* User: Kathy Date: 3/08/05 Time: 1:50p
* Created in $/LibSource/VEObject
* Approval
*********************************************************************************************/
using System;
using System.Text;
using System.Collections.Specialized;
namespace VEObject
{
/// <summary>
/// Summary description for AppConflict.
/// </summary>
public enum AppConflictTypes
{
RO=0, Trans=1, LibDoc=2
};
public class AppConflict
{
public AppConflictTypes CType;
public string ProcNum;
public string SeqNum;
public VEO_DummySet DummySet;
public AppConflict()
{
}
public string GetLocStr(string pnum, string snum)
{
string locstr=null;
string secnumtitle = DummySet.GetSectionNumAndTitle(pnum,snum);
if (snum.Length>1)
{
char tmp = System.Convert.ToChar(snum.Substring(1,1));
string stpnum = System.Convert.ToString(tmp-'0');
locstr = secnumtitle + " Step " + stpnum;
}
else
locstr = secnumtitle;
return locstr;
}
public virtual StringCollection GetStrForDlg()
{
return null;
}
public virtual string GetStrForEdit()
{
return null;
}
}
public class AppROConflict : AppConflict
{
public string ROID;
public string AccID;
public bool IsImage;
public string Val1, Val2;
public AppROConflict(VEO_DummySet ds, string rid, string pnum, string snum, bool image, string v1, string v2)
{
CType = AppConflictTypes.RO;
ROID = rid;
DummySet = ds;
ProcNum = pnum;
SeqNum = snum;
IsImage=image;
Val1=v1; //if image, this will contain image file path
Val2=v2;
if (Val1==null) Val1=" not defined ";
if (Val2==null) Val2=" not defined ";
}
public override string GetStrForEdit()
{
// For ROs:
// reference line is trimmed to 100 chars & consists of...
// 12 chars - sequence number where RO is used
// 20 chars - procedure number where RO is used
// 88 chars - menu item text, i.e. what's shown on dialog.
StringBuilder sb = new StringBuilder(125);
sb.Append(SeqNum.PadRight(12,' '));
sb.Append(ProcNum.PadRight(20,' '));
string locstr = GetLocStr(ProcNum,SeqNum);
string tmp=null;
if (IsImage)
tmp = "RO: Image File Difference: " + Val1.Replace("\n"," ") + " used in " + locstr;
else
tmp = "RO: New Value = " + Val1.Replace("\n"," ") + " Old Value = " + Val2.Replace("\n"," ") + " used in " + locstr;
int len = tmp.Length;
if (len==88)
sb.Append(tmp);
else if (len > 88)
sb.Append(tmp.Substring(0,88));
else
sb.Append(tmp.PadRight(88,' '));
return sb.ToString();
}
public override StringCollection GetStrForDlg()
{
StringCollection retstrs = new StringCollection();
StringBuilder sb = new StringBuilder();
string retstr;
string locstr = GetLocStr(ProcNum,SeqNum);
if (IsImage)
{
sb.Append(" RO Image File Difference At: ");
sb.Append(locstr);
retstrs.Add(sb.ToString());
sb.Remove(0,sb.Length);
sb.Append(" RO Value: ");
sb.Append(Val1);
retstrs.Add(sb.ToString());
}
else
{
int nlptr = -1;
int idx = 0;
sb.Append(" RO Difference At: ");
sb.Append(locstr);
retstrs.Add(sb.ToString());
sb.Remove(0,sb.Length);
sb.Append(" New Value = ");
nlptr = Val1.IndexOf("\n");
while (nlptr > -1)
{
sb.Append(Val1.Substring(idx,nlptr-idx));
retstrs.Add(sb.ToString());
sb.Remove(0,sb.Length);
idx = nlptr+1;
nlptr = Val1.IndexOf("\n",idx);
sb.Append(" ");
}
sb.Append(Val1.Substring(idx));
retstrs.Add(sb.ToString());
sb.Remove(0,sb.Length);
sb.Append(" Old Value = ");
idx = 0;
nlptr = Val2.IndexOf("\n");
while (nlptr > -1)
{
sb.Append(Val2.Substring(idx,nlptr-idx));
retstrs.Add(sb.ToString());
sb.Remove(0,sb.Length);
idx = nlptr+1;
nlptr = Val2.IndexOf("\n",idx);
sb.Append(" ");
}
sb.Append(Val2.Substring(idx));
retstrs.Add(sb.ToString());
}
return retstrs;
}
}
public class AppTransConflict : AppConflict
{
public string ToNum;
public string ToSeq;
public string OldTo;
public AppTransConflict(VEO_DummySet ds, string pnum, string snum, string tpnum, string tsnum, string old)
{
CType = AppConflictTypes.Trans;
DummySet = ds;
ProcNum = pnum;
SeqNum = snum;
ToNum=tpnum;
ToSeq=tsnum;
OldTo = old;
}
public override StringCollection GetStrForDlg()
{
StringCollection retstrs = new StringCollection();
StringBuilder sb = new StringBuilder();
sb.Append(" Transition: From = ");
sb.Append(ProcNum);
sb.Append(" ");
sb.Append(GetLocStr(ProcNum,SeqNum));
retstrs.Add(sb.ToString());
sb.Remove(0,sb.Length);
sb.Append(" To = ");
sb.Append(ToNum);
sb.Append(" ");
sb.Append(GetLocStr(ToNum,ToSeq));
retstrs.Add(sb.ToString());
return retstrs;
}
public override string GetStrForEdit()
{
// For Trans:
// reference line is trimmed to 100 chars & consists of...
// 12 chars - sequence number where Tran is used
// 20 chars - procedure number where Tran is used
// 88 chars - menu item text, i.e. what's shown on dialog.
StringBuilder sb = new StringBuilder(125);
sb.Append(SeqNum.PadRight(12,' '));
sb.Append(ProcNum.PadRight(20,' '));
string tmp = "Transition: To = " + " " + GetLocStr(ToNum,ToSeq);
int len = tmp.Length;
if (len==88)
sb.Append(tmp);
else if (len > 88)
sb.Append(tmp.Substring(0,88));
else
sb.Append(tmp.PadRight(88,' '));
return sb.ToString();
}
}
public class AppLibDocConflict : AppConflict
{
public string LibDocName;
public AppLibDocConflict(VEO_DummySet ds, string pnum, string seq, string Lname)
{
CType = AppConflictTypes.LibDoc;
DummySet = ds;
ProcNum = pnum;
SeqNum = seq;
LibDocName = Lname;
}
public override StringCollection GetStrForDlg()
{
StringCollection retstrs = new StringCollection();
StringBuilder sb = new StringBuilder();
sb.Append(" Library Doc = ");
sb.Append(LibDocName);
sb.Append(" used in ");
sb.Append(GetLocStr(ProcNum,SeqNum));
retstrs.Add(sb.ToString());
return retstrs;
}
public override string GetStrForEdit()
{
// For libdoc:
// reference line is trimmed to 100 chars & consists of...
// 12 chars - sequence number where LibDoc is used
// 20 chars - procedure number where LibDoc is used
// 88 chars - menu item text, i.e. what's shown on dialog.
StringBuilder sb = new StringBuilder(125);
sb.Append(SeqNum.PadRight(12,' '));
sb.Append(ProcNum.PadRight(20,' '));
string tmp = "Library Document: File Name = " + LibDocName + " used in " + GetLocStr(ProcNum,SeqNum);
int len = tmp.Length;
if (len==88)
sb.Append(tmp);
else if (len > 88)
sb.Append(tmp.Substring(0,88));
else
sb.Append(tmp.PadRight(88,' '));
return sb.ToString();
}
}
}

View File

@@ -0,0 +1,76 @@
/*********************************************************************************************
* Copyright 2005 - Volian Enterprises, Inc. All rights reserved.
* Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
* ------------------------------------------------------------------------------
* $Workfile: AppIndItm.cs $ $Revision: 1 $
* $Author: Kathy $ $Date: 3/08/05 1:50p $
*
* $History: AppIndItm.cs $
*
* ***************** Version 1 *****************
* User: Kathy Date: 3/08/05 Time: 1:50p
* Created in $/LibSource/VEObject
* Approval
*********************************************************************************************/
using System;
using System.Collections;
namespace VEObject
{
/// <summary>
/// Summary description for AppIndItm.
/// </summary>
public class AppIndItem
{
public VEO_Proc Proc;
public ArrayList ConflictList;
public bool Checked;
public AppIndItem(VEO_Proc prc)
{
Checked=false;
Proc = prc;
ConflictList = new ArrayList();
}
public void AddConflict(AppConflict aconflct)
{
ConflictList.Add(aconflct);
}
}
public class ModLibDoc
{
public string LibFile;
public int status;
public int DocPages;
public ModLibDoc(string file, int stat)
{
LibFile = file;
status=stat;
DocPages=0;
}
}
public class ModRO
{
public string roid;
public bool IsImage;
public string Val1;
public string Val2;
public bool IsUsed;
public ModRO(string r, bool im, string v1, string v2)
{
roid = r;
IsImage = im;
Val1 = v1;
Val2 = v2;
IsUsed=false;
}
}
}

View File

@@ -0,0 +1,235 @@
/*********************************************************************************************
* Copyright 2005 - Volian Enterprises, Inc. All rights reserved.
* Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
* ------------------------------------------------------------------------------
* $Workfile: ApproveDlg.cs $ $Revision: 2 $
* $Author: Jsj $ $Date: 5/17/05 11:55a $
*
* $History: ApproveDlg.cs $
*
* ***************** Version 2 *****************
* User: Jsj Date: 5/17/05 Time: 11:55a
* Updated in $/LibSource/VEObject
* cleanup
*
* ***************** Version 1 *****************
* User: Kathy Date: 3/08/05 Time: 1:50p
* Created in $/LibSource/VEObject
* Approval
*********************************************************************************************/
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using Utils;
namespace VEObject
{
/// <summary>
/// Summary description for ApproveDlg.
/// </summary>
public class ApproveDlg : System.Windows.Forms.Form
{
private System.Windows.Forms.TextBox tbApprovalDate;
private System.Windows.Forms.Label lblDate;
private System.Windows.Forms.GroupBox grpCB;
private System.Windows.Forms.RadioButton rbWDKeep;
private System.Windows.Forms.RadioButton rbWDRemove;
private System.Windows.Forms.CheckBox cbZipApp;
private System.Windows.Forms.Button btnOK;
private System.Windows.Forms.Button btnCancel;
private System.Windows.Forms.CheckBox cbTmpChg;
public ApprovalOptions ApprovalOptions
{
get
{
ApprovalOptions ao = new ApprovalOptions();
ao.ApproveDate = this.tbApprovalDate.Text;
ao.ChangeBarsWD = this.rbWDKeep.Checked;
ao.DoZip = this.cbZipApp.Checked;
return ao;
}
}
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
public ApproveDlg()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
this.tbApprovalDate.Text = DTI.MakeDate(DTI.DateTimeInit,false,false);
this.rbWDRemove.Checked = true;
this.cbZipApp.Checked = true;
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(ApproveDlg));
this.tbApprovalDate = new System.Windows.Forms.TextBox();
this.lblDate = new System.Windows.Forms.Label();
this.grpCB = new System.Windows.Forms.GroupBox();
this.rbWDRemove = new System.Windows.Forms.RadioButton();
this.rbWDKeep = new System.Windows.Forms.RadioButton();
this.cbZipApp = new System.Windows.Forms.CheckBox();
this.btnOK = new System.Windows.Forms.Button();
this.btnCancel = new System.Windows.Forms.Button();
this.cbTmpChg = new System.Windows.Forms.CheckBox();
this.grpCB.SuspendLayout();
this.SuspendLayout();
//
// tbApprovalDate
//
this.tbApprovalDate.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.tbApprovalDate.Location = new System.Drawing.Point(221, 9);
this.tbApprovalDate.Name = "tbApprovalDate";
this.tbApprovalDate.Size = new System.Drawing.Size(249, 24);
this.tbApprovalDate.TabIndex = 3;
this.tbApprovalDate.Text = "";
//
// lblDate
//
this.lblDate.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.lblDate.Location = new System.Drawing.Point(19, 18);
this.lblDate.Name = "lblDate";
this.lblDate.Size = new System.Drawing.Size(183, 19);
this.lblDate.TabIndex = 2;
this.lblDate.Text = "Approval Date:";
//
// grpCB
//
this.grpCB.Controls.Add(this.rbWDRemove);
this.grpCB.Controls.Add(this.rbWDKeep);
this.grpCB.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.grpCB.Location = new System.Drawing.Point(10, 65);
this.grpCB.Name = "grpCB";
this.grpCB.Size = new System.Drawing.Size(268, 64);
this.grpCB.TabIndex = 4;
this.grpCB.TabStop = false;
this.grpCB.Text = "Change Bars In Working Draft";
//
// rbWDRemove
//
this.rbWDRemove.Location = new System.Drawing.Point(154, 28);
this.rbWDRemove.Name = "rbWDRemove";
this.rbWDRemove.Size = new System.Drawing.Size(86, 27);
this.rbWDRemove.TabIndex = 1;
this.rbWDRemove.Text = "Remove";
//
// rbWDKeep
//
this.rbWDKeep.Location = new System.Drawing.Point(29, 28);
this.rbWDKeep.Name = "rbWDKeep";
this.rbWDKeep.Size = new System.Drawing.Size(77, 27);
this.rbWDKeep.TabIndex = 0;
this.rbWDKeep.Text = "Keep";
//
// cbZipApp
//
this.cbZipApp.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.cbZipApp.Location = new System.Drawing.Point(19, 194);
this.cbZipApp.Name = "cbZipApp";
this.cbZipApp.Size = new System.Drawing.Size(269, 28);
this.cbZipApp.TabIndex = 6;
this.cbZipApp.Text = "Archive Data Before Approval?";
//
// btnOK
//
this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK;
this.btnOK.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.btnOK.Location = new System.Drawing.Point(96, 240);
this.btnOK.Name = "btnOK";
this.btnOK.Size = new System.Drawing.Size(182, 28);
this.btnOK.TabIndex = 7;
this.btnOK.Text = "Continue with Approval";
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
//
// btnCancel
//
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnCancel.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.btnCancel.Location = new System.Drawing.Point(307, 240);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(183, 28);
this.btnCancel.TabIndex = 8;
this.btnCancel.Text = "Cancel Approval";
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
//
// cbTmpChg
//
this.cbTmpChg.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.cbTmpChg.Location = new System.Drawing.Point(19, 157);
this.cbTmpChg.Name = "cbTmpChg";
this.cbTmpChg.Size = new System.Drawing.Size(317, 28);
this.cbTmpChg.TabIndex = 9;
this.cbTmpChg.Text = "Create A Temporary Change Version?";
//
// ApproveDlg
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 15);
this.ClientSize = new System.Drawing.Size(604, 293);
this.Controls.Add(this.cbTmpChg);
this.Controls.Add(this.btnCancel);
this.Controls.Add(this.btnOK);
this.Controls.Add(this.cbZipApp);
this.Controls.Add(this.grpCB);
this.Controls.Add(this.tbApprovalDate);
this.Controls.Add(this.lblDate);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "ApproveDlg";
this.Text = "Approval Properties";
this.grpCB.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private void btnOK_Click(object sender, System.EventArgs e)
{
}
private void btnCancel_Click(object sender, System.EventArgs e)
{
}
}
public class ApprovalOptions
{
//public string ApproveNameRev;
public string Type;
public string ApproveDate;
public bool ChangeBarsWD;
public bool ChangeBarsApp;
public bool DoZip;
}
}

View File

@@ -0,0 +1,237 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 1.3
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">1.3</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1">this is my long string</data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
[base64 mime encoded serialized .NET Framework object]
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
[base64 mime encoded string representing a byte array form of the .NET Framework object]
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used forserialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>1.3</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="tbApprovalDate.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="tbApprovalDate.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="tbApprovalDate.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="lblDate.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="lblDate.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="lblDate.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="grpCB.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="grpCB.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>8, 8</value>
</data>
<data name="grpCB.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="grpCB.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="grpCB.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="grpCB.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="rbWDRemove.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="rbWDRemove.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="rbWDRemove.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="rbWDKeep.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="rbWDKeep.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="rbWDKeep.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="cbZipApp.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="cbZipApp.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="cbZipApp.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="btnOK.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="btnOK.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="btnOK.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="btnCancel.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="btnCancel.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="btnCancel.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="cbTmpChg.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="cbTmpChg.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="cbTmpChg.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="$this.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="$this.Language" type="System.Globalization.CultureInfo, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>(Default)</value>
</data>
<data name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="$this.Localizable" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="$this.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>8, 8</value>
</data>
<data name="$this.Name">
<value>ApproveDlg</value>
</data>
<data name="$this.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="$this.TrayHeight" type="System.Int32, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>80</value>
</data>
<data name="$this.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="$this.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAICAQAAAAAADoAgAAFgAAACgAAAAgAAAAQAAAAAEABAAAAAAAgAIAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAADAAADAAAAAwMAAwAAAAMAAwADAwAAAwMDAAICAgAAAAP8AAP8AAAD//wD/AAAA/wD/AP//
AAD///8AiIiIiIiIiIiIiIiIiIiIiPF3F3F3F3F3F3d3d3d3d3jxdxdxdxdxdxd3d3d3d3d49xdxdxdx
dxdxd3d3d3d3ePcXcXcXcXcXcXd3d3d3d3jxcXcXcXcXcXcXd3d3d3d48XF3F3F3F3F3F3d3d3d3ePdx
F3F3F3F3F3F3d3d3d3j3cRdxdxdxdxdxd3d3d3d49xdxdxdxdxdxdxd3d3d3ePcXcXcXcXcXcXcXd3d3
d3jxdxcXcXcXcXcXcXd3d3d48XcXF3F3F3F3F3F3d3d3ePdxdxF3F3F3F3F3F3d3d3j3cXcRdxdxdxdx
dxd3d3d49xdxdxdxdxdxdxdxd3d3ePcXcXcXcXcXcXcXcXd3d3jxdxdxcXcXcXcXcXcXd3d48XcXcXF3
F3F3F3F3F3d3ePdxdxd3F3F3F3F3F3F3d3j3cXcXdxdxdxdxdxdxd3d49xdxd3dxdxdxdxdxdxd3ePcX
cXd3cXcXcXcXcXcXd3jxdxd3d3cXcXcXcXcXcXd48XcXd3d3F3F3F3F3F3F3ePdxd3d3d3F3F3F3F3F3
F3j3cXd3d3dxdxdxdxdxdxd49xd3d3d3dxdxdxdxdxdxePcXd3d3d3cXcXcXcXcXcXjxd3d3d3d3cXcX
cXcXcXcY8Xd3d3d3d3F3F3F3F3F3GP////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==
</value>
</data>
</root>

View File

@@ -0,0 +1,615 @@
/*********************************************************************************************
* Copyright 2005 - Volian Enterprises, Inc. All rights reserved.
* Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
* ------------------------------------------------------------------------------
* $Workfile: ApproveSelDlg.cs $ $Revision: 9 $
* $Author: Jsj $ $Date: 4/16/07 12:05p $
*
* $History: ApproveSelDlg.cs $
*
* ***************** Version 9 *****************
* User: Jsj Date: 4/16/07 Time: 12:05p
* Updated in $/LibSource/VEObject
* Clear Button needed to clear flag in Modified Lib Doc List
*
* ***************** Version 8 *****************
* User: Jsj Date: 7/21/06 Time: 2:57p
* Updated in $/LibSource/VEObject
* remove duplicates from dependency list
*
* ***************** Version 7 *****************
* User: Kathy Date: 6/21/05 Time: 7:25a
* Updated in $/LibSource/VEObject
* cleanup/bug fixes
*
* ***************** Version 6 *****************
* User: Jsj Date: 6/02/05 Time: 11:33a
* Updated in $/LibSource/VEObject
* fix for approving with conditional ROs
*
* ***************** Version 5 *****************
* User: Jsj Date: 5/17/05 Time: 11:56a
* Updated in $/LibSource/VEObject
* cleanup
*
* ***************** Version 4 *****************
* User: Kathy Date: 4/21/05 Time: 10:21a
* Updated in $/LibSource/VEObject
* print all lines for long line in report
*
* ***************** Version 3 *****************
* User: Kathy Date: 4/12/05 Time: 1:01p
* Updated in $/LibSource/VEObject
*
* ***************** Version 2 *****************
* User: Kathy Date: 3/22/05 Time: 10:02a
* Updated in $/LibSource/VEObject
* log file & edit conflict
*
* ***************** Version 1 *****************
* User: Kathy Date: 3/08/05 Time: 1:50p
* Created in $/LibSource/VEObject
* Approval
*********************************************************************************************/
using System;
using System.Drawing;
using System.Drawing.Printing;
using System.Collections;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Windows.Forms;
using System.IO;
using VlnStatus;
using Utils;
namespace VEObject
{
/// <summary>
/// Summary description for ApproveSelDlg.
/// </summary>
public class ApproveSelDlg : System.Windows.Forms.Form
{
private System.Windows.Forms.ListBox listAvail;
private System.Windows.Forms.ListBox listSelect;
private System.Windows.Forms.Label lblAvail;
private System.Windows.Forms.Label lblSelected;
private System.Windows.Forms.Button btnSelect;
private System.Windows.Forms.Button btnClear;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button btnApprove;
private System.Windows.Forms.Button btnResolve;
private System.Windows.Forms.Button btnCancel;
private System.Windows.Forms.Button btnRpt;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
private VEO_DummySet CurDSet;
private ArrayList AppItems;
private ArrayList ModROs;
private System.Windows.Forms.ListBox listDepend;
private ArrayList ModLibDocs;
public ApproveSelDlg(ArrayList items, VEO_ProcSet curset, ArrayList mros, ArrayList mlibdocs)
{
InitializeComponent();
// procedures are stored off dummyset, which is children[1] always
CurDSet = (VEO_DummySet) curset.Children[1];
AppItems = items;
ModROs = mros;
ModLibDocs = mlibdocs;
SetUpAvailSelectLists();
VlnStatusMessage StatMsgWin = new VlnStatusMessage("Looking for Dependencies...");
StatMsgWin.StatusMessage = "Populating Dependency List";
PopulateDependList();
PopulateLogFile();
StatMsgWin.Dispose();
}
private void SetUpAvailSelectLists()
{
// add the list of procs to the selected list and
// see if there are any more selections made.
foreach (object obj in AppItems)
{
AppIndItem apitm = (AppIndItem) obj;
string UnitSpecPrcNum = ROFST_FILE.ROProcessTools.UnitSpecific(apitm.Proc._Prcnum,0,0,CurDSet.LargestNumber);
listSelect.Items.Add(UnitSpecPrcNum);
}
int cnt=0;
while (cnt < CurDSet.Children.Count)
{
VEO_Proc prc = (VEO_Proc) CurDSet.Children[cnt];
string pnum = ROFST_FILE.ROProcessTools.UnitSpecific(prc._Prcnum,0,0,CurDSet.LargestNumber);
if (!listSelect.Items.Contains(pnum)) listAvail.Items.Add(pnum);
cnt++;
}
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(ApproveSelDlg));
this.listAvail = new System.Windows.Forms.ListBox();
this.listSelect = new System.Windows.Forms.ListBox();
this.lblAvail = new System.Windows.Forms.Label();
this.lblSelected = new System.Windows.Forms.Label();
this.btnSelect = new System.Windows.Forms.Button();
this.btnClear = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.btnApprove = new System.Windows.Forms.Button();
this.btnResolve = new System.Windows.Forms.Button();
this.btnCancel = new System.Windows.Forms.Button();
this.btnRpt = new System.Windows.Forms.Button();
this.listDepend = new System.Windows.Forms.ListBox();
this.SuspendLayout();
//
// listAvail
//
this.listAvail.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.listAvail.ItemHeight = 20;
this.listAvail.Location = new System.Drawing.Point(29, 28);
this.listAvail.Name = "listAvail";
this.listAvail.Size = new System.Drawing.Size(345, 184);
this.listAvail.TabIndex = 0;
//
// listSelect
//
this.listSelect.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.listSelect.ItemHeight = 20;
this.listSelect.Location = new System.Drawing.Point(509, 28);
this.listSelect.Name = "listSelect";
this.listSelect.Size = new System.Drawing.Size(355, 184);
this.listSelect.TabIndex = 1;
//
// lblAvail
//
this.lblAvail.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.lblAvail.Location = new System.Drawing.Point(29, 8);
this.lblAvail.Name = "lblAvail";
this.lblAvail.Size = new System.Drawing.Size(221, 16);
this.lblAvail.TabIndex = 2;
this.lblAvail.Text = "Available Procedures";
this.lblAvail.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// lblSelected
//
this.lblSelected.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.lblSelected.Location = new System.Drawing.Point(509, 8);
this.lblSelected.Name = "lblSelected";
this.lblSelected.Size = new System.Drawing.Size(249, 16);
this.lblSelected.TabIndex = 3;
this.lblSelected.Text = "Selected Procedures";
this.lblSelected.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// btnSelect
//
this.btnSelect.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.btnSelect.Location = new System.Drawing.Point(384, 32);
this.btnSelect.Name = "btnSelect";
this.btnSelect.Size = new System.Drawing.Size(120, 40);
this.btnSelect.TabIndex = 4;
this.btnSelect.Text = "Select";
this.btnSelect.Click += new System.EventHandler(this.btnSelect_Click);
//
// btnClear
//
this.btnClear.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.btnClear.Location = new System.Drawing.Point(384, 96);
this.btnClear.Name = "btnClear";
this.btnClear.Size = new System.Drawing.Size(120, 40);
this.btnClear.TabIndex = 5;
this.btnClear.Text = "Clear";
this.btnClear.Click += new System.EventHandler(this.btnClear_Click);
//
// label1
//
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.label1.Location = new System.Drawing.Point(29, 216);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(187, 18);
this.label1.TabIndex = 7;
this.label1.Text = "Dependencies Report";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// btnApprove
//
this.btnApprove.DialogResult = System.Windows.Forms.DialogResult.OK;
this.btnApprove.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.btnApprove.Location = new System.Drawing.Point(56, 616);
this.btnApprove.Name = "btnApprove";
this.btnApprove.Size = new System.Drawing.Size(216, 32);
this.btnApprove.TabIndex = 8;
this.btnApprove.Text = "Continue With Approval";
//
// btnResolve
//
this.btnResolve.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.btnResolve.Location = new System.Drawing.Point(360, 616);
this.btnResolve.Name = "btnResolve";
this.btnResolve.Size = new System.Drawing.Size(200, 32);
this.btnResolve.TabIndex = 9;
this.btnResolve.Text = "Edit Dependencies";
this.btnResolve.Click += new System.EventHandler(this.btnResolve_Click);
//
// btnCancel
//
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnCancel.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.btnCancel.Location = new System.Drawing.Point(648, 616);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(192, 32);
this.btnCancel.TabIndex = 10;
this.btnCancel.Text = "Cancel";
//
// btnRpt
//
this.btnRpt.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.btnRpt.Location = new System.Drawing.Point(384, 160);
this.btnRpt.Name = "btnRpt";
this.btnRpt.Size = new System.Drawing.Size(120, 46);
this.btnRpt.TabIndex = 11;
this.btnRpt.Text = "Print Report";
this.btnRpt.Click += new System.EventHandler(this.btnRpt_Click);
//
// listDepend
//
this.listDepend.Font = new System.Drawing.Font("Courier New", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.listDepend.HorizontalScrollbar = true;
this.listDepend.ItemHeight = 16;
this.listDepend.Location = new System.Drawing.Point(29, 240);
this.listDepend.Name = "listDepend";
this.listDepend.SelectionMode = System.Windows.Forms.SelectionMode.None;
this.listDepend.Size = new System.Drawing.Size(835, 356);
this.listDepend.TabIndex = 12;
//
// ApproveSelDlg
//
this.AutoScale = false;
this.AutoScaleBaseSize = new System.Drawing.Size(6, 15);
this.AutoScroll = true;
this.ClientSize = new System.Drawing.Size(871, 662);
this.Controls.Add(this.listDepend);
this.Controls.Add(this.btnRpt);
this.Controls.Add(this.btnCancel);
this.Controls.Add(this.btnResolve);
this.Controls.Add(this.btnApprove);
this.Controls.Add(this.label1);
this.Controls.Add(this.btnClear);
this.Controls.Add(this.btnSelect);
this.Controls.Add(this.lblSelected);
this.Controls.Add(this.lblAvail);
this.Controls.Add(this.listSelect);
this.Controls.Add(this.listAvail);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "ApproveSelDlg";
this.Text = "Approve Selected Procedures";
this.ResumeLayout(false);
}
#endregion
// if user presses Clear button, clear the selected items list, and
// reset the available to all in procedure set.
private void btnClear_Click(object sender, System.EventArgs e)
{
// reset both lists and will reset available from procedures in set.
listSelect.Items.Clear();
listAvail.Items.Clear();
AppItems.Clear(); // no procedures to approve.
SetUpAvailSelectLists();
listDepend.Items.Clear();
// Bug Fix: B2007-010
// If you don't clear the DocPages, then if you re-select
// the same procedure to approve, it will think that
// the library document check was already done - thus
// no depenencies the second time around.
foreach (ModLibDoc ml in ModLibDocs) ml.DocPages = 0;
}
private bool PopulateEditList()
{
bool hascon = false;
if (AppItems.Count<=0)
{
MessageBox.Show("No conflicts exist","Approve Selected");
return hascon;
}
VlnStatusMessage StatMsgWin = new VlnStatusMessage("Conflict Resolution...");
StatMsgWin.StatusMessage = "Populating Edit List";
// Create the reference file - use apprcon as filename
// get first item in list & use this as the procedure number.
AppIndItem apitm = (AppIndItem) AppItems[0];
string pnum = apitm.Proc._Prcnum;
RefList rl = new RefList(pnum,"apprcon",CurDSet.usrRunTime);
rl.Create();
ArrayList tarry = new ArrayList();
foreach (object obj in AppItems)
{
apitm = (AppIndItem) obj;
foreach (AppConflict ac in apitm.ConflictList)
{
hascon = true;
string strForEdit;
strForEdit = ac.GetStrForEdit();
if (!tarry.Contains(strForEdit))
{
rl.WriteRefLine(strForEdit);
tarry.Add(strForEdit);
}
// rl.WriteRefLine(ac.GetStrForEdit());
}
}
rl.WriteTotalNumRefs();
rl.CloseFile();
StatMsgWin.Dispose();
if (!hascon)
{
MessageBox.Show("No conflicts exist - cannot edit.","Approve Selected");
apitm = (AppIndItem) AppItems[0];
// note that if the following is entered as a single string (rather than
// two strings concatenated) the argument passing changes the string and
// exeadjust does not work correctly - keep as two separate strings.
string fl = apitm.Proc.usrRunTime.ExeAdjust("\xE7" + "apprcon");
if (File.Exists(fl))File.Delete(fl);
return false;
}
return true;
}
private void PopulateDependList()
{
listDepend.Items.Clear();
bool doblank = false;
foreach (object obj in AppItems)
{
AppIndItem apitm = (AppIndItem) obj;
if (doblank) // don't add a blank line the first time.
listDepend.Items.Add(" ");
else
doblank=true;
listDepend.Items.Add("Dependencies in : " + ROFST_FILE.ROProcessTools.UnitSpecific(apitm.Proc._Prcnum,0,0,CurDSet.LargestNumber));
if (apitm.ConflictList.Count==0)
listDepend.Items.Add(" None");
else
{
foreach (AppConflict ac in apitm.ConflictList)
{
StringCollection sc = ac.GetStrForDlg();
foreach (string tmpstr in sc)
{
listDepend.Items.Add(tmpstr);
}
// listDepend.Items.Add(ac.GetStrForDlg());
}
}
}
}
private void PopulateLogFile()
{
using (StreamWriter sw = new StreamWriter("Approval.log", true))
{
sw.Write("APPROVE SELECTED: Conflicts found on ");
sw.Write(DateTime.Now);
sw.WriteLine(" performed by " + DTI.Initials);
foreach (object obj in AppItems)
{
AppIndItem apitm = (AppIndItem) obj;
sw.WriteLine(" Dependencies in : " + ROFST_FILE.ROProcessTools.UnitSpecific(apitm.Proc._Prcnum,0,0,CurDSet.LargestNumber));
if (apitm.ConflictList.Count==0)
sw.WriteLine(" None");
else
{
foreach (AppConflict ac in apitm.ConflictList)
{
sw.WriteLine(ac.GetStrForDlg());
}
}
sw.WriteLine(" ");
}
sw.WriteLine(" ");
}
}
private void btnSelect_Click(object sender, System.EventArgs e)
{
if (listAvail.SelectedIndex<0)
{
MessageBox.Show("You must select an item in the list.");
return;
}
string prc_sel = (string) listAvail.Items[listAvail.SelectedIndex];
VEO_ProcSet ps = (VEO_ProcSet) CurDSet.parentObj;
// find the proc object & add it to the arraylist of procedures to process. Then
// do the individual processing on it.
foreach (Object obj in CurDSet.Children)
{
VEO_Proc prc = (VEO_Proc) obj;
string tst = ROFST_FILE.ROProcessTools.UnitSpecific(prc._Prcnum,0,0,CurDSet.LargestNumber);
if (tst==prc_sel)
{
AppIndItem aii= new AppIndItem(prc);
AppItems.Add(aii);
ps.ProcessInd(AppItems, AppItems.Count-1, ModROs, ModLibDocs);
break;
}
}
int indx=0;
VlnStatusMessage StatMsgWin = null;
while (indx>=0)
{
AppIndItem CurItem = (AppIndItem) AppItems[indx];
if (!CurItem.Checked)
{
if (StatMsgWin==null)StatMsgWin = new VlnStatusMessage("Looking for Dependencies...");
StatMsgWin.StatusMessage = "Checking " + CurItem.Proc._Prcnum;
ps.ProcessInd(AppItems, indx, ModROs, ModLibDocs);
CurItem.Checked=true;
}
indx = -1;
for (int i=0;i<AppItems.Count;i++)
{
CurItem = (AppIndItem) AppItems[i];
if (!CurItem.Checked)
{
indx=i;
break;
}
}
}
listSelect.Items.Clear();
listAvail.Items.Clear();
SetUpAvailSelectLists();
if (StatMsgWin!=null)StatMsgWin.Dispose();
PopulateDependList();
}
private void btnRpt_Click(object sender, System.EventArgs e)
{
if (this.AppItems.Count<=0)
{
MessageBox.Show("No procedures are selected to approve, no items in conflict report.","Approve Selected");
return;
}
new PrintingConflictReport(listDepend);
}
private void btnResolve_Click(object sender, System.EventArgs e)
{
bool haslist = PopulateEditList();
if (haslist)
{
AppIndItem apitm = (AppIndItem) AppItems[0];
VEO_Proc prc = apitm.Proc;
VEO_ProcSet ps = (VEO_ProcSet) CurDSet.parentObj;
ps.AppSelForEdit = prc;
prc.ExecVfw("a");
this.Close();
}
}
}
public class PrintingConflictReport
{
private System.Windows.Forms.ListBox ListToPrint;
private Font printFont;
private int CurLine;
private int PageCnt;
public PrintingConflictReport(System.Windows.Forms.ListBox listDepend)
{
CurLine=0;
PageCnt=0;
ListToPrint = listDepend;
Printing();
}
// The PrintPage event is raised for each page to be printed.
private void pd_PrintPage(object sender, PrintPageEventArgs ev)
{
float linesPerPage = 0;
float yPos = 0;
int count = 0;
PageCnt++;
float leftMargin = ev.MarginBounds.Left;
float topMargin = ev.MarginBounds.Top;
String line=null;
// Calculate the number of lines per page.
linesPerPage = ev.MarginBounds.Height /
printFont.GetHeight(ev.Graphics) ;
Font titleFont = new Font("Courier New", 12, FontStyle.Bold);
line = "Approve Selected Dependency List Report " + DateTime.Now + " Page " + PageCnt.ToString();
yPos = topMargin + (count * printFont.GetHeight(ev.Graphics));
ev.Graphics.DrawString (line, titleFont, Brushes.Black,
leftMargin, yPos, new StringFormat());
count++;
line = " ";
yPos = topMargin + (count * printFont.GetHeight(ev.Graphics));
ev.Graphics.DrawString (line, printFont, Brushes.Black,
leftMargin, yPos, new StringFormat());
count++;
// Iterate over the file, printing each line.
while (count < linesPerPage && CurLine <ListToPrint.Items.Count)
{
line = ListToPrint.Items[CurLine].ToString();
SizeF sz = ev.Graphics.MeasureString(line,printFont);
while (sz.Width>ev.MarginBounds.Width&&line.Length>85)
{
// going backwards from 85 chars, find a space to use as the line
// breaking point.
int indx = line.LastIndexOf(" ",84,85);
string sline = line.Substring(0,indx);
yPos = topMargin + (count * printFont.GetHeight(ev.Graphics));
ev.Graphics.DrawString (sline, printFont, Brushes.Black,
leftMargin, yPos, new StringFormat());
count++;
line = " " + line.Substring(indx,line.Length-indx);
}
yPos = topMargin + (count * printFont.GetHeight(ev.Graphics));
ev.Graphics.DrawString (line, printFont, Brushes.Black,
leftMargin, yPos, new StringFormat());
count++;
CurLine++;
}
// If more lines exist, print another page.
if (CurLine<ListToPrint.Items.Count)
ev.HasMorePages = true;
else
ev.HasMorePages = false;
}
// Print the file.
public void Printing()
{
printFont = new Font("Courier New", 10);
PrintDocument pd = new PrintDocument();
// Set the left and right margins to 1/2 inch.
pd.DefaultPageSettings.Margins.Left = 50;
pd.DefaultPageSettings.Margins.Right = 50;
// Set the top and bottom margins to 3/4 & 1 inch.
pd.DefaultPageSettings.Margins.Top = 75;
pd.DefaultPageSettings.Margins.Bottom = 100;
pd.PrintPage += new PrintPageEventHandler(pd_PrintPage);
// Print the document.
pd.Print();
}
}
}

View File

@@ -0,0 +1,255 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 1.3
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">1.3</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1">this is my long string</data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
[base64 mime encoded serialized .NET Framework object]
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
[base64 mime encoded string representing a byte array form of the .NET Framework object]
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used forserialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>1.3</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="listAvail.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="listAvail.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="listAvail.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="listSelect.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="listSelect.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="listSelect.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="lblAvail.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="lblAvail.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="lblAvail.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="lblSelected.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="lblSelected.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="lblSelected.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="btnSelect.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="btnSelect.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="btnSelect.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="btnClear.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="btnClear.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="btnClear.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="label1.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="label1.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="label1.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="btnApprove.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="btnApprove.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="btnApprove.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="btnResolve.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="btnResolve.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="btnResolve.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="btnCancel.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="btnCancel.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="btnCancel.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="btnRpt.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="btnRpt.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="btnRpt.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="listDepend.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="listDepend.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="listDepend.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="$this.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="$this.Language" type="System.Globalization.CultureInfo, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>(Default)</value>
</data>
<data name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="$this.Localizable" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="$this.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>8, 8</value>
</data>
<data name="$this.Name">
<value>ApproveSelDlg</value>
</data>
<data name="$this.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="$this.TrayHeight" type="System.Int32, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>80</value>
</data>
<data name="$this.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="$this.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAICAQAAAAAADoAgAAFgAAACgAAAAgAAAAQAAAAAEABAAAAAAAgAIAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAADAAADAAAAAwMAAwAAAAMAAwADAwAAAwMDAAICAgAAAAP8AAP8AAAD//wD/AAAA/wD/AP//
AAD///8AiIiIiIiIiIiIiIiIiIiIiPF3F3F3F3F3F3d3d3d3d3jxdxdxdxdxdxd3d3d3d3d49xdxdxdx
dxdxd3d3d3d3ePcXcXcXcXcXcXd3d3d3d3jxcXcXcXcXcXcXd3d3d3d48XF3F3F3F3F3F3d3d3d3ePdx
F3F3F3F3F3F3d3d3d3j3cRdxdxdxdxdxd3d3d3d49xdxdxdxdxdxdxd3d3d3ePcXcXcXcXcXcXcXd3d3
d3jxdxcXcXcXcXcXcXd3d3d48XcXF3F3F3F3F3F3d3d3ePdxdxF3F3F3F3F3F3d3d3j3cXcRdxdxdxdx
dxd3d3d49xdxdxdxdxdxdxdxd3d3ePcXcXcXcXcXcXcXcXd3d3jxdxdxcXcXcXcXcXcXd3d48XcXcXF3
F3F3F3F3F3d3ePdxdxd3F3F3F3F3F3F3d3j3cXcXdxdxdxdxdxdxd3d49xdxd3dxdxdxdxdxdxd3ePcX
cXd3cXcXcXcXcXcXd3jxdxd3d3cXcXcXcXcXcXd48XcXd3d3F3F3F3F3F3F3ePdxd3d3d3F3F3F3F3F3
F3j3cXd3d3dxdxdxdxdxdxd49xd3d3d3dxdxdxdxdxdxePcXd3d3d3cXcXcXcXcXcXjxd3d3d3d3cXcX
cXcXcXcY8Xd3d3d3d3F3F3F3F3F3GP////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==
</value>
</data>
</root>

View File

@@ -0,0 +1,406 @@
/*********************************************************************************************
* Copyright 2004 - Volian Enterprises, Inc. All rights reserved.
* Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
* ------------------------------------------------------------------------------
* $Workfile: Archive.cs $ $Revision: 3 $
* $Author: Kathy $ $Date: 1/31/05 11:05a $
*
* $History: Archive.cs $
*
* ***************** Version 3 *****************
* User: Kathy Date: 1/31/05 Time: 11:05a
* Updated in $/LibSource/VEObject
* Fix B2005-005 - this just fixed empty icon usage
*
* ***************** Version 2 *****************
* User: Kathy Date: 1/24/05 Time: 2:45p
* Updated in $/LibSource/VEObject
* B2005-004 fixes - icon clean-up
*
* ***************** Version 1 *****************
* User: Kathy Date: 7/27/04 Time: 8:52a
* Created in $/LibSource/VEObject
*********************************************************************************************/
using System;
using System.Windows.Forms;
using System.Windows.Forms.Design;
using System.ComponentModel;
using System.IO;
using System.Text;
using Utils;
using System.Collections.Specialized;
namespace VEObject
{
/// <summary>
/// Archive Object.
/// </summary>
public class VEO_Archive: VEO_Base
{
public bool isnew;
// These three strings are stored in the Zip file's
// comment field
private String tmpArchiveTitle;
private String _Comment;
public ArchiveTypeOptions _ArchiveType;
private String tmpComment;
private bool _ReadOnly;
private bool oldReadOnly;
private bool NeedToGetReadOnly;
private bool changeReadOnly;
private bool changeComment;
private bool changeArchiveTitle;
public VEO_Archive(string ipath, VEO_DummyZip dz)
{
iconStates = new int[5] {0,0,0,0,0};
_Location = ipath; // full path to the Zip file
VEObjectType = (int)VEObjectTypesDefs.Archive;
changeReadOnly = false;
changeComment = false;
changeArchiveTitle = false;
NeedToGetReadOnly = true;
isnew = IsThisANewArchive(ipath);
if (isnew)
{
_Title = "New Archive";
_Comment = "Created: " + System.DateTime.Now.ToString();
}
else // get the title and comment from the Zip file
{
GetInfoFromZipComment();
}
LoadLockInfo();
icon = iconStates[(int)Lock.LockStatus];
parentObj = dz;
usrRunTime = dz.usrRunTime;
}
// Read in the Title, Archive Type, and Comment from the Zip file's
// comment field.
private void GetInfoFromZipComment()
{
string tmpstr;
ZipFuncs ZipInfo = new ZipFuncs(_Location);
// just opening the zip file like this will read the zip's comment field
if (ZipInfo.strArcTitle != null)
tmpstr = ZipInfo.strArcTitle.Trim();
else
tmpstr = "";
// if the title is blank, then use the zip file name as the title
if (tmpstr.Length == 0)
this._Title = _Location.Substring(_Location.LastIndexOf("\\")+1);
else
this._Title = tmpstr;
_Comment = ZipInfo.strComment;
if (ZipInfo.ArchiveType == (int)VEO_Base.ArchiveTypeOptions.Full)
_ArchiveType = VEO_Base.ArchiveTypeOptions.Full;
else
_ArchiveType = VEO_Base.ArchiveTypeOptions.Partial;
}
private bool IsThisANewArchive(string arcPath)
{
string tmpstr = arcPath.ToUpper();
return (!tmpstr.EndsWith(".ZIP") || !File.Exists(tmpstr));
}
private string ParseOutZipPath()
{
string zpath = _Location.Substring(0,_Location.LastIndexOf("\\"));
return zpath;
}
// Gets and Sets for the Property Page
[Description("Location"),Category("Archive"),ReadOnly(true)]
public string Location
{
get{return _Location;}
//note: we don't allow them to change the zip file name or path.
}
[Description("Archive Title"),Category("Archive")]public string Description
{
get
{
if (!changeArchiveTitle)
return _Title;
else
return tmpArchiveTitle;
}
set
{
changeArchiveTitle = true;
tmpArchiveTitle = value;
}
}
[Description("Archive Type"),Category("Archive"),ReadOnly(true)]public ArchiveTypeOptions ArchiveType
{
get
{
return _ArchiveType;
}
set
{
_ArchiveType=value;
}
}
[Description("Comment"),Category("Archive")]public string Comment
{ get
{
if (!changeComment)
return _Comment;
else
return tmpComment;
}
set
{
changeComment = true;
tmpComment = value;
}
}
[Description("ReadOnly"),Category("Archive")]public bool ReadOnlyArchiveFile
{
get
{
if (!changeReadOnly && NeedToGetReadOnly)
{
FileAttributes attrib = File.GetAttributes(_Location);
_ReadOnly = (attrib & FileAttributes.ReadOnly) == FileAttributes.ReadOnly;
NeedToGetReadOnly = false;
}
return _ReadOnly;
}
set
{
if (!changeReadOnly) // only save previous value once
oldReadOnly = _ReadOnly;
changeReadOnly = true;
_ReadOnly = value;
}
}
// When the Save Button is pressed on the Property page, this function
// is called.
public override bool Write()
{
if (changeReadOnly)
{
changeReadOnly = false;
NeedToGetReadOnly = true;
FileAttributes attrib = File.GetAttributes(_Location);
if (_ReadOnly != ((attrib & FileAttributes.ReadOnly) == FileAttributes.ReadOnly))
attrib ^= FileAttributes.ReadOnly; //toggle
File.SetAttributes(_Location,attrib);
}
if (changeComment)
{
changeComment = false;
_Comment = tmpComment;
}
if (changeArchiveTitle)
{
changeArchiveTitle = false;
_Title = tmpArchiveTitle;
}
return true;
}
// When the Cancel Button on the Property Page is pressed,
// this function is called.
public override void CancelWrite()
{
if (changeReadOnly)
{
_ReadOnly = oldReadOnly;
}
changeArchiveTitle = false;
changeComment = false;
changeReadOnly = false;
NeedToGetReadOnly = true;
}
public override bool Read(bool dummy)
{
//load archive file list
return true;
}
public override void AddToTree(TreeNode parentnd)
{
}
public override bool Expand(TreeNode parentnd)
{
return true;
}
public override bool PropertiesDlg(Object parent)
{
ARProperties propdlg = new ARProperties(parent, this);
if (propdlg.ShowDialog() == DialogResult.OK) return true;
return false;
}
public bool Exists(string dname)
{
if(dname==null||dname=="") return false;
string archname=null;
// see if this is a pathname, it needs to be for the Exists check.
if (dname.IndexOf("\\") < 0) // it's not a path, prepend the path
archname = _Location + "\\" + dname;
else
archname = dname;
return File.Exists(archname);
}
public override bool mnuAllowNew()
{
return false;
}
public override bool mnuAllowDelete()
{
// VEO_DummyArchive ds = (VEO_DummyArchive) this.parentObj;
// VEO_ProcSet ps = (VEO_ProcSet) ds.parentObj;
// if (ps.isApproved == true) return false;
// if (amILockedByMe()==false) return false;
// if ((ps.accessFlags&Security.DOCMAINT)==Security.DOCMAINT) return true;
return true;
}
public override bool mnuAllowUpdateArch()
{
if (amILockedByMe()==false) return false;
return true;
}
public override bool mnuAllowExtractArch()
{
if (amILockedByMe()==false) return false;
return true;
}
public override bool mnuAllowTestArchive()
{
return true;
}
public override void DoListView(ListView veoListView)
{
ZipFuncs ZipInfo = new ZipFuncs(_Location);
ListViewItem item=null;
veoListView.Columns.Add("Date/Time", 150, HorizontalAlignment.Left);
veoListView.Columns.Add("File", 450, HorizontalAlignment.Left);
StringCollection ZipFileList;
// veoListView.Sorting = SortOrder.Ascending;
ZipFileList = ZipInfo.ZipFileContents();
for (int i=0; i< ZipFileList.Count; i++)
{
string tmpstr = ZipFileList[i].ToString();
int subIdx = tmpstr.IndexOf('!');
item = new ListViewItem(tmpstr.Substring(0,subIdx));
item.SubItems.Add(tmpstr.Substring(subIdx+1));
item.Tag = this;
veoListView.Items.Add(item);
}
AllowListViewSort = true;
}
public override bool Delete()
{
if ((File.GetAttributes(_Location) & System.IO.FileAttributes.ReadOnly) == System.IO.FileAttributes.ReadOnly)
File.SetAttributes(_Location,System.IO.FileAttributes.Normal);
File.Delete(_Location);
// if this is the last zip, then change parent's icon to empty
VEO_DummyZip zip = (VEO_DummyZip) this.parentObj;
if (zip.Children.Count==1) zip.IsEmpty=true; // just this one.
return true;
}
}
// This class is used when creating a new archive
public class VEO_ArchiveN: VEO_Archive
{
public VEO_ArchiveN(string ipath, VEO_DummyZip dz)
: base(ipath, dz)
{
}
[Description("Location"),Category("Archive"),ReadOnly(false),EditorAttribute(typeof(PropSaveFileAsDlg), typeof(System.Drawing.Design.UITypeEditor))]
public new string Location
{
get{return _Location;}
set
{
_Location=value.ToString();
}
}
[Description("Archive Type"),Category("Archive"),ReadOnly(false)]public new ArchiveTypeOptions ArchiveType
{
get
{
return _ArchiveType;
}
set
{
_ArchiveType=value;
}
}
}
/*
* Setup a class that will display the SaveFileAs dialog from the property dialog
* when the "..." is pressed.
*/
public class PropSaveFileAsDlg : System.Drawing.Design.UITypeEditor
{
public override System.Drawing.Design.UITypeEditorEditStyle GetEditStyle(System.ComponentModel.ITypeDescriptorContext context)
{
return System.Drawing.Design.UITypeEditorEditStyle.Modal;
}
public override object EditValue(
System.ComponentModel.ITypeDescriptorContext context,
System.IServiceProvider provider, object value)
{
SaveFileDialog saveFileDialog1 = new SaveFileDialog();
saveFileDialog1.AddExtension = true;
saveFileDialog1.CheckPathExists = true;
saveFileDialog1.DefaultExt = ".zip";
saveFileDialog1.Filter = "ZIP Files|*.zip|All Files|*.*||";
saveFileDialog1.DereferenceLinks = true;
saveFileDialog1.OverwritePrompt = true;
saveFileDialog1.Title = "Archive Location and Name";
saveFileDialog1.FileName = value.ToString();
saveFileDialog1.ShowDialog();
return saveFileDialog1.FileName;
}
public override bool GetPaintValueSupported(
System.ComponentModel.ITypeDescriptorContext context)
{
return false;
}
}
}

View File

@@ -0,0 +1,55 @@
using System.Reflection;
using System.Runtime.CompilerServices;
//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
//
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.1.*")]
//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
// (*) If no key is specified, the assembly is not signed.
// (*) KeyName refers to a key that has been installed in the Crypto Service
// Provider (CSP) on your machine. KeyFile refers to a file which contains
// a key.
// (*) If the KeyFile and the KeyName values are both specified, the
// following processing occurs:
// (1) If the KeyName can be found in the CSP, that key is used.
// (2) If the KeyName does not exist and the KeyFile does exist, the key
// in the KeyFile is installed into the CSP and used.
// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
// When specifying the KeyFile, the location of the KeyFile should be
// relative to the project output directory which is
// %Project Directory%\obj\<configuration>. For example, if your KeyFile is
// located in the project directory, you would specify the AssemblyKeyFile
// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
// documentation for more information on this.
//

View File

@@ -0,0 +1,58 @@
using System.Reflection;
using System.Runtime.CompilerServices;
//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
//
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.1.*")]
//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
// (*) If no key is specified, the assembly is not signed.
// (*) KeyName refers to a key that has been installed in the Crypto Service
// Provider (CSP) on your machine. KeyFile refers to a file which contains
// a key.
// (*) If the KeyFile and the KeyName values are both specified, the
// following processing occurs:
// (1) If the KeyName can be found in the CSP, that key is used.
// (2) If the KeyName does not exist and the KeyFile does exist, the key
// in the KeyFile is installed into the CSP and used.
// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
// When specifying the KeyFile, the location of the KeyFile should be
// relative to the project output directory which is
// %Project Directory%\obj\<configuration>. For example, if your KeyFile is
// located in the project directory, you would specify the AssemblyKeyFile
// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
// documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("E:\\proms.net\\Public Key\\vlnkey.snk")]
[assembly: AssemblyKeyName("")]

View File

@@ -0,0 +1,421 @@
/*********************************************************************************************
* Copyright 2004 - Volian Enterprises, Inc. All rights reserved.
* Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
* ------------------------------------------------------------------------------
* $Workfile: DataPath.cs $ $Revision: 5 $
* $Author: Jsj $ $Date: 3/06/07 1:26p $
*
* $History: DataPath.cs $
*
* ***************** Version 5 *****************
* User: Jsj Date: 3/06/07 Time: 1:26p
* Updated in $/LibSource/VEObject
* check for a null Location.
*
* ***************** Version 4 *****************
* User: Kathy Date: 1/24/05 Time: 2:45p
* Updated in $/LibSource/VEObject
* B2005-004 fixes
*
* ***************** Version 3 *****************
* User: Kathy Date: 1/19/05 Time: 11:59a
* Updated in $/LibSource/VEObject
* Fix B2005-003 - missing plant security setting
*
* ***************** Version 2 *****************
* User: Kathy Date: 1/14/05 Time: 10:38a
* Updated in $/LibSource/VEObject
* B2004-061: fix security options
*
* ***************** Version 1 *****************
* User: Kathy Date: 7/27/04 Time: 8:53a
* Created in $/LibSource/VEObject
*********************************************************************************************/
using System;
using System.Windows.Forms;
using System.Collections;
using System.Xml;
using System.IO;
using System.ComponentModel;
using Utils;
namespace VEObject
{
/// <summary>
/// This defines the DataPath class, which handles the datapath information
/// which tells the program where to search for veproms data. A datapath is of
/// the form "[path],[title];" for example G:\,GDRIVE;
/// Its children are vedata directories as found in the menuwin.xml file.
/// These vedata directories represent plant data.
/// </summary>
public class VEO_DataPath : VEO_Base
{
protected string tmpTitle;
protected string tmpLocation;
protected bool changeLocation;
protected bool changeTitle;
private string PrevDirectory;
public VEO_DataPath(UserRunTime iusrRunTime, string ititle, string iloc)
{
iconStates = new int[5] {6,21,8,22,7};
_Title = ititle;
_Location = iloc;
usrRunTime = iusrRunTime;
changeTitle=false;
changeLocation=false;
isNew=false;
LoadLockInfo();
icon = iconStates[(int)Lock.LockStatus];
}
// the following properties are used in the properties dialog for modification
// of 'property' data.
[Description("Location"),Category("Data Path"),ReadOnly(true)]public string Location
{
get{return _Location;}
set
{
ShortName sname = new ShortName(value);
_Location=sname.ShortFileName;
sname = null;
}
}
[Description("Title"),Category("Data Path")]public string Title
{
get
{
if (!changeTitle)
return _Title;
else
return tmpTitle;
}
set
{
changeTitle=true;
tmpTitle=value;
}
}
public override void Restore()
{
changeTitle = false;
}
// Make a new child, which is a plant node.
public override Object MakeNewChild()
{
VEO_Plant pl = new VEO_PlantN(usrRunTime,null,null);
return (Object) pl;
}
// 'Open' positions in the datapath directory (for creation of plant
// directories (store the previous directory, to position out of this
// directory on end).
public override bool Open()
{
if (Directory.Exists(_Location) == false) return false;
isOpen = true;
PrevDirectory = Directory.GetCurrentDirectory();
if(_Location!=null)Directory.SetCurrentDirectory(_Location);
return true;
}
// Close clears any multi-user settings for the system level
public override bool Close()
{
if (!isOpen)return false;
isOpen = false;
Directory.SetCurrentDirectory(PrevDirectory);
return true;
}
// Save the new plant & add to children if it succeeds.
public override bool SaveChild(Object obj)
{
VEO_Plant plnt = (VEO_Plant)obj;
bool succeed = plnt.SaveNew(this._Location);
if (succeed == true)
{
plnt._Location = this._Location + plnt._Location;
plnt.parentObj = this;
}
return succeed;
}
public override bool Delete()
{
// concatenate title/loc so that it can be removed from the datapath string
string delpth = _Location + "," + _Title + ";";
bool success = usrRunTime.DeletePathFromCfg(delpth);
return success;
}
// for this data path, read in which plants are available, and add to
// the list.
public override bool Read(bool dummy)
{
ArrayList tmpChildren = new ArrayList();
// using the . do exist tests to see if they exist on this datapath.
XmlDocument xmldoc = usrRunTime.menuwinXML.GetXmlDoc();
XmlElement top = (XmlElement) xmldoc.FirstChild;
XmlElement sys = (XmlElement) top.SelectSingleNode("SystemAttach");
XmlElement ele = (XmlElement) sys.SelectSingleNode("Plant");
while (ele != null)
{
// get plants and test for existence with the location for
// this datapath. If exists, add it to the PlantList.
//get the TemplateName & if there is a {t} replace the {t}
// with this datapath's path.
XmlElement tn = (XmlElement) ele.SelectSingleNode("TemplateName");
if (tn != null)
{
string templatename = tn.InnerText;
if (templatename.IndexOf("{t}",0) != -1)
{
string tpath = templatename.Replace("{t}",this.Location);
string path = tpath.Substring(0,tpath.IndexOf(" menu"));
DirectoryInfo source = new DirectoryInfo(path.Replace("/","//"));
if (source.Exists)
{
XmlElement etitle = (XmlElement) ele.SelectSingleNode("MenuName");
VEO_Plant plnt = new VEO_Plant(usrRunTime, etitle.InnerText,path);
plnt.parentObj = this;
tmpChildren.Add(plnt);
}
}
}
ele = (XmlElement) ele.NextSibling;
}
Security lsec = usrRunTime.sec;
if (lsec.OpenFile()==true)
{
for(int i=0;i<tmpChildren.Count;i++)
{
VEO_Plant plnt = (VEO_Plant) tmpChildren[i];
lsec.AddPlant(i,plnt._Location);
// Check if the plant is included in the vesam file. If not,
// it may have been added since vesam was run. In this case,
// the BlockAccess flag is used to determine whether the user
// should have access to the plant.
bool hasSec = lsec.PlantHasSecurity(i);
// see if the plant has any plant options, if so, include
// it in the list. If not, check to see if any of its procedures
// have options set & if so, the plant should be included.
//
bool procopts=false;
if (hasSec)
{
plnt.accessFlags = lsec.GetPlantSecurity(i);
if (plnt.accessFlags==0L)
{
procopts = lsec.AnyOptionsSet(i);
}
}
// if security is okay, i.e. either the plant has options or at least
// one of the sets within it has some options, include the plant in the
// list. Also, if there is not security, but access is not blocked
// (!BlockAccess) add it.
if ((hasSec && (plnt.accessFlags!=0L||procopts)) || (!hasSec&&!lsec.BlockAccess()))
Children.Add(plnt);
}
lsec.CloseFile();
}
return true;
}
// write out to the user's cfg file.
public override bool Write()
{
string newtitle=null;
string oldmodstr=_Location + "," + _Title + ";";
if (changeTitle)
newtitle = tmpTitle;
else
newtitle = _Title;
string newmodstr = _Location + "," + newtitle + ";";
usrRunTime.ModTitleToCfg(oldmodstr,newmodstr);
if (changeTitle) _Title=newtitle;
changeTitle=false;
return true;
}
public override void DoListView(ListView veoListView)
{
ListViewItem item=null;
veoListView.Columns.Add("Location", 120, HorizontalAlignment.Left);
veoListView.Columns.Add("Title", 300, HorizontalAlignment.Left);
for (int i=0; i<Children.Count; i++)
{
VEO_Plant plnt = (VEO_Plant) Children[i];
item = new ListViewItem(plnt._Location,plnt.icon);
item.Tag = plnt;
item.SubItems.Add(plnt._Title);
veoListView.Items.Add(item);
}
}
public override bool mnuAllowNew()
{
if (amILockedByMe()==false) return false; // new (plant) requires sys lock
if(usrRunTime.sec.SystemAdminFlag) return true;
return false;
}
public override bool CollapseSibling()
{
if (!usrRunTime.InMultiUserMode) return false;
return true;
}
}
// the following class inherits from the VEO_DataPath and is used to handle
// a New data path (it has the Location property as editable).
class VEO_DataPathN : VEO_DataPath
{
public VEO_DataPathN(UserRunTime iusrRunTime, string ititle, string iloc)
: base(iusrRunTime, ititle, iloc)
{
isNew=true;
}
// this method is used so that if a new datapath is created, it is associated
// with editable properties (such as path). When the object exists this is
// not editable. So when a new object is created, if it's successful, it's
// copied to an object which is not editable for the treeview & any further
// operations.
public override Object Copy()
{
VEO_DataPath dp = new VEO_DataPath(usrRunTime,this._Title,this._Location);
dp.parentObj=this.parentObj;
return (Object) dp;
}
public void SaveFields()
{
// B2007-005
// Check to see if tmpLocation is null before checking for a substring.
if (tmpLocation != null && tmpLocation.Substring(tmpLocation.Length-1,1) != "\\")
_Location = tmpLocation+"\\";
else
_Location=tmpLocation;
_Title=tmpTitle;
changeLocation=false;
changeTitle=false;
}
[Description("Location"),Category("Data Path"),ReadOnly(false),EditorAttribute(typeof(VEFolderBrowserDlg), typeof(System.Drawing.Design.UITypeEditor))]public new string Location
{
get
{
if (!changeLocation)
return _Location;
else
return tmpLocation;
}
set
{
ShortName sname = new ShortName(value);
tmpLocation=sname.ShortFileName;
sname = null;
changeLocation=true;
}
}
}
public class VEFolderBrowserDlg : System.Drawing.Design.UITypeEditor
{
public override System.Drawing.Design.UITypeEditorEditStyle GetEditStyle(System.ComponentModel.ITypeDescriptorContext context)
{
return System.Drawing.Design.UITypeEditorEditStyle.Modal;
}
public override object EditValue(
System.ComponentModel.ITypeDescriptorContext context,
System.IServiceProvider provider, object value)
{
FolderBrowserDialog FldrDlg = new FolderBrowserDialog();
FldrDlg.ShowNewFolderButton = true;
FldrDlg.SelectedPath = Directory.GetCurrentDirectory();
if(FldrDlg.ShowDialog() == DialogResult.OK)
return FldrDlg.SelectedPath;
else
return null;
}
public override bool GetPaintValueSupported(
System.ComponentModel.ITypeDescriptorContext context)
{
return false;
}
}
public class VESymbDlg : System.Drawing.Design.UITypeEditor
{
public override System.Drawing.Design.UITypeEditorEditStyle GetEditStyle(System.ComponentModel.ITypeDescriptorContext context)
{
return System.Drawing.Design.UITypeEditorEditStyle.Modal;
}
public override object EditValue(
System.ComponentModel.ITypeDescriptorContext context,
System.IServiceProvider provider, object value)
{
System.Windows.Forms.GridItem grdentr = (GridItem) provider;
SymbolListSteps symblst = new SymbolListSteps();
SymbDlg symdlg = new SymbDlg(symblst,grdentr);
if(symdlg.ShowDialog() == DialogResult.OK)
{
return symdlg.ReturnText;
}
else
return value;
}
public override bool GetPaintValueSupported(
System.ComponentModel.ITypeDescriptorContext context)
{
return false;
}
}
public class VECreateFolderBrowserDlg : System.Drawing.Design.UITypeEditor
{
public override System.Drawing.Design.UITypeEditorEditStyle GetEditStyle(System.ComponentModel.ITypeDescriptorContext context)
{
return System.Drawing.Design.UITypeEditorEditStyle.Modal;
}
public override object EditValue(
System.ComponentModel.ITypeDescriptorContext context,
System.IServiceProvider provider, object value)
{
FolderBrowserDialog FldrDlg = new FolderBrowserDialog();
FldrDlg.SelectedPath = Directory.GetCurrentDirectory();
FldrDlg.ShowNewFolderButton = true;
if(FldrDlg.ShowDialog() == DialogResult.OK)
return FldrDlg.SelectedPath;
else
return null;
}
public override bool GetPaintValueSupported(
System.ComponentModel.ITypeDescriptorContext context)
{
return false;
}
}
}

View File

@@ -0,0 +1,325 @@
/*********************************************************************************************
* Copyright 2004 - Volian Enterprises, Inc. All rights reserved.
* Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
* ------------------------------------------------------------------------------
* $Workfile: DataRoot.cs $ $Revision: 2 $
* $Author: Jsj $ $Date: 3/06/07 1:29p $
*
* $History: DataRoot.cs $
*
* ***************** Version 2 *****************
* User: Jsj Date: 3/06/07 Time: 1:29p
* Updated in $/LibSource/VEObject
* Property page check
*
* ***************** Version 1 *****************
* User: Kathy Date: 7/27/04 Time: 8:53a
* Created in $/LibSource/VEObject
*********************************************************************************************/
using System;
using System.Collections;
using System.Windows.Forms;
using System.ComponentModel;
using System.IO;
using VENetwork;
using Utils;
namespace VEObject
{
/// <summary>
/// This module defines the DataRoot class, which is the root of all
/// data that is accessible to this user. (i.e. it is the container
/// for all data within the datapath). Applications accessing the database
/// should create a DataRoot.
/// </summary>
public class VEO_DataRoot : VEO_Base
{
protected string tmpLocation;
protected bool changeLocation;
public VEO_DataRoot(UserRunTime iusrRunTime)
{
VEObjectType=(int)VEObjectTypesDefs.System;
iconStates = new int[5] {6,21,8,22,7};
_Title = "VE-PROMS Data "+iusrRunTime.ucfgpath;
_Location = iusrRunTime.ucfgpath;
changeLocation = false;
usrRunTime = iusrRunTime;
isNew=false;
LoadLockInfo();
icon = iconStates[(int)Lock.LockStatus];
}
public override void LoadLockInfo()
{
Lock = new VELock(usrRunTime.syspath, usrRunTime.myUserData, usrRunTime.InMultiUserMode?VENetwork.LockTypes.System:VENetwork.LockTypes.None);
}
// The following properties are used in the 'Properties' dialog. This set is used
// for modify.
[Description("Title"),Category("VE-PROMS Data Paths (CFG File)"),ReadOnly(true)]public string Title
{
get{return _Title;}
set{_Title=value;}
}
//[Description("Location"),Category("VE-PROMS Data Paths (CFG File)"),EditorAttribute(typeof(DataRootFileDlg), typeof(System.Drawing.Design.UITypeEditor))]public string Location
[Description("Location"),Category("VE-PROMS Data Paths (CFG File)"),ReadOnly(true)]public string Location
{
get
{
if (!changeLocation)
return _Location;
else
return tmpLocation;
}
set
{
FileInfo fi = new FileInfo(value);
if (!fi.Exists)
{
MessageBox.Show("The file that was specified does not exist.");
return;
}
changeLocation = true;
tmpLocation=value;
}
}
public override bool Open()
{
isOpen = true;
// check current multi-user status
if (Connection!=null)Connection.Enter(false);
return true;
}
// Close clears any multi-user settings for the system level
public override bool Close()
{
isOpen = false;
if (Connection!=null)Connection.Exit();
return true;
}
public override void Restore()
{
changeLocation = false;
}
public override bool mnuAllowDelete()
{
return false;
}
public override bool mnuAllowLckDB()
{
if (usrRunTime.InMultiUserMode && usrRunTime.sec.PermissionToLockFlag&&Lock.LockStatus==VENetwork.Status.NoLock) return true;
return false;
}
public override bool mnuAllowNew()
{
// if (usrRunTime.InMultiUserMode && Lock.LockStatus==VENetwork.Status.LockedByOther)return false;
// B2007-005
// Standardize the need for a lock. Prevent NEW button on first tree node
// if a lock is not set
if (amILockedByMe()==false) return false;
return true;
}
public override bool mnuAllowUnlckDB()
{
if (usrRunTime.InMultiUserMode && usrRunTime.sec.PermissionToLockFlag&&(Lock.LockStatus==VENetwork.Status.Locked||
Lock.LockStatus==VENetwork.Status.LockPending)) return true;
return false;
}
// Add a Data Path. Private method used below.
private void AddDataPath(string entry)
{
int comma;
string tmp;
string loc;
string title;
comma = entry.IndexOf(",");
tmp=entry.Substring(0,comma);
loc=tmp.Trim();
//Make sure datapath has an ending backslash
if (!(loc.EndsWith("\\")))
loc = loc + "\\";
tmp=entry.Substring(comma+1,entry.Length-comma-2); // -2, don't copy ";"
title=tmp.Trim();
VEO_DataPath dp = new VEO_DataPath(usrRunTime,title,loc);
dp.parentObj = (VEO_Base) this;
Children.Add(dp);
}
// Get the datapath list. If in demo mode, use sample list; otherwise read in
// from the user's cfg file.
public override bool Read(bool dummy)
{
PrivateProfile ppCfg;
string dpath;
string entry;
int semi;
int strtindx=0;
int netpth;
if (usrRunTime.sec.isDemoMode)
{
dpath = usrRunTime.syspath + "\\samples\\,Demo Data;";
}
else
{
// for this data root, read in the datapath. If a user's cfg exists
// use that data. Otherwise, use the menuwin2.xml data which is part
// of the user's run time.
ppCfg = new PrivateProfile(usrRunTime.ucfgpath);
// dpath=ppCfg.Attr("/ini/section[@name='Menu']/param[@name='DataPath']/@value");
dpath=ppCfg.Attr("Menu","DataPath");
if (dpath==null || dpath=="")return false;
}
semi=dpath.IndexOf(";",strtindx);
if (semi == -1)
{
MessageBox.Show("Must have semi-colon in datapath");
Environment.Exit(-1);
}
while (semi !=-1)
{
entry = dpath.Substring(strtindx,semi-strtindx+1);
netpth = entry.IndexOf("////",0);
if (netpth != -1)
//if(GetNetTempDisk()) AddDataPath(entry);
MessageBox.Show("Need to support network temp disk");
else
AddDataPath(entry);
if (semi+1>dpath.Length)
strtindx=-1;
else
{
strtindx=semi+1;
semi=dpath.IndexOf(";",strtindx);
}
}
return true;
}
// use the change to the cfg file.
public override bool Write()
{
// check for cfg file existence
FileInfo fi = new FileInfo(Location);
if (fi.Exists)
{
if(changeLocation)_Location=tmpLocation;
changeLocation=false;
this._Title = "VE-PROMS Data " + Location;
usrRunTime.ucfgpath = Location;
return true;
}
else
{
MessageBox.Show("The file that was specified does not exist.");
return false;
}
}
// add a new datapath
public override Object MakeNewChild()
{
VEO_DataPathN dp = new VEO_DataPathN(usrRunTime,null,null);
return dp;
}
// check that the directory input by the user exists. If so, add the
// directory & title to the cfg file.
public override bool SaveChild(Object obj)
{
VEO_DataPathN dp = (VEO_DataPathN) obj;
// B2007-005
// If the user didn't enter a location, then show an error message
//and don't continue with the save.
if (dp.Location == null || dp.Location.Length == 0)
{
MessageBox.Show("No data path Location specified.","Error");
return false;
}
dp.SaveFields();
// Check for existance of directory if it doesn't exist give message
// and return;
string pth = dp._Location;
DirectoryInfo di = new DirectoryInfo(pth);
if (di.Exists == false)
{
try
{
di.Create();
}
catch
{
MessageBox.Show("Directory for data path doesn't exist, and could not be created.");
}
return false;
}
string newcfgpth = dp._Location+","+dp._Title+";";
usrRunTime.AddPathToCfg(newcfgpth);
return true;
}
public override void DoListView(ListView veoListView)
{
ListViewItem item=null;
veoListView.Columns.Add("Location", 120, HorizontalAlignment.Left);
veoListView.Columns.Add("Title", 300, HorizontalAlignment.Left);
for (int i=0; i<Children.Count; i++)
{
VEO_DataPath dp = (VEO_DataPath) Children[i];
item = new ListViewItem(dp._Location,dp.icon);
item.Tag = dp;
item.SubItems.Add(dp._Title);
veoListView.Items.Add(item);
}
}
}
public class DataRootFileDlg : System.Drawing.Design.UITypeEditor
{
public override System.Drawing.Design.UITypeEditorEditStyle GetEditStyle(System.ComponentModel.ITypeDescriptorContext context)
{
return System.Drawing.Design.UITypeEditorEditStyle.Modal;
}
public override object EditValue(
System.ComponentModel.ITypeDescriptorContext context,
System.IServiceProvider provider, object value)
{
OpenFileDialog FileDialog1 = new OpenFileDialog();
FileDialog1.AddExtension = true;
FileDialog1.CheckPathExists = true;
FileDialog1.DefaultExt = ".cfg";
FileDialog1.Filter = "CFG Files|*.cfg|All Files|*.*||";
FileDialog1.DereferenceLinks = true;
FileDialog1.Title = "User Configuration File (defines datapath)";
FileDialog1.FileName = value.ToString();
FileDialog1.ShowDialog();
return FileDialog1.FileName;
}
public override bool GetPaintValueSupported(
System.ComponentModel.ITypeDescriptorContext context)
{
return false;
}
}
}

View File

@@ -0,0 +1,315 @@
/*********************************************************************************************
* Copyright 2004 - Volian Enterprises, Inc. All rights reserved.
* Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
* ------------------------------------------------------------------------------
* $Workfile: LDProperties.cs $ $Revision: 3 $
* $Author: Kathy $ $Date: 2/10/05 12:36p $
*
* $History: LDProperties.cs $
*
* ***************** Version 3 *****************
* User: Kathy Date: 2/10/05 Time: 12:36p
* Updated in $/LibSource/VEObject
* B2005-012: No apply button for new
*
* ***************** Version 2 *****************
* User: Kathy Date: 8/04/04 Time: 10:25a
* Updated in $/LibSource/VEObject
* No usage on New Lib Doc
*
* ***************** Version 1 *****************
* User: Kathy Date: 7/27/04 Time: 8:53a
* Created in $/LibSource/VEObject
*********************************************************************************************/
using System;
using System.IO;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Text;
using Utils;
namespace VEObject
{
/// <summary>
/// NOTE: cmbType (the combo box that contains the document types) must match
/// the order of document types given in the ProcTypeOptions for this dialog
/// to work correctly
/// </summary>
public class LDProperties : System.Windows.Forms.Form
{
private System.Windows.Forms.Button btnOK;
private System.Windows.Forms.Button btnCancel;
private System.Windows.Forms.Button btnApply;
private VEO_Base _ParentObj;
private VEO_Base _CurObj;
private bool isnew;
private System.Windows.Forms.TabControl tabControl1;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
private System.Windows.Forms.TabPage tbPageUsage;
private System.Windows.Forms.PropertyGrid myPropertyGrid;
private System.Windows.Forms.TabPage tbGeneral;
private System.Windows.Forms.Label lblUsage;
private System.Windows.Forms.ListBox lbUsage;
private bool canedit;
public LDProperties(Object parent, Object curobj)
{
//
// Required for Windows Form Designer support
//
_ParentObj = (VEO_Base) parent;
_CurObj = (VEO_Base) curobj;
VEO_LibDoc ld = (VEO_LibDoc) curobj;
if (ld.isNew == true)
isnew=true;
else
isnew=false;
InitializeComponent();
this.myPropertyGrid.SelectedObject=curobj;
if (isnew == true)
{
this.tabControl1.TabPages.Remove(this.tbPageUsage);
canedit=true;
}
else
{
if (this.tabControl1.TabPages.Contains(this.tbPageUsage)==false)
this.tabControl1.TabPages.Add(this.tbPageUsage);
ld.GetUsages();
foreach (string usg in ld.usages)
{
this.lbUsage.Items.Add(usg);
}
}
if((_CurObj.canEdit()==false)&&!isnew)
{
canedit=false;
this.myPropertyGrid.Enabled=false;
}
else if (!isnew)
{
canedit=true;
this.myPropertyGrid.Enabled=true;
}
this.lblUsage.Text = "'" + ld.Title + "' is used in...";
btnApply.Enabled = false;
// make apply button visible if modify
this.btnApply.Visible = !isnew;
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(LDProperties));
this.btnOK = new System.Windows.Forms.Button();
this.btnCancel = new System.Windows.Forms.Button();
this.btnApply = new System.Windows.Forms.Button();
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tbGeneral = new System.Windows.Forms.TabPage();
this.myPropertyGrid = new System.Windows.Forms.PropertyGrid();
this.tbPageUsage = new System.Windows.Forms.TabPage();
this.lblUsage = new System.Windows.Forms.Label();
this.lbUsage = new System.Windows.Forms.ListBox();
this.tabControl1.SuspendLayout();
this.tbGeneral.SuspendLayout();
this.tbPageUsage.SuspendLayout();
this.SuspendLayout();
//
// btnOK
//
this.btnOK.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.btnOK.Location = new System.Drawing.Point(424, 296);
this.btnOK.Name = "btnOK";
this.btnOK.Size = new System.Drawing.Size(64, 24);
this.btnOK.TabIndex = 8;
this.btnOK.Text = "OK";
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
//
// btnCancel
//
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnCancel.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.btnCancel.Location = new System.Drawing.Point(504, 296);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(64, 24);
this.btnCancel.TabIndex = 9;
this.btnCancel.Text = "Cancel";
this.btnCancel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
//
// btnApply
//
this.btnApply.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.btnApply.Location = new System.Drawing.Point(584, 296);
this.btnApply.Name = "btnApply";
this.btnApply.Size = new System.Drawing.Size(56, 24);
this.btnApply.TabIndex = 10;
this.btnApply.Text = "Apply";
this.btnApply.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.btnApply.Click += new System.EventHandler(this.btnApply_Click);
//
// tabControl1
//
this.tabControl1.Controls.Add(this.tbGeneral);
this.tabControl1.Controls.Add(this.tbPageUsage);
this.tabControl1.Location = new System.Drawing.Point(0, 0);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(784, 280);
this.tabControl1.TabIndex = 17;
//
// tbGeneral
//
this.tbGeneral.Controls.Add(this.myPropertyGrid);
this.tbGeneral.Location = new System.Drawing.Point(4, 22);
this.tbGeneral.Name = "tbGeneral";
this.tbGeneral.Size = new System.Drawing.Size(776, 254);
this.tbGeneral.TabIndex = 0;
this.tbGeneral.Text = "General";
//
// myPropertyGrid
//
this.myPropertyGrid.CommandsVisibleIfAvailable = true;
this.myPropertyGrid.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.myPropertyGrid.HelpVisible = false;
this.myPropertyGrid.LargeButtons = false;
this.myPropertyGrid.LineColor = System.Drawing.SystemColors.ScrollBar;
this.myPropertyGrid.Location = new System.Drawing.Point(8, 39);
this.myPropertyGrid.Name = "myPropertyGrid";
this.myPropertyGrid.Size = new System.Drawing.Size(736, 94);
this.myPropertyGrid.TabIndex = 16;
this.myPropertyGrid.Text = "Properties";
this.myPropertyGrid.ToolbarVisible = false;
this.myPropertyGrid.ViewBackColor = System.Drawing.SystemColors.Window;
this.myPropertyGrid.ViewForeColor = System.Drawing.SystemColors.WindowText;
this.myPropertyGrid.PropertyValueChanged += new System.Windows.Forms.PropertyValueChangedEventHandler(this.myPropertyGrid_PropertyValueChanged);
//
// tbPageUsage
//
this.tbPageUsage.Controls.Add(this.lblUsage);
this.tbPageUsage.Controls.Add(this.lbUsage);
this.tbPageUsage.Location = new System.Drawing.Point(4, 22);
this.tbPageUsage.Name = "tbPageUsage";
this.tbPageUsage.Size = new System.Drawing.Size(776, 254);
this.tbPageUsage.TabIndex = 1;
this.tbPageUsage.Text = "Usages";
//
// lblUsage
//
this.lblUsage.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.lblUsage.Location = new System.Drawing.Point(16, 8);
this.lblUsage.Name = "lblUsage";
this.lblUsage.Size = new System.Drawing.Size(624, 24);
this.lblUsage.TabIndex = 22;
//
// lbUsage
//
this.lbUsage.Location = new System.Drawing.Point(16, 40);
this.lbUsage.Name = "lbUsage";
this.lbUsage.Size = new System.Drawing.Size(624, 199);
this.lbUsage.TabIndex = 21;
//
// LDProperties
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(768, 326);
this.Controls.Add(this.tabControl1);
this.Controls.Add(this.btnApply);
this.Controls.Add(this.btnCancel);
this.Controls.Add(this.btnOK);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "LDProperties";
this.Text = "Library Document Properties";
this.tabControl1.ResumeLayout(false);
this.tbGeneral.ResumeLayout(false);
this.tbPageUsage.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
// save was clicked, use the objects save methods.
private bool saveclick()
{
bool success = true;
if (isnew)
{
if(_ParentObj==null)
{
DialogResult=DialogResult.Cancel;
return true;
}
success=_ParentObj.SaveChild(_CurObj);
}
else
{
success=_CurObj.Write();
}
return success;
}
// save was clicked, use the objects save methods.
private void btnOK_Click(object sender, System.EventArgs e)
{
bool success = true;
if(canedit)success = saveclick();
if (success==true)
{
DialogResult = DialogResult.OK;
this.Close();
}
}
private void btnApply_Click(object sender, System.EventArgs e)
{
if(canedit)return;
bool success = saveclick();
if(success==true)btnApply.Enabled=false;
Refresh();
}
private void btnCancel_Click(object sender, System.EventArgs e)
{
if(!canedit)return;
_CurObj.Restore();
}
private void myPropertyGrid_PropertyValueChanged(object s, System.Windows.Forms.PropertyValueChangedEventArgs e)
{
btnApply.Enabled = true;
}
}
}

View File

@@ -0,0 +1,255 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 1.3
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">1.3</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1">this is my long string</data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
[base64 mime encoded serialized .NET Framework object]
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
[base64 mime encoded string representing a byte array form of the .NET Framework object]
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used forserialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>1.3</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="btnOK.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="btnOK.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="btnOK.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="btnCancel.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="btnCancel.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="btnCancel.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="btnApply.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="btnApply.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="btnApply.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="tabControl1.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="tabControl1.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="tabControl1.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="tabControl1.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="tabControl1.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="tabControl1.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>8, 8</value>
</data>
<data name="tbGeneral.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="tbGeneral.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="tbGeneral.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="tbGeneral.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="tbGeneral.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="tbGeneral.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>8, 8</value>
</data>
<data name="myPropertyGrid.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="myPropertyGrid.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="myPropertyGrid.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="tbPageUsage.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="tbPageUsage.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="tbPageUsage.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="tbPageUsage.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="tbPageUsage.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="tbPageUsage.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>8, 8</value>
</data>
<data name="lblUsage.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="lblUsage.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="lblUsage.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="lbUsage.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="lbUsage.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="lbUsage.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="$this.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="$this.Language" type="System.Globalization.CultureInfo, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>(Default)</value>
</data>
<data name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="$this.Name">
<value>LDProperties</value>
</data>
<data name="$this.Localizable" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="$this.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>8, 8</value>
</data>
<data name="$this.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="$this.TrayHeight" type="System.Int32, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>80</value>
</data>
<data name="$this.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="$this.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAICAQAAAAAADoAgAAFgAAACgAAAAgAAAAQAAAAAEABAAAAAAAgAIAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAADAAADAAAAAwMAAwAAAAMAAwADAwAAAwMDAAICAgAAAAP8AAP8AAAD//wD/AAAA/wD/AP//
AAD///8AiIiIiIiIiIiIiIiIiIiIiPF3F3F3F3F3F3d3d3d3d3jxdxdxdxdxdxd3d3d3d3d49xdxdxdx
dxdxd3d3d3d3ePcXcXcXcXcXcXd3d3d3d3jxcXcXcXcXcXcXd3d3d3d48XF3F3F3F3F3F3d3d3d3ePdx
F3F3F3F3F3F3d3d3d3j3cRdxdxdxdxdxd3d3d3d49xdxdxdxdxdxdxd3d3d3ePcXcXcXcXcXcXcXd3d3
d3jxdxcXcXcXcXcXcXd3d3d48XcXF3F3F3F3F3F3d3d3ePdxdxF3F3F3F3F3F3d3d3j3cXcRdxdxdxdx
dxd3d3d49xdxdxdxdxdxdxdxd3d3ePcXcXcXcXcXcXcXcXd3d3jxdxdxcXcXcXcXcXcXd3d48XcXcXF3
F3F3F3F3F3d3ePdxdxd3F3F3F3F3F3F3d3j3cXcXdxdxdxdxdxdxd3d49xdxd3dxdxdxdxdxdxd3ePcX
cXd3cXcXcXcXcXcXd3jxdxd3d3cXcXcXcXcXcXd48XcXd3d3F3F3F3F3F3F3ePdxd3d3d3F3F3F3F3F3
F3j3cXd3d3dxdxdxdxdxdxd49xd3d3d3dxdxdxdxdxdxePcXd3d3d3cXcXcXcXcXcXjxd3d3d3d3cXcX
cXcXcXcY8Xd3d3d3d3F3F3F3F3F3GP////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==
</value>
</data>
</root>

View File

@@ -0,0 +1,403 @@
/*********************************************************************************************
* Copyright 2004 - Volian Enterprises, Inc. All rights reserved.
* Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
* ------------------------------------------------------------------------------
* $Workfile: LibDoc.cs $ $Revision: 6 $
* $Author: Kathy $ $Date: 5/31/06 9:47a $
*
* $History: LibDoc.cs $
*
* ***************** Version 6 *****************
* User: Kathy Date: 5/31/06 Time: 9:47a
* Updated in $/LibSource/VEObject
* Fixed B2006-023 - library document usages, duplicates and missing
* procedure titles
*
* ***************** Version 5 *****************
* User: Kathy Date: 2/08/06 Time: 10:22a
* Updated in $/LibSource/VEObject
* Fix B2006-004 - usages not found
*
* ***************** Version 4 *****************
* User: Kathy Date: 5/31/05 Time: 12:42p
* Updated in $/LibSource/VEObject
* crash on save if no comment
*
* ***************** Version 3 *****************
* User: Kathy Date: 5/25/05 Time: 10:32a
* Updated in $/LibSource/VEObject
* Allow edits for tmpchg
*
* ***************** Version 2 *****************
* User: Kathy Date: 1/31/05 Time: 11:05a
* Updated in $/LibSource/VEObject
* Fix B2005-005 - this just fixed empty icon usage
*
* ***************** Version 1 *****************
* User: Kathy Date: 7/27/04 Time: 8:53a
* Created in $/LibSource/VEObject
*********************************************************************************************/
using System;
using System.IO;
using System.Windows.Forms;
using System.ComponentModel;
using System.Collections;
using System.Data;
using VDB_TransUsage;
using Utils;
namespace VEObject
{
/// <summary>
/// Summary description for LibDoc.
/// </summary>
public class VEO_LibDoc : VEO_Base
{
string _Comment;
public ArrayList usages;
public string ldname;
private string tmpRtfFileName;
protected bool changeTitle;
protected bool changeComment;
protected string tmpTitle;
protected string tmpComment;
public VEO_LibDoc(string ipath, VEO_DummyLibDoc ld, bool inew)
{
iconStates = new int[5] {15,15,15,15,15};
string loctitle=null;
string loccomment=null;
_Location = ipath;
VEObjectType = (int)VEObjectTypesDefs.LibraryDoc;
parentObj = ld;
usages = new ArrayList();
isNew = inew;
// use the path to open the file & read the title & comment
FileInfo fi = new FileInfo(ipath);
FileStream fs=null;
fs = fi.Open(FileMode.Open, FileAccess.Read, FileShare.ReadWrite );
BinaryReader br = new BinaryReader(fs,System.Text.ASCIIEncoding.ASCII);
int cntPage = br.ReadInt16();
if(cntPage != -1)
{ // Not End of File
int nchar = br.ReadInt16();
string tmp = new string(br.ReadChars(nchar));
loctitle = tmp.Substring(0,tmp.Length-1); // remove null at end.
nchar = br.ReadInt16();
if (nchar>0)
{
tmp = new String(br.ReadChars(nchar));
loccomment = tmp.Substring(0,tmp.Length-1); // remove null at end.
}
}
br.Close();
fs.Close();
if (loctitle!=null)
_Title = loctitle;
else
_Title=ipath;
_Comment = loccomment;
VEO_Base tmp1 = (VEO_Base) ld.parentObj;
usrRunTime = tmp1.usrRunTime;
string pthnm = this._Location.Substring(0,_Location.ToUpper().IndexOf(".LIB"));
ldname = pthnm.Substring(_Location.LastIndexOf("\\")+1,8);
LoadLockInfo();
icon = iconStates[(int) Lock.LockStatus];
}
[Description("Location"),Category("Library Document"),ReadOnly(true)]public string Location
{
get{return _Location;}
set{_Location=value;}
}
[Description("Title"),Category("Library Document")]public string Title
{
get
{
if(!changeTitle)
return _Title;
else
return tmpTitle;
}
set
{
changeTitle=true;
tmpTitle=value;
}
}
[Description("Comment"),Category("Library Document")]public string Comment
{
get
{
if(!changeComment)
return _Comment;
else
return tmpComment;
}
set
{
changeComment=true;
tmpComment=value;
}
}
public override bool PropertiesDlg(Object parent)
{
LDProperties propdlg = new LDProperties(parent, this);
if (propdlg.ShowDialog() == DialogResult.OK) return true;
// for New libdoc, a file was created in order for dialog to work,
// remove it on cancel.
if (this.isNew && File.Exists(_Location)) File.Delete(_Location);
return false;
}
public void GetUsages()
{
usages.Clear();
VEO_DummyLibDoc dl = (VEO_DummyLibDoc) this.parentObj;
VEO_ProcSet ps = (VEO_ProcSet) dl.parentObj;
string pth = ps._curDirectory+"\\"+ps.Location+"\\tran.dbf";
vdb_TransUsage transusg = new vdb_TransUsage(pth);
DataSet ds = transusg.GetSortedByToTrans("[TONUMBER] = \'"+ldname.ToUpper() + "\' OR [TONUMBER] = \'" + ldname.ToLower()+"\'");
VEO_DummySet dset = (VEO_DummySet) ps.Children[1];
if (ds.Tables[0].Rows.Count !=0)
{
foreach(DataRow dr in ds.Tables[0].Rows)
{
string usg = dr["FROMNUMBER"].ToString();
string titl = null;
if (dset.Children.Count==0) dset.Read(false);
foreach(Object obj in dset.Children)
{
VEO_Proc prc = (VEO_Proc) obj;
if (usg == prc._Prcnum)
{
titl = prc._Title;
break;
}
}
usages.Add(usg + " " + titl);
}
}
transusg = null;
}
public override bool SaveNew(string dummy)
{
// since the file was created before creating this object, use the 'Write' method
// to save it.
bool success = Write();
isNew=false;
// the parent icon cannot be empty.
VEO_DummyLibDoc ld = (VEO_DummyLibDoc) parentObj;
ld.icon = ld.iconStates[0];
ld.IsEmpty=false;
return success;
}
public override bool Write()
{
string origfile=null;
if (isNew||changeTitle||changeComment)
{
try
{
// rename file extension to bak & rewrite it.
origfile = _Location.Substring(0,_Location.Length-3) + "BAK";
File.Delete(origfile);
File.Move(_Location,origfile);
FileStream chgfile = new FileStream(_Location, FileMode.Create);
BinaryWriter bw = new BinaryWriter(chgfile,System.Text.Encoding.ASCII);
// Write out header to the new file
short j=0;
bw.Seek(0,SeekOrigin.Begin);
bw.Write(j); // temporary page count value (reset on pagination)
j=(short)(Title.Length+1);
bw.Write(j);
char [] xbuf = new char[Title.Length];
xbuf = Title.ToCharArray();
bw.Write(xbuf);
bw.Write((byte)0); // add null for end of string
j=0;
if (Comment != null) j=(short)(Comment.Length+1);
bw.Write(j);
if(j>0)
{
xbuf = new char[Comment.Length];
xbuf = Comment.ToCharArray();
bw.Write(xbuf);
bw.Write((byte)0);
}
// Now open the original file for reading data, get past the header info
// first.
FileStream oldfile = new FileStream(origfile, FileMode.Open, FileAccess.Read);
BinaryReader br = new BinaryReader(oldfile,System.Text.ASCIIEncoding.ASCII);
int cntPage = br.ReadInt16();
if(cntPage != -1)
{ // Not End of File
int nchar = br.ReadInt16();
string tmp = new string(br.ReadChars(nchar));
nchar = br.ReadInt16();
if (nchar>0)tmp = new String(br.ReadChars(nchar));
}
byte ac;
bool done = false;
while(done==false)
{
if (br.PeekChar() >0)
{
ac = br.ReadByte();
bw.Write(ac);
}
else
done=true;
}
br.Close();
bw.Close();
oldfile.Close();
chgfile.Close();
}
catch (Exception e)
{
MessageBox.Show(e.Message,"Error on library document save.");
if (origfile!=null)
{
File.Delete(_Location);
File.Move(origfile,_Location);
}
return false;
}
if(origfile!=null)File.Delete(origfile);
if(changeComment)
{
_Comment=tmpComment;
changeComment=false;
}
if(changeTitle)
{
_Title=tmpTitle;
changeTitle=false;
}
}
return true;
}
private bool canDelete()
{
if (usages.Count == 0) GetUsages();
if (usages.Count > 0)
{
MessageBox.Show("Cannot delete library document, it is used.");
return false;
}
return true;
}
public override bool Delete()
{
// first see if the library document can be deleted (if it is used, it cannot
// be deleted.
if (canDelete()==false) return false;
File.Delete(_Location);
// if this is the only library document. then set the parents, icon to empty
VEO_DummyLibDoc ld = (VEO_DummyLibDoc) this.parentObj;
if (ld.Children.Count==1) IsEmpty=true; // just this one.
return true;
}
public string GetContentsFile()
{
return tmpRtfFileName;
}
public void ClearContentsFile()
{
if(tmpRtfFileName!=null)File.Delete(tmpRtfFileName);
tmpRtfFileName=null;
}
public bool ReadContentsFile()
{
try
{
// Open the file for reading data, get past the header info first.
FileStream ldfile = new FileStream(_Location, FileMode.Open, FileAccess.Read);
BinaryReader br = new BinaryReader(ldfile,System.Text.ASCIIEncoding.ASCII);
tmpRtfFileName = Path.GetTempFileName();
FileStream tmpfile = new FileStream(tmpRtfFileName, FileMode.Create);
BinaryWriter bw = new BinaryWriter(tmpfile,System.Text.Encoding.ASCII);
int cntPage = br.ReadInt16();
if(cntPage != -1)
{
int nchar = br.ReadInt16();
string tmp = new string(br.ReadChars(nchar));
nchar = br.ReadInt16();
if (nchar>0)tmp = new String(br.ReadChars(nchar));
}
byte ac;
bool done = false;
while(done==false)
{
if (br.PeekChar() >0)
{
ac = br.ReadByte();
bw.Write(ac);
}
else
done=true;
}
br.Close();
ldfile.Close();
bw.Close();
tmpfile.Close();
}
catch (Exception e)
{
MessageBox.Show(e.Message,"Error reading Library Document");
return false;
}
return true;
}
public override void AddToTree(TreeNode parentnd)
{
}
public override bool Expand(TreeNode parentnd)
{
return true;
}
public override bool mnuAllowNew()
{
return false;
}
public override bool mnuAllowDelete()
{
return AllowMods();
}
public override bool canEdit()
{
return AllowMods();
}
private bool AllowMods()
{
VEO_DummyLibDoc ds = (VEO_DummyLibDoc) this.parentObj;
VEO_ProcSet ps = (VEO_ProcSet) ds.parentObj;
if (ps.isApproved == true) return false;
if (amILockedByMe()==false) return false;
if ((ps.accessFlags&Security.LIBRARYDOCS)==Security.LIBRARYDOCS) return true;
return false;
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,435 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 1.3
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">1.3</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1">this is my long string</data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
[base64 mime encoded serialized .NET Framework object]
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
[base64 mime encoded string representing a byte array form of the .NET Framework object]
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used forserialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>1.3</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="btnOK.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="btnOK.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="btnOK.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="btnCancel.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="btnCancel.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="btnCancel.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="btnApply.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="btnApply.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="btnApply.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="tabControl1.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="tabControl1.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="tabControl1.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="tabControl1.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="tabControl1.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="tabControl1.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>8, 8</value>
</data>
<data name="tbGeneral.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="tbGeneral.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="tbGeneral.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="tbGeneral.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="tbGeneral.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="tbGeneral.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>8, 8</value>
</data>
<data name="cbChgBarApp.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="cbChgBarApp.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="cbChgBarApp.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="tbExtraRev.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="tbExtraRev.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="tbExtraRev.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="lblExtraRev.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="lblExtraRev.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="lblExtraRev.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="btnCurSet.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="btnCurSet.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="btnCurSet.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="lblGdLink.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="lblGdLink.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="lblGdLink.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="cmbGuideLink.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="cmbGuideLink.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="cmbGuideLink.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="lblPLink.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="lblPLink.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="lblPLink.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="cmbPLink.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="cmbPLink.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="cmbPLink.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="lblType.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="lblType.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="lblType.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="cmbType.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="cmbType.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="cmbType.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="myPropertyGrid.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="myPropertyGrid.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="myPropertyGrid.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="tbPageAdvanced.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="tbPageAdvanced.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="tbPageAdvanced.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="tbPageAdvanced.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="tbPageAdvanced.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="tbPageAdvanced.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>8, 8</value>
</data>
<data name="lblIniFile.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="lblIniFile.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="lblIniFile.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="tbIniText.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="tbIniText.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="tbIniText.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="tbpgSetINI.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="tbpgSetINI.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="tbpgSetINI.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="tbpgSetINI.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="tbpgSetINI.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="tbpgSetINI.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>8, 8</value>
</data>
<data name="lblSetINI.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="lblSetINI.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="lblSetINI.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="tbSetIniText.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="tbSetIniText.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="tbSetIniText.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="tbERG_Relate.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="tbERG_Relate.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="tbERG_Relate.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="tbERG_Relate.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="tbERG_Relate.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="tbERG_Relate.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>8, 8</value>
</data>
<data name="label2.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="label2.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="label2.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="cbErgRelateList.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="cbErgRelateList.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="cbErgRelateList.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="lbEopRelateList.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="lbEopRelateList.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="lbEopRelateList.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="label1.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="label1.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="label1.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="$this.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="$this.Language" type="System.Globalization.CultureInfo, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>(Default)</value>
</data>
<data name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="$this.Localizable" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="$this.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>8, 8</value>
</data>
<data name="$this.Name">
<value>PSProperties</value>
</data>
<data name="$this.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="$this.TrayHeight" type="System.Int32, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>80</value>
</data>
<data name="$this.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="$this.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAICAQAAAAAADoAgAAFgAAACgAAAAgAAAAQAAAAAEABAAAAAAAgAIAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAADAAADAAAAAwMAAwAAAAMAAwADAwAAAwMDAAICAgAAAAP8AAP8AAAD//wD/AAAA/wD/AP//
AAD///8AiIiIiIiIiIiIiIiIiIiIiPF3F3F3F3F3F3d3d3d3d3jxdxdxdxdxdxd3d3d3d3d49xdxdxdx
dxdxd3d3d3d3ePcXcXcXcXcXcXd3d3d3d3jxcXcXcXcXcXcXd3d3d3d48XF3F3F3F3F3F3d3d3d3ePdx
F3F3F3F3F3F3d3d3d3j3cRdxdxdxdxdxd3d3d3d49xdxdxdxdxdxdxd3d3d3ePcXcXcXcXcXcXcXd3d3
d3jxdxcXcXcXcXcXcXd3d3d48XcXF3F3F3F3F3F3d3d3ePdxdxF3F3F3F3F3F3d3d3j3cXcRdxdxdxdx
dxd3d3d49xdxdxdxdxdxdxdxd3d3ePcXcXcXcXcXcXcXcXd3d3jxdxdxcXcXcXcXcXcXd3d48XcXcXF3
F3F3F3F3F3d3ePdxdxd3F3F3F3F3F3F3d3j3cXcXdxdxdxdxdxdxd3d49xdxd3dxdxdxdxdxdxd3ePcX
cXd3cXcXcXcXcXcXd3jxdxd3d3cXcXcXcXcXcXd48XcXd3d3F3F3F3F3F3F3ePdxd3d3d3F3F3F3F3F3
F3j3cXd3d3dxdxdxdxdxdxd49xd3d3d3dxdxdxdxdxdxePcXd3d3d3cXcXcXcXcXcXjxd3d3d3d3cXcX
cXcXcXcY8Xd3d3d3d3F3F3F3F3F3GP////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==
</value>
</data>
</root>

View File

@@ -0,0 +1,701 @@
/*********************************************************************************************
* Copyright 2004 - Volian Enterprises, Inc. All rights reserved.
* Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
* ------------------------------------------------------------------------------
* $Workfile: Plant.cs $ $Revision: 10 $
* $Author: Jsj $ $Date: 10/20/06 9:34a $
*
* $History: Plant.cs $
*
* ***************** Version 10 *****************
* User: Jsj Date: 10/20/06 Time: 9:34a
* Updated in $/LibSource/VEObject
* long name fix
*
* ***************** Version 9 *****************
* User: Jsj Date: 9/26/06 Time: 9:38a
* Updated in $/LibSource/VEObject
* check for a siingle quote in directory name
*
* ***************** Version 8 *****************
* User: Kathy Date: 6/06/05 Time: 12:35p
* Updated in $/LibSource/VEObject
* Allow lock set even if system lock set
*
* ***************** Version 7 *****************
* User: Kathy Date: 4/12/05 Time: 1:01p
* Updated in $/LibSource/VEObject
*
* ***************** Version 6 *****************
* User: Kathy Date: 2/02/05 Time: 10:13a
* Updated in $/LibSource/VEObject
* B2005-006: fix missing proc sets under plant
*
* ***************** Version 5 *****************
* User: Kathy Date: 1/31/05 Time: 11:06a
* Updated in $/LibSource/VEObject
* Fix B2005-005 (connection & delete directory errors). also, fix icon
* usage & security for new
*
* ***************** Version 4 *****************
* User: Kathy Date: 1/24/05 Time: 2:45p
* Updated in $/LibSource/VEObject
* B2005-004 fixes
*
* ***************** Version 3 *****************
* User: Kathy Date: 1/14/05 Time: 10:38a
* Updated in $/LibSource/VEObject
* B2004-061: Fix security optoins
*
* ***************** Version 2 *****************
* User: Kathy Date: 1/10/05 Time: 12:58p
* Updated in $/LibSource/VEObject
* B2004-063 fix
*
* ***************** Version 1 *****************
* User: Kathy Date: 7/27/04 Time: 8:53a
* Created in $/LibSource/VEObject
*********************************************************************************************/
using System;
using System.Collections;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Xml;
using System.ComponentModel;
using Utils;
using VENetwork;
namespace VEObject
{
/// <summary>
/// This defines the VEO_Plant class which handles plant data. This contains
/// support for the vexxx layer.
/// </summary>
public class VEO_Plant : VEO_Base
{
public long accessFlags;
protected string tmpTitle;
protected string tmpLocation;
protected bool changeLocation;
protected bool changeTitle;
private string PrevDirectory;
public VEO_Plant(UserRunTime iusrRunTime, string ititle, string ipath)
{
// iconStates are the imagelist indexes for the tree view (imglist1)
// the states are Nolock, LockedByMe, LockedByOther, LockPending, Empty.
iconStates = new int[5] {3,21,5,22,4};
_Title = ititle;
_Location = ipath;
usrRunTime = iusrRunTime;
changeLocation=false;
changeTitle=false;
IsEmpty=false;
VEObjectType=(int)VEObjectTypesDefs.Plant;
isNew=false;
LoadLockInfo();
icon = iconStates[(int)Lock.LockStatus];
if (Lock.LockStatus != VENetwork.Status.LockedByOther)
{
if (ipath != null)
{
string[] dirs = new string[40];
dirs = Directory.GetDirectories(ipath);
if (dirs.Length == 0)
{
IsEmpty=true;
//only reset the icon to empty if there is no lock icon.
//if a lock, show the lock icon
if (Lock.LockStatus == VENetwork.Status.NoLock) icon = iconStates[(int)VEO_IconStates.Empty];
}
}
}
}
public override void LoadLockInfo()
{
Lock = new VELock(_Location, usrRunTime.myUserData, usrRunTime.InMultiUserMode?VENetwork.LockTypes.Plant:VENetwork.LockTypes.None);
}
// Properties used for modify of 'Properties' from File menu.
[Description("Location"),Category("Plant"),ReadOnly(true)]public string Location
{
get{return _Location;}
set{_Location=value;}
}
[Description("Title"),Category("Plant")]public string Title
{
get
{
if (!changeTitle)
return _Title;
else
return tmpTitle;
}
set
{
changeTitle=true;
tmpTitle=value;
}
}
// The open method checks for multi-user settings at the plant level. It
// also positions into the plant directory.
public override bool Open()
{
isOpen = true;
PrevDirectory = Directory.GetCurrentDirectory();
if(_Location!=null)Directory.SetCurrentDirectory(_Location);
if (Connection!=null)Connection.Enter(false);
return true;
}
// The close method resets, if necessary from any multi-user settings and
// positions back to the datapath directory (which is a level above the
// current level)
public override bool Close()
{
if (!isOpen)return false;
isOpen=false;
if (Connection!=null)Connection.Exit();
Directory.SetCurrentDirectory("..");
return true;
}
public override void Restore()
{
changeTitle=false;
}
public override bool Delete()
{
DialogResult result = MessageBox.Show("Are you sure you want to delete the entire plant directory " + this._Location,"Confirm Delete Again",MessageBoxButtons.YesNoCancel);
if (result == DialogResult.Yes)
{
// delete the entire directory
if (Directory.Exists(this._Location))
{
if(isOpen)Close();
try
{
Directory.Delete(this._Location,true);
}
catch (Exception e)
{
MessageBox.Show("Could not delete directory - manually delete " + this._Location + ". Cause: " + e.Message);
}
if (Directory.Exists(this._Location))
{
MessageBox.Show("Unable to delete the plant directory.");
return false;
}
return true;
}
}
return false;
}
private void CreateProcSet(string dirpath, XmlElement nm, string dirname, long flags)
{
// see if there is a title file in the directory and use
// it if there is, otherwise use menuname & if there's no menu
// name, use the directory name.
VEO_ProcSet procset = null;
string titlepath = dirpath + "\\" + "Title";
FileInfo fi = new FileInfo(titlepath);
if (File.Exists(titlepath))
{
StreamReader myReader = new StreamReader(titlepath);
titlepath = myReader.ReadLine();
myReader.Close();
procset = new VEO_ProcSet(usrRunTime, titlepath.Trim(), dirpath, flags);
}
else
{
if (nm != null)
procset = new VEO_ProcSet(usrRunTime, nm.InnerText, dirpath, flags);
else
{
string tmpdirnm = dirname;
int indx=0;
// if this is temp change directory, tack on text to recognize it
if ((indx=dirpath.ToUpper().IndexOf("TMPCHG"))>-1)
tmpdirnm = dirname + " - Temporary Change Version";
// if this is approved, tack on Current Approved Version to the title
else if ((indx=dirpath.ToUpper().IndexOf("APPROVED"))>-1)
tmpdirnm = dirname + " - Current Approved Version";
procset = new VEO_ProcSet(usrRunTime, tmpdirnm, dirpath,flags);
}
}
procset.parentObj = this;
Children.Add(procset);
}
// private method, used below, to add a directory to the child list
// (list contains proc sets)
private bool ProcessDirName(XmlElement par, string dirname, int plntsecindx)
{
XmlNodeList nodeList = par.SelectNodes("ProcFile");
if (nodeList == null) return false;
foreach (XmlNode dirnd in nodeList)
{
XmlElement dele=(XmlElement)dirnd;
string dirpath = _Location + "\\" + dirname;
if (File.Exists(dirpath+"\\"+dirnd.InnerText))
{
//
// see if there's an exception or a requirement, i.e. use
// the Working Draft if there's no proc2 directory (Except)
// or use the Working Draft Unit 1 if there's a proc2
// directory (Require)
bool excpt = false;
bool req = true;
string path1=null;
XmlElement except = (XmlElement) par.SelectSingleNode("Exception");
if (except != null)
{
// if this exception directory exists, don't add this to
// the set.
path1 = dirpath + "\\" + except.InnerText;
if (Directory.Exists(path1)) excpt = true;
}
XmlElement require = (XmlElement) par.SelectSingleNode("Require");
if (require != null)
{
// if this require directory exists, add this to set only
// if this exists.
path1 = dirpath + "\\" + require.InnerText;
if (Directory.Exists(path1) == false) req = false;
}
if (excpt == false && req == true)
{
XmlElement nm = (XmlElement) par.SelectSingleNode("MenuName");
long flags=0L;
// bug fix B2006-045
// need to convert long folder/file names to short (8.3)
ShortName sname = new ShortName(dirpath);
bool hasSec = usrRunTime.sec.ProcSetHasSecurity(plntsecindx, Path.GetFileName(sname.ShortFileName));
// bool hasSec = usrRunTime.sec.ProcSetHasSecurity(plntsecindx, dirname);
if (this.usrRunTime.sec==null) flags=Security.SUPERACCESS;
else if (hasSec) flags = usrRunTime.sec.GetProcSecurity(sname.ShortFileName);
// else if (hasSec) flags = usrRunTime.sec.GetProcSecurity(dirpath);
if((hasSec && flags!=0L) || (!hasSec&&!usrRunTime.sec.BlockAccess()))
{
CreateProcSet(dirpath, nm, dirname, flags);
return true;
}
}
}
}
return false;
}
// This method processes through the SubDirSearch xmlelement tree in
// menuwin2.xml to see if the input procedure set directory has valid
// procedure set subdirectories. Arguments are:
// subtop is xmlelement for the SubDirSearch in menuwin2.xml, dir is actual
// procset directory name (for example, procs, proc000.dvt, etc) and
// dname is the name to be used for the directory name in the menuwin2.xml
// file under the SubDirSearch xmlelement tree (for example, procs, *.dvt, etc)
private bool ProcessSubDir(XmlElement subtop, string dri, string dname, int plntsecindx)
{
XmlNodeList nodeList;
string xp = "descendant::ProcSet[Dir = \'" + dname + "\']";
try
{
nodeList = subtop.SelectNodes(xp);
// for each possible subdirectory for this directory, see if it
// exists.
foreach (XmlNode subdirname in nodeList)
{
XmlElement subdele=(XmlElement)subdirname;
XmlNodeList FnodeList = subdirname.SelectNodes("ProcFile");
// see if the files listed exist, if so, add them to the
// plant procset list.
foreach (XmlNode dirnd in FnodeList)
{
XmlElement dele=(XmlElement)dirnd;
string dirpath = _Location + "\\" + dri;
if (File.Exists(dirpath+"\\"+dirnd.InnerText))
{
XmlElement nm = (XmlElement) subdirname.SelectSingleNode("MenuName");
string subdir = dirnd.InnerText.Substring(0,dirnd.InnerText.LastIndexOf("\\"));
long flags=0L;
bool hasSec = usrRunTime.sec.ProcSetHasSecurity(plntsecindx, dri+"\\"+subdir);
if (this.usrRunTime.sec==null) flags=Security.SUPERACCESS;
else if (hasSec) flags = usrRunTime.sec.GetProcSecurity(dirpath + "\\" + subdir);
if((hasSec && flags!=0L) || (!hasSec&&!usrRunTime.sec.BlockAccess()))
CreateProcSet(dirpath+"\\"+subdir, nm, dri, flags);
}
break; // out of file check foreach
}
}
}
catch (Exception e)
{
MessageBox.Show(e.Message);
return false;
}
return true;
}
// Using the menuwin2.xml file, read in child list by seeing which
// directories (proc sets) are contained in this vexxx directory.
public override bool Read(bool ChkForChldOnly)
{
bool didone;
Cursor.Current = Cursors.WaitCursor;
// using the . Then do exist tests to see if they
// exist on this datapath.
usrRunTime.LoadMenuWin2();
XmlDocument xmldoc = usrRunTime.menuwin2XML.GetXmlDoc();
XmlElement top = (XmlElement) xmldoc.FirstChild;
XmlElement sys = (XmlElement) top.SelectSingleNode("PlantAttach");
XmlElement subtop = (XmlElement) top.SelectSingleNode("SubDirSearch");
DirectoryInfo cur = new DirectoryInfo(_Location);
DirectoryInfo[] diArr = cur.GetDirectories();
int plntsecindx = usrRunTime.sec.GetPlantSecurityIndex(_Location);
foreach (DirectoryInfo dri in diArr)
{
XmlNodeList nodeList;
string dname = null;
int indx;
if ((indx=dri.Name.IndexOf("."))>-1)
{
//must be *.prc, *.bck, *.dvt, *.sl?
if (indx+4<=dri.Name.Length)
{
dname = "*." + dri.Name.Substring(indx+1,3).ToLower();
if (dname.StartsWith("*.sl"))
dname = dname.Substring(0,4) + "?";
}
else
dname = null;
}
else if ((indx=dri.Name.IndexOf("'"))>-1)
{
// bug fix B2006-047
// if not a .PRC folder, then we get an error looking up
// the directory name in XML (if it has an ' in the name)
dname = null;
}
else
{
dname = dri.Name.ToLower();
}
if (dname!=null)
{
string xp = "descendant::ProcSet[Dir = \'" + dname + "\']";
try
{
nodeList = sys.SelectNodes(xp);
foreach (XmlNode dirname in nodeList)
{
XmlElement dele=(XmlElement)dirname;
didone = ProcessDirName(dele, dri.Name, plntsecindx);
if (Children.Count > 0 && ChkForChldOnly)
{
Cursor.Current = Cursors.Default;
return true;
}
// if a directory was found, see if any
// subdirectories exist that need added too.
bool didsub = false;
if (didone) didsub = ProcessSubDir(subtop, dri.Name, dname, plntsecindx);
}
}
catch (Exception e)
{
MessageBox.Show(e.Message.ToString());
Cursor.Current = Cursors.Default;
return false;
}
}
}
// if no children, change icon to empty (unless it has a lock icon)
if (Children.Count <=0 && Lock.LockStatus == VENetwork.Status.NoLock) icon = iconStates[(int)VEO_IconStates.Empty];
Cursor.Current = Cursors.Default;
return true;
}
// write out change (modification of title for plant) for plant to
// the menuwin.xml file
public override bool Write()
{
string newtitle=null;
if (changeTitle)
{
newtitle = tmpTitle;
bool success = usrRunTime.ModMenuWin(newtitle, this._Title);
if (success==false)
{
MessageBox.Show("Could not modify title for the plant.");
return false;
}
MessageBox.Show("Please send \\ve-proms\\menuwin & \\ve-proms\\menuwin.xml files to Volian.");
_Title=newtitle;
changeTitle=false;
}
return true;
}
// create a new proc set object (child for this plant)
public override Object MakeNewChild()
{
if (!isOpen)Open();
VEO_ProcSet ps = new VEO_ProcSetN(usrRunTime,null,_Location);
return ps;
}
// save a new proc set (child for this plant)
public override bool SaveChild(Object obj)
{
VEO_ProcSetN ps = (VEO_ProcSetN) obj;
// check for valid child
bool valid = ps.IsValid();
if (valid == false) return false;
valid = ps.SaveNew("dummy");
if (valid == true)
{
// add this item to this plants list of children.
Children.Add((VEO_ProcSet)obj);
ps.parentObj=this;
ps._Location = this._Location + "\\" + ps._Location;
ps.icon=iconStates[0];
// if this plant's icon is 'empty', change it to either lock (if locked),
// or to not empty.
icon = iconStates[(int)Lock.LockStatus];
IsEmpty=false;
}
return valid;
}
// save a new plant directory
public override bool SaveNew(string pth)
{
// check for non-empty data.
if (tmpLocation == null || tmpLocation == "" || tmpTitle == null || tmpTitle == "")
{
MessageBox.Show("Need to fill in all data.");
return false;
}
// for this new plant, make the directory and write out
// to the menuwin & menuwin.xml files.
// if using the file browser dialog, the drive may be included, if so
// check that the directory matches the datapath.
int slash = tmpLocation.LastIndexOf("\\");
if (slash>0)
{
string drvtmp = tmpLocation.Substring(0,slash+1);
ShortName sname = new ShortName(drvtmp);
string drv=sname.ShortFileName;
sname = null;
if (drv.ToUpper() != pth.ToUpper())
{
MessageBox.Show("Invalid path, directory must match datapath");
return false;
}
// remove the drive part of the path, it's added back later.
tmpLocation = tmpLocation.Substring(slash+1,tmpLocation.Length-(slash+1));
}
// check for ve*
if (tmpLocation.Substring(0,2).ToUpper() != "VE")
{
MessageBox.Show("First two characters must be 'VE' for new plant directory name.");
return false;
}
// also check that the name is not greater than 8 characters (an old 16-bit hangover)
if (tmpLocation.Length>8)
{
MessageBox.Show("Directory/plant name must be 8 characters or less.");
return false;
}
// make path to new directory & check for existence.
string curpath=null;
curpath = pth + "\\" + this.tmpLocation;
DirectoryInfo cur = new DirectoryInfo(curpath);
if (cur.Exists )
{
DirectoryInfo[] di = cur.GetDirectories("*");
FileInfo[] fi = cur.GetFiles("*");
if (di.Length>0 || fi.Length>0)
{
MessageBox.Show("The plant directory you specified already exists & has contents. Enter a different name.");
return false;
}
}
// if the directory exists & it is already in the menu file, it didn't succeed
// in adding the new item.
if (cur.Exists && (usrRunTime.IsInMenuWin(this.tmpLocation)!=0))
{
MessageBox.Show("The plant directory you specified already exists and the plant name exists in the menu files.");
return false;
}
try
{
if (cur.Exists == false)cur.Create();
}
catch (Exception e)
{
MessageBox.Show("Error creating directory: " + e.Message);
return false;
}
// now add to end of menuwin & menuwin.xml.
bool success = usrRunTime.AddToMenuWin(this.tmpTitle,this.tmpLocation);
if (success==false)
{
MessageBox.Show("Could not add directory to ve-proms menuing files. Could not create plant directory.");
cur.Delete();
return false;
}
MessageBox.Show("The VE-PROMS Security Access Module (VESAM) may need to be used to set permissions to access the new plant.");
_Title=tmpTitle;
_Location=tmpLocation;
changeTitle=false;
changeLocation=false;
// set a security flag for this. Cases could be that there is no security in vesam,
// that it has security in vesam, though it didn't exist for this user until now,
// or the user could be super user.
accessFlags=0L;
int idx = usrRunTime.sec.GetPlantSecurityIndex(curpath);
accessFlags = usrRunTime.sec.GetPlantSecurity(idx);
return true;
}
public override void DoListView(ListView veoListView)
{
ListViewItem item=null;
veoListView.Columns.Add("Location", 120, HorizontalAlignment.Left);
veoListView.Columns.Add("Title", 300, HorizontalAlignment.Left);
for (int i=0; i<Children.Count; i++)
{
VEO_ProcSet ps = (VEO_ProcSet) Children[i];
item = new ListViewItem(ps._Location,ps.icon);
item.Tag = ps;
item.SubItems.Add(ps._Title);
veoListView.Items.Add(item);
}
}
public override bool CollapseSibling()
{
if (!usrRunTime.InMultiUserMode) return false;
return true;
}
public override bool mnuAllowLckDB()
{
if (!usrRunTime.InMultiUserMode) return false;
//if (amILockedByMe()==true) return false;
if (Lock.LockStatus==VENetwork.Status.LockedByOther)return false;
// if there are no children, allow a lock in case the user is creating a plant level
// with procedure set
if (this.Children.Count==0) return true;
if ((accessFlags&Security.LOCKSET)==Security.LOCKSET && Lock.LockStatus==VENetwork.Status.NoLock) return true;
return false;
}
public override bool mnuAllowUnlckDB()
{
if (!usrRunTime.InMultiUserMode) return false;
if ((accessFlags&Security.LOCKSET)==Security.LOCKSET&&(Lock.LockStatus==VENetwork.Status.Locked||
Lock.LockStatus==VENetwork.Status.LockPending)) return true;
return false;
}
public override bool mnuAllowDelete()
{
if (amILockedByMe()==false) return false;
if(usrRunTime.sec.SystemAdminFlag) return true;
return false;
}
public override bool mnuAllowNew()
{
if (amILockedByMe()==false) return false;
if (usrRunTime.sec.PermissionToManageFlag) return true;
return false;
}
public override bool canEdit()
{
if (amILockedByMe()==false) return false;
if(usrRunTime.sec.SystemAdminFlag) return true;
return false;
}
}
// the following class is used to support the New plant option from the 'Properties'
// dialog by making location to be editable.
class VEO_PlantN : VEO_Plant
{
public VEO_PlantN(UserRunTime iusrRunTime, string ititle, string ipath)
: base(iusrRunTime, ititle, ipath)
{
isNew=true;
}
// this method is used so that if a new datapath is created, it is associated
// with editable properties (such as path). When the object exists this is
// not editable. So when a new object is created, if it's successful, it's
// copied to an object which is not editable for the treeview & any further
// operations.
public override Object Copy()
{
VEO_Plant plnt = new VEO_Plant(usrRunTime,this._Title,this._Location);
plnt.parentObj = this.parentObj;
plnt.accessFlags = this.accessFlags;
return (Object) plnt;
}
public void SaveFields()
{
_Location=tmpLocation;
_Title=tmpTitle;
changeLocation=false;
changeTitle=false;
}
[Description("Location"),Category("Plant"),ReadOnly(false),EditorAttribute(typeof(VECreateFolderBrowserDlg), typeof(System.Drawing.Design.UITypeEditor))]public new string Location
{
get
{
if (!changeLocation)
return _Location;
else
return tmpLocation;
}
set
{
changeLocation=true;
tmpLocation=value;
}
}
}
}

View File

@@ -0,0 +1,415 @@
/*********************************************************************************************
* Copyright 2004 - Volian Enterprises, Inc. All rights reserved.
* Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
* ------------------------------------------------------------------------------
* $Workfile: PrcProperties.cs $ $Revision: 2 $
* $Author: Kathy $ $Date: 2/10/05 12:36p $
*
* $History: PrcProperties.cs $
*
* ***************** Version 2 *****************
* User: Kathy Date: 2/10/05 Time: 12:36p
* Updated in $/LibSource/VEObject
* B2005-012: No apply button for new
*
* ***************** Version 1 *****************
* User: Kathy Date: 7/27/04 Time: 8:53a
* Created in $/LibSource/VEObject
*********************************************************************************************/
/*********************************************************************************************
* Copyright 2004 - Volian Enterprises, Inc. All rights reserved.
* Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
* ------------------------------------------------------------------------------
* $Workfile: PrcProperties.cs $ $Revision: 2 $
* $Author: Kathy $ $Date: 2/10/05 12:36p $
*
* $History: PrcProperties.cs $
*
* ***************** Version 2 *****************
* User: Kathy Date: 2/10/05 Time: 12:36p
* Updated in $/LibSource/VEObject
* B2005-012: No apply button for new
*
* ***************** Version 1 *****************
* User: Kathy Date: 7/27/04 Time: 8:53a
* Created in $/LibSource/VEObject
*********************************************************************************************/
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
namespace VEObject
{
/// <summary>
/// Summary description for PrcProperties.
/// </summary>
public class PrcProperties : System.Windows.Forms.Form
{
private System.Windows.Forms.TabPage generalTPage;
private System.Windows.Forms.Button btnOK;
private System.Windows.Forms.Button btnCancel;
private System.Windows.Forms.Button btnApply;
private System.Windows.Forms.TabControl tabCtlProc;
private PropertyGrid genPropertyGrid;
private PropertyGrid extPropertyGrid;
private VEO_Base ParentObj;
private VEO_Base ProcObj;
private VEO_Base ProcExtObj;
private bool isnew;
private bool dosuffix;
private System.Windows.Forms.TabPage ExtTPage;
public GridItem CurrentGridItem;
private System.Windows.Forms.Label lblSuffix;
private System.Windows.Forms.ComboBox cmbSuffix;
private bool canedit;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
public PrcProperties(Object par, Object prc, Object ext)
{
ParentObj = (VEO_Base) par;
ProcObj = (VEO_Base) prc;
ProcExtObj = (VEO_Base) ext;
if(ProcObj.isNew)
isnew=true;
else
isnew=false;
//
// Required for Windows Form Designer support
//
InitializeComponent();
this.genPropertyGrid.SelectedObject=prc;
if (ext != null)
{
this.extPropertyGrid.SelectedObject=ext;
if (this.tabCtlProc.TabPages.Count<2)this.tabCtlProc.TabPages.Add(ExtTPage);
}
else
this.tabCtlProc.TabPages.Remove(ExtTPage);
// make apply button visible if modify
this.btnApply.Visible = !isnew;
// if the parent has suffixes as part of format, then
// turn visibility on to the suffix combo box & label, and
// add each character to the suffix combo box & set current
// value.
VEO_ProcSet ps = (VEO_ProcSet) ParentObj.parentObj;
if (ps.SuffixFlags != null && ps.SuffixFlags != "")
{
dosuffix=true;
this.lblSuffix.Visible=true;
this.cmbSuffix.Visible=true;
this.cmbSuffix.Items.Add("blank");
for (int i=0; i<ps.SuffixFlags.Length; i++)
this.cmbSuffix.Items.Add(ps.SuffixFlags.Substring(i,1));
VEO_Proc lprc = (VEO_Proc) ProcObj;
this.cmbSuffix.SelectedIndex = 0;
if (lprc._ProcCode != null && lprc._ProcCode != "")
{
for(int i=0;i<ps.SuffixFlags.Length; i++)
{
if(lprc._ProcCode==this.cmbSuffix.Items[i].ToString())
{
this.cmbSuffix.SelectedIndex = i;
break;
}
}
}
}
else
{
this.lblSuffix.Visible=false;
this.cmbSuffix.Visible=false;
dosuffix=false;
}
if((ProcObj.canEdit()==false)&&!isnew)
{
canedit=false;
this.genPropertyGrid.Enabled=false;
this.extPropertyGrid.Enabled=false;
this.cmbSuffix.Enabled=false;
}
else
{
canedit=true;
this.genPropertyGrid.Enabled=true;
this.extPropertyGrid.Enabled=true;
this.cmbSuffix.Enabled=true;
}
this.btnApply.Enabled=false;
// make apply button visible if modify
this.btnApply.Visible = !isnew;
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(PrcProperties));
this.tabCtlProc = new System.Windows.Forms.TabControl();
this.generalTPage = new System.Windows.Forms.TabPage();
this.genPropertyGrid = new System.Windows.Forms.PropertyGrid();
this.ExtTPage = new System.Windows.Forms.TabPage();
this.extPropertyGrid = new System.Windows.Forms.PropertyGrid();
this.btnOK = new System.Windows.Forms.Button();
this.btnCancel = new System.Windows.Forms.Button();
this.btnApply = new System.Windows.Forms.Button();
this.cmbSuffix = new System.Windows.Forms.ComboBox();
this.lblSuffix = new System.Windows.Forms.Label();
this.tabCtlProc.SuspendLayout();
this.generalTPage.SuspendLayout();
this.ExtTPage.SuspendLayout();
this.SuspendLayout();
//
// tabCtlProc
//
this.tabCtlProc.Controls.Add(this.generalTPage);
this.tabCtlProc.Controls.Add(this.ExtTPage);
this.tabCtlProc.Location = new System.Drawing.Point(0, 0);
this.tabCtlProc.Name = "tabCtlProc";
this.tabCtlProc.SelectedIndex = 0;
this.tabCtlProc.Size = new System.Drawing.Size(704, 192);
this.tabCtlProc.TabIndex = 0;
//
// generalTPage
//
this.generalTPage.Controls.Add(this.genPropertyGrid);
this.generalTPage.Location = new System.Drawing.Point(4, 22);
this.generalTPage.Name = "generalTPage";
this.generalTPage.Size = new System.Drawing.Size(696, 166);
this.generalTPage.TabIndex = 0;
this.generalTPage.Text = "General";
//
// genPropertyGrid
//
this.genPropertyGrid.CommandsVisibleIfAvailable = true;
this.genPropertyGrid.Dock = System.Windows.Forms.DockStyle.Top;
this.genPropertyGrid.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.genPropertyGrid.HelpVisible = false;
this.genPropertyGrid.LargeButtons = false;
this.genPropertyGrid.LineColor = System.Drawing.SystemColors.ScrollBar;
this.genPropertyGrid.Location = new System.Drawing.Point(0, 0);
this.genPropertyGrid.Name = "genPropertyGrid";
this.genPropertyGrid.PropertySort = System.Windows.Forms.PropertySort.Categorized;
this.genPropertyGrid.Size = new System.Drawing.Size(696, 416);
this.genPropertyGrid.TabIndex = 1;
this.genPropertyGrid.Text = "Properties";
this.genPropertyGrid.ToolbarVisible = false;
this.genPropertyGrid.ViewBackColor = System.Drawing.SystemColors.Window;
this.genPropertyGrid.ViewForeColor = System.Drawing.SystemColors.WindowText;
this.genPropertyGrid.PropertyValueChanged += new System.Windows.Forms.PropertyValueChangedEventHandler(this.genPropertyGrid_PropertyValueChanged);
//
// ExtTPage
//
this.ExtTPage.Controls.Add(this.extPropertyGrid);
this.ExtTPage.Location = new System.Drawing.Point(4, 22);
this.ExtTPage.Name = "ExtTPage";
this.ExtTPage.Size = new System.Drawing.Size(696, 166);
this.ExtTPage.TabIndex = 1;
this.ExtTPage.Text = "Extended";
//
// extPropertyGrid
//
this.extPropertyGrid.CommandsVisibleIfAvailable = true;
this.extPropertyGrid.Dock = System.Windows.Forms.DockStyle.Top;
this.extPropertyGrid.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.extPropertyGrid.HelpVisible = false;
this.extPropertyGrid.LargeButtons = false;
this.extPropertyGrid.LineColor = System.Drawing.SystemColors.ScrollBar;
this.extPropertyGrid.Location = new System.Drawing.Point(0, 0);
this.extPropertyGrid.Name = "extPropertyGrid";
this.extPropertyGrid.PropertySort = System.Windows.Forms.PropertySort.Categorized;
this.extPropertyGrid.Size = new System.Drawing.Size(696, 416);
this.extPropertyGrid.TabIndex = 0;
this.extPropertyGrid.Text = "PropertyGrid";
this.extPropertyGrid.ToolbarVisible = false;
this.extPropertyGrid.ViewBackColor = System.Drawing.SystemColors.Window;
this.extPropertyGrid.ViewForeColor = System.Drawing.SystemColors.WindowText;
this.extPropertyGrid.PropertyValueChanged += new System.Windows.Forms.PropertyValueChangedEventHandler(this.extPropertyGrid_PropertyValueChanged);
//
// btnOK
//
this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK;
this.btnOK.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.btnOK.Location = new System.Drawing.Point(400, 264);
this.btnOK.Name = "btnOK";
this.btnOK.Size = new System.Drawing.Size(88, 32);
this.btnOK.TabIndex = 1;
this.btnOK.Text = "OK";
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
//
// btnCancel
//
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnCancel.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.btnCancel.Location = new System.Drawing.Point(504, 264);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(88, 32);
this.btnCancel.TabIndex = 2;
this.btnCancel.Text = "Cancel";
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
//
// btnApply
//
this.btnApply.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.btnApply.Location = new System.Drawing.Point(608, 264);
this.btnApply.Name = "btnApply";
this.btnApply.Size = new System.Drawing.Size(88, 32);
this.btnApply.TabIndex = 3;
this.btnApply.Text = "Apply";
this.btnApply.Click += new System.EventHandler(this.btnApply_Click);
//
// cmbSuffix
//
this.cmbSuffix.Location = new System.Drawing.Point(72, 216);
this.cmbSuffix.Name = "cmbSuffix";
this.cmbSuffix.Size = new System.Drawing.Size(56, 21);
this.cmbSuffix.TabIndex = 4;
this.cmbSuffix.Text = "comboBox1";
this.cmbSuffix.SelectedIndexChanged += new System.EventHandler(this.cmbSuffix_SelectedIndexChanged);
//
// lblSuffix
//
this.lblSuffix.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.lblSuffix.Location = new System.Drawing.Point(16, 216);
this.lblSuffix.Name = "lblSuffix";
this.lblSuffix.Size = new System.Drawing.Size(48, 16);
this.lblSuffix.TabIndex = 5;
this.lblSuffix.Text = "Suffix:";
//
// PrcProperties
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(720, 318);
this.Controls.Add(this.lblSuffix);
this.Controls.Add(this.cmbSuffix);
this.Controls.Add(this.btnApply);
this.Controls.Add(this.btnCancel);
this.Controls.Add(this.btnOK);
this.Controls.Add(this.tabCtlProc);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "PrcProperties";
this.Text = "Procedure Properties";
this.tabCtlProc.ResumeLayout(false);
this.generalTPage.ResumeLayout(false);
this.ExtTPage.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private void genPropertyGrid_Click(object sender, System.EventArgs e)
{
CurrentGridItem = this.genPropertyGrid.SelectedGridItem;
}
private void extPropertyGrid_Click(object sender, System.EventArgs e)
{
CurrentGridItem = this.extPropertyGrid.SelectedGridItem;
}
private void genPropertyGrid_PropertyValueChanged(object s, System.Windows.Forms.PropertyValueChangedEventArgs e)
{
btnApply.Enabled = true;
CurrentGridItem = this.genPropertyGrid.SelectedGridItem;
}
private void extPropertyGrid_PropertyValueChanged(object s, System.Windows.Forms.PropertyValueChangedEventArgs e)
{
btnApply.Enabled = true;
CurrentGridItem = this.extPropertyGrid.SelectedGridItem;
}
// save data for use by ok and apply button clicks
private bool saveclick()
{
bool success = true;
// save the suffix if using it. Note that this was done
// as a separate combo box since fields cannot be removed
// from the property grid at run time.
if (dosuffix)
{
VEO_Proc prc = (VEO_Proc)ProcObj;
if (cmbSuffix.SelectedIndex == 0)
prc._ProcCode = null;
else
prc._ProcCode = cmbSuffix.SelectedItem.ToString();
}
if (isnew)
{
if(ParentObj==null)
{
DialogResult=DialogResult.Cancel;
return success;
}
success=ParentObj.SaveChild(ProcObj);
}
else
{
success=ProcObj.Write();
}
return success;
}
// save was clicked, use the objects save methods.
private void btnOK_Click(object sender, System.EventArgs e)
{
bool success = true;
if(canedit)success = saveclick();
if (success==true)
{
DialogResult = DialogResult.OK;
this.Close();
}
}
private void btnApply_Click(object sender, System.EventArgs e)
{
if(canedit)return;
bool success = saveclick();
if(success==true)btnApply.Enabled=false;
Refresh();
}
private void btnCancel_Click(object sender, System.EventArgs e)
{
if(!canedit)return;
ProcObj.Restore();
}
private void cmbSuffix_SelectedIndexChanged(object sender, System.EventArgs e)
{
btnApply.Enabled=true;
}
}
}

View File

@@ -0,0 +1,264 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 1.3
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">1.3</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1">this is my long string</data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
[base64 mime encoded serialized .NET Framework object]
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
[base64 mime encoded string representing a byte array form of the .NET Framework object]
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used forserialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>1.3</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="tabCtlProc.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="tabCtlProc.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="tabCtlProc.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="tabCtlProc.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="tabCtlProc.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="tabCtlProc.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>8, 8</value>
</data>
<data name="generalTPage.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="generalTPage.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="generalTPage.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="generalTPage.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="generalTPage.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="generalTPage.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>8, 8</value>
</data>
<data name="genPropertyGrid.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="genPropertyGrid.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="genPropertyGrid.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="ExtTPage.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="ExtTPage.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="ExtTPage.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="ExtTPage.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="ExtTPage.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="ExtTPage.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>8, 8</value>
</data>
<data name="extPropertyGrid.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="extPropertyGrid.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="extPropertyGrid.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="btnOK.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="btnOK.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="btnOK.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="btnCancel.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="btnCancel.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="btnCancel.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="btnApply.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="btnApply.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="btnApply.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="cmbSuffix.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="cmbSuffix.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="cmbSuffix.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="lblSuffix.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="lblSuffix.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="lblSuffix.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="$this.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="$this.Name">
<value>PrcProperties</value>
</data>
<data name="$this.Language" type="System.Globalization.CultureInfo, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>(Default)</value>
</data>
<data name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="$this.Localizable" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="$this.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>8, 8</value>
</data>
<data name="$this.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="$this.TrayHeight" type="System.Int32, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>80</value>
</data>
<data name="$this.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="$this.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAICAQAAAAAADoAgAAFgAAACgAAAAgAAAAQAAAAAEABAAAAAAAgAIAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAADAAADAAAAAwMAAwAAAAMAAwADAwAAAwMDAAICAgAAAAP8AAP8AAAD//wD/AAAA/wD/AP//
AAD///8AiIiIiIiIiIiIiIiIiIiIiPF3F3F3F3F3F3d3d3d3d3jxdxdxdxdxdxd3d3d3d3d49xdxdxdx
dxdxd3d3d3d3ePcXcXcXcXcXcXd3d3d3d3jxcXcXcXcXcXcXd3d3d3d48XF3F3F3F3F3F3d3d3d3ePdx
F3F3F3F3F3F3d3d3d3j3cRdxdxdxdxdxd3d3d3d49xdxdxdxdxdxdxd3d3d3ePcXcXcXcXcXcXcXd3d3
d3jxdxcXcXcXcXcXcXd3d3d48XcXF3F3F3F3F3F3d3d3ePdxdxF3F3F3F3F3F3d3d3j3cXcRdxdxdxdx
dxd3d3d49xdxdxdxdxdxdxdxd3d3ePcXcXcXcXcXcXcXcXd3d3jxdxdxcXcXcXcXcXcXd3d48XcXcXF3
F3F3F3F3F3d3ePdxdxd3F3F3F3F3F3F3d3j3cXcXdxdxdxdxdxdxd3d49xdxd3dxdxdxdxdxdxd3ePcX
cXd3cXcXcXcXcXcXd3jxdxd3d3cXcXcXcXcXcXd48XcXd3d3F3F3F3F3F3F3ePdxd3d3d3F3F3F3F3F3
F3j3cXd3d3dxdxdxdxdxdxd49xd3d3d3dxdxdxdxdxdxePcXd3d3d3cXcXcXcXcXcXjxd3d3d3d3cXcX
cXcXcXcY8Xd3d3d3d3F3F3F3F3F3GP////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==
</value>
</data>
</root>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,218 @@
/*********************************************************************************************
* Copyright 2004 - Volian Enterprises, Inc. All rights reserved.
* Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
* ------------------------------------------------------------------------------
* $Workfile: ProcExt.cs $ $Revision: 3 $
* $Author: Kathy $ $Date: 4/21/05 10:22a $
*
* $History: ProcExt.cs $
*
* ***************** Version 3 *****************
* User: Kathy Date: 4/21/05 Time: 10:22a
* Updated in $/LibSource/VEObject
* remove upgrade2005 define
*
* ***************** Version 2 *****************
* User: Kathy Date: 3/08/05 Time: 1:51p
* Updated in $/LibSource/VEObject
* Approval
*
* ***************** Version 1 *****************
* User: Kathy Date: 7/27/04 Time: 8:53a
* Created in $/LibSource/VEObject
*********************************************************************************************/
using System;
using System.Collections;
using System.Text;
using System.IO;
using System.Windows.Forms;
using System.Data;
using System.ComponentModel;
using System.Diagnostics;
using Utils;
using VDB;
namespace VEObject
{
/// <summary>
/// VEO_ProcExt support procedure set functionality.
/// </summary>
public class VEO_ProcExt : VEO_Base
{
public string latestRev; // 30 char long
public string latestPC; // 10 char long
public string recID; // 8 char long
public string approvalTD;
private string tmpComment;
private bool changeComment;
private string _Comment;
public DataRow drow;
public VEO_ProcExt(string comment, string rev, string pc, string recid, string std, DataRow row)
{
changeComment=false;
_Comment = comment;
latestRev = rev;
latestPC = pc;
recID = recid;
approvalTD = std;
drow = row;
if (std==null || std=="")
approvalTD = "Not Approved";
else
{
DateTime dtx = System.Convert.ToDateTime(std);
ThisTimeZone TZ = new ThisTimeZone();
TimeSpan TimeZoneSpan = TZ.GetUtcOffset(dtx); // Time Zone offset from UTC
long TimeZoneAdj = Math.Abs(TimeZoneSpan.Ticks / 10000000); // convert to seconds
DateTime cnv = dtx.AddSeconds(-TimeZoneAdj);
approvalTD = cnv.ToLongDateString() + " " + cnv.ToLongTimeString();
}
}
[Description("Approved"),Category("Procedure Extension"),ReadOnly(true)]public string Approved
{
get{return approvalTD;}
}
[Description("Revision"),Category("Procedure Extension"),ReadOnly(true)]public string Revision
{
get{return latestRev;}
}
[Description("Change ID"),Category("Procedure Extension"),ReadOnly(true)]public string ChangeID
{
get{return latestPC;}
}
[Description("Comment"),Category("Procedure Extension")]public string Comment
{
get
{
if (!changeComment)
return _Comment;
else
return tmpComment;
}
set
{
changeComment=true;
tmpComment=value;
}
}
public override void Restore()
{
changeComment=false;
}
public bool SaveNew(VEO_Proc prc, string srecid)
{
try
{
VEO_DummySet ds = (VEO_DummySet) prc.parentObj;
// Add the record to the setext file.
DataTable pdatatable = ds.vdbSetExt.DB_Data.Tables[0];
DataRow recidrow = pdatatable.Rows[0];
recidrow["RECID"]=srecid;
DataRow pdatarow = pdatatable.NewRow();
recID = srecid;
pdatarow["RECID"] = srecid;
pdatarow["COMMENT"] = Comment;
pdatarow["REV"] = System.DBNull.Value;
pdatarow["PC"] = System.DBNull.Value;
pdatatable.Rows.Add(pdatarow);
ds.vdbSetExt.DB_Data = pdatarow.Table.DataSet;
_Comment=Comment;
changeComment=false;
drow=pdatarow;
prc.procExt = this;
}
catch (Exception e)
{
MessageBox.Show(e.Message,"Could not perform database functions required to add procedure.");
return false;
}
return true;
}
public override bool Read(bool dummy)
{
return true;
}
public bool Write(VEO_DummySet dset)
{
bool dchange=false;
VEO_ProcSet pset = (VEO_ProcSet) dset.parentObj;
if (changeComment)
{
if((drow["COMMENT"]==System.DBNull.Value && tmpComment!=null) ||((string)drow["COMMENT"]!=tmpComment))
{
drow["COMMENT"] = tmpComment;
_Comment = tmpComment;
changeComment=false;
dchange=true;
}
}
if(dchange)
{
try
{
dset.vdbSetExt.DB_Data = drow.Table.DataSet;
}
catch (Exception e)
{
MessageBox.Show(e.Message);
return false;
}
}
return true;
}
public void SetProcApprovedDate(string dbname, string ApprovedPath)
{
MessageBox.Show("Set Extention setting of approval date is not implemented yet");
/*
* string apprfilepath = ApprovedPath + "\\" + dbname + ".dbf";
DateTime dt = File.GetLastWriteTime(apprfilepath);
//C - CODE....
//get the approved file date/time stamp
if ( getftime(apprfile, &ft) == -1)
{
Zfree(&buff);
close(apprfile);
return;
}
close(apprfile);
// assign the file date/time to the Date and Time structures
dt.da_year = ft.ft_year + 1980;
dt.da_mon = (char)ft.ft_month;
dt.da_day = (char)ft.ft_day;
tm.ti_hour = (char)ft.ft_hour;
tm.ti_min = (char)ft.ft_min;
tm.ti_sec = (char)ft.ft_tsec << 1;
// getdate(&dt);
// gettime(&tm);
(void) VDB_GetSetExtRecord(SetExtfd,rec,(char *)buff);
buff->approvalTD=dostounix(&dt,&tm);
NWSetMode(NWExclusive);
if (!VDB_LockSetFile(SetExtfd))
return;
(void) VDB_UpdateSetExtRecord(SetExtfd,rec,(char *)buff);
NWResetMode();
VDB_UnLockSetFile(SetExtfd);
Zfree(&buff);
return;
*/
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,237 @@
/*********************************************************************************************
* Copyright 2004 - Volian Enterprises, Inc. All rights reserved.
* Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
* ------------------------------------------------------------------------------
* $Workfile: Properties.cs $ $Revision: 1 $
* $Author: Kathy $ $Date: 7/27/04 8:53a $
*
* $History: Properties.cs $
*
* ***************** Version 1 *****************
* User: Kathy Date: 7/27/04 Time: 8:53a
* Created in $/LibSource/VEObject
*********************************************************************************************/
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
namespace VEObject
{
/// <summary>
/// This class provides the 'Properties' dialog box. It includes a property
/// grid which uses Property data from caller to list items in the grid.
/// </summary>
public class Properties : System.Windows.Forms.Form
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
private System.Windows.Forms.PropertyGrid myPropertyGrid;
private System.Windows.Forms.Panel panel1;
private VEO_Base _ParentObj;
private VEO_Base _CurObj;
private System.Windows.Forms.Button btnCancel;
private System.Windows.Forms.Button btnSave;
private System.Windows.Forms.Button btnApply;
private bool isnew;
public GridItem CurrentGridItem;
private bool canedit;
public Properties(Object par, Object obj)
{
_ParentObj = (VEO_Base) par;
_CurObj = (VEO_Base) obj;
if(_CurObj.isNew)
isnew=true;
else
isnew=false;
//
// Required for Windows Form Designer support
//
InitializeComponent();
this.btnApply.Enabled=false;
if((_CurObj.canEdit()==false)&&!isnew)
this.myPropertyGrid.Enabled=false;
else
this.myPropertyGrid.Enabled=true;
this.myPropertyGrid.SelectedObject=obj;
canedit=this.myPropertyGrid.Enabled;
// make apply button visible if modify
this.btnApply.Visible = !isnew;
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Properties));
this.myPropertyGrid = new System.Windows.Forms.PropertyGrid();
this.panel1 = new System.Windows.Forms.Panel();
this.btnApply = new System.Windows.Forms.Button();
this.btnCancel = new System.Windows.Forms.Button();
this.btnSave = new System.Windows.Forms.Button();
this.panel1.SuspendLayout();
this.SuspendLayout();
//
// myPropertyGrid
//
this.myPropertyGrid.CommandsVisibleIfAvailable = true;
this.myPropertyGrid.Dock = System.Windows.Forms.DockStyle.Top;
this.myPropertyGrid.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.myPropertyGrid.HelpVisible = false;
this.myPropertyGrid.LargeButtons = false;
this.myPropertyGrid.LineColor = System.Drawing.SystemColors.ScrollBar;
this.myPropertyGrid.Location = new System.Drawing.Point(0, 0);
this.myPropertyGrid.Name = "myPropertyGrid";
this.myPropertyGrid.PropertySort = System.Windows.Forms.PropertySort.Categorized;
this.myPropertyGrid.Size = new System.Drawing.Size(704, 416);
this.myPropertyGrid.TabIndex = 1;
this.myPropertyGrid.Text = "Properties";
this.myPropertyGrid.ToolbarVisible = false;
this.myPropertyGrid.ViewBackColor = System.Drawing.SystemColors.Window;
this.myPropertyGrid.ViewForeColor = System.Drawing.SystemColors.WindowText;
this.myPropertyGrid.Click += new System.EventHandler(this.myPropertyGrid_Click);
this.myPropertyGrid.PropertyValueChanged += new System.Windows.Forms.PropertyValueChangedEventHandler(this.myPropertyGrid_PropertyValueChanged);
this.myPropertyGrid.DoubleClick += new System.EventHandler(this.myPropertyGrid_Click);
//
// panel1
//
this.panel1.Controls.Add(this.btnApply);
this.panel1.Controls.Add(this.btnCancel);
this.panel1.Controls.Add(this.btnSave);
this.panel1.Location = new System.Drawing.Point(0, 128);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(704, 96);
this.panel1.TabIndex = 2;
//
// btnApply
//
this.btnApply.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.btnApply.Location = new System.Drawing.Point(200, 8);
this.btnApply.Name = "btnApply";
this.btnApply.Size = new System.Drawing.Size(64, 24);
this.btnApply.TabIndex = 2;
this.btnApply.Text = "Apply";
this.btnApply.Click += new System.EventHandler(this.btnApply_Click);
//
// btnCancel
//
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnCancel.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.btnCancel.Location = new System.Drawing.Point(112, 8);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(64, 24);
this.btnCancel.TabIndex = 1;
this.btnCancel.Text = "Cancel";
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
//
// btnSave
//
this.btnSave.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.btnSave.Location = new System.Drawing.Point(24, 8);
this.btnSave.Name = "btnSave";
this.btnSave.Size = new System.Drawing.Size(64, 24);
this.btnSave.TabIndex = 0;
this.btnSave.Text = "OK";
this.btnSave.Click += new System.EventHandler(this.btnOK_Click);
//
// Properties
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(704, 190);
this.Controls.Add(this.panel1);
this.Controls.Add(this.myPropertyGrid);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "Properties";
this.Text = "Properties";
this.panel1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private void myPropertyGrid_Click(object sender, System.EventArgs e)
{
CurrentGridItem = this.myPropertyGrid.SelectedGridItem;
}
private void myPropertyGrid_PropertyValueChanged(object s, System.Windows.Forms.PropertyValueChangedEventArgs e)
{
btnApply.Enabled = true;
CurrentGridItem = this.myPropertyGrid.SelectedGridItem;
}
// save data for use by ok and apply button clicks
private bool saveclick()
{
bool success = true;
if (isnew)
{
if(_ParentObj==null)
{
DialogResult=DialogResult.Cancel;
return success;
}
success=_ParentObj.SaveChild(_CurObj);
}
else
{
success=_CurObj.Write();
}
return success;
}
// save was clicked, use the objects save methods.
private void btnOK_Click(object sender, System.EventArgs e)
{
bool success = true;
if (canedit) success = saveclick();
if (success==true)
{
DialogResult = DialogResult.OK;
this.Close();
}
}
private void btnApply_Click(object sender, System.EventArgs e)
{
if(!canedit)return;
bool success = saveclick();
if(success==true)btnApply.Enabled=false;
this.myPropertyGrid.Refresh();
}
private void btnCancel_Click(object sender, System.EventArgs e)
{
if(!canedit)return;
_CurObj.Restore();
}
}
}

View File

@@ -0,0 +1,201 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 1.3
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">1.3</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1">this is my long string</data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
[base64 mime encoded serialized .NET Framework object]
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
[base64 mime encoded string representing a byte array form of the .NET Framework object]
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used forserialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>1.3</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="myPropertyGrid.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="myPropertyGrid.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="myPropertyGrid.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="panel1.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="panel1.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="panel1.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="panel1.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>8, 8</value>
</data>
<data name="panel1.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="panel1.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="btnApply.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="btnApply.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="btnApply.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="btnCancel.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="btnCancel.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="btnCancel.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="btnSave.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="btnSave.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="btnSave.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="$this.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="$this.Language" type="System.Globalization.CultureInfo, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>(Default)</value>
</data>
<data name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="$this.Localizable" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="$this.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>8, 8</value>
</data>
<data name="$this.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="$this.Name">
<value>Properties</value>
</data>
<data name="$this.TrayHeight" type="System.Int32, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>80</value>
</data>
<data name="$this.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="$this.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAICAQAAAAAADoAgAAFgAAACgAAAAgAAAAQAAAAAEABAAAAAAAgAIAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAADAAADAAAAAwMAAwAAAAMAAwADAwAAAwMDAAICAgAAAAP8AAP8AAAD//wD/AAAA/wD/AP//
AAD///8AiIiIiIiIiIiIiIiIiIiIiPF3F3F3F3F3F3d3d3d3d3jxdxdxdxdxdxd3d3d3d3d49xdxdxdx
dxdxd3d3d3d3ePcXcXcXcXcXcXd3d3d3d3jxcXcXcXcXcXcXd3d3d3d48XF3F3F3F3F3F3d3d3d3ePdx
F3F3F3F3F3F3d3d3d3j3cRdxdxdxdxdxd3d3d3d49xdxdxdxdxdxdxd3d3d3ePcXcXcXcXcXcXcXd3d3
d3jxdxcXcXcXcXcXcXd3d3d48XcXF3F3F3F3F3F3d3d3ePdxdxF3F3F3F3F3F3d3d3j3cXcRdxdxdxdx
dxd3d3d49xdxdxdxdxdxdxdxd3d3ePcXcXcXcXcXcXcXcXd3d3jxdxdxcXcXcXcXcXcXd3d48XcXcXF3
F3F3F3F3F3d3ePdxdxd3F3F3F3F3F3F3d3j3cXcXdxdxdxdxdxdxd3d49xdxd3dxdxdxdxdxdxd3ePcX
cXd3cXcXcXcXcXcXd3jxdxd3d3cXcXcXcXcXcXd48XcXd3d3F3F3F3F3F3F3ePdxd3d3d3F3F3F3F3F3
F3j3cXd3d3dxdxdxdxdxdxd49xd3d3d3dxdxdxdxdxdxePcXd3d3d3cXcXcXcXcXcXjxd3d3d3d3cXcX
cXcXcXcY8Xd3d3d3d3F3F3F3F3F3GP////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==
</value>
</data>
</root>

View File

@@ -0,0 +1,436 @@
/*********************************************************************************************
* Copyright 2004 - Volian Enterprises, Inc. All rights reserved.
* Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
* ------------------------------------------------------------------------------
* $Workfile: RO.cs $ $Revision: 6 $
* $Author: Kathy $ $Date: 5/02/06 9:46a $
*
* $History: RO.cs $
*
* ***************** Version 6 *****************
* User: Kathy Date: 5/02/06 Time: 9:46a
* Updated in $/LibSource/VEObject
* B2006-018: ro usages for procnums with single quote
*
* ***************** Version 5 *****************
* User: Jsj Date: 6/02/05 Time: 11:36a
* Updated in $/LibSource/VEObject
* fix for approving with conditional ROs and code cleanup
*
* ***************** Version 4 *****************
* User: Kathy Date: 5/19/05 Time: 11:08a
* Updated in $/LibSource/VEObject
* speed up approve
*
* ***************** Version 3 *****************
* User: Jsj Date: 5/17/05 Time: 12:00p
* Updated in $/LibSource/VEObject
* Approve graphic fix
*
* ***************** Version 2 *****************
* User: Jsj Date: 3/10/05 Time: 4:02p
* Updated in $/LibSource/VEObject
* hooks to new namespace for RO FST file
*
* ***************** Version 1 *****************
* User: Kathy Date: 3/08/05 Time: 1:51p
* Created in $/LibSource/VEObject
* Approval
*********************************************************************************************/
using System;
using System.IO;
using System.Data;
using System.Windows.Forms;
using System.Collections;
using Utils;
using ROFST_FILE;
using VDB_ROUsage;
using VlnStatus;
namespace VEObject
{
/// <summary>
/// Summary description for ROFST. Provides support/interface to/from RO.fst file.
/// </summary>
public class ROFST : ROFST_File
{
// constructor loads ro.fst databases
public ROFST(string path):base(path)
{
}
~ ROFST()
{
}
public void CopyImagesToApproved(string appdir, VlnStatusMessage StatMsgWindow)
{
for(int i=0;i<numDatabases;i++)
{
// Go through the list entries recursively finding any graphics images to copy
// to approved.
uint start = ((ROFST_DbInfo)DatabasesInfo[i]).dbiGL;
ushort level = ((ROFST_DbInfo)DatabasesInfo[i]).dbiID;
ProcessGroupsForImages(appdir,null,0,null,brROFst,start,0,level, StatMsgWindow);
}
}
private bool wasused (ushort tblid, uint id)
{
string pth = DirPath.Substring(0,DirPath.Length-6);
vdb_ROUsage ROusage = new vdb_ROUsage(pth + "usagero.dbf"); // need path
string roid = tblid.ToString("X4") + id.ToString("X8");
string WhereStr = "WHERE ROID LIKE '" + roid.ToLower() + "%'";
DataSet RODataSet = ROusage.GetSortedByROID(WhereStr);
DataTable roTbl = RODataSet.Tables[0];
if (roTbl.Rows.Count>0) return true;
return false;
}
private void CopyROFile(string fname, string ApprovedDir)
{
PrivateProfile ropathINI = new PrivateProfile("PROC.INI");
string ropath = ropathINI.Attr("RO Defaults","ROPATH");
if (ropath == null || ropath == "") ropath = "..\\RO";
string src = ropath + "\\" + fname;
string dst = ApprovedDir + "\\" + fname;
if (File.Exists(src))
{
File.Copy(src,dst,true);
FileInfo fi_src = new FileInfo(src);
FileInfo fi_dst = new FileInfo(dst);
fi_dst.LastWriteTime = fi_src.LastWriteTime;
}
else
MessageBox.Show("Could not copy " + src);
}
private long CalculatePromsDate(DateTime imgdate)
{
/*
* do some conversion so that comparison can be made on date/time
* stored on image data from ro.fst to a datetime from .net.
* Proms had it in seconds since 00:00:00 1/1/1970.
* .NET has it in ticks since 00:00:00 1/1/1
*/
DateTime promsdt = new DateTime(1970,1,1,0,0,0); // Jan 1, 1970
// Convert the promsdt to UTC (GMT)
DateTime promsdtU = promsdt.ToUniversalTime();
long promsdtU_num = promsdtU.Ticks / 10000000;
// Convert the image file datetime to UTC
DateTime imgdateU = imgdate.ToUniversalTime();
long imgdateu_num = imgdateU.Ticks / 10000000;
/**
* Get the time adjustment for the current Time Zone with respect
* to the coordinated universal time (UTC) - a.k.a. Greenwich mean time (GMT).
* The time gotten for the Jan 1, 1970 is in UTC time, the imgdate time is
* in EST.
*
* Get the offset time between this time zone and UTC (GMT) time.
* Convert the offset to seconds.
* Subtract the offset from the UTC time gotten for Jan 1, 1970
*/
ThisTimeZone TZ = new ThisTimeZone();
TimeSpan TimeZoneSpan = TZ.GetUtcOffset(promsdt); // Time Zone offset from UTC
long TimeZoneAdj = Math.Abs(TimeZoneSpan.Ticks / 10000000); // convert to seconds
/*
* The file date/time and the Jan 1, 1970 adjustment date are in UTC.
* Subtract the "Jan 1, 1970" date/time from the file date/time
* the add the Time Zone offset to place the date/time value into
* local time.
*/
long lsec = (imgdateu_num - promsdtU_num) + TimeZoneAdj;
return lsec;
}
public void ApproveGraphicsFile(string fstRec, string appdir, VlnStatusMessage StatMsgWindow)
{
long dt;
// position to Graphics file name
int nlindx = fstRec.IndexOf("\n");
// Graphics file name
string fbuf = fstRec.Substring(0,nlindx);
// Grpahics file date/time (stored in RO.FST)
dt = System.Convert.ToInt32(fstRec.Substring(nlindx+1,8),16);
// Add the graphics file extension if needed
int indx = fbuf.IndexOf(".");
if (indx<0 || (fbuf.Length>indx+1 && fbuf[indx+1]=='\\'))
{
if (DefaultGraphicFileExt[0] != '.') fbuf = fbuf + ".";
fbuf = fbuf + DefaultGraphicFileExt;
}
// if file doesn't exist in approved
// or if it is more recent than approved,
// copy it to approved.
string appfbuf = appdir + "\\" + fbuf;
FileInfo app_fi = new FileInfo(fbuf);
if (!File.Exists(appfbuf) || (CalculatePromsDate(app_fi.LastWriteTime)!=dt))
{
if (StatMsgWindow !=null) StatMsgWindow.StatusMessage = "Updating graphic " + fbuf;
CopyROFile(fbuf,appdir);
}
}
private void ProcessGroupsForImages(string appdir, string tmp,uint x1,string ttl,BinaryReader br,
uint start, short level, ushort tblid, VlnStatusMessage StatMsgWindow)
{
uint id, parid;
short howmany;
long wasAt = br.BaseStream.Position;
br.BaseStream.Seek((long) start, SeekOrigin.Begin);
id = br.ReadUInt32();
parid = br.ReadUInt32();
howmany = br.ReadInt16();
if (howmany <= 0 && (ttl!=null && ttl!="") && wasused(tblid,id))
{
byte bt = br.ReadByte(); // skip type
bt = br.ReadByte();
// Read the Graphics File ROFST record
string dtl = ROFST.GetAsciiString(br);
// Approve the Graphics file
ApproveGraphicsFile(dtl, appdir, StatMsgWindow);
}
// if count in howmany is greater than zero, this must be a group
// recursively call this to find ros.
if (howmany>0)
{
if (level>=0)
{
string [] title = new string [howmany];
UInt32 [] offset = new UInt32 [howmany];
UInt16 [] type = new UInt16 [howmany];
for (int i=0; i<howmany; i++)
{
offset[i]=br.ReadUInt32();
type[i]=br.ReadUInt16();
title[i] = ROFST.GetAsciiString(br);
}
for (int i=0; i<howmany; i++)
{
if ((type[i]&8)>0)
ProcessGroupsForImages(appdir,null,type[i],title[i],br,offset[i],System.Convert.ToInt16(level+1),tblid,StatMsgWindow);
}
}
}
br.BaseStream.Seek(wasAt,SeekOrigin.Begin);
}
}
public class Usages
{
static Usages()
{
}
public static int CheckRoReferences(VEO_ProcSet ps, string path, ArrayList al, ArrayList ModROs, string keystr)
{
// get usage records for the input string 'keystr' and then check to
// see if the RO is in the input Modified list.
// If keystr is a lib-doc (i.e. starts with "DOC") then just return the
// whether there is modified ro in here.
// If keystr is a procedure num, check to see if other procedures use this
// modified RO and add them to the list of items to approve (al).
// -1 flags failure on return. Otherwise, return count of those found.
int retval=0;
vdb_ROUsage rousg=null;
DataSet dataset=null;
string us_path = path + "\\usagero.dbf";
try
{
rousg = new vdb_ROUsage(us_path);
dataset = rousg.GetSortedByProc("[NUMBER] = \'"+keystr.Replace("'","''")+"\'");
}
catch (Exception e)
{
MessageBox.Show("Could not get RO usages for this item " + keystr + ", " + e.Message);
return -1;
}
foreach (DataRow dr in dataset.Tables[0].Rows)
{
// if we find an RO that's in the ModROs list, then here's where
// we see if it's used by other procedures too.
string roid = dr["ROID"].ToString();
if (roid.Length == 12)
roid = roid + "0000";
else if (!roid.EndsWith("0000"))
roid = roid.Substring(0,12) + "0000";
ModRO wasModRO = null;
foreach (ModRO mro in ModROs)
{
string tmpROID = mro.roid;
if (tmpROID.Length == 12)
tmpROID = tmpROID + "0000";
if (tmpROID.Equals(roid))
{
mro.roid = tmpROID;
wasModRO = mro;
mro.IsUsed = true;
break;
}
}
// if just checking if the library document has any modified ROs, then
// just return (return with a number greater than 0 to flag that it had
// modified ROs. Doc is only passed in as the keystr when checking for
// modified library documents.
if (keystr.Substring(0,3).ToUpper()=="DOC")
{
if (wasModRO != null) return 1;
return 0;
}
// if this was a procedure, then we'll see if other procedures use this.
if (wasModRO != null)
{
us_path = path + "\\approved\\usagero.dbf";
rousg = null;
rousg = new vdb_ROUsage(us_path);
DataSet dataset_prc = null;
string keyroid = roid.Substring(0,12)+"%";
try
{
dataset_prc = rousg.GetSortedByROID("[ROID] LIKE \'"+keyroid+"\'");
//dataset_prc = rousg.GetSortedByROID("[ROID] = \'"+roid+"\'");
}
catch (Exception e)
{
MessageBox.Show("Could not get procedures using modified RO " + roid + ", " + e.Message);
return -1;
}
foreach (DataRow drroid in dataset_prc.Tables[0].Rows)
{
// first see if this prpc is already in list of procedures to approve
// if so, don't add it, but check to be sure this ro is in the conflict
// list.
bool inlist = false;
AppIndItem cur=null;
foreach (object obal in al)
{
AppIndItem aiiobj = (AppIndItem) obal;
if (aiiobj.Proc._Prcnum == (string)drroid["NUMBER"])
{
cur=aiiobj;
inlist=true;
break;
}
}
if (!inlist)
{
VEO_DummySet ds = (VEO_DummySet) ps.Children[1];
// find the procedure object to add it the the approve list
foreach (object ob in ds.Children)
{
VEO_Proc pr = (VEO_Proc) ob;
if (pr._Prcnum == (string) drroid["NUMBER"])
{
cur = new AppIndItem(pr);
al.Add(cur);
retval++;
break;
}
}
if (cur==null)
{
retval++;
cur = new AppIndItem(null);
}
}
// is this ROID already in the conflict list.
inlist = false;
foreach (AppConflict aco in cur.ConflictList)
{
if (aco.CType == AppConflictTypes.RO)
{
AppROConflict raco = (AppROConflict) aco;
if (raco.ROID == roid)
{
inlist=true;
break;
}
}
}
if (!inlist)
{
string val1 = (drroid["NUMBER"]==System.DBNull.Value)?null:(string)drroid["NUMBER"];
string val2 = (drroid["SEQUENCE"]==System.DBNull.Value)?null:(string)drroid["SEQUENCE"];
AppROConflict roc = new AppROConflict((VEO_DummySet)ps.Children[1],roid, val1, val2,wasModRO.IsImage,wasModRO.Val1,wasModRO.Val2);
cur.AddConflict(roc);
}
}
}
}
return retval;
}
// For approve individual, update the approved version with the ro usages for the
// procedure or library defined by input 'WdNum'. 'ApNum' is the procedure number if
// this is a procedure - if libdoc this will be same as 'WdNum', in case of change
// in procedure number.
public static void FixROUsages(string WdPath, string ApprovedPath, string ApNum, string WdNum)
{
string appath=ApprovedPath+"\\usagero.dbf";
try
{
vdb_ROUsage arousg = new vdb_ROUsage(appath);
// remove ro usages from the approved ro usage file. ApNum will be null
// if this is a new procedure - in this case we don't need to remove anything
// from the approved usages file.
if (ApNum != null)
{
DataSet adset = arousg.GetSortedByProc("[NUMBER]=\'"+ApNum.Replace("'","''")+"\'");
int ndr = adset.Tables[0].Rows.Count;
if (ndr>0)
{
int errs = arousg.DeleteSelected("[NUMBER]=\'"+ApNum.Replace("'","''")+"\'");
if (errs>0)
{
MessageBox.Show("Error resolving transition records");
return;
}
arousg.Pack();
}
adset=null;
}
// now update the approved ro usages from data based on data in the working
// draft.
vdb_ROUsage rousg = new vdb_ROUsage(WdPath+"\\usagero.dbf");
DataSet wdset = rousg.GetSortedByProc("[NUMBER] = \'"+WdNum.Replace("'","''")+"\'");
if (wdset.Tables[0].Rows.Count>0)
{
int errs = rousg.InsertInto(WdPath+"\\"+ApprovedPath+"\\usagero.dbf","[NUMBER] = \'"+WdNum.Replace("'","''")+"\'");
if (errs>0)
{
MessageBox.Show("Error resolving RO usage records.");
return;
}
}
wdset.Dispose();
rousg=null;
arousg=null;
}
catch (Exception e)
{
MessageBox.Show("Could not approve ro usages for " + WdNum + ", "+e.Message);
return;
}
}
}
}

View File

@@ -0,0 +1,121 @@
/*********************************************************************************************
* Copyright 2005 - Volian Enterprises, Inc. All rights reserved.
* Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
* ------------------------------------------------------------------------------
* $Workfile: RefList.cs $ $Revision: 3 $
* $Author: Jsj $ $Date: 7/21/06 2:59p $
*
* $History: RefList.cs $
*
* ***************** Version 3 *****************
* User: Jsj Date: 7/21/06 Time: 2:59p
* Updated in $/LibSource/VEObject
* The File for Edit Depenencies was being created in the wrong place for
* VFW to find.
*
* ***************** Version 2 *****************
* User: Kathy Date: 3/22/05 Time: 10:11a
* Updated in $/LibSource/VEObject
* clean up code
*
* ***************** Version 1 *****************
* User: Kathy Date: 3/08/05 Time: 1:51p
* Created in $/LibSource/VEObject
* Approval
*********************************************************************************************/
using System;
using System.IO;
using System.Text;
using System.Windows.Forms;
using Utils;
namespace VEObject
{
/// <summary>
/// Summary description for RefList.
///
/// The RefList class creates, reads, writes, and deletes a file
/// of the 'input' name to hold procedure numbers/sequence numbers that
/// represent dependencies that need to be addressed (i.e. removed) by
/// the user in the editor. This is either for resolving approve selected
/// conflicts or deleting a procedure with transitions. (actual current use is
/// for approve selected conflicts).
/// The contents of this file is read in and listed via the TranRefsDlg in vfw
/// for now, i.e. as long as vfw is the editor.
/// The 'input' file is created in the user's Temp directory when in multi-user
/// mode or in the procedure directory when a lock is set or when in single user \
/// mode.
/// </summary>
public class RefList
{
private string FileName;
private string FromProcNum;
private FileStream FSRef;
private BinaryWriter BWRef;
private UserRunTime usrRunTime;
private long HeaderOffset;
private Int16 NumRefs;
public RefList(string frmProcNum, string fname, UserRunTime urt)
{
FileName = fname;
usrRunTime=urt;
FromProcNum=frmProcNum;
NumRefs=0;
BWRef = null;
}
public bool Create()
{
try
{
// Bug fix B2006-034
// Note that ExeAdjust() needs to check for a lock set.
// When a lock is set, the xE7 char would act like the xE2 char in
// the ExeAdjust() function.
// This bug fix is taking advantage of the fact that lock must be set
// at the time the approval code reaches this logic.
//
// FSRef = new FileStream(usrRunTime.ExeAdjust("\xE7" + FileName),FileMode.Create,FileAccess.Write,FileShare.ReadWrite);
FSRef = new FileStream(usrRunTime.ExeAdjust("\xE2" + FileName),FileMode.Create,FileAccess.Write,FileShare.ReadWrite);
BWRef = new BinaryWriter(FSRef);
BWRef.Write(NumRefs); // Temporary holding for number of references
Int16 len = (Int16)FromProcNum.Length;
BWRef.Write(len);
byte[] btmp = Encoding.ASCII.GetBytes(FromProcNum);
BWRef.Write(btmp,0,len);
HeaderOffset = FSRef.Length;
}
catch (Exception e)
{
MessageBox.Show(e.Message);
return false;
}
return true;
}
public void CloseFile()
{
if (BWRef != null) BWRef.Close();
FSRef=null;
BWRef=null;
NumRefs=0;
HeaderOffset=0;
}
public void WriteTotalNumRefs()
{
FSRef.Seek(0,System.IO.SeekOrigin.Begin);
BWRef.Write(NumRefs);
FSRef.Seek(0,System.IO.SeekOrigin.End);
}
public void WriteRefLine(string refline)
{
byte[] btmp = Encoding.ASCII.GetBytes(refline);
BWRef.Write(btmp,0,100);
NumRefs++;
}
}
}

View File

@@ -0,0 +1,810 @@
/*********************************************************************************************
* Copyright 2004 - Volian Enterprises, Inc. All rights reserved.
* Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
* ------------------------------------------------------------------------------
* $Workfile: VEObject.cs $ $Revision: 9 $
* $Author: Jsj $ $Date: 8/30/06 10:04a $
*
* $History: VEObject.cs $
*
* ***************** Version 9 *****************
* User: Jsj Date: 8/30/06 Time: 10:04a
* Updated in $/LibSource/VEObject
* Added Multi Procedure Data Checker
*
* ***************** Version 8 *****************
* User: Kathy Date: 6/21/05 Time: 7:27a
* Updated in $/LibSource/VEObject
* edit for approve if from procset/procedures node
*
* ***************** Version 7 *****************
* User: Kathy Date: 5/11/05 Time: 9:29a
* Updated in $/LibSource/VEObject
* approve menu from procedures tree node
*
* ***************** Version 6 *****************
* User: Kathy Date: 4/21/05 Time: 10:24a
* Updated in $/LibSource/VEObject
* remove upgrade2005 define
*
* ***************** Version 5 *****************
* User: Kathy Date: 3/22/05 Time: 10:14a
* Updated in $/LibSource/VEObject
* approve: remove revise menu enable
*
* ***************** Version 4 *****************
* User: Kathy Date: 2/03/05 Time: 11:20a
* Updated in $/LibSource/VEObject
* Change 'DUMMY' node to 'TEMP' node (just in case user sees it)
*
* ***************** Version 3 *****************
* User: Kathy Date: 1/31/05 Time: 11:06a
* Updated in $/LibSource/VEObject
* Fix B2005-005 (connection & delete directory errors). also, fix icon
*
* ***************** Version 2 *****************
* User: Kathy Date: 10/25/04 Time: 10:24a
* Updated in $/LibSource/VEObject
* Fix B2004-049
*
* ***************** Version 1 *****************
* User: Kathy Date: 7/27/04 Time: 8:53a
* Created in $/LibSource/VEObject
*********************************************************************************************/
using System;
using System.Text;
using System.Collections;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using Utils;
using VENetwork;
using VEMessageNS;
namespace VEObject
{
/// <summary>
/// VEObject namespace provides classes for the Volian Enterprises Objects DataRoot, DataPath,
/// Plant, Procedure Set, Procedures, Library Documents and Archives.
///
/// This file has the base class, VEO_Base, which all other objects inherits from.
/// </summary>
public enum VEObjectTypesDefs
{
Generic = 0, ProcedureSet = 1, Procedure = 2, Archive = 3, LibraryDoc =4, System = 5, Plant = 6, DummySet = 7
};
public enum VEO_IconStates
{
Normal=0, LckByMe=1, LckByOther=2, LckPending=3, Empty=4
};
public enum ProcTypeOptions
{
// Standard=0, Background=1, Deviation=2, Slave=3
Standard=0, Slave=1, Background=2, Deviation=3
};
public class VEO_Base
{
public int [] iconStates;
public int icon;
public string _Title;
public string _Location;
public ArrayList Children;
public Object parentObj;
public UserRunTime usrRunTime;
public bool isOpen;
private bool Expanded;
public bool IsEmpty;
public int VEObjectType;
public bool isNew;
public bool AllowListViewSort;
public VELock Lock;
public VEConnection Connection;
public TreeNode treeNode;
public enum ProcColumnOptions
{
OneColumn=0, TwoColumn=1, ThreeColumn=2
};
public enum ArchiveTypeOptions
{
Full=0, Partial=1
};
// constructor
public VEO_Base()
{
Expanded = false;
isOpen = false;
AllowListViewSort = false;
Children = new ArrayList();
VEObjectType = (int)VEObjectTypesDefs.Generic;
}
~ VEO_Base()
{
if (Connection!=null) Connection.Exit();
}
public virtual void LoadLockInfo()
{
Lock = new VELock(_Location, usrRunTime==null?null:usrRunTime.myUserData, VENetwork.LockTypes.None);
}
public virtual bool mnuAllowDelete()
{
return true;
}
public virtual bool mnuAllowApprove()
{
return false;
}
public virtual bool mnuAllowApproveSel()
{
return false;
}
public virtual bool mnuAllowApproveAll()
{
return false;
}
public virtual bool mnuAllowProperties()
{
return true;
}
public virtual bool mnuAllowNew()
{
return true;
}
public virtual bool mnuAllowUpdRO()
{
return false;
}
public virtual bool mnuAllowClean()
{
return false;
}
public virtual bool mnuAllowDataCheck()
{
return false;
}
public virtual bool mnuAllowChgDef()
{
return false;
}
public virtual bool mnuAllowUpdateArch()
{
return false;
}
public virtual bool mnuAllowTestArchive()
{
return false;
}
public virtual bool mnuAllowExtractArch()
{
return false;
}
public virtual bool mnuAllowLckDB()
{
return false;
}
public virtual bool mnuAllowUnlckDB()
{
return false;
}
public virtual bool mnuAllowMonUsr()
{
if (usrRunTime.InMultiUserMode && !(Lock.LockType==VENetwork.LockTypes.None) &&
!(Lock.LockStatus==VENetwork.Status.LockedByOther)) return true;
return false;
}
public virtual bool canEdit()
{
return true;
}
// used to flag whether all siblings of a node should be collapsed before expanding the
// node. This is needed for multi-user support for the plant & procedure set levels so
// that a user does not have open connections all over the tree.
public virtual bool CollapseSibling()
{
return false;
}
public virtual bool amILockedByMe()
{
// if not a newtork serial number, treat it as anything is locked.
if (!usrRunTime.InMultiUserMode)return true;
VEO_Base obj = this;
while (obj!=null)
{
if (obj.Lock.LockStatus == VENetwork.Status.Locked) return true;
obj = (VEO_Base) obj.parentObj;
}
return false;
}
public virtual bool isProcSet()
{
return false;
}
public virtual bool isArchiveSet()
{
return false;
}
public virtual bool updateROValues()
{
return false;
}
public virtual void CleanTransitionsAndROsUsages(int clntype,string ProcName)
{
return;
}
public virtual void ApproveProcedures(int ApproveType, ArrayList prcs)
{
return;
}
public virtual void DataIntegrityCheck(string ProcName)
{
return;
}
// Add TreeNodes to the input TreeNode parent.
public virtual void AddToTree(TreeNode parentnd)
{
for(int i=0; i<Children.Count; i++)
{
VEO_Base veo = (VEO_Base) Children[i];
veo.treeNode = new TreeNode(veo.GetTreeNodeText(),veo.icon,veo.icon);
parentnd.Nodes.Add(veo.treeNode);
veo.treeNode.Tag = veo;
}
}
public virtual void Restore()
{
}
public virtual bool PropertiesDlg(Object parent)
{
Properties propdlg = new Properties(parent, this);
DialogResult dr = propdlg.ShowDialog();
if (dr == DialogResult.OK) return true;
// restore the data (user may have changed in properties dialog,
// but need to restore original.
this.Restore();
return false;
}
public virtual bool EditNode()
{
return true;
}
public virtual bool canDoDragDrop()
{
return false;
}
public void RefreshTreeNode(TreeNode nd)
{
VEO_Base veo = (VEO_Base) nd.Tag;
//refresh the connect & lock.
if (veo.Connection != null) veo.Connection.Enter(false);
// if the object doesn't have a lock type (i.e. isn't where the system,
// plant or procset lock would be set) read in data & add it to the tree.
if (veo.Lock.LockType == VENetwork.LockTypes.None && !(veo is VEO_DummySet))
{
if (veo.Children.Count>0) veo.Children.Clear();
if (nd.Nodes.Count>0) nd.Nodes.Clear();
veo.Read(false);
veo.AddToTree(nd);
}
// if the object can have a lock at this level, but it currently doesnot
// have a lock, if it has children add a temp node to the treeview. This
// is done so that if this becomes expanded, the lock is checked again.
else if (veo.Lock.LockStatus!=VENetwork.Status.LockedByOther)
{
veo.Read(true);
if (veo.Children.Count>0)
{
veo.Children.Clear();
TreeNode dmy = new TreeNode("TEMP");
nd.Nodes.Add(dmy);
}
}
// if multi-user serial number, may have to reset lock status icon.
if (usrRunTime.InMultiUserMode)
{
// if no lock & emtpy, show empty. Otherwise, show lock icon
if (IsEmpty && veo.Lock.LockStatus==VENetwork.Status.NoLock)
veo.icon = veo.iconStates[(int)VEO_IconStates.Empty];
else
veo.icon = veo.iconStates[(int)veo.Lock.LockStatus];
nd.ImageIndex = veo.icon;
nd.SelectedImageIndex = veo.icon;
}
}
// When the user collapses the treenode, also, do some object cleanup.
// This removes children, exits connections for all sub-tree children
// and also refreshes locks, updates icons based on lock changes and
// load in children at the current node level.
public void Collapse(TreeNode nd, TreeViewAction act, bool dorefresh,bool closeconn)
{
Expanded=false;
Children.Clear();
if (Connection != null && closeconn) Connection.Exit();
// if this is the actual node that was collapsed, then refresh at this level,
// i.e. refresh the lock, update the icon (in case of lock status change)
// and load children (may make into temp child if necessary)
if (act == TreeViewAction.Collapse||dorefresh) {
RefreshTreeNode(nd);
// need to exit again because refresh tree node opens the connection
// to determine locking status.
if (Connection != null && closeconn) Connection.Exit();
}
}
// Expand the TreeNode. This makes a new/reenters connection at the level, sets up
// icons for the level, enters it by loading its children (if it successfully
// entered it, i.e. it's not locked.
public virtual bool Expand(TreeNode mytreend)
{
if (Connection==null)
Connection = new VEConnection(Lock, usrRunTime);
// Enter the connection, i.e. refresh the lock & then see if can get into the
// data level.
bool canenter = Connection.Enter(false);
// update icons (in case of lock status change)
if (usrRunTime.InMultiUserMode)
{
// if no lock & emtpy, show empty. Otherwise, show lock icon
if (IsEmpty && Lock.LockStatus==VENetwork.Status.NoLock)
icon = iconStates[(int)VEO_IconStates.Empty];
else
icon = iconStates[(int)Lock.LockStatus];
mytreend.ImageIndex = icon;
mytreend.SelectedImageIndex = icon;
}
// if user cannot enter, it must be locked. Return a false.
if (canenter==false)
{
Collapse(mytreend,TreeViewAction.Unknown,true,false);
mytreend.Nodes.Clear();
mytreend.TreeView.Refresh();
return false;
}
if (Expanded) return true;
Expanded = true;
// load the children. First check for either no children (in case this was locked on
// load, and then subsequently unlocked before the selection or check for a 'TEMP'
// node. If it exists, remove it. Then if this has a lock type of none, load it's
// children. Otherwise, load a temp child under each child. The temp child is
// used because when the user actually expands this node, a recheck of the lock
// status is needed and a change may have occurred (another user may have added,
// deleted or modified children by the time this is entered).
TreeNode frstchld = mytreend.FirstNode;
if (frstchld==null || frstchld.Text == "TEMP")
{
mytreend.Nodes.Clear();
Read(false);
AddToTree(mytreend);
}
VEO_Base veo;
for (int i=0; i<mytreend.Nodes.Count; i++)
{
veo = (VEO_Base) mytreend.Nodes[i].Tag;
// if the object doesn't have a lock type (i.e. isn't where the system,
// plant or procset lock would be set) read in data & add it to the tree.
if (veo.Lock.LockType == VENetwork.LockTypes.None && !(veo is VEO_DummySet))
{
veo.Read(false);
veo.AddToTree(mytreend.Nodes[i]);
}
// if the object can have a lock at this level, but it currently does not
// have a lock, if it has children, add a temp node to the treeview. This
// is done so that if this becomes expanded, the lock is checked again.
else if (veo.Lock.LockStatus!=VENetwork.Status.LockedByOther)
{
veo.Read(true);
if (veo.Children.Count>0)
{
veo.Children.Clear();
TreeNode dmy = new TreeNode("TEMP");
mytreend.Nodes[i].Nodes.Add(dmy);
}
}
}
return true;
}
public virtual void LockedDlg()
{
}
// virtual read
public virtual bool Read(bool dummy)
{
return true;
}
// virtual write
public virtual bool Write()
{
return false;
}
public virtual bool Open()
{
return false;
}
public virtual bool Close()
{
return false;
}
// virtual cancel write (save)
public virtual void CancelWrite()
{
}
public virtual bool Delete()
{
return true;
}
// make a new plain vanilla object (this is really a virtual.
public virtual Object MakeNewChild()
{
return (new Object());
}
public virtual Object Copy()
{
return this; //default to returning self
}
public virtual Object AddNewChild()
{
VEO_Base newobj = (VEO_Base) this.MakeNewChild();
if (newobj==null) return null; // something happened, just return
newobj.parentObj = (VEO_Base) this;
newobj.isNew=true;
bool prpchg = newobj.PropertiesDlg(this);
if (prpchg == true)
{
// Copy is used so that a VEO-object is created that has editable
// (versus new) properties. When the object is 'new' many fields
// are editable that should not be editable when not new (this is
// mainly an issue with the property grid, since the ReadOnly
// setting can only be done at compile/build time - it CANNOT be
// done at run-time. So when a new object is created, if it's
// successful, it's copied to an object which is edit (not new)
// for the treeview & any further operations.
VEO_Base cpyobj = (VEO_Base) newobj.Copy();
Children.Add(cpyobj); // add the new one to the children
if(newobj!=cpyobj)Children.Remove(newobj);
cpyobj.Read(false); // read any child data
return cpyobj;
}
else
return null;
}
public virtual string GetTreeNodeText()
{
return _Title;
}
public virtual bool SaveChild(Object obj)
{
return false;
}
// virtual SaveNew
public virtual bool SaveNew(string pth)
{
return false;
}
public virtual void DoListView(ListView veoListView)
{
return;
}
public virtual void DoWizzard()
{
return;
}
// Comunication between this object & vfw
struct COPYDATASTRUCT
{
public IntPtr dwData;
public int cbData;
public IntPtr lpData;
}
const int WM_COPYDATA = 0x004A;
// sending side
[DllImport("user32.dll")]
static extern bool SendMessage(
IntPtr hWnd,
UInt32 Msg,
UInt32 wParam,
ref COPYDATASTRUCT lParam);
public struct RqstAttachMsg
{
public Int16 level;
public Int16 flag;
public Int32 longval;
}
public struct AnswerMsg
{
public Int16 done;
public Int16 intAnswer;
public Int32 longAnswer;
}
public struct PRecordMsg
{
public Int16 done;
public Int16 cnt;
[MarshalAs(UnmanagedType.ByValTStr,SizeConst=140)] public String buff;
}
[StructLayout(LayoutKind.Sequential)]
public struct PosUpdateStr
{
[MarshalAs(UnmanagedType.ByValTStr,SizeConst=16)] public String sender;
[MarshalAs(UnmanagedType.ByValTStr,SizeConst=80)] public String directory;
public Int32 docnumindx;
public Int32 recID;
}
private VEO_Base GetObjectAtLevel(int level)
{
try
{
VEO_Base veo = this;
while (veo != null)
{
if (level == 2 && veo.VEObjectType == (int)VEObjectTypesDefs.ProcedureSet)
return veo;
else if (level == 1 && veo.VEObjectType == (int)VEObjectTypesDefs.Plant)
return veo;
else if (level == 0 && veo.VEObjectType == (int)VEObjectTypesDefs.System)
return veo;
veo = (VEO_Base)veo.parentObj;
}
}
catch (Exception e)
{
MessageBox.Show(e.Message.ToString());
}
return null;
}
private bool ReturnProcRecord(VEO_Base veo,Int16 size, IntPtr vfwhndl)
{
bool success=true;
COPYDATASTRUCT cds = new COPYDATASTRUCT();
PRecordMsg prmsg;
prmsg.done = 1;
byte [] bt = new byte[size+4];
prmsg.cnt = veo.Connection.GetProcRecBuff(size, ref bt);
if (prmsg.cnt != size)
{
MessageBox.Show("Could not read multi-user connection information");
return false;
}
prmsg.buff = Encoding.ASCII.GetString(bt,0,size);
IntPtr p = Marshal.AllocHGlobal(size+4);
Marshal.StructureToPtr(prmsg,p,true);
cds.dwData = (IntPtr)VEMessageNS.MessageOps.GETPROCESSREC;
// the following would be 'size+4', however marshalling requires space to be
// a multiple of 8
cds.cbData = 160;
cds.lpData = p;
try
{
SendMessage(vfwhndl,WM_COPYDATA,(UInt32)8, ref cds);
}
catch (Exception e)
{
MessageBox.Show(e.Message.ToString());
success=false;
}
Marshal.FreeHGlobal(p);
return success;
}
private bool Reply(Int16 done, Int16 intAnswer, Int32 longAnswer, IntPtr vfwhndl)
{
bool success=true;
COPYDATASTRUCT cds = new COPYDATASTRUCT();
AnswerMsg ans;
ans.done = done;
ans.intAnswer = intAnswer;
ans.longAnswer = longAnswer;
IntPtr p=Marshal.AllocHGlobal(8);
Marshal.StructureToPtr(ans,p,true);
cds.dwData = (IntPtr)VEMessageNS.MessageOps.GETANSWER;
cds.cbData = 8;
cds.lpData = p;
try
{
SendMessage(vfwhndl,WM_COPYDATA,(UInt32)8, ref cds);
}
catch (Exception e)
{
MessageBox.Show(e.Message.ToString());
success=false;
}
Marshal.FreeHGlobal(p);
return success;
}
public virtual void ProcessMessage(Message m, IntPtr vfwhndl)
{
VEO_Base veo = null;
bool success=false;
if (m.Msg==(int)VEMessageNS.MessageOps.POSQUERY)
{
// POSQUERY is only called to get initial procedure - make the main
// form invisible when this request is made. Wait until now so that
// the main form is visible until vfw window is just about to be
// made visible.
IntPtr handle =
System.Diagnostics.Process.GetCurrentProcess().MainWindowHandle;
Form mainForm = (Form)Form.FromHandle(handle);
mainForm.Visible = false;
COPYDATASTRUCT cds = new COPYDATASTRUCT();
PosUpdateStr pu;
pu.sender = "NEWBROWSER";
VEO_Proc prc = null;
if (!(this is VEO_Proc))
{
// get to a proc, this is either a set or 'procedures' node
// from an approve selected.
VEO_ProcSet ps = null;
if (this is VEO_ProcSet)
ps = (VEO_ProcSet) this;
else if (this is VEO_DummySet)
ps = (VEO_ProcSet) this.parentObj;
else
{
MessageBox.Show("Error finding procedure for edit","VE-PROMS");
return;
}
prc=ps.AppSelForEdit;
}
else
prc = (VEO_Proc) this;
VEO_DummySet ds = (VEO_DummySet) prc.parentObj;
pu.directory = ds._Location;
pu.docnumindx = ds.Children.IndexOf(prc);
pu.recID = System.Convert.ToInt32(prc.recid,10);
IntPtr p=Marshal.AllocHGlobal(130);
Marshal.StructureToPtr(pu,p,true);
cds.dwData = (IntPtr)VEMessageNS.MessageOps.POSUPDATE;
cds.cbData = 130;
cds.lpData = p;
try
{
SendMessage(vfwhndl,WM_COPYDATA,(UInt32)8, ref cds);
}
catch (Exception e)
{
MessageBox.Show(e.Message.ToString());
}
Marshal.FreeHGlobal(p);
}
else if (m.Msg==WM_COPYDATA)
{
bool reply = true;
Int16 int1=0, int2=0;
int int3=0;
int lvl = 0;
COPYDATASTRUCT cds = (COPYDATASTRUCT) m.GetLParam(typeof(COPYDATASTRUCT));
int tmpmsg = (int)cds.dwData;
VEMessageNS.MessageOps msg = (VEMessageNS.MessageOps) tmpmsg;
RqstAttachMsg ramsg = (RqstAttachMsg)Marshal.PtrToStructure(cds.lpData,typeof(RqstAttachMsg));
// get level veobject associated with this request, i.e. system, plant, or procset
// and then connect at level
lvl = ramsg.level;
try
{
veo = GetObjectAtLevel(lvl);
switch (msg)
{
case VEMessageNS.MessageOps.RQSTATTACH:
success = veo.Connection.Enter(false);
int2 = (short)(success?1:0);
break;
case VEMessageNS.MessageOps.RQSTFILEOFFSET:
if (ramsg.flag==0)
int3 = (int)veo.Connection.FileOffset;
//else
// MessageBox.Show("Set file offset" + ramsg.longval.ToString());
break;
case VEMessageNS.MessageOps.RQSTFILEMODE:
int2 = (short) veo.Connection.GetVfwMode();
break;
case VEMessageNS.MessageOps.RQSTFILEOWNER:
int2 = 1;
break;
case VEMessageNS.MessageOps.RQSTFILESEEK:
int3 = (int)veo.Connection.Seek(ramsg.longval, ramsg.flag);
break;
case VEMessageNS.MessageOps.RQSTFILECLOSE: //used in lock/unlock
veo.Connection.Close();
break;
case VEMessageNS.MessageOps.RQSTFILEOPEN: //used in lock/unlock
int2 = (short) veo.Connection.Open(ramsg.flag);
break;
// RQSTFILEREAD - not used in vfw <-> browser communication
case VEMessageNS.MessageOps.RQSTFILEREAD:
MessageBox.Show("RqstFileRead");
break;
case VEMessageNS.MessageOps.RQSTFILEWRITE: //used in lock/unlock
MessageBox.Show("RqstFileWrite");
break;
case VEMessageNS.MessageOps.RQSTPROCESSRECORD:
reply=false;
success=ReturnProcRecord(veo,ramsg.flag,vfwhndl);
break;
case VEMessageNS.MessageOps.SETLOCKBYUSER: //do set lock yet.
if (ramsg.flag >= 0)
{
if (ramsg.flag==0)
veo.Lock.LockStatus=VENetwork.Status.NoLock;
else
veo.Lock.LockStatus=VENetwork.Status.Locked;
}
int2 = (Int16)((veo.Lock.LockStatus==VENetwork.Status.Locked)?1:0);
break;
}
if (reply) success = Reply(int1,int2,int3,vfwhndl);
}
catch (Exception e)
{
MessageBox.Show(e.Message);
}
}
}
}
}

View File

@@ -0,0 +1,298 @@
<VisualStudioProject>
<CSHARP
ProjectType = "Local"
ProductVersion = "7.10.3077"
SchemaVersion = "2.0"
ProjectGuid = "{9EB41ACC-03B1-4349-86F6-F9165AD77B57}"
>
<Build>
<Settings
ApplicationIcon = ""
AssemblyKeyContainerName = ""
AssemblyName = "VEObject"
AssemblyOriginatorKeyFile = ""
DefaultClientScript = "JScript"
DefaultHTMLPageLayout = "Grid"
DefaultTargetSchema = "IE50"
DelaySign = "false"
OutputType = "Library"
PreBuildEvent = ""
PostBuildEvent = ""
RootNamespace = "VEObject"
RunPostBuildEvent = "OnBuildSuccess"
StartupObject = ""
>
<Config
Name = "Debug"
AllowUnsafeBlocks = "false"
BaseAddress = "285212672"
CheckForOverflowUnderflow = "false"
ConfigurationOverrideFile = ""
DefineConstants = "DEBUG;TRACE"
DocumentationFile = ""
DebugSymbols = "true"
FileAlignment = "4096"
IncrementalBuild = "true"
NoStdLib = "false"
NoWarn = ""
Optimize = "false"
OutputPath = "..\..\..\Ve-proms.net\BIN\"
RegisterForComInterop = "false"
RemoveIntegerChecks = "false"
TreatWarningsAsErrors = "false"
WarningLevel = "4"
/>
<Config
Name = "Release"
AllowUnsafeBlocks = "false"
BaseAddress = "285212672"
CheckForOverflowUnderflow = "false"
ConfigurationOverrideFile = ""
DefineConstants = "TRACE"
DocumentationFile = ""
DebugSymbols = "false"
FileAlignment = "4096"
IncrementalBuild = "false"
NoStdLib = "false"
NoWarn = ""
Optimize = "true"
OutputPath = "..\..\..\Ve-proms.net\BIN\"
RegisterForComInterop = "false"
RemoveIntegerChecks = "false"
TreatWarningsAsErrors = "false"
WarningLevel = "4"
/>
</Settings>
<References>
<Reference
Name = "System"
AssemblyName = "System"
HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.dll"
/>
<Reference
Name = "System.Data"
AssemblyName = "System.Data"
HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.Data.dll"
/>
<Reference
Name = "System.XML"
AssemblyName = "System.Xml"
HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.XML.dll"
/>
<Reference
Name = "System.Windows.Forms"
AssemblyName = "System.Windows.Forms"
HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.Windows.Forms.dll"
/>
<Reference
Name = "System.Drawing"
AssemblyName = "System.Drawing"
HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Drawing.dll"
/>
<Reference
Name = "System.Messaging"
AssemblyName = "System.Messaging"
HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Messaging.dll"
/>
<Reference
Name = "VlnProfiler"
AssemblyName = "VlnProfiler"
HintPath = "..\..\..\Ve-proms.net\BIN\VlnProfiler.dll"
/>
<Reference
Name = "IniFileIO"
AssemblyName = "IniFileIO"
HintPath = "..\..\..\Ve-proms.net\BIN\IniFileIO.dll"
/>
<Reference
Name = "Utils"
AssemblyName = "Utils"
HintPath = "..\..\..\Ve-proms.net\BIN\Utils.dll"
/>
<Reference
Name = "VDB"
AssemblyName = "VDB"
HintPath = "..\..\..\Ve-proms.net\BIN\VDB.dll"
/>
<Reference
Name = "VEMessage"
AssemblyName = "VEMessage"
HintPath = "..\..\..\Ve-proms.net\BIN\VEMessage.dll"
/>
<Reference
Name = "VENetwork"
AssemblyName = "VENetwork"
HintPath = "..\..\..\Ve-proms.net\BIN\VENetwork.dll"
/>
<Reference
Name = "ROFST"
AssemblyName = "ROFST"
HintPath = "..\..\..\Ve-proms.net\BIN\ROFST.dll"
Private = "False"
/>
<Reference
Name = "GUI_Utils"
AssemblyName = "GUI_Utils"
HintPath = "..\..\..\Ve-proms.net\BIN\GUI_Utils.dll"
Private = "False"
/>
<Reference
Name = "VlnStatus"
AssemblyName = "VlnStatus"
HintPath = "..\..\..\Ve-proms.net\BIN\VlnStatus.dll"
Private = "False"
/>
<Reference
Name = "dznet"
AssemblyName = "dznet"
HintPath = "..\..\..\Ve-proms.net\BIN\dznet.dll"
/>
</References>
</Build>
<Files>
<Include>
<File
RelPath = "AppConflict.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "AppIndItm.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "ApproveDlg.cs"
SubType = "Form"
BuildAction = "Compile"
/>
<File
RelPath = "ApproveDlg.resx"
DependentUpon = "ApproveDlg.cs"
BuildAction = "EmbeddedResource"
/>
<File
RelPath = "ApproveSelDlg.cs"
SubType = "Form"
BuildAction = "Compile"
/>
<File
RelPath = "ApproveSelDlg.resx"
DependentUpon = "ApproveSelDlg.cs"
BuildAction = "EmbeddedResource"
/>
<File
RelPath = "Archive.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "ARProperties.cs"
SubType = "Form"
BuildAction = "Compile"
/>
<File
RelPath = "ARProperties.resx"
DependentUpon = "ARProperties.cs"
BuildAction = "EmbeddedResource"
/>
<File
RelPath = "AssemblyInfo.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "DataPath.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "DataRoot.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "LDProperties.cs"
SubType = "Form"
BuildAction = "Compile"
/>
<File
RelPath = "LDProperties.resx"
DependentUpon = "LDProperties.cs"
BuildAction = "EmbeddedResource"
/>
<File
RelPath = "LibDoc.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "Plant.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "PrcProperties.cs"
SubType = "Form"
BuildAction = "Compile"
/>
<File
RelPath = "PrcProperties.resx"
DependentUpon = "PrcProperties.cs"
BuildAction = "EmbeddedResource"
/>
<File
RelPath = "Proc.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "ProcExt.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "ProcSet.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "Properties.cs"
SubType = "Form"
BuildAction = "Compile"
/>
<File
RelPath = "Properties.resx"
DependentUpon = "Properties.cs"
BuildAction = "EmbeddedResource"
/>
<File
RelPath = "PSProperties.cs"
SubType = "Form"
BuildAction = "Compile"
/>
<File
RelPath = "PSProperties.resx"
DependentUpon = "PSProperties.cs"
BuildAction = "EmbeddedResource"
/>
<File
RelPath = "RefList.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "RO.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "VEObject.cs"
SubType = "Code"
BuildAction = "Compile"
/>
</Include>
</Files>
</CSHARP>
</VisualStudioProject>

View File

@@ -0,0 +1,21 @@
Microsoft Visual Studio Solution File, Format Version 8.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VEObject", "VEObject.csproj", "{9EB41ACC-03B1-4349-86F6-F9165AD77B57}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfiguration) = preSolution
Debug = Debug
Release = Release
EndGlobalSection
GlobalSection(ProjectConfiguration) = postSolution
{9EB41ACC-03B1-4349-86F6-F9165AD77B57}.Debug.ActiveCfg = Debug|.NET
{9EB41ACC-03B1-4349-86F6-F9165AD77B57}.Debug.Build.0 = Debug|.NET
{9EB41ACC-03B1-4349-86F6-F9165AD77B57}.Release.ActiveCfg = Release|.NET
{9EB41ACC-03B1-4349-86F6-F9165AD77B57}.Release.Build.0 = Release|.NET
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection
GlobalSection(ExtensibilityAddIns) = postSolution
EndGlobalSection
EndGlobal