VEPROMS_UI / remove BouncyCastle
This commit is contained in:
@@ -1,9 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using VEPROMS.CSLA.Library;
|
||||
using VEPROMS.Properties;
|
||||
@@ -12,6 +8,7 @@ using DevComponents.DotNetBar.Controls;
|
||||
using Volian.Controls.Library;
|
||||
using DescriptiveEnum;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
namespace VEPROMS
|
||||
{
|
||||
@@ -20,11 +17,10 @@ namespace VEPROMS
|
||||
private string _DefaultFormatName = null;
|
||||
private string _DefaultNumColumns = null;
|
||||
private string _DefaultPaginationStyle = null;
|
||||
private string _DefaultPrintSize = null;
|
||||
private bool _Initializing;
|
||||
private SectionConfig _SectionConfig;
|
||||
private Document _DocumentToDelete = null;
|
||||
private StepTabRibbon _MyStepTabRibbon;
|
||||
private readonly SectionConfig _SectionConfig;
|
||||
private Document _DocumentToDelete = null;
|
||||
private readonly StepTabRibbon _MyStepTabRibbon;
|
||||
private bool _isStepSection = true;
|
||||
private bool _hasSectionCheckoffDefault = false;
|
||||
private bool _isDefaultStepSection = false;
|
||||
@@ -35,36 +31,30 @@ namespace VEPROMS
|
||||
InitializeComponent();
|
||||
btnGeneral.PerformClick(); // always start with General tab or button
|
||||
ItemInfo ii = ItemInfo.Get(_SectionConfig.MySection.ItemID);
|
||||
//if (sectionConfig.Number.Length > 0)
|
||||
// this.Text = string.Format("{0} {1} Properties", sectionConfig.Number, sectionConfig.Title);
|
||||
//else
|
||||
// this.Text = string.Format("{0} Properties", sectionConfig.Title);
|
||||
if (sectionConfig.Number.Length > 0)
|
||||
this.Text = string.Format("{0} {1} Properties", ii.DisplayNumber, ii.DisplayText);
|
||||
Text = $"{ii.DisplayNumber} {ii.DisplayText} Properties";
|
||||
else
|
||||
this.Text = string.Format("{0} Properties", ii.DisplayText);
|
||||
Text = $"{ii.DisplayText} Properties";
|
||||
ppSectTitleStpRTB.Font = ppSectTitleStpRTB.FormatFont = new System.Drawing.Font("Microsoft Sans Serif", 10F);
|
||||
ppSectTitleStpRTB.FieldToEdit = E_FieldToEdit.Text;
|
||||
ppSectTitleStpRTB.BorderStyle = BorderStyle.Fixed3D;
|
||||
ppSectTitleStpRTB.MyItemInfo = ii;
|
||||
ppSectTitleStpRTB.RefreshDisplay(true);
|
||||
ppSectNumberStpRTB.Font = this.ppSectNumberStpRTB.FormatFont = new System.Drawing.Font("Microsoft Sans Serif", 10F);
|
||||
ppSectNumberStpRTB.Font = ppSectNumberStpRTB.FormatFont = new System.Drawing.Font("Microsoft Sans Serif", 10F);
|
||||
ppSectNumberStpRTB.FieldToEdit = E_FieldToEdit.Number;
|
||||
ppSectNumberStpRTB.BorderStyle = BorderStyle.Fixed3D;
|
||||
ppSectNumberStpRTB.MyItemInfo = ii;
|
||||
ppSectNumberStpRTB.RefreshDisplay(true);
|
||||
_MyStepTabRibbon = new StepTabRibbon();
|
||||
//_MyStepTabRibbon.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
//_MyStepTabRibbon.Location = new System.Drawing.Point(0, 0);
|
||||
_MyStepTabRibbon.Name = "displayTabRibbon1";
|
||||
_MyStepTabRibbon.Visible = false;
|
||||
_MyStepTabRibbon = new StepTabRibbon
|
||||
{
|
||||
Name = "displayTabRibbon1",
|
||||
Visible = false
|
||||
};
|
||||
|
||||
// B2017-272 disable/enable the Steps and Word radio buttons based on the section types defined in the format
|
||||
// and the type of an existing section or if we are creating a new section.
|
||||
// Move the check of creating a new section into CheckAvailableSectionTypes()
|
||||
CheckAvaibleSectionTypes();
|
||||
//// if creating a new section, enable the StepSect and WordSect radio buttons
|
||||
//rbStepSect.Enabled = rbWordSect.Enabled = !(ii.HasWordContent || ii.HasStepContent);
|
||||
|
||||
// if this is an auto table of contents (mydocstyle == null if new section, so must check for that first)
|
||||
if (ii.IsAutoTOCSection)
|
||||
@@ -181,15 +171,14 @@ namespace VEPROMS
|
||||
{
|
||||
// find first section in list that has originalsteps (flags a default section)
|
||||
int defsctId = 0;
|
||||
foreach (SectionInfo si in _SectionConfig.MySection.MySectionInfo.MyProcedure.Sections)
|
||||
foreach (SectionInfo si in _SectionConfig.MySection.MySectionInfo.MyProcedure.Sections.OfType<SectionInfo>())
|
||||
{
|
||||
SectionConfig sc = si.MyConfig as SectionConfig;
|
||||
if (si.ItemID != _SectionConfig.MySection.ItemID && sc != null && sc.Section_OriginalSteps == "Y")
|
||||
{
|
||||
defsctId = si.ItemID;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (si.ItemID != _SectionConfig.MySection.ItemID && si.MyConfig is SectionConfig sc && sc.Section_OriginalSteps == "Y")
|
||||
{
|
||||
defsctId = si.ItemID;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (defsctId != 0)
|
||||
{
|
||||
// also need to set the procedure's config sectionstart to the selected section
|
||||
@@ -209,19 +198,18 @@ namespace VEPROMS
|
||||
// this property set - it is used when printing page numbers with 'WithSteps' numbering sequence.
|
||||
else if (!_isDefaultStepSection && ppCbDefaultStepSection.Checked)
|
||||
{
|
||||
foreach (SectionInfo si in _SectionConfig.MySection.MySectionInfo.MyProcedure.Sections)
|
||||
foreach (SectionInfo si in _SectionConfig.MySection.MySectionInfo.MyProcedure.Sections.OfType<SectionInfo>())
|
||||
{
|
||||
SectionConfig sc = si.MyConfig as SectionConfig;
|
||||
if (si.ItemID != _SectionConfig.MySection.ItemID && sc != null && sc.Section_OriginalSteps == "Y")
|
||||
{
|
||||
using (Section ssav = si.Get())
|
||||
{
|
||||
ssav.SectionConfig.Section_OriginalSteps = "N";
|
||||
ssav.Save();
|
||||
ItemInfo.Refresh(ssav);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (si.ItemID != _SectionConfig.MySection.ItemID && si.MyConfig is SectionConfig sc && sc.Section_OriginalSteps == "Y")
|
||||
{
|
||||
using (Section ssav = si.Get())
|
||||
{
|
||||
ssav.SectionConfig.Section_OriginalSteps = "N";
|
||||
ssav.Save();
|
||||
ItemInfo.Refresh(ssav);
|
||||
}
|
||||
}
|
||||
}
|
||||
// also need to set the procedure's config sectionstart to the selected section
|
||||
// if it is not set:
|
||||
using (Procedure p = Procedure.Get(_SectionConfig.MySection.MySectionInfo.MyProcedure.ItemID))
|
||||
@@ -253,8 +241,8 @@ namespace VEPROMS
|
||||
}
|
||||
}
|
||||
}
|
||||
this.DialogResult = DialogResult.OK;
|
||||
this.Close();
|
||||
DialogResult = DialogResult.OK;
|
||||
Close();
|
||||
}
|
||||
public void SaveText(StepRTB myStepRTB)
|
||||
{
|
||||
@@ -269,7 +257,7 @@ namespace VEPROMS
|
||||
myStepRTB.ClearUndo();
|
||||
}
|
||||
}
|
||||
//private static void FinishSectionSave(Section section)
|
||||
|
||||
private void FinishSectionSave(Section section)
|
||||
{
|
||||
ItemInfo sectinfo = ItemInfo.Get(section.ItemID);
|
||||
@@ -305,7 +293,7 @@ namespace VEPROMS
|
||||
_DocumentToDelete = null;
|
||||
sectionConfigBindingSource.CancelEdit();
|
||||
DialogResult = DialogResult.Cancel;
|
||||
this.Close();
|
||||
Close();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -320,12 +308,6 @@ namespace VEPROMS
|
||||
// Get the default format name
|
||||
_DefaultFormatName = _SectionConfig.DefaultFormatSelection;
|
||||
SetupDefault(_DefaultFormatName, ppLblFormatDefault, ppCmbxFormat);
|
||||
//if (_DefaultFormatName != null && !(_DefaultFormatName.Equals("")))
|
||||
//{
|
||||
// string defName = string.Format("{0}", _DefaultFormatName);
|
||||
// ppLblFormatDefault.Text = defName;
|
||||
// ppCmbxFormat.WatermarkText = defName;
|
||||
//}
|
||||
SectionConfig.SectionColumnMode sc = _SectionConfig.Section_ColumnMode;
|
||||
_DefaultNumColumns = sc.ToString();
|
||||
SetupDefault(EnumDescConverter.GetEnumDescription(sc), ppLblDefaultNumColumns, ppCmbxNumColumns);
|
||||
@@ -333,8 +315,6 @@ namespace VEPROMS
|
||||
//Console.WriteLine("{0}, {1}, default pagination", _SectionConfig.MySection.DisplayNumber, sp);
|
||||
_DefaultPaginationStyle = sp.ToString();
|
||||
SetupDefault(EnumDescConverter.GetEnumDescription(sp), ppLblDefPaginationStyle, ppCmbxSectPagination);
|
||||
//_DefaultPrintSize = _SectionConfig.Section_AttachmentPrintSize.ToString();
|
||||
//SetupDefault(EnumDescConverter.GetEnumDescription(_SectionConfig.Section_AttachmentPrintSize), ppLblDefaultPrintSize, ppCmbxAccPgPrintSize);
|
||||
|
||||
_SectionConfig.ParentLookup = false;
|
||||
}
|
||||
@@ -349,7 +329,7 @@ namespace VEPROMS
|
||||
{
|
||||
if (defaultText != null && !(defaultText.Equals("")))
|
||||
{
|
||||
string deftext = string.Format("{0}", defaultText);
|
||||
string deftext = $"{defaultText}";
|
||||
lbl.Text = deftext;
|
||||
cmbo.WatermarkText = deftext;
|
||||
}
|
||||
@@ -365,7 +345,7 @@ namespace VEPROMS
|
||||
ppCmbxFormat.DisplayMember = "FullName";
|
||||
ppCmbxFormat.ValueMember = "FullName";
|
||||
ppCmbxFormat.DataSource = FormatUtility.GetFilteredFormatList(FormatInfoList.SortedFormatInfoList);
|
||||
if (_SectionConfig.MySection.MySectionInfo.ActiveFormat != null) _cmbxformatOriginal = (int)_SectionConfig.MySection.MySectionInfo.ActiveFormat.FormatID;
|
||||
if (_SectionConfig.MySection.MySectionInfo.ActiveFormat != null) _cmbxformatOriginal = (int)_SectionConfig.MySection.MySectionInfo.ActiveFormat.FormatID;
|
||||
if (_SectionConfig.FormatSelection != null)
|
||||
ppCmbxFormat.SelectedValue = _SectionConfig.FormatSelection;
|
||||
else
|
||||
@@ -373,7 +353,7 @@ namespace VEPROMS
|
||||
// Get the saved settings for this user
|
||||
//
|
||||
// Get setting telling us whether to display the default values on this property page
|
||||
ppCbShwDefSettings.Checked = (Settings.Default["ShowDefaultSectionProp"] != null) ? Settings.Default.ShowDefaultSectionProp : false;
|
||||
ppCbShwDefSettings.Checked = (Settings.Default["ShowDefaultSectionProp"] != null) && Settings.Default.ShowDefaultSectionProp;
|
||||
|
||||
// Get the User's property page style "PropPageStyle" (this is a system wide user setting)
|
||||
// 1 - Button Dialog (default)
|
||||
@@ -382,7 +362,7 @@ namespace VEPROMS
|
||||
{
|
||||
tcSectionProp.TabsVisible = true;
|
||||
panSectBtns.Visible = false;
|
||||
this.Width -= panSectBtns.Width;
|
||||
Width -= panSectBtns.Width;
|
||||
}
|
||||
|
||||
// Get the default values for the property page information
|
||||
@@ -419,24 +399,10 @@ namespace VEPROMS
|
||||
ppBtnDefaultNumColumns.Visible = false;
|
||||
ppCmbxNumColumns.SelectedValueChanged += new EventHandler(ppCmbxNumColumns_SelectedValueChanged);
|
||||
|
||||
//ppCmbxAccPgPrintSize.DataSource = EnumDetail<SectionConfig.AttPrintSize>.Details();
|
||||
//ppCmbxAccPgPrintSize.DisplayMember = "Description";
|
||||
//ppCmbxAccPgPrintSize.ValueMember = "Evalue";
|
||||
//ppCmbxAccPgPrintSize.SelectedIndex = -1;
|
||||
|
||||
if (!_isStepSection)
|
||||
ppCmbxLibDocFill();
|
||||
|
||||
// check type of section from document styles to determine if the stepsection checkbox should
|
||||
// be checked.
|
||||
//int secindx = (int)_SectionConfig.SectionType;
|
||||
//// find the index for the document style to determine whether this is a step or word section.
|
||||
PlantFormat pf = _SectionConfig.MyFormat != null ? _SectionConfig.MyFormat.PlantFormat : _SectionConfig.MyDefaultFormat.PlantFormat;
|
||||
//for (int i = 0; i < pf.DocStyles.DocStyleList.Count; i++)
|
||||
//{
|
||||
// if (pf.DocStyles.DocStyleList[i].Index == secindx)
|
||||
// rbStepSect.Checked = pf.DocStyles.DocStyleList[i].IsStepSection; _SectionConfig.MySection.
|
||||
//}
|
||||
|
||||
// set the StepSect radio button based on _isStepSection to ensure the proper section types are available
|
||||
rbStepSect.Checked = _isStepSection;
|
||||
@@ -455,7 +421,6 @@ namespace VEPROMS
|
||||
// show the automatic indent checkbox.
|
||||
ppCbEditableData.Enabled = _SectionConfig.MySection.MySectionInfo.Sections != null && _SectionConfig.MySection.MySectionInfo.Sections.Count > 0;
|
||||
ppCbEditableData.Visible = _isStepSection; // only display if we are on a step editor section
|
||||
//ppCbAutoIndent.Enabled = _SectionConfig.MySection.MySectionInfo.Sections != null && _SectionConfig.MySection.MySectionInfo.Sections.Count > 0;
|
||||
ppCbAutoIndent.Enabled = pf.FormatData.SectData.UseMetaSections;
|
||||
ppCbAutoIndent.Visible = _isStepSection; // only display if we are on a step editor section
|
||||
|
||||
@@ -493,8 +458,6 @@ namespace VEPROMS
|
||||
ppCbPlaceKeeper.Enabled = _isStepSection;
|
||||
if (!_isStepSection && (_SectionConfig.MySection.MySectionInfo.MyDocStyle.StructureStyle.Style & E_DocStructStyle.Placekeeper) == E_DocStructStyle.Placekeeper)
|
||||
{
|
||||
//ppCbPlaceKeeper.Text = "Auto Generate Placekeeper";
|
||||
//ppCbPlaceKeeper.Enabled = true;
|
||||
ppCbPlaceKeeper.Enabled = false;
|
||||
}
|
||||
if (ppCbPlaceKeeper.Enabled) ppCbPlaceKeeper.Checked = _SectionConfig.Section_Placekeeper == "Y";
|
||||
@@ -606,7 +569,7 @@ namespace VEPROMS
|
||||
ppBtnConvertToDocX.Visible = false; // Don't allow save as DOCX for libraries documents
|
||||
ppBtnCvrtToLibDoc.Text = "Convert this Section To A Non-Library Document";
|
||||
lblLibraryDocument.Text = "Library Document";
|
||||
superTooltip1.SetSuperTooltip(this.ppBtnCvrtToLibDoc, new DevComponents.DotNetBar.SuperTooltipInfo("Convert To Non-Library Document", "", "This button will convert the current section from a library document to a non-library document",
|
||||
superTooltip1.SetSuperTooltip(ppBtnCvrtToLibDoc, new DevComponents.DotNetBar.SuperTooltipInfo("Convert To Non-Library Document", "", "This button will convert the current section from a library document to a non-library document",
|
||||
null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, false, new System.Drawing.Size(250, 76)));
|
||||
}
|
||||
else
|
||||
@@ -616,17 +579,17 @@ namespace VEPROMS
|
||||
{
|
||||
ItemInfo ii = ItemInfo.Get(_SectionConfig.MySection.ItemID);
|
||||
if (!ii.IsAutoTOCSection) // Only show the Convert To DocX button for non-Auto Table Of Contents Section
|
||||
this.ppBtnConvertToDocX.Visible = true; // Only allow save as DocX for normal word sections when the existing text is RTF.
|
||||
ppBtnConvertToDocX.Visible = true; // Only allow save as DocX for normal word sections when the existing text is RTF.
|
||||
}
|
||||
else
|
||||
this.ppBtnConvertToDocX.Visible = false;
|
||||
ppBtnConvertToDocX.Visible = false;
|
||||
if (_SectionConfig.MySection.MyContent.MyEntry.MyDocument == null)
|
||||
ppBtnCvrtToLibDoc.Visible = false;
|
||||
else
|
||||
{
|
||||
ppBtnCvrtToLibDoc.Text = "Convert this to a Library Document";
|
||||
lblLibraryDocument.Text = "Select Library Document";
|
||||
superTooltip1.SetSuperTooltip(this.ppBtnCvrtToLibDoc, new DevComponents.DotNetBar.SuperTooltipInfo("Convert To Library Document button", "", "This button will convert the current section to a library document, allowing it t" +
|
||||
superTooltip1.SetSuperTooltip(ppBtnCvrtToLibDoc, new DevComponents.DotNetBar.SuperTooltipInfo("Convert To Library Document button", "", "This button will convert the current section to a library document, allowing it t" +
|
||||
"o be shared with other procedures.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, false, new System.Drawing.Size(250, 76)));
|
||||
}
|
||||
}
|
||||
@@ -694,12 +657,11 @@ namespace VEPROMS
|
||||
int oldSelIndx = -1;
|
||||
if (!myInit)
|
||||
{
|
||||
DocStyleList oldDocStyles = null;
|
||||
opf = _SectionConfig.MyFormat != null ? _SectionConfig.MyFormat.PlantFormat : _SectionConfig.MyDefaultFormat.PlantFormat;
|
||||
opf = _SectionConfig.MyFormat != null ? _SectionConfig.MyFormat.PlantFormat : _SectionConfig.MyDefaultFormat.PlantFormat;
|
||||
if (pf != opf)
|
||||
{
|
||||
oldDocStyles = new DocStyleList(null);
|
||||
foreach (DocStyle ds in opf.DocStyles.DocStyleListActive)
|
||||
DocStyleList oldDocStyles = new DocStyleList(null);
|
||||
foreach (DocStyle ds in opf.DocStyles.DocStyleListActive)
|
||||
{
|
||||
if (_isStepSection && ds.IsStepSection)
|
||||
oldDocStyles.Add(ds); // find only step section types
|
||||
@@ -786,7 +748,8 @@ namespace VEPROMS
|
||||
}
|
||||
}
|
||||
private List<CheckOff> SectionPropertyCheckOffList = null;
|
||||
private Dictionary<int, int> _CheckOffIndex = new Dictionary<int, int>(); // C2020-003 translate the sorted index number to the actual checkoff index
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "Keeping Collections Not ReadOnly")]
|
||||
private Dictionary<int, int> _CheckOffIndex = new Dictionary<int, int>(); // C2020-003 translate the sorted index number to the actual checkoff index
|
||||
private void SetupCheckoffsDropdowns()
|
||||
{
|
||||
if (!_isStepSection) return; // not needed for accessory pages (word attachments)
|
||||
@@ -794,7 +757,7 @@ namespace VEPROMS
|
||||
_Initializing = true;
|
||||
PlantFormat pf = _SectionConfig.MyFormat!=null?_SectionConfig.MyFormat.PlantFormat:_SectionConfig.MyDefaultFormat.PlantFormat;
|
||||
CheckOffList chkoffList = pf.FormatData.ProcData.CheckOffData.CheckOffList;
|
||||
if (chkoffList != null) chkoffList.Sort(CompareCheckoffUsingOrderBy); // C2020-003 sort the checkoff list via the Index and/or OrderBy elements
|
||||
chkoffList?.Sort(CompareCheckoffUsingOrderBy); // C2020-003 sort the checkoff list via the Index and/or OrderBy elements
|
||||
CheckOffHeaderList chkoffHeaderList = pf.FormatData.ProcData.CheckOffData.CheckOffHeaderList;
|
||||
int maxindx = pf.FormatData.ProcData.CheckOffData.CheckOffList.MaxIndexNoInherit;
|
||||
// B2019-013: was crashing on indexer of checkofflist. If there were UCF checkoffs but none in original format, the indexer
|
||||
@@ -815,10 +778,9 @@ namespace VEPROMS
|
||||
if (chkoffList != null && maxindx > 0 &&
|
||||
(pf.FormatData.ProcData.CheckOffData.Menu == "Signoff") || _hasSectionCheckoffDefault)
|
||||
{
|
||||
if (SectionPropertyCheckOffList!=null)SectionPropertyCheckOffList.Clear();
|
||||
SectionPropertyCheckOffList?.Clear();
|
||||
SectionPropertyCheckOffList = new List<CheckOff>();
|
||||
// Don't put up the first item in the chkoffList, it is '{Section Default}'.
|
||||
//for (int i = 1; i < chkoffList.Count; i++)
|
||||
int idxcnt = 0;
|
||||
int translatedCfgIdx = 0;
|
||||
_CheckOffIndex.Clear();
|
||||
@@ -882,7 +844,7 @@ namespace VEPROMS
|
||||
{
|
||||
string suffix = "format ";
|
||||
if (_DefaultFormatName.ToUpper().Contains("FORMAT")) suffix = "";
|
||||
MessageBox.Show(string.Format("{0}\n\n{1}does not support {2} section type", _DefaultFormatName, suffix, isWordSection ? "MS Word" : "Step"), "Incompatible Format", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||
MessageBox.Show($"{_DefaultFormatName}\n\n{suffix}does not support {(isWordSection ? "MS Word" : "Step")} section type", "Incompatible Format", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -918,7 +880,6 @@ namespace VEPROMS
|
||||
// determine if the default button and the default description text should visable
|
||||
ppBtnDefaultFmt.Visible = !(ppCmbxFormat.SelectedValue == null || ppCmbxFormat.SelectedIndex == -1);
|
||||
ppLblFormatDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefaultFmt.Visible;
|
||||
//if (!didDefault) SetupPpCmbxSectionType();
|
||||
SetupPpCmbxSectionType();
|
||||
// B2017-272 disable/enable the Steps and Word radio buttons based on the section types defined in the format
|
||||
// and the type of an existing section or if we are creating a new section.
|
||||
@@ -940,7 +901,7 @@ namespace VEPROMS
|
||||
return true; // valid format
|
||||
string suffix = "format ";
|
||||
if (ppCmbxFormat.SelectedValue.ToString().ToUpper().Contains("FORMAT")) suffix = "";
|
||||
MessageBox.Show(string.Format("{0}\n\n{1}does not support {2} section type", ppCmbxFormat.SelectedValue, suffix, isWordSection ? "MS Word" : "Step"), "Incompatible Format", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||
MessageBox.Show($"{ppCmbxFormat.SelectedValue}\n\n{suffix}does not support {(isWordSection ? "MS Word" : "Step")} section type", "Incompatible Format", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -951,20 +912,17 @@ namespace VEPROMS
|
||||
_SectionConfig.SectionType = (int)(ppCmbxStyleSectionType.SelectedValue);
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Library Document tab
|
||||
#region Library Document tab
|
||||
|
||||
/// <summary>
|
||||
/// This is the Library Document button used on the button interface design
|
||||
/// </summary>
|
||||
/// <param name="sender">object</param>
|
||||
/// <param name="e">EventArgs</param>
|
||||
private void btnLibDocs_Click(object sender, EventArgs e)
|
||||
{
|
||||
ProcessButtonClick(tiLibDoc, btnLibDocs);
|
||||
}
|
||||
private void ppBtnCvrtToLibDoc_Click(object sender, EventArgs e)
|
||||
/// <summary>
|
||||
/// This is the Library Document button used on the button interface design
|
||||
/// </summary>
|
||||
/// <param name="sender">object</param>
|
||||
/// <param name="e">EventArgs</param>
|
||||
private void btnLibDocs_Click(object sender, EventArgs e) => ProcessButtonClick(tiLibDoc, btnLibDocs);
|
||||
private void ppBtnCvrtToLibDoc_Click(object sender, EventArgs e)
|
||||
{
|
||||
// Double Check that this is not a step section, if so just return.
|
||||
if (_isStepSection) return;
|
||||
@@ -995,7 +953,7 @@ namespace VEPROMS
|
||||
ppCmbxLibDoc.Items.Clear();
|
||||
ppCmbxLibDoc.WatermarkEnabled = true;
|
||||
ppBtnCvrtToLibDoc.Text = "Convert this to a Library Document";
|
||||
superTooltip1.SetSuperTooltip(this.ppBtnCvrtToLibDoc, new DevComponents.DotNetBar.SuperTooltipInfo("Convert To Library Document button", "", "This button will convert the current section to a library document, allowing it t" +
|
||||
superTooltip1.SetSuperTooltip(ppBtnCvrtToLibDoc, new DevComponents.DotNetBar.SuperTooltipInfo("Convert To Library Document button", "", "This button will convert the current section to a library document, allowing it t" +
|
||||
"o be shared with other procedures.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, false, new System.Drawing.Size(250, 76)));
|
||||
return;
|
||||
}
|
||||
@@ -1038,7 +996,7 @@ namespace VEPROMS
|
||||
}
|
||||
ppBtnCvrtToLibDoc.Text = "Convert this Section To A Non-Library Document";
|
||||
lblLibraryDocument.Text = "Library Document";
|
||||
superTooltip1.SetSuperTooltip(this.ppBtnCvrtToLibDoc, new DevComponents.DotNetBar.SuperTooltipInfo("Convert To Non-Library Document", "", "This button will convert the current section from a library document to a non-library document",
|
||||
superTooltip1.SetSuperTooltip(ppBtnCvrtToLibDoc, new DevComponents.DotNetBar.SuperTooltipInfo("Convert To Non-Library Document", "", "This button will convert the current section from a library document to a non-library document",
|
||||
null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, false, new System.Drawing.Size(250, 76)));
|
||||
}
|
||||
|
||||
@@ -1070,11 +1028,6 @@ namespace VEPROMS
|
||||
}
|
||||
|
||||
}
|
||||
//else if (_SectionConfig.MySection.MyContent.MyEntry.MyDocument == null)
|
||||
//{
|
||||
// // was creating a new document & selected to connect it to a libdoc
|
||||
// _DocumentToDelete = _SectionConfig.MySection.MyContent.MyEntry.MyDocument;
|
||||
//}
|
||||
else
|
||||
{
|
||||
// it already is a library document, just change usages...
|
||||
@@ -1086,34 +1039,30 @@ namespace VEPROMS
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception(string.Format("Index Out Of Range Index = {0}, Count = {1}", ppCmbxLibDoc.SelectedIndex, LibDocList.Count));
|
||||
throw new Exception($"Index Out Of Range Index = {ppCmbxLibDoc.SelectedIndex}, Count = {LibDocList.Count}");
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region View Settings tab
|
||||
#region View Settings tab
|
||||
|
||||
/// <summary>
|
||||
/// This is the View Settings button used on the button interface design
|
||||
/// </summary>
|
||||
/// <param name="sender">object</param>
|
||||
/// <param name="e">EventArgs</param>
|
||||
private void btnAutomation_Click(object sender, EventArgs e)
|
||||
/// <summary>
|
||||
/// This is the View Settings button used on the button interface design
|
||||
/// </summary>
|
||||
/// <param name="sender">object</param>
|
||||
/// <param name="e">EventArgs</param>
|
||||
private void btnAutomation_Click(object sender, EventArgs e) => ProcessButtonClick(tiAutomation, btnAutomation);
|
||||
|
||||
#endregion
|
||||
|
||||
#region Generic functions used on this property page
|
||||
|
||||
/// <summary>
|
||||
/// Determines what labels (showing default values) are visable on the property pages
|
||||
/// </summary>
|
||||
private void defaultSettingsVisiblity()
|
||||
{
|
||||
ProcessButtonClick(tiAutomation, btnAutomation);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Generic functions used on this property page
|
||||
|
||||
/// <summary>
|
||||
/// Determines what labels (showing default values) are visable on the property pages
|
||||
/// </summary>
|
||||
private void defaultSettingsVisiblity()
|
||||
{
|
||||
//ItemInfo ii = ItemInfo.Get(_SectionConfig.MySection.ItemID);
|
||||
ppLblDefSettingsInfo.Visible = ppCbShwDefSettings.Checked;
|
||||
ppLblFormatDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefaultFmt.Visible;
|
||||
ppLblDefaultNumColumns.Visible = _isStepSection && ppCbShwDefSettings.Checked && ppBtnDefaultNumColumns.Visible;
|
||||
@@ -1160,26 +1109,7 @@ namespace VEPROMS
|
||||
private void tabpage_Enter(object sender, EventArgs e)
|
||||
{
|
||||
// Show or hide the labels containing the default values
|
||||
//if (!_Initializing) // jsj 1-23-2017 was not showing default check upon property page entry
|
||||
defaultSettingsVisiblity();
|
||||
}
|
||||
/// <summary>
|
||||
/// Process a change in the combo box selection
|
||||
/// </summary>
|
||||
/// <param name="cmbx">Combo Box Name</param>
|
||||
/// <param name="defstr">string containing default text</param>
|
||||
/// <param name="button">button to reset to default value</param>
|
||||
/// <param name="deflabel">label containing the default</param>
|
||||
private void ProcessCmbxSelectedValueChange(ComboBoxEx cmbx, string defstr, ButtonX button, Label deflabel)
|
||||
{
|
||||
if ((cmbx.SelectedIndex != -1) && defstr != null && defstr.Equals(cmbx.SelectedValue))
|
||||
{
|
||||
button.Visible = true;
|
||||
button.Focus();
|
||||
button.PerformClick();
|
||||
}
|
||||
button.Visible = (cmbx.SelectedValue != null);
|
||||
deflabel.Visible = (ppCbShwDefSettings.Checked) && button.Visible;
|
||||
defaultSettingsVisiblity();
|
||||
}
|
||||
/// <summary>
|
||||
/// Process a change in the enum combo box selection
|
||||
@@ -1201,30 +1131,21 @@ namespace VEPROMS
|
||||
cmbx.SelectedIndex = -1; // This will hide the Default button
|
||||
_Initializing = sav_Initializing;
|
||||
}
|
||||
//button.Visible = ((!_FolderConfig.Name.Equals("VEPROMS")) && (cmbx.SelectedValue != null));
|
||||
button.Visible = ((cmbx.SelectedValue != null) && (cmbx.SelectedIndex >= 0));
|
||||
deflabel.Visible = ppCbShwDefSettings.Checked && button.Visible;
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
private void ppSectNumberStpRTB_Enter(object sender, EventArgs e)
|
||||
{
|
||||
_MyStepTabRibbon.MyStepRTB = ppSectNumberStpRTB;
|
||||
}
|
||||
private void ppSectNumberStpRTB_Enter(object sender, EventArgs e) => _MyStepTabRibbon.MyStepRTB = ppSectNumberStpRTB;
|
||||
|
||||
private void ppSectTitleStpRTB_Enter(object sender, EventArgs e)
|
||||
{
|
||||
_MyStepTabRibbon.MyStepRTB = ppSectTitleStpRTB;
|
||||
}
|
||||
private void ppSectTitleStpRTB_Enter(object sender, EventArgs e) => _MyStepTabRibbon.MyStepRTB = ppSectTitleStpRTB;
|
||||
|
||||
private void ShowAvailableOptionsForSectionType()
|
||||
private void ShowAvailableOptionsForSectionType()
|
||||
{
|
||||
lblColumns.Visible = _isStepSection;
|
||||
ppCmbxNumColumns.Visible = _isStepSection;
|
||||
lblPagination.Visible = _isStepSection;
|
||||
ppCmbxSectPagination.Visible = _isStepSection;
|
||||
//lblPrintSize.Visible = !_isStepSection;
|
||||
//ppCmbxAccPgPrintSize.Visible = !_isStepSection;
|
||||
ppGpbxSignoffCheckoff.Visible = _isStepSection;
|
||||
cbKeepWordDocMargins.Visible = !_isStepSection;
|
||||
ppCbDefaultStepSection.Visible = _isStepSection;
|
||||
@@ -1257,12 +1178,6 @@ namespace VEPROMS
|
||||
tcpFormat.Focus();
|
||||
}
|
||||
|
||||
//private void ppCmbxAccPgPrintSize_SelectedValueChanged(object sender, EventArgs e)
|
||||
//{
|
||||
// SectionConfig.AttPrintSize attsize = (SectionConfig.AttPrintSize)Enum.Parse(typeof(SectionConfig.AttPrintSize), _DefaultPrintSize);
|
||||
// ProcessCmbxSelectionEnumChanged(ppCmbxAccPgPrintSize, attsize, ppBtnDefaultPrintSize, ppLblDefaultPrintSize);
|
||||
//}
|
||||
|
||||
private void ppBtnDefaultPaginationStyle_Click(object sender, EventArgs e)
|
||||
{
|
||||
// Get the parent setting
|
||||
@@ -1285,12 +1200,9 @@ namespace VEPROMS
|
||||
tcpFormat.Focus();
|
||||
}
|
||||
|
||||
private void frmSectionProperties_Shown(object sender, EventArgs e)
|
||||
{
|
||||
ppSectNumberStpRTB.Focus();
|
||||
}
|
||||
private void frmSectionProperties_Shown(object sender, EventArgs e) => ppSectNumberStpRTB.Focus();
|
||||
|
||||
private void ppCbEditableData_CheckedChanged(object sender, EventArgs e)
|
||||
private void ppCbEditableData_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
bool isEditable = ppCbEditableData.Checked;
|
||||
if (!_Initializing)
|
||||
@@ -1353,7 +1265,7 @@ namespace VEPROMS
|
||||
int cntDefaultSect = 0;
|
||||
string defSectDesc = "";
|
||||
string curSectDesc = "";
|
||||
foreach (SectionInfo si in _SectionConfig.MySection.MySectionInfo.MyProcedure.Sections)
|
||||
foreach (SectionInfo si in _SectionConfig.MySection.MySectionInfo.MyProcedure.Sections.OfType<SectionInfo>())
|
||||
{
|
||||
SectionConfig sc = si.MyConfig as SectionConfig;
|
||||
if (sc != null && sc.Section_OriginalSteps == "Y")
|
||||
@@ -1405,10 +1317,6 @@ namespace VEPROMS
|
||||
ItemInfo ii = ItemInfo.Get(_SectionConfig.MySection.ItemID);
|
||||
DocumentInfo doclibinfo = ii.MyContent.MyEntry.MyDocument;
|
||||
DSOFile myfile = new DSOFile(doclibinfo);
|
||||
// When trying to fix this , the update of the document waas causing a CSLA crash so I switched
|
||||
// to make document
|
||||
//using (Document myDoc = doclibinfo.Get())
|
||||
//{
|
||||
// Open MSWord App
|
||||
LBWordLibrary.LBApplicationClass ap = new LBWordLibrary.LBApplicationClass();
|
||||
LBWordLibrary.LBDocumentClass doc = ap.Documents.Open(myfile.FullName);
|
||||
@@ -1420,17 +1328,13 @@ namespace VEPROMS
|
||||
FileStream fs = File.Open(filename, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);// B2016-053
|
||||
long len = fs.Length;
|
||||
byte[] ByteArray = new byte[len];
|
||||
int nBytesRead = fs.Read(ByteArray, 0, (int)len);
|
||||
_ = fs.Read(ByteArray, 0, (int)len);
|
||||
fs.Close();
|
||||
Document myDoc = Document.MakeDocument(null, ByteArray, doclibinfo.DocAscii, doclibinfo.Config, ".DOCX");
|
||||
_SectionConfig.MySection.MyContent.MyEntry.MyDocument = myDoc;
|
||||
_SectionConfig.MySection.MyContent.MyEntry.Save();
|
||||
//myDoc.DocContent = ByteArray;
|
||||
//myDoc.FileExtension = ".DOCX";
|
||||
//myDoc.Save();
|
||||
fi.Delete();// Cleanup afterwards
|
||||
ppBtnConvertToDocX.Visible = false; // Hide the button after the execution is complete.
|
||||
//}
|
||||
}
|
||||
|
||||
private void ppCmbxFormat_DropDown(object sender, EventArgs e)
|
||||
@@ -1460,14 +1364,11 @@ namespace VEPROMS
|
||||
_SectionConfig.Section_IsFoldout = (cbIsFoldoutSection.Checked) ? "Y" : "N";
|
||||
}
|
||||
|
||||
// B2019-165 check box added to Automation tab to prevent a duplex foldout from
|
||||
// being printed on the back of the last page of the Word document that does not include duplex foldouts
|
||||
private void ppCbNoDuplexFoldout_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
_SectionConfig.Section_DontIncludeDuplexFoldout = ppCbNoDuplexFoldout.Checked;
|
||||
}
|
||||
// C2029-025 Show or hide replace words. Can highlight replace words in editor.
|
||||
private void ppCbShowRplWords_CheckedChanged(object sender, EventArgs e)
|
||||
// B2019-165 check box added to Automation tab to prevent a duplex foldout from
|
||||
// being printed on the back of the last page of the Word document that does not include duplex foldouts
|
||||
private void ppCbNoDuplexFoldout_CheckedChanged(object sender, EventArgs e) => _SectionConfig.Section_DontIncludeDuplexFoldout = ppCbNoDuplexFoldout.Checked;
|
||||
// C2029-025 Show or hide replace words. Can highlight replace words in editor.
|
||||
private void ppCbShowRplWords_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (!_Initializing)
|
||||
{
|
||||
@@ -1475,15 +1376,5 @@ namespace VEPROMS
|
||||
}
|
||||
}
|
||||
|
||||
//private void ppBtnDefaultPrintSize_Click(object sender, EventArgs e)
|
||||
//{
|
||||
// // Get the parent setting
|
||||
// SectionConfig.AttPrintSize attsize = (SectionConfig.AttPrintSize)Enum.Parse(typeof(SectionConfig.AttPrintSize), _DefaultPrintSize);
|
||||
// // Compare parent setting with current setting
|
||||
// if (attsize != _SectionConfig.Section_AttachmentPrintSize)
|
||||
// _SectionConfig.Section_AttachmentPrintSize = attsize; // this will force a database update (write)
|
||||
// ppCmbxAccPgPrintSize.SelectedIndex = -1;//reset to the default Accessory page Print Size setting
|
||||
// tcpFormat.Focus();
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user