C2018-039: Upgrade – User Control of Format

This commit is contained in:
2018-12-12 15:25:53 +00:00
parent dcefdc8754
commit e2392f5fec
20 changed files with 5491 additions and 1203 deletions

View File

@@ -130,6 +130,7 @@ namespace VEPROMS
private LocalAnnotationTypeInfoList myLocalAnnotationTypeInfoList = null;
private StageInfoList myStageInfoList = null;
private LocalStageInfoList myLocalStageInfoList = null;
private int? _cmbxformatOriginal = null;
private void frmFolderProperties_Load(object sender, EventArgs e)
{
_Initializing = true;
@@ -150,6 +151,7 @@ namespace VEPROMS
ppCmbxFormat.DisplayMember = "FullName";
ppCmbxFormat.ValueMember = "FullName";
ppCmbxFormat.DataSource = FormatInfoList.SortedFormatInfoList;
if (_FolderConfig != null && _FolderConfig.MyFolder != null) _cmbxformatOriginal = _FolderConfig.MyFolder.FormatID;
if (_FolderConfig.FormatSelection != null)
{
ppCmbxFormat.SelectedValue = _FolderConfig.FormatSelection;
@@ -350,6 +352,24 @@ namespace VEPROMS
btnAnnoTypeUndo.PerformClick();
//if (btnAnnoTypeSave.Enabled) return;
folderConfigBindingSource.EndEdit();
// if there is a change to the format, clean up any overridden formats that point to the selected item before saving the format change:
if (_FolderConfig.MyFolder.FormatID != _cmbxformatOriginal)
{
// clean up & then refresh the configs
using (ContentInfoList cil = ContentInfoList.ClearOverrideFormatsByFolder(_FolderConfig.MyFolder.FolderID, _cmbxformatOriginal, _FolderConfig.MyFolder.FormatID))
{
foreach (ContentInfo ci in cil)
{
using (Content c = ci.Get())
{
// first refresh configs because the ContentInfo.Refresh causes events to occur that refresh screen
// and if configs aren't done first, the screen refresh, if based on config data, will not be correct.
foreach (ItemInfo ii in ci.ContentItems) ii.RefreshConfig();
ContentInfo.Refresh(c);
}
}
}
}
// Save Default settings for User
//
// Save whether we should display the default values on this property page