This commit is contained in:
Kathy Ruffing 2009-02-03 13:20:14 +00:00
parent c063a11a1a
commit 68b3fd8049
3 changed files with 455 additions and 0 deletions

View File

@ -0,0 +1,207 @@
namespace VEPROMS
{
partial class frmRODbProperties
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmRODbProperties));
this.ppBtnOk = new System.Windows.Forms.Button();
this.ppBtnCancel = new System.Windows.Forms.Button();
this.ppPnlRODb = new DevComponents.DotNetBar.PanelEx();
this.ppTxtExt = new System.Windows.Forms.TextBox();
this.ppTxtPath = new System.Windows.Forms.TextBox();
this.ppLblGraphicFileExtLoc = new System.Windows.Forms.Label();
this.ppLblExt = new System.Windows.Forms.Label();
this.ppBtnFldrDlg = new DevComponents.DotNetBar.ButtonX();
this.ppLblPath = new System.Windows.Forms.Label();
this.ppRTxtName = new System.Windows.Forms.RichTextBox();
this.ppLblName = new System.Windows.Forms.Label();
this.ppPnlRODb.SuspendLayout();
this.SuspendLayout();
//
// ppBtnOk
//
this.ppBtnOk.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.ppBtnOk.DialogResult = System.Windows.Forms.DialogResult.OK;
this.ppBtnOk.Location = new System.Drawing.Point(471, 201);
this.ppBtnOk.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.ppBtnOk.Name = "ppBtnOk";
this.ppBtnOk.Size = new System.Drawing.Size(66, 26);
this.ppBtnOk.TabIndex = 1;
this.ppBtnOk.Text = "OK";
this.ppBtnOk.UseVisualStyleBackColor = true;
this.ppBtnOk.Click += new System.EventHandler(this.ppBtnOk_Click);
//
// ppBtnCancel
//
this.ppBtnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.ppBtnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.ppBtnCancel.Location = new System.Drawing.Point(552, 201);
this.ppBtnCancel.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.ppBtnCancel.Name = "ppBtnCancel";
this.ppBtnCancel.Size = new System.Drawing.Size(66, 26);
this.ppBtnCancel.TabIndex = 2;
this.ppBtnCancel.Text = "Cancel";
this.ppBtnCancel.UseVisualStyleBackColor = true;
//
// ppPnlRODb
//
this.ppPnlRODb.CanvasColor = System.Drawing.SystemColors.Control;
this.ppPnlRODb.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007;
this.ppPnlRODb.Controls.Add(this.ppTxtExt);
this.ppPnlRODb.Controls.Add(this.ppTxtPath);
this.ppPnlRODb.Controls.Add(this.ppLblGraphicFileExtLoc);
this.ppPnlRODb.Controls.Add(this.ppLblExt);
this.ppPnlRODb.Controls.Add(this.ppBtnFldrDlg);
this.ppPnlRODb.Controls.Add(this.ppLblPath);
this.ppPnlRODb.Controls.Add(this.ppRTxtName);
this.ppPnlRODb.Controls.Add(this.ppLblName);
this.ppPnlRODb.Dock = System.Windows.Forms.DockStyle.Top;
this.ppPnlRODb.Location = new System.Drawing.Point(0, 0);
this.ppPnlRODb.Name = "ppPnlRODb";
this.ppPnlRODb.Size = new System.Drawing.Size(646, 192);
this.ppPnlRODb.Style.Alignment = System.Drawing.StringAlignment.Center;
this.ppPnlRODb.Style.BackColor1.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground;
this.ppPnlRODb.Style.BackColor2.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2;
this.ppPnlRODb.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine;
this.ppPnlRODb.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
this.ppPnlRODb.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText;
this.ppPnlRODb.Style.GradientAngle = 90;
this.ppPnlRODb.TabIndex = 3;
//
// ppTxtExt
//
this.ppTxtExt.Enabled = false;
this.ppTxtExt.Location = new System.Drawing.Point(200, 106);
this.ppTxtExt.Name = "ppTxtExt";
this.ppTxtExt.Size = new System.Drawing.Size(275, 22);
this.ppTxtExt.TabIndex = 41;
//
// ppTxtPath
//
this.ppTxtPath.Location = new System.Drawing.Point(129, 68);
this.ppTxtPath.Name = "ppTxtPath";
this.ppTxtPath.Size = new System.Drawing.Size(389, 22);
this.ppTxtPath.TabIndex = 40;
//
// ppLblGraphicFileExtLoc
//
this.ppLblGraphicFileExtLoc.AutoSize = true;
this.ppLblGraphicFileExtLoc.BackColor = System.Drawing.Color.Transparent;
this.ppLblGraphicFileExtLoc.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ppLblGraphicFileExtLoc.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.ppLblGraphicFileExtLoc.Location = new System.Drawing.Point(197, 131);
this.ppLblGraphicFileExtLoc.Name = "ppLblGraphicFileExtLoc";
this.ppLblGraphicFileExtLoc.Size = new System.Drawing.Size(61, 17);
this.ppLblGraphicFileExtLoc.TabIndex = 39;
this.ppLblGraphicFileExtLoc.Text = "(default)";
//
// ppLblExt
//
this.ppLblExt.AutoSize = true;
this.ppLblExt.BackColor = System.Drawing.Color.Transparent;
this.ppLblExt.Location = new System.Drawing.Point(33, 106);
this.ppLblExt.Name = "ppLblExt";
this.ppLblExt.Size = new System.Drawing.Size(149, 17);
this.ppLblExt.TabIndex = 38;
this.ppLblExt.Text = "Graphic File Extension";
//
// ppBtnFldrDlg
//
this.ppBtnFldrDlg.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
this.ppBtnFldrDlg.BackColor = System.Drawing.Color.Transparent;
this.ppBtnFldrDlg.Image = ((System.Drawing.Image)(resources.GetObject("ppBtnFldrDlg.Image")));
this.ppBtnFldrDlg.Location = new System.Drawing.Point(539, 62);
this.ppBtnFldrDlg.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.ppBtnFldrDlg.Name = "ppBtnFldrDlg";
this.ppBtnFldrDlg.Size = new System.Drawing.Size(21, 23);
this.ppBtnFldrDlg.TabIndex = 37;
this.ppBtnFldrDlg.Click += new System.EventHandler(this.ppBtnFldrDlg_Click);
//
// ppLblPath
//
this.ppLblPath.AutoSize = true;
this.ppLblPath.BackColor = System.Drawing.Color.Transparent;
this.ppLblPath.Location = new System.Drawing.Point(30, 68);
this.ppLblPath.Name = "ppLblPath";
this.ppLblPath.Size = new System.Drawing.Size(62, 17);
this.ppLblPath.TabIndex = 17;
this.ppLblPath.Text = "RO Path";
//
// ppRTxtName
//
this.ppRTxtName.Location = new System.Drawing.Point(129, 28);
this.ppRTxtName.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.ppRTxtName.Multiline = false;
this.ppRTxtName.Name = "ppRTxtName";
this.ppRTxtName.Size = new System.Drawing.Size(389, 22);
this.ppRTxtName.TabIndex = 16;
this.ppRTxtName.Text = "";
//
// ppLblName
//
this.ppLblName.AutoSize = true;
this.ppLblName.BackColor = System.Drawing.Color.Transparent;
this.ppLblName.Location = new System.Drawing.Point(30, 31);
this.ppLblName.Name = "ppLblName";
this.ppLblName.Size = new System.Drawing.Size(93, 17);
this.ppLblName.TabIndex = 15;
this.ppLblName.Text = "RO Fst Name";
//
// frmRODbProperties
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(125)))), ((int)(((byte)(125)))), ((int)(((byte)(125)))));
this.ClientSize = new System.Drawing.Size(646, 238);
this.Controls.Add(this.ppPnlRODb);
this.Controls.Add(this.ppBtnCancel);
this.Controls.Add(this.ppBtnOk);
this.Name = "frmRODbProperties";
this.Text = "RO Database Properties";
this.Load += new System.EventHandler(this.frmRODbProperties_Load);
this.ppPnlRODb.ResumeLayout(false);
this.ppPnlRODb.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Button ppBtnOk;
private System.Windows.Forms.Button ppBtnCancel;
private DevComponents.DotNetBar.PanelEx ppPnlRODb;
private System.Windows.Forms.Label ppLblPath;
private System.Windows.Forms.RichTextBox ppRTxtName;
private System.Windows.Forms.Label ppLblName;
private DevComponents.DotNetBar.ButtonX ppBtnFldrDlg;
private System.Windows.Forms.Label ppLblGraphicFileExtLoc;
private System.Windows.Forms.Label ppLblExt;
private System.Windows.Forms.TextBox ppTxtPath;
private System.Windows.Forms.TextBox ppTxtExt;
}
}

