remove ancient cruft

This commit is contained in:
Michael Becker 2021-02-17 21:11:54 -05:00
parent 3d46dd27cc
commit 6ee8782d7e
No known key found for this signature in database
GPG Key ID: 98C333A81F18C22C
6 changed files with 1 additions and 228 deletions

View File

@ -669,9 +669,6 @@ namespace UniversalEditor.UserInterface
}
#endregion
private MenuBar mvarMenuBar = new MenuBar();
public MenuBar MenuBar { get { return mvarMenuBar; } }
private CommandBar.CommandBarCollection mvarToolbars = new CommandBar.CommandBarCollection();
public CommandBar.CommandBarCollection Toolbars { get { return mvarToolbars; } }

View File

@ -1264,18 +1264,5 @@ namespace UniversalEditor.UserInterface
}
}
}
public virtual ActionMenuItem[] CreateMenuItemsFromPlaceholder(PlaceholderMenuItem pmi)
{
List<ActionMenuItem> list = new List<ActionMenuItem>();
switch (pmi.PlaceholderID)
{
case "RecentFiles":
{
break;
}
}
return list.ToArray();
}
}
}

View File

@ -63,9 +63,6 @@ namespace UniversalEditor.UserInterface
/// </summary>
/// <returns>True if the user accepted the dialog; false otherwise.</returns>
bool ShowOptionsDialog();
void ToggleMenuItemEnabled(string menuItemName, bool enabled);
void RefreshCommand(object nativeCommandObject);
void UpdateStatus(string statusText);

View File

@ -1346,16 +1346,6 @@ namespace UniversalEditor.UserInterface
return ((UIApplication)Application.Instance).ShowSettingsDialog();
}
public void ToggleMenuItemEnabled(string menuItemName, bool enabled)
{
throw new NotImplementedException();
}
public void RefreshCommand(object nativeCommandObject)
{
throw new NotImplementedException();
}
private void AddRecentMenuItem(string FileName)
{
Command mnuFileRecentFiles = ((UIApplication)Application.Instance).Commands["FileRecentFiles"];
@ -1447,9 +1437,7 @@ namespace UniversalEditor.UserInterface
{
get
{
if (pnlSolutionExplorer.Project != null)
return pnlSolutionExplorer.Project;
return null;
return pnlSolutionExplorer.Project;
}
set
{

View File

@ -1,195 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
using MBS.Framework;
namespace UniversalEditor.UserInterface
{
public class MenuBar
{
private MenuItem.MenuItemCollection mvarItems = new MenuItem.MenuItemCollection();
public MenuItem.MenuItemCollection Items { get { return mvarItems; } }
}
public abstract class MenuItem
{
public class MenuItemCollection
: System.Collections.ObjectModel.Collection<MenuItem>
{
private System.Collections.Generic.Dictionary<string, MenuItem> itemsByName = new Dictionary<string, MenuItem>();
public ActionMenuItem Add(string name, string title)
{
return Add(name, title, null);
}
public ActionMenuItem Add(string name, string title, EventHandler onClick)
{
return Add(name, title, onClick, Count);
}
public ActionMenuItem Add(string name, string title, int position)
{
return Add(name, title, null, position);
}
public ActionMenuItem Add(string name, string title, EventHandler onClick, int position)
{
ActionMenuItem item = new ActionMenuItem(name, title);
if (onClick != null)
{
item.Click += onClick;
}
item.Position = position;
Add(item);
return item;
}
public SeparatorMenuItem AddSeparator()
{
return AddSeparator(Count);
}
public SeparatorMenuItem AddSeparator(int position)
{
SeparatorMenuItem item = new SeparatorMenuItem();
item.Position = position;
item.Name = "separator__" + (Count + 1).ToString();
Add(item);
return item;
}
public MenuItem this[string name]
{
get
{
return itemsByName[name];
}
}
public bool Contains(string name)
{
return itemsByName.ContainsKey(name);
}
public bool Remove(string name)
{
if (itemsByName.ContainsKey(name))
{
base.Remove(itemsByName[name]);
return true;
}
return false;
}
protected override void InsertItem(int index, MenuItem item)
{
item.mvarParent = this;
base.InsertItem(index, item);
itemsByName.Add(item.Name, item);
}
protected override void RemoveItem(int index)
{
this[index].mvarParent = null;
itemsByName.Remove(this[index].Name);
base.RemoveItem(index);
}
internal void UpdateName(MenuItem item, string oldName)
{
itemsByName.Remove(oldName);
itemsByName.Add(item.Name, item);
}
}
private List<object> mvarNativeControls = new List<object>();
public List<object> NativeControls { get { return mvarNativeControls; } }
private MenuItemCollection mvarParent = null;
private string mvarName = String.Empty;
public string Name
{
get { return mvarName; }
set
{
string oldName = mvarName; mvarName = value;
if (mvarParent != null)
{
mvarParent.UpdateName(this, oldName);
}
}
}
private int mvarPosition = -1;
public int Position { get { return mvarPosition; } set { mvarPosition = value; } }
private bool mvarEnabled = true;
public bool Enabled
{
get { return mvarEnabled; }
set
{
mvarEnabled = value;
foreach (object NativeControl in mvarNativeControls)
{
(Application.Instance as IHostApplication).CurrentWindow.RefreshCommand(NativeControl);
}
}
}
private bool mvarVisible = true;
public bool Visible { get { return mvarVisible; }
set
{
mvarVisible = value;
foreach (object NativeControl in mvarNativeControls)
{
(Application.Instance as IHostApplication).CurrentWindow.RefreshCommand(NativeControl);
}
}
}
}
public class ActionMenuItem : MenuItem
{
private string mvarTitle = String.Empty;
public string Title { get { return mvarTitle; } set { mvarTitle = value; } }
private MenuItem.MenuItemCollection mvarItems = new MenuItem.MenuItemCollection();
public MenuItem.MenuItemCollection Items { get { return mvarItems; } }
private CommandDisplayStyle mvarDisplayStyle = CommandDisplayStyle.ImageOnly;
public CommandDisplayStyle DisplayStyle { get { return mvarDisplayStyle; } set { mvarDisplayStyle = value; } }
public event EventHandler Click;
public ActionMenuItem(string title)
{
base.Name = title;
mvarTitle = title;
}
public ActionMenuItem(string name, string title)
{
base.Name = name;
mvarTitle = title;
}
public void OnClick(EventArgs e)
{
if (Click != null)
{
Click(this, e);
}
}
}
public class SeparatorMenuItem : MenuItem
{
}
public class PlaceholderMenuItem : MenuItem
{
private string mvarPlaceholderID = String.Empty;
public string PlaceholderID { get { return mvarPlaceholderID; } set { mvarPlaceholderID = value; } }
public PlaceholderMenuItem(string placeholderID)
{
mvarPlaceholderID = placeholderID;
}
}
}

View File

@ -79,7 +79,6 @@
<Compile Include="MainWindow.cs" />
<Compile Include="Panels\ErrorListPanel.cs" />
<Compile Include="Panel.cs" />
<Compile Include="MenuBar.cs" />
<Compile Include="LocalConfiguration.cs" />
<Compile Include="Tests.cs" />
<Compile Include="Dialogs\DataFormatAboutDialog.cs" />