diff --git a/CSharp/Engines/WindowsForms/Engines/UniversalEditor.UserInterface.WindowsForms.DesktopApplication/Dialogs/DocumentPropertiesDialog.cs b/CSharp/Engines/WindowsForms/Engines/UniversalEditor.UserInterface.WindowsForms.DesktopApplication/Dialogs/DocumentPropertiesDialog.cs index 4bb98dbe..24412dae 100644 --- a/CSharp/Engines/WindowsForms/Engines/UniversalEditor.UserInterface.WindowsForms.DesktopApplication/Dialogs/DocumentPropertiesDialog.cs +++ b/CSharp/Engines/WindowsForms/Engines/UniversalEditor.UserInterface.WindowsForms.DesktopApplication/Dialogs/DocumentPropertiesDialog.cs @@ -98,7 +98,7 @@ namespace UniversalEditor.UserInterface.WindowsForms.Dialogs } foreach (ObjectModelReference dfr in omrs) { - dlg.AvailableObjects.Add(dfr.Create()); + dlg.AvailableObjects.Add(dfr); } dlg.SelectionChanged += dlgObjectModel_SelectionChanged; dlg.Show(); @@ -117,7 +117,17 @@ namespace UniversalEditor.UserInterface.WindowsForms.Dialogs if (mvarMode == DocumentPropertiesDialogMode.Save) { // show all dataformats for the current object model - dfrs = UniversalEditor.Common.Reflection.GetAvailableDataFormats(mvarObjectModel.MakeReference()); + Association[] assocs = Association.FromCriteria(new AssociationCriteria() { ObjectModel = mvarObjectModel.MakeReference() }); + List dfrlist = new List(); + foreach (Association assoc in assocs) + { + foreach(DataFormatReference dfr in assoc.DataFormats) + { + dlg.AvailableObjects.Add(dfr); + } + } + dlg.SelectionChanged += dlgDataFormat_SelectionChanged; + dlg.Show(); } else if (mvarMode == DocumentPropertiesDialogMode.Open) { @@ -146,7 +156,7 @@ namespace UniversalEditor.UserInterface.WindowsForms.Dialogs } foreach (DataFormatReference dfr in dfrs) { - dlg.AvailableObjects.Add(dfr.Create()); + dlg.AvailableObjects.Add(dfr); } dlg.SelectionChanged += dlgDataFormat_SelectionChanged; dlg.Show(); @@ -205,7 +215,7 @@ namespace UniversalEditor.UserInterface.WindowsForms.Dialogs foreach (AccessorReference ar in ars) { if (!ar.Visible) continue; - dlg.AvailableObjects.Add(ar.Create()); + dlg.AvailableObjects.Add(ar); } dlg.SelectionChanged += dlgAccessor_SelectionChanged; dlg.Show(); diff --git a/CSharp/Engines/WindowsForms/Engines/UniversalEditor.UserInterface.WindowsForms.DesktopApplication/Dialogs/GenericBrowserPopup.cs b/CSharp/Engines/WindowsForms/Engines/UniversalEditor.UserInterface.WindowsForms.DesktopApplication/Dialogs/GenericBrowserPopup.cs index 14ff7816..1223ac83 100644 --- a/CSharp/Engines/WindowsForms/Engines/UniversalEditor.UserInterface.WindowsForms.DesktopApplication/Dialogs/GenericBrowserPopup.cs +++ b/CSharp/Engines/WindowsForms/Engines/UniversalEditor.UserInterface.WindowsForms.DesktopApplication/Dialogs/GenericBrowserPopup.cs @@ -21,12 +21,12 @@ namespace UniversalEditor.UserInterface.WindowsForms.Dialogs protected override void OnDeactivate(EventArgs e) { - // base.OnDeactivate(e); - // this.Close(); + base.OnDeactivate(e); + this.Close(); } - private System.Collections.ObjectModel.Collection mvarAvailableObjects = new System.Collections.ObjectModel.Collection(); - public System.Collections.ObjectModel.Collection AvailableObjects { get { return mvarAvailableObjects; } } + private System.Collections.ObjectModel.Collection mvarAvailableObjects = new System.Collections.ObjectModel.Collection(); + public System.Collections.ObjectModel.Collection AvailableObjects { get { return mvarAvailableObjects; } } private TObj mvarSelectedObject = default(TObj); public TObj SelectedObject { get { return mvarSelectedObject; } set { mvarSelectedObject = value; } } @@ -40,12 +40,11 @@ namespace UniversalEditor.UserInterface.WindowsForms.Dialogs private void UpdateSearch() { lv.Items.Clear(); - foreach (TObj item in mvarAvailableObjects) + foreach (TRef item in mvarAvailableObjects) { - TRef itmr = item.MakeReference(); - if (String.IsNullOrEmpty(txtSearch.Text.Trim()) || itmr.ShouldFilterObject(txtSearch.Text)) + if (String.IsNullOrEmpty(txtSearch.Text.Trim()) || item.ShouldFilterObject(txtSearch.Text)) { - AddObjectToList(itmr); + AddObjectToList(item); } }