the selections system in universal editor needs an extreme makeover
This commit is contained in:
parent
81e0f09a33
commit
34adda75f7
@ -38,7 +38,15 @@ namespace UniversalEditor.Plugins.Multimedia.UserInterface.Editors.Multimedia.Pa
|
||||
}
|
||||
public override void UpdateSelections()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
if (Selections.Count == 1)
|
||||
{
|
||||
_SelectedEntry = (Selections[0] as PaletteEntrySelection).Value;
|
||||
}
|
||||
else
|
||||
{
|
||||
_SelectedEntry = null;
|
||||
}
|
||||
Refresh();
|
||||
}
|
||||
|
||||
private static EditorReference _er = null;
|
||||
@ -204,6 +212,12 @@ namespace UniversalEditor.Plugins.Multimedia.UserInterface.Editors.Multimedia.Pa
|
||||
get { return _SelectedEntry; }
|
||||
set
|
||||
{
|
||||
bool changed = (_SelectedEntry != value);
|
||||
if (!changed) return;
|
||||
|
||||
Selections.Clear();
|
||||
Selections.Add(new PaletteEntrySelection(value));
|
||||
|
||||
System.ComponentModel.CancelEventArgs ce = new System.ComponentModel.CancelEventArgs();
|
||||
OnSelectionChanging(ce);
|
||||
if (ce.Cancel) return;
|
||||
|
||||
@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using UniversalEditor.ObjectModels.Multimedia.Palette;
|
||||
using UniversalEditor.UserInterface;
|
||||
|
||||
namespace UniversalEditor.Plugins.Multimedia.UserInterface.Editors.Multimedia.Palette
|
||||
{
|
||||
public class PaletteEntrySelection : EditorSelection
|
||||
{
|
||||
public PaletteEntrySelection(PaletteEntry value)
|
||||
{
|
||||
Value = value;
|
||||
}
|
||||
public PaletteEntry Value { get; set; } = null;
|
||||
|
||||
public override object Content { get => Value; set => Value = (value as PaletteEntry); }
|
||||
}
|
||||
}
|
||||
@ -45,6 +45,7 @@
|
||||
<Compile Include="Editors\Multimedia\Palette\PaletteEditor.Designer.cs" />
|
||||
<Compile Include="Editors\Multimedia\Playlist\PlaylistEditor.cs" />
|
||||
<Compile Include="Editors\Multimedia\Playlist\PlaylistEditor.Designer.cs" />
|
||||
<Compile Include="Editors\Multimedia\Palette\PaletteEntrySelection.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Editors\" />
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user