View File

@ -0,0 +1,109 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
using VEPROMS.CSLA.Library;
namespace VEPROMS
{
public partial class frmRODbProperties : Form
{
private RODbInfo _roDbInfo;
private string _origROName;
private string _origFolderPath;
private DocVersion _docVersion;
public frmRODbProperties(DocVersion docVersion, RODbInfo roDbInfo)
{
_roDbInfo = roDbInfo;
_docVersion = docVersion;
InitializeComponent();
_origROName = (_roDbInfo == null) ? null : _roDbInfo.ROName;
_origFolderPath = (_roDbInfo == null) ? null : _roDbInfo.FolderPath;
}
private void ppBtnFldrDlg_Click(object sender, EventArgs e)
{
FolderBrowserDialog dlgROFolder = new FolderBrowserDialog();
if (dlgROFolder.ShowDialog() == DialogResult.OK)
{
ppTxtPath.Text = dlgROFolder.SelectedPath;
}
}
private void ppBtnOk_Click(object sender, EventArgs e)
{
// check for modify - if modify, just save current data, close & return.
if (_origROName !=null && _origFolderPath !=null && (_origROName != ppRTxtName.Text || _origFolderPath != ppTxtPath.Text))
{
RODb roDb = RODb.Get(_roDbInfo.RODbID);
if (_origROName != ppRTxtName.Text) roDb.ROName = ppRTxtName.Text;
if (_origFolderPath != ppTxtPath.Text) roDb.FolderPath = ppTxtPath.Text;
roDb.Save().Dispose();
Close();
return;
}
// this is creating a new rodb. A new rofst record will be created as well & the association set
// check for unique name/path first
RODbInfoList allrodbinfo = RODbInfoList.Get();
foreach (RODbInfo rdi in allrodbinfo)
{
if (ppRTxtName.Text == rdi.ROName || ppTxtPath.Text == rdi.FolderPath)
{
MessageBox.Show("Name and/or folder path are not unique, create unique names.");
return;
}
}
if (ppRTxtName.Text == null || ppRTxtName.Text == "")
{
MessageBox.Show("You must enter a Name.");
return;
}
if (ppTxtPath.Text == null || ppTxtPath.Text == "")
{
MessageBox.Show("You must enter a Path.");
return;
}
// check for an ro.fst existing in the selected path. If it is valid, create an rodb, rofst
// and an association to its docversion.
string rofstPath = ppTxtPath.Text + @"\ro.fst";
if (!File.Exists(rofstPath))
{
MessageBox.Show("No existing ro.fst in path " + ppTxtPath.Text + ". Check for invalid path");
return;
}
RODb newroDb = RODb.MakeRODb(ppRTxtName.Text, ppTxtPath.Text, "cstring", null);
RODbInfo newrdi = RODbInfo.Get(newroDb.RODbID);
newroDb.Save().Dispose();
ROFst rofst = ROFstInfo.AddRoFst(newrdi, _docVersion);
Close();
}
private void frmRODbProperties_Load(object sender, EventArgs e)
{
ppRTxtName.Text = (_roDbInfo == null) ? null : _roDbInfo.ROName;
ppTxtPath.Text = (_roDbInfo == null) ? null : _roDbInfo.FolderPath;
RODbConfig cfg = (_roDbInfo == null) ? new RODbConfig() : new RODbConfig(_roDbInfo);
// Note that the Graphic Extension data is shown in a non-editable text box here because
// the data is either retrieved from the roapp.ini - and if there can only be editted from
// the file system. Otherwise it is derived from the top node - and changed from folder
// properties on the top node. And lastly, it is the code default.
ppTxtExt.Text = cfg.GetDefaultGraphicExtension();
ppLblGraphicFileExtLoc.Text = (cfg == null) ? null : cfg.GetDefaultGraphicExtensionLocation();
if (_roDbInfo == null)
{
string newFolderPath = null;
FolderBrowserDialog dlgROFolder = new FolderBrowserDialog();
if (dlgROFolder.ShowDialog() == DialogResult.OK)
{
newFolderPath = dlgROFolder.SelectedPath;
}
ppTxtPath.Text = newFolderPath;
}
}
}
}

