Compare commits
22 Commits
F2026-010_
...
Developmen
| Author | SHA1 | Date | |
|---|---|---|---|
| fe90af5aa4 | |||
| 7e672d91e9 | |||
| 09f472bee2 | |||
| 30da0c5105 | |||
| d2082cdbea | |||
| c42596811e | |||
| d095a19187 | |||
| 8089e2c898 | |||
| a657d03fb0 | |||
| 4e829200f5 | |||
| bef9be5cbe | |||
| 56f14323d1 | |||
| 4fcd22ca68 | |||
| 21890e74fe | |||
| ef32564fba | |||
| d95505726f | |||
| bb7b892f7c | |||
| 836cdaf087 | |||
| 6f5c41abb8 | |||
| 6379321785 | |||
| e4c6e4393e | |||
| ded6f18dd5 |
Binary file not shown.
@@ -32,7 +32,7 @@ namespace ctlXMLEditLib
|
||||
public void InsertSymbol( int symbcode)
|
||||
{
|
||||
int position = this.SelectionStart;
|
||||
string sym = string.Format(symbcode < 256 ? "\'{0:X2}" : @"\u{0}", symbcode);
|
||||
string sym = symbcode < 256 ? ((char)symbcode).ToString() : string.Format(@"\u{0}", symbcode);
|
||||
this.SelectedRtf = RtfPrefixForSymbols + sym + @"}";
|
||||
Select(position, -1);
|
||||
Select(position + 1, 0);
|
||||
|
||||
@@ -1337,24 +1337,37 @@ namespace VEPROMS
|
||||
pi.ClearChangeBarOverrides();
|
||||
|
||||
//B2019-140 Change bars do not get refreshed when approval is run.
|
||||
ProcedureInfo newproc = ItemInfo.ResetProcedure(pi.ItemID);
|
||||
ProcedureInfo newproc;
|
||||
|
||||
//// Refresh the StepPanel for the current Procedure
|
||||
//// so change bars update
|
||||
//// on any open StepPanel
|
||||
DisplayTabItem dti = MyFrmVEPROMS.GetTabContainingProcedure(pi.ItemID);
|
||||
//// Refresh the StepPanel for the current Procedure
|
||||
//// so change bars update
|
||||
//// on any open StepPanel
|
||||
|
||||
//B2026-019 Attempt to prevent an Access Error by utilizing a different Refresh if a Procedure is Open
|
||||
DisplayTabItem dti = MyFrmVEPROMS.GetTabContainingProcedure(pi.ItemID);
|
||||
if (dti != null)
|
||||
{
|
||||
if (!dti.MyStepTabPanel.MyStepPanel.ContainsFocus)
|
||||
dti.MyStepTabPanel.MyStepPanel.Focus();
|
||||
|
||||
foreach (EditItem eitm in dti.MyStepTabPanel.MyStepPanel.Controls.OfType<EditItem>())
|
||||
eitm.ChangeBar = eitm.MyItemInfo.HasChangeBar;
|
||||
}
|
||||
{
|
||||
eitm.ChangeBar = eitm.MyItemInfo.HasChangeBar;
|
||||
}
|
||||
|
||||
//since in a separate form, need to update the tree view
|
||||
//so "Showing Change Bars" Content Menu Item is correct
|
||||
MyFrmVEPROMS.RefreshProcedureNode(newproc);
|
||||
dti.MyStepTabPanel.MyStepTabRibbon.RefreshProcedure();
|
||||
Application.DoEvents();
|
||||
newproc = ProcedureInfo.Get(pi.ItemID);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
newproc = ItemInfo.ResetProcedure(pi.ItemID);
|
||||
}
|
||||
|
||||
//since in a separate form, need to update the tree view
|
||||
//so "Showing Change Bars" Content Menu Item is correct
|
||||
MyFrmVEPROMS.RefreshProcedureNode(newproc);
|
||||
}
|
||||
else
|
||||
UpdateProcedureConfig(pi, ap.RevNumber, ap.RevDate, myDTS, selectedSlave);
|
||||
|
||||
@@ -626,22 +626,33 @@ namespace VEPROMS
|
||||
itm.UserID = Volian.Base.Library.VlnSettings.UserID;
|
||||
itm.Save();
|
||||
|
||||
//B2019-140 Change bars do not get refreshed when approval is run.
|
||||
// Reset a Procedure and sub items in the cache
|
||||
ProcedureInfo newproc = ItemInfo.ResetProcedure(pi.ItemID);
|
||||
//B2019-140 Change bars do not get refreshed when approval is run.
|
||||
// Reset a Procedure and sub items in the cache
|
||||
|
||||
//// Refresh the StepPanel for the current Procedure
|
||||
//// so change bars update
|
||||
//// on any open StepPanel
|
||||
|
||||
//B2026-019 Attempt to prevent an Access Error by utilizing a different Refresh if a Procedure is Open
|
||||
DisplayTabItem dti = GetTabContainingProcedure(pi.ItemID);
|
||||
if (dti != null)
|
||||
{
|
||||
_ = ItemInfo.ResetProcedure(pi.ItemID, true);
|
||||
|
||||
//// Refresh the StepPanel for the current Procedure
|
||||
//// so change bars update
|
||||
//// on any open StepPanel
|
||||
DisplayTabItem dti = GetTabContainingProcedure(pi.ItemID);
|
||||
if (dti != null)
|
||||
{
|
||||
if (!dti.MyStepTabPanel.MyStepPanel.ContainsFocus)
|
||||
dti.MyStepTabPanel.MyStepPanel.Focus();
|
||||
dti.MyStepTabPanel.MyStepPanel.Focus();
|
||||
|
||||
foreach (EditItem eitm in dti.MyStepTabPanel.MyStepPanel.Controls.OfType<EditItem>())
|
||||
{
|
||||
eitm.ChangeBar = eitm.MyItemInfo.HasChangeBar;
|
||||
}
|
||||
|
||||
dti.MyStepTabPanel.MyStepTabRibbon.RefreshProcedure();
|
||||
}
|
||||
else
|
||||
{
|
||||
_ = ItemInfo.ResetProcedure(pi.ItemID);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1113,13 +1113,34 @@ namespace VEPROMS
|
||||
if (_Apples == null)
|
||||
{
|
||||
_Apples = new List<MiniConfig>();
|
||||
}
|
||||
_Apples.Add(cfg);
|
||||
}
|
||||
|
||||
//B2026-017 Use Pre-typed in information when adding New Applicability
|
||||
if (_Apples.Count == 0)
|
||||
{
|
||||
cfg.ID = textBox1.Text;
|
||||
if (!string.IsNullOrEmpty(textBox2.Text))
|
||||
{
|
||||
cfg.Name = textBox2.Text;
|
||||
}
|
||||
cfg.Number = textBox3.Text;
|
||||
cfg.Text = textBox4.Text;
|
||||
cfg.OtherID = textBox8.Text;
|
||||
cfg.OtherName = textBox9.Text;
|
||||
cfg.OtherNumber = textBox10.Text;
|
||||
cfg.OtherText = textBox11.Text;
|
||||
cfg.ProcedureNumber = textBox5.Text;
|
||||
cfg.SetID = textBox6.Text;
|
||||
cfg.SetName = textBox7.Text;
|
||||
}
|
||||
_Apples.Add(cfg);
|
||||
|
||||
bsApples.DataSource = null;
|
||||
bsApples.DataSource = _Apples;
|
||||
lbApplicabilities.SelectedItem = cfg;
|
||||
}
|
||||
lbApplicabilities.SelectedItem = cfg;
|
||||
lbApplicabilities_SelectedIndexChanged(sender, e);
|
||||
|
||||
}
|
||||
|
||||
private bool ApplicIsUsed(MiniConfig cfg) // B2017-230 - don't allow user to remove an applicability that is being used (specified)
|
||||
{
|
||||
|
||||
@@ -2291,7 +2291,7 @@ OnPropertyChanged("Default_BkColor");
|
||||
public void RemoveSlave(int index)
|
||||
{
|
||||
XmlNode dd = _Xp.XmlContents.SelectSingleNode("//Slave[@index='" + index.ToString() + "']");
|
||||
dd.ParentNode.RemoveChild(dd);
|
||||
dd?.ParentNode?.RemoveChild(dd);
|
||||
}
|
||||
public int MaxSlaveIndex
|
||||
{
|
||||
|
||||
@@ -3839,9 +3839,17 @@ namespace VEPROMS.CSLA.Library
|
||||
_SupInfos = null;
|
||||
}
|
||||
|
||||
//B2019-140 Change bars do not get refreshed when approval is run.
|
||||
// Reset a Procedure and sub items in the cache
|
||||
public static ProcedureInfo ResetProcedure(int procID)
|
||||
//B2019-140 Change bars do not get refreshed when approval is run.
|
||||
// Reset a Procedure and sub items in the cache
|
||||
// **********************
|
||||
// Be carefull calling this when the Procedure is Open
|
||||
// When the Procedure is Open - use StepTabRibbon.RefreshProcedure(); instead
|
||||
// When a Procedure is open and you try to refresh it,
|
||||
// events can fire behind the scenes - causing data to try to be accessed while you are trying to refresh it
|
||||
// When This occurs, it will cause a
|
||||
// "ThreadException ... Collection was modified; enumeration operation may not execute.”
|
||||
// **********************
|
||||
public static ProcedureInfo ResetProcedure(int procID, bool resetindisplaytab = false)
|
||||
{
|
||||
// The following lines reload the procedure info cache
|
||||
ProcedureInfo newproc = ProcedureInfo.Get(procID, true);
|
||||
@@ -3859,24 +3867,28 @@ namespace VEPROMS.CSLA.Library
|
||||
ItemInfo newprocitem = Get(procID, true);
|
||||
newprocitem.RefreshConfig();
|
||||
|
||||
//Reload all the child/sub items
|
||||
#pragma warning disable S2971 // LINQ expressions should be simplified - need initial ToList to force enumeration
|
||||
//otherwise will get a "Collection was modified; enumeration operation may not execute" error
|
||||
List<int> itemIDs = _CacheByPrimaryKey.Values.ToList().SelectMany(y => y).Where(t => t?.ActiveParent != null && (t.ActiveParent is ItemInfo) && t.MyProcedure.ItemID == procID).Select(x => (x.ActiveParent as ItemInfo).ItemID).Distinct().ToList();
|
||||
#pragma warning restore S2971 // LINQ expressions should be simplified
|
||||
for (int index = 0; index < itemIDs.Count; index++)
|
||||
if (!resetindisplaytab)
|
||||
{
|
||||
ResetParts(itemIDs[index]);
|
||||
}
|
||||
|
||||
//reset the procedure config for all items attached to current procedure
|
||||
//Reload all the child/sub items
|
||||
#pragma warning disable S2971 // LINQ expressions should be simplified - need initial ToList to force enumeration
|
||||
//otherwise will get a "Collection was modified; enumeration operation may not execute" error
|
||||
List<ItemInfo> pconfigrefresh_items = _CacheByPrimaryKey.Values.ToList().SelectMany(y => y).Where(t => t?.MyProcedure?.ItemID == procID).Distinct().ToList();
|
||||
//otherwise will get a "Collection was modified; enumeration operation may not execute" error
|
||||
List<int> itemIDs = _CacheByPrimaryKey.Values.ToList().SelectMany(y => y).Where(t => t?.ActiveParent != null && (t.ActiveParent is ItemInfo) && t.MyProcedure.ItemID == procID).Select(x => (x.ActiveParent as ItemInfo).ItemID).Distinct().ToList();
|
||||
#pragma warning restore S2971 // LINQ expressions should be simplified
|
||||
for (int index = 0; index < pconfigrefresh_items.Count; index++)
|
||||
{
|
||||
pconfigrefresh_items[index].MyProcedure = newproc;
|
||||
for (int index = 0; index < itemIDs.Count; index++)
|
||||
{
|
||||
ResetParts(itemIDs[index]);
|
||||
}
|
||||
|
||||
//reset the procedure config for all items attached to current procedure
|
||||
#pragma warning disable S2971 // LINQ expressions should be simplified - need initial ToList to force enumeration
|
||||
//otherwise will get a "Collection was modified; enumeration operation may not execute" error
|
||||
List<ItemInfo> pconfigrefresh_items = _CacheByPrimaryKey.Values.ToList().SelectMany(y => y).Where(t => t?.MyProcedure?.ItemID == procID).Distinct().ToList();
|
||||
#pragma warning restore S2971 // LINQ expressions should be simplified
|
||||
for (int index = 0; index < pconfigrefresh_items.Count; index++)
|
||||
{
|
||||
pconfigrefresh_items[index].MyProcedure = newproc;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//return the changed procedure info
|
||||
|
||||
@@ -4162,8 +4162,11 @@ namespace Volian.Controls.Library
|
||||
}
|
||||
void MyConfig_PropertyChanged(object sender, PropertyChangedEventArgs e)
|
||||
{
|
||||
SaveConfig();
|
||||
}
|
||||
//B2026-024 Change bars should not show when updating Applicability.
|
||||
if (e.PropertyName == "MasterSlave_Applicability") ChangeBarForConfigItemChange = false;
|
||||
SaveConfig();
|
||||
if (e.PropertyName == "MasterSlave_Applicability") ChangeBarForConfigItemChange = true;
|
||||
}
|
||||
public void SaveConfig()
|
||||
{
|
||||
if (!MyItemInfo.MyConfig.IsDirty) return;
|
||||
|
||||
Reference in New Issue
Block a user