View File

@ -0,0 +1,139 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="ppBtnFldrDlg.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAALBQAA
CwUByY3ISQAAAn9JREFUOE+lk2tI01EYxhf0oU8WqVEIRpaIBWJgSPUhROmippS3QkkTylsXDMW8ts3b
1G06daVibuqaOq0sxbBCKBSJ0PJCialZUFSKqaGSt1//TbIsww8deOBwznl+5zkv71kHiP5rGAFrKb1Q
5ypR6bmaVU6m2kCiXJv007Om2XgwJEaNT4QiyDi/GF9mKRVgsWkav+CYQkR1utwAQfypphqZ4l/JIhOL
jvtGKfCOyDMB6O/WMjNea9L3MT1zIxoM5QrqdWnS1SA+kUq8w1V4hhUgqq1QMj1WtcK88KmIud5oqsqy
qCzOQFMopSQvhRvyBApkcQLzV91E1docpr9ol29eFMz0J0Bv2Kr6C3CrVMa3jyWm2EZzc12OSQ8M2TTo
ZdytzMCgSUVfIqFcfY2bqiSKlQmoc+JNaUSVJRlMvsvHGHuoVUx9lZKFIQkMp63UW2FtMBH6YuBVFF01
/lwO9aoQadSpTAxkwXs596oVtD+ULx36/Qkvg6HDl/k2D2YeufCmwoELZ45MCIA9olKVmK+vJQy3JVOv
l7M4KIae8CVAV6hgPMV8uxczLYeZbDrIaN1eJBG2nHazyDN1cZEymdHueG7rcuh8KiTpixYA56AziMVn
J5h9coyp5kOM1TvxudqejvRNBHrY4GRnZmcCqLMT6GlJ4Y4uGwZS4IUQ97kfs62eTD12YbzBmRGDAx+0
u+iVmyMO24njbqvG5VbOz4yjtjyL3vuRdOSKltUuX0+LbAON0o3UJFmiibPi+pXtBLrvWHR2tHZfBuSm
xZIrPk9mfAiJlwKMleWsvxsnj+7H9YAD+xxssbexwnqbBVs2m7HV3GxlI631E9fa/wGRpaRpa3TTbQAA
AABJRU5ErkJggg==
</value>
</data>
</